drm: Disallow DRM_IOCTL_MODESET_CTL for KMS drivers
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 29 May 2012 22:58:09 +0000 (00:58 +0200)
committerDave Airlie <airlied@gmail.com>
Tue, 17 Jul 2012 20:05:48 +0000 (06:05 +1000)
DRM_IOCTL_MODESET_CTL must only be used for UMS drivers. Make it a no-op
for KMS drivers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@gmail.com>
drivers/gpu/drm/drm_irq.c

index c798eeae0a03de6a9b0a9d575aaba75f33e70a8f..03f16f352fe2e9e9b309008c182b33954fc46f93 100644 (file)
@@ -974,7 +974,6 @@ EXPORT_SYMBOL(drm_vblank_off);
  * drm_vblank_pre_modeset - account for vblanks across mode sets
  * @dev: DRM device
  * @crtc: CRTC in question
- * @post: post or pre mode set?
  *
  * Account for vblank events across mode setting events, which will likely
  * reset the hardware frame counter.
@@ -1037,6 +1036,10 @@ int drm_modeset_ctl(struct drm_device *dev, void *data,
        if (!dev->num_crtcs)
                return 0;
 
+       /* KMS drivers handle this internally */
+       if (drm_core_check_feature(dev, DRIVER_MODESET))
+               return 0;
+
        crtc = modeset->crtc;
        if (crtc >= dev->num_crtcs)
                return -EINVAL;