summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorDavid Airlie <airlied@asimov.stargames.com.au>2007-04-10 11:51:31 +1000
committerDavid Airlie <airlied@asimov.stargames.com.au>2007-04-10 11:51:31 +1000
commiteb9bdc27879d1aa307b234bbdb0f81494dcf7095 (patch)
tree9b91a924b27d2e94f9efd5eb9e4fcceefae47d24 /libdrm
parented0ebd9d3da2e5c4e8053b6e7a7d2898b184f857 (diff)
mode: fixup problems with framebuffer add function
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drmMode.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index 55a9d91c..5f480890 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -192,10 +192,11 @@ err_allocs:
return 0;
}
-uint32_t drmModeAddFB(int fd, uint32_t width, uint32_t height,
- uint8_t bpp, uint32_t pitch, drmBO *bo)
+int drmModeAddFB(int fd, uint32_t width, uint32_t height,
+ uint8_t bpp, uint32_t pitch, drmBO *bo, uint32_t *buf_id)
{
struct drm_mode_fb_cmd f;
+ int ret;
f.width = width;
f.height = height;
@@ -203,10 +204,11 @@ uint32_t drmModeAddFB(int fd, uint32_t width, uint32_t height,
f.bpp = bpp;
f.handle = bo->handle;
- if (ioctl(fd, DRM_IOCTL_MODE_ADDFB, &f))
- return 0;
+ if (ret = ioctl(fd, DRM_IOCTL_MODE_ADDFB, &f))
+ return ret;
- return f.buffer_id;
+ *buf_id = f.buffer_id;
+ return 0;
}
int drmModeRmFB(int fd, uint32_t bufferId)