From ed072ed075ec431b0746ac1aa8bad5f687d75d8c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 8 May 2008 14:01:24 +1000 Subject: drm_mode: initial replacefb implemenation --- libdrm/xf86drmMode.c | 21 +++++++++++++++++++++ libdrm/xf86drmMode.h | 6 ++++++ 2 files changed, 27 insertions(+) (limited to 'libdrm') 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 -- cgit v1.2.3