aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_sprite.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-04-24 03:55:08 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-05-03 05:18:13 -0400
commit1cff8f6b4c668a060c7e3f82d3f1fb5aaa37edc4 (patch)
tree1ceab1794043c677b541d3bee50a33f72e0527e4 /drivers/gpu/drm/i915/intel_sprite.c
parent13a86b85aca24f825c7843cdcd81eaff19fa4ea9 (diff)
drm/i915: properly check for MODESET for kms driver ioctls
Also ditch the cargo-culted dev_priv checks - either we have a giant hole in our setup code or this is useless. Plainly bogus to check for it in either case. v2: Chris Wilson noticed that I've missed one bogus dev_priv check. v3: The check in the overlay code is redundant (Chris) Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sprite.c')
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 44315674f472..2a20fb0781d7 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -558,14 +558,13 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
558 struct drm_file *file_priv) 558 struct drm_file *file_priv)
559{ 559{
560 struct drm_intel_sprite_colorkey *set = data; 560 struct drm_intel_sprite_colorkey *set = data;
561 struct drm_i915_private *dev_priv = dev->dev_private;
562 struct drm_mode_object *obj; 561 struct drm_mode_object *obj;
563 struct drm_plane *plane; 562 struct drm_plane *plane;
564 struct intel_plane *intel_plane; 563 struct intel_plane *intel_plane;
565 int ret = 0; 564 int ret = 0;
566 565
567 if (!dev_priv) 566 if (!drm_core_check_feature(dev, DRIVER_MODESET))
568 return -EINVAL; 567 return -ENODEV;
569 568
570 /* Make sure we don't try to enable both src & dest simultaneously */ 569 /* Make sure we don't try to enable both src & dest simultaneously */
571 if ((set->flags & (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) 570 if ((set->flags & (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE))
@@ -592,14 +591,13 @@ int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
592 struct drm_file *file_priv) 591 struct drm_file *file_priv)
593{ 592{
594 struct drm_intel_sprite_colorkey *get = data; 593 struct drm_intel_sprite_colorkey *get = data;
595 struct drm_i915_private *dev_priv = dev->dev_private;
596 struct drm_mode_object *obj; 594 struct drm_mode_object *obj;
597 struct drm_plane *plane; 595 struct drm_plane *plane;
598 struct intel_plane *intel_plane; 596 struct intel_plane *intel_plane;
599 int ret = 0; 597 int ret = 0;
600 598
601 if (!dev_priv) 599 if (!drm_core_check_feature(dev, DRIVER_MODESET))
602 return -EINVAL; 600 return -ENODEV;
603 601
604 mutex_lock(&dev->mode_config.mutex); 602 mutex_lock(&dev->mode_config.mutex);
605 603