diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-11-03 20:02:50 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-04-22 11:41:11 +0200 |
commit | 22471cf638bab5d78ee1e6c465c9d7c1971ebbf5 (patch) | |
tree | 57f4bee31d85c2d7ff475fe3c800fdf2e5d9a18c /drivers/gpu/drm/drm_irq.c | |
parent | eaaf8f0fc32468d4dedbb5b5f9c5bfb27744be4c (diff) | |
download | op-kernel-dev-22471cf638bab5d78ee1e6c465c9d7c1971ebbf5.zip op-kernel-dev-22471cf638bab5d78ee1e6c465c9d7c1971ebbf5.tar.gz |
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: Thierry Reding <treding@nvidia.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index e5920e7..580f9ed 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -386,22 +386,21 @@ int drm_control(struct drm_device *dev, void *data, * 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) { 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) && ctl->irq != drm_dev_to_irq(dev)) return -EINVAL; return drm_irq_install(dev); 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); default: return -EINVAL; |