aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-09-29 11:20:42 -0400
committerDave Airlie <airlied@redhat.com>2012-02-16 13:35:11 -0500
commit019d96cb55ade38a4b4a52bba0304e8cd681f30a (patch)
treef3d43aff33a8a897d4992f045257108a5a243bf4
parent466e69b8b03b8c1987367912782bc12988ad8794 (diff)
drm: add some caps for userspace to discover more info for dumb KMS driver (v2)
For the simple KMS driver case we need some more info about what the preferred depth and if a shadow framebuffer is preferred. I've only added this for intel/radeon which support the dumb ioctls so far. If you need something really fancy you should be writing a real X.org driver. v2: drop cursor information, just return an error from the cursor ioctls and we can make userspace fallback to sw cursor in that case, cursor info was getting too messy, best to start smaller. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_ioctl.c6
-rw-r--r--drivers/gpu/drm/i915/intel_display.c3
-rw-r--r--drivers/gpu/drm/radeon/radeon_display.c3
-rw-r--r--include/drm/drm.h2
-rw-r--r--include/drm/drm_crtc.h3
5 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 2300ab1a2a77..cf85155da2a0 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -277,6 +277,12 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
277 case DRM_CAP_VBLANK_HIGH_CRTC: 277 case DRM_CAP_VBLANK_HIGH_CRTC:
278 req->value = 1; 278 req->value = 1;
279 break; 279 break;
280 case DRM_CAP_DUMB_PREFERRED_DEPTH:
281 req->value = dev->mode_config.preferred_depth;
282 break;
283 case DRM_CAP_DUMB_PREFER_SHADOW:
284 req->value = dev->mode_config.prefer_shadow;
285 break;
280 default: 286 default:
281 return -EINVAL; 287 return -EINVAL;
282 } 288 }
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index dfa67449827a..0a8a640d36ef 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9089,6 +9089,9 @@ void intel_modeset_init(struct drm_device *dev)
9089 dev->mode_config.min_width = 0; 9089 dev->mode_config.min_width = 0;
9090 dev->mode_config.min_height = 0; 9090 dev->mode_config.min_height = 0;
9091 9091
9092 dev->mode_config.preferred_depth = 24;
9093 dev->mode_config.prefer_shadow = 1;
9094
9092 dev->mode_config.funcs = (void *)&intel_mode_funcs; 9095 dev->mode_config.funcs = (void *)&intel_mode_funcs;
9093 9096
9094 intel_init_quirks(dev); 9097 intel_init_quirks(dev);
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 5515f1054b29..7cb062daa71e 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -1240,6 +1240,9 @@ int radeon_modeset_init(struct radeon_device *rdev)
1240 rdev->ddev->mode_config.max_height = 4096; 1240 rdev->ddev->mode_config.max_height = 4096;
1241 } 1241 }
1242 1242
1243 rdev->ddev->mode_config.preferred_depth = 24;
1244 rdev->ddev->mode_config.prefer_shadow = 1;
1245
1243 rdev->ddev->mode_config.fb_base = rdev->mc.aper_base; 1246 rdev->ddev->mode_config.fb_base = rdev->mc.aper_base;
1244 1247
1245 ret = radeon_modeset_create_props(rdev); 1248 ret = radeon_modeset_create_props(rdev);
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 49d94ede2ec2..34a7b89fd006 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -761,6 +761,8 @@ struct drm_event_vblank {
761 761
762#define DRM_CAP_DUMB_BUFFER 0x1 762#define DRM_CAP_DUMB_BUFFER 0x1
763#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 763#define DRM_CAP_VBLANK_HIGH_CRTC 0x2
764#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
765#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
764 766
765/* typedef area */ 767/* typedef area */
766#ifndef __KERNEL__ 768#ifndef __KERNEL__
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 823531454799..2a0872cac333 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -796,6 +796,9 @@ struct drm_mode_config {
796 struct drm_property *scaling_mode_property; 796 struct drm_property *scaling_mode_property;
797 struct drm_property *dithering_mode_property; 797 struct drm_property *dithering_mode_property;
798 struct drm_property *dirty_info_property; 798 struct drm_property *dirty_info_property;
799
800 /* dumb ioctl parameters */
801 uint32_t preferred_depth, prefer_shadow;
799}; 802};
800 803
801#define obj_to_crtc(x) container_of(x, struct drm_crtc, base) 804#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)