summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorJakob Bornecrantz <wallbraker@gmail.com>2007-04-10 18:44:47 +1000
committerDave Airlie <airlied@linux.ie>2007-04-10 18:44:47 +1000
commitb50bda002b824efb24e18e8d514ff0ca763c15b9 (patch)
tree4dba23e53834ca25760d2fd8a55498c43a390c91 /libdrm
parent7e2b1a6cf55579c6f8b1fd56a97e9f41e34b88fc (diff)
add addfb/rmfb ioctls
Originally from Jakob, cleaned up by airlied.
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drmMode.c22
-rw-r--r--libdrm/xf86drmMode.h6
2 files changed, 26 insertions, 2 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index c4403b1c..55a9d91c 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -192,6 +192,28 @@ err_allocs:
return 0;
}
+uint32_t drmModeAddFB(int fd, uint32_t width, uint32_t height,
+ uint8_t bpp, uint32_t pitch, drmBO *bo)
+{
+ struct drm_mode_fb_cmd f;
+
+ f.width = width;
+ f.height = height;
+ f.pitch = pitch;
+ f.bpp = bpp;
+ f.handle = bo->handle;
+
+ if (ioctl(fd, DRM_IOCTL_MODE_ADDFB, &f))
+ return 0;
+
+ return f.buffer_id;
+}
+
+int drmModeRmFB(int fd, uint32_t bufferId)
+{
+ return ioctl(fd, DRM_IOCTL_MODE_RMFB, bufferId);
+}
+
#if 0
int drmModeForceProbe(int fd, uint32_t outputId)
{
diff --git a/libdrm/xf86drmMode.h b/libdrm/xf86drmMode.h
index c027a16d..45b157a8 100644
--- a/libdrm/xf86drmMode.h
+++ b/libdrm/xf86drmMode.h
@@ -77,8 +77,10 @@ typedef struct _drmModeRes {
typedef struct _drmModeFrameBuffer {
- uint32_t minWidth, maxWidth;
- uint32_t minHeight, maxHeight;
+ uint32_t width;
+ uint32_t height;
+ uint32_t pitch;
+ uint8_t bpp;
} drmModeFrameBuffer, *drmModeFrameBufferPtr;