summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2008-05-08 14:01:24 +1000
committerDave Airlie <airlied@linux.ie>2008-05-08 14:02:05 +1000
commited072ed075ec431b0746ac1aa8bad5f687d75d8c (patch)
treeec69b2280384472f8111f1ca0831390e7ac2df03 /libdrm
parentdf46e0691bdd62da8ccc6b3811f57731dd5a2a4b (diff)
drm_mode: initial replacefb implemenation
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drmMode.c21
-rw-r--r--libdrm/xf86drmMode.h6
2 files changed, 27 insertions, 0 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index 605377dd..ae15fd65 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -608,3 +608,24 @@ int drmCheckModesettingSupported(const char *busid)
return -ENOSYS;
}
+
+int drmModeReplaceFB(int fd, uint32_t buffer_id,
+ uint32_t width, uint32_t height, uint8_t depth,
+ uint8_t bpp, uint32_t pitch, uint32_t bo_handle)
+{
+ struct drm_mode_fb_cmd f;
+ int ret;
+
+ f.width = width;
+ f.height = height;
+ f.pitch = pitch;
+ f.bpp = bpp;
+ f.depth = depth;
+ f.handle = bo_handle;
+ f.buffer_id = buffer_id;
+
+ if ((ret = ioctl(fd, DRM_IOCTL_MODE_REPLACEFB, &f)))
+ return ret;
+
+ return 0;
+}
diff --git a/libdrm/xf86drmMode.h b/libdrm/xf86drmMode.h
index e5a6ee92..5171b592 100644
--- a/libdrm/xf86drmMode.h
+++ b/libdrm/xf86drmMode.h
@@ -184,6 +184,12 @@ extern int drmModeAddFB(int fd, uint32_t width, uint32_t height, uint8_t depth,
*/
extern int drmModeRmFB(int fd, uint32_t bufferId);
+/**
+ * Replace a framebuffer object with a new one - for resizing the screen.
+ */
+extern int drmModeReplaceFB(int fd, uint32_t buffer_id,
+ uint32_t width, uint32_t height, uint8_t depth,
+ uint8_t bpp, uint32_t pitch, uint32_t bo_handle);
/*
* Crtc functions