diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2006-10-11 22:21:01 +0200 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2006-10-11 22:21:01 +0200 |
commit | 30703893674b3da5b862dee2acd6efca13424398 (patch) | |
tree | b2f6e08e0f426464dfbbff8f34a0371d546efe07 /libdrm | |
parent | f2db76e2f206d2017f710eaddc4b33add4498898 (diff) |
Compatibility code for 2.6.15-2.6.18. It is ugly but a little comfort is that
it will go away in the mainstream kernel.
Some bugfixes, mainly in error paths.
Diffstat (limited to 'libdrm')
-rw-r--r-- | libdrm/xf86drm.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index a083ca23..c7683182 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -2624,7 +2624,8 @@ int drmBOCreate(int fd, void *ttm, unsigned long start, unsigned long size, drm_bo_arg_t arg; drm_bo_arg_request_t *req = &arg.d.req; drm_bo_arg_reply_t *rep = &arg.d.rep; - + int ret; + memset(buf, 0, sizeof(*buf)); memset(&arg, 0, sizeof(arg)); req->mask = mask; @@ -2650,7 +2651,11 @@ int drmBOCreate(int fd, void *ttm, unsigned long start, unsigned long size, } req->op = drm_bo_create; - if (ioctl(fd, DRM_IOCTL_BUFOBJ, &arg)) + do { + ret = ioctl(fd, DRM_IOCTL_BUFOBJ, &arg); + } while (ret != 0 && errno == EAGAIN); + + if (ret) return -errno; if (!arg.handled) { return -EFAULT; |