drm: add cap bit to denote if dumb ioctl is available or not.
authorDave Airlie <airlied@redhat.com>
Fri, 4 Mar 2011 04:50:28 +0000 (14:50 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 4 Mar 2011 05:56:22 +0000 (15:56 +1000)
This allows libkms to make an easier decision.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_ioctl.c
include/drm/drm.h

index d6de9d042b76ce2f2e74ae2f62a03acca41c3cf0..7f6912a16761a12c360310fd60e45d375d17966e 100644 (file)
@@ -275,6 +275,14 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
        struct drm_get_cap *req = data;
 
        req->value = 0;
+       switch (req->capability) {
+       case DRM_CAP_DUMB_BUFFER:
+               if (dev->driver->dumb_create)
+                       req->value = 1;
+               break;
+       default:
+               return -EINVAL;
+       }
        return 0;
 }
 
index da4efd162d5803534f50e0069a87dd6291d062f9..9ac431396176d6c5e89d44084af7b249c41b94fc 100644 (file)
@@ -752,6 +752,8 @@ struct drm_event_vblank {
        __u32 reserved;
 };
 
+#define DRM_CAP_DUMB_BUFFER 0x1
+
 /* typedef area */
 #ifndef __KERNEL__
 typedef struct drm_clip_rect drm_clip_rect_t;