OSDN Git Service

drm: add dumb interface
authorDave Airlie <airlied@redhat.com>
Wed, 9 Feb 2011 03:41:28 +0000 (13:41 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 4 Mar 2011 04:46:36 +0000 (14:46 +1000)
include/drm/drm.h
include/drm/drm_mode.h

index 2ba7136..c968dc8 100644 (file)
@@ -703,6 +703,10 @@ struct drm_gem_open {
 #define DRM_IOCTL_MODE_PAGE_FLIP       DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
 #define DRM_IOCTL_MODE_DIRTYFB         DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
 
+#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
+#define DRM_IOCTL_MODE_MAP_DUMB    DRM_IOWR(0xB3, struct drm_mode_map_dumb)
+#define DRM_IOCTL_MODE_DESTROY_DUMB    DRM_IOWR(0xB4, struct drm_mode_destroy_dumb)
+
 /**
  * Device specific ioctls should only be in their respective headers
  * The device specific ioctl range is from 0x40 to 0x99.
index 0fc7397..8b263ad 100644 (file)
@@ -344,4 +344,33 @@ struct drm_mode_crtc_page_flip {
        __u64 user_data;
 };
 
+/* create a dumb scanout buffer */
+struct drm_mode_create_dumb {
+        uint32_t height;
+        uint32_t width;
+        uint32_t bpp;
+        uint32_t flags;
+        /* handle, pitch, size will be returned */
+        uint32_t handle;
+        uint32_t pitch;
+        uint64_t size;
+};
+
+/* set up for mmap of a dumb scanout buffer */
+struct drm_mode_map_dumb {
+        /** Handle for the object being mapped. */
+        __u32 handle;
+        __u32 pad;
+        /**
+         * Fake offset to use for subsequent mmap call
+         *
+         * This is a fixed-size type for 32/64 compatibility.
+         */
+        __u64 offset;
+};
+
+struct drm_mode_destroy_dumb {
+       uint32_t handle;
+};
+
 #endif