Commit 22471cf6 authored by Daniel Vetter's avatar Daniel Vetter

drm/irq: drm_control is a legacy ioctl, so pci devices only

This just adds a correspdonding check, follow-up patches will exploit
this.

v2: Whitespace polish (Thierry)
Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent eaaf8f0f
...@@ -386,22 +386,21 @@ int drm_control(struct drm_device *dev, void *data, ...@@ -386,22 +386,21 @@ int drm_control(struct drm_device *dev, void *data,
* this used to be a separate function in drm_dma.h * this used to be a separate function in drm_dma.h
*/ */
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return 0;
if (drm_core_check_feature(dev, DRIVER_MODESET))
return 0;
/* UMS was only ever support on pci devices. */
if (WARN_ON(!dev->pdev))
return -EINVAL;
switch (ctl->func) { switch (ctl->func) {
case DRM_INST_HANDLER: case DRM_INST_HANDLER:
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return 0;
if (drm_core_check_feature(dev, DRIVER_MODESET))
return 0;
if (dev->if_version < DRM_IF_VERSION(1, 2) && if (dev->if_version < DRM_IF_VERSION(1, 2) &&
ctl->irq != drm_dev_to_irq(dev)) ctl->irq != drm_dev_to_irq(dev))
return -EINVAL; return -EINVAL;
return drm_irq_install(dev); return drm_irq_install(dev);
case DRM_UNINST_HANDLER: case DRM_UNINST_HANDLER:
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return 0;
if (drm_core_check_feature(dev, DRIVER_MODESET))
return 0;
return drm_irq_uninstall(dev); return drm_irq_uninstall(dev);
default: default:
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment