drm: change fb api to take a bo handle not the bo pointer.
authorDave Airlie <airlied@redhat.com>
Fri, 29 Feb 2008 04:07:29 +0000 (14:07 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 29 Feb 2008 04:07:29 +0000 (14:07 +1000)
libdrm/xf86drmMode.c
libdrm/xf86drmMode.h
tests/mode/modetest.c
tests/modedemo/demo.c

index 717e1fe..dd1a6ca 100644 (file)
@@ -203,7 +203,8 @@ uint32_t drmModeGetHotplug(int fd)
 }
 
 int drmModeAddFB(int fd, uint32_t width, uint32_t height, uint8_t depth,
-                 uint8_t bpp, uint32_t pitch, drmBO *bo, uint32_t *buf_id)
+                 uint8_t bpp, uint32_t pitch, uint32_t bo_handle,
+                uint32_t *buf_id)
 {
        struct drm_mode_fb_cmd f;
        int ret;
@@ -213,7 +214,7 @@ int drmModeAddFB(int fd, uint32_t width, uint32_t height, uint8_t depth,
        f.pitch  = pitch;
        f.bpp    = bpp;
        f.depth  = depth;
-       f.handle = bo->handle;
+       f.handle = bo_handle;
 
        if (ret = ioctl(fd, DRM_IOCTL_MODE_ADDFB, &f))
                return ret;
index 71e779d..edf9efe 100644 (file)
@@ -177,7 +177,7 @@ extern drmModeFBPtr drmModeGetFB(int fd, uint32_t bufferId);
  * Creates a new framebuffer with an buffer object as its scanout buffer.
  */
 extern int drmModeAddFB(int fd, uint32_t width, uint32_t height, uint8_t depth,
-                       uint8_t bpp, uint32_t pitch, drmBO *bo,
+                       uint8_t bpp, uint32_t pitch, uint32_t bo_handle,
                        uint32_t *buf_id);
 /**
  * Destroies the given framebuffer.
index ab0cdc9..a50b0cc 100644 (file)
@@ -291,7 +291,7 @@ int testFrameBufferAdd(int fd, drmModeResPtr res)
                goto err;
 
        printf("\tAdding FB\n");
-       ret = drmModeAddFB(fd, 800, 600, 32, 8, 0, &bo, &fb);
+       ret = drmModeAddFB(fd, 800, 600, 32, 8, 0, bo->handle, &fb);
        if (ret)
                goto err_bo;
 
index db51cd6..00020bd 100644 (file)
@@ -483,7 +483,7 @@ drmModeFBPtr createFB(int fd, drmModeResPtr res)
                goto err;
        }
 
-       ret = drmModeAddFB(fd, SIZE_X, SIZE_Y, 32, 32, PITCH * 4, &bo, &fb);
+       ret = drmModeAddFB(fd, SIZE_X, SIZE_Y, 32, 32, PITCH * 4, bo->handle, &fb);
 
        if (ret)
                goto err_bo;