drm/irq: Don't check for DRIVER_HAVE_IRQ in drm_irq_(un)install

If a non-legacy driver calls these it's valid to assume there is
interrupt support. The flag is really only needed for legacy drivers,
which control IRQ enabling/disabling through the DRM_IOCTL_CONTROL
legacy IOCTL.

Also remove all the flag usage from non-legacy drivers.

v2: Review from Emil:
- improve commit message
- I forgot hibmc, fix that

Cc: linux-arm-kernel@lists.infradead.org
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: virtualization@lists.linux-foundation.org
Cc: spice-devel@lists.freedesktop.org
Cc: amd-gfx@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190129104248.26607-1-daniel.vetter@ffwll.ch
This commit is contained in:
Daniel Vetter 2019-01-29 11:42:46 +01:00
parent f12d0b91af
commit 5b38e7475e
18 changed files with 16 additions and 26 deletions

View File

@ -1189,7 +1189,7 @@ amdgpu_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe,
static struct drm_driver kms_driver = { static struct drm_driver kms_driver = {
.driver_features = .driver_features =
DRIVER_USE_AGP | DRIVER_ATOMIC | DRIVER_USE_AGP | DRIVER_ATOMIC |
DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | DRIVER_IRQ_SHARED | DRIVER_GEM |
DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ, DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ,
.load = amdgpu_driver_load_kms, .load = amdgpu_driver_load_kms,
.open = amdgpu_driver_open_kms, .open = amdgpu_driver_open_kms,

View File

@ -229,7 +229,7 @@ static int hdlcd_debugfs_init(struct drm_minor *minor)
DEFINE_DRM_GEM_CMA_FOPS(fops); DEFINE_DRM_GEM_CMA_FOPS(fops);
static struct drm_driver hdlcd_driver = { static struct drm_driver hdlcd_driver = {
.driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | .driver_features = DRIVER_GEM |
DRIVER_MODESET | DRIVER_PRIME | DRIVER_MODESET | DRIVER_PRIME |
DRIVER_ATOMIC, DRIVER_ATOMIC,
.irq_handler = hdlcd_irq, .irq_handler = hdlcd_irq,

View File

@ -720,7 +720,7 @@ static void atmel_hlcdc_dc_irq_uninstall(struct drm_device *dev)
DEFINE_DRM_GEM_CMA_FOPS(fops); DEFINE_DRM_GEM_CMA_FOPS(fops);
static struct drm_driver atmel_hlcdc_dc_driver = { static struct drm_driver atmel_hlcdc_dc_driver = {
.driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | .driver_features = DRIVER_GEM |
DRIVER_MODESET | DRIVER_PRIME | DRIVER_MODESET | DRIVER_PRIME |
DRIVER_ATOMIC, DRIVER_ATOMIC,
.irq_handler = atmel_hlcdc_dc_irq_handler, .irq_handler = atmel_hlcdc_dc_irq_handler,

View File

@ -103,9 +103,6 @@ int drm_irq_install(struct drm_device *dev, int irq)
int ret; int ret;
unsigned long sh_flags = 0; unsigned long sh_flags = 0;
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EOPNOTSUPP;
if (irq == 0) if (irq == 0)
return -EINVAL; return -EINVAL;
@ -174,9 +171,6 @@ int drm_irq_uninstall(struct drm_device *dev)
bool irq_enabled; bool irq_enabled;
int i; int i;
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EOPNOTSUPP;
irq_enabled = dev->irq_enabled; irq_enabled = dev->irq_enabled;
dev->irq_enabled = false; dev->irq_enabled = false;

View File

@ -137,7 +137,7 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg)
DEFINE_DRM_GEM_CMA_FOPS(fsl_dcu_drm_fops); DEFINE_DRM_GEM_CMA_FOPS(fsl_dcu_drm_fops);
static struct drm_driver fsl_dcu_drm_driver = { static struct drm_driver fsl_dcu_drm_driver = {
.driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET .driver_features = DRIVER_GEM | DRIVER_MODESET
| DRIVER_PRIME | DRIVER_ATOMIC, | DRIVER_PRIME | DRIVER_ATOMIC,
.load = fsl_dcu_load, .load = fsl_dcu_load,
.unload = fsl_dcu_unload, .unload = fsl_dcu_unload,

View File

@ -468,7 +468,7 @@ static const struct file_operations psb_gem_fops = {
}; };
static struct drm_driver driver = { static struct drm_driver driver = {
.driver_features = DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | \ .driver_features = DRIVER_IRQ_SHARED | \
DRIVER_MODESET | DRIVER_GEM, DRIVER_MODESET | DRIVER_GEM,
.load = psb_driver_load, .load = psb_driver_load,
.unload = psb_driver_unload, .unload = psb_driver_unload,

View File

@ -56,8 +56,7 @@ static irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
} }
static struct drm_driver hibmc_driver = { static struct drm_driver hibmc_driver = {
.driver_features = DRIVER_GEM | DRIVER_MODESET | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
DRIVER_ATOMIC | DRIVER_HAVE_IRQ,
.fops = &hibmc_fops, .fops = &hibmc_fops,
.name = "hibmc", .name = "hibmc",
.date = "20160828", .date = "20160828",

View File

@ -3209,7 +3209,7 @@ static struct drm_driver driver = {
* deal with them for Intel hardware. * deal with them for Intel hardware.
*/ */
.driver_features = .driver_features =
DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | DRIVER_PRIME | DRIVER_IRQ_SHARED | DRIVER_GEM | DRIVER_PRIME |
DRIVER_RENDER | DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_SYNCOBJ, DRIVER_RENDER | DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_SYNCOBJ,
.release = i915_driver_release, .release = i915_driver_release,
.open = i915_driver_open, .open = i915_driver_open,

View File

@ -90,7 +90,7 @@ static irqreturn_t meson_irq(int irq, void *arg)
DEFINE_DRM_GEM_CMA_FOPS(fops); DEFINE_DRM_GEM_CMA_FOPS(fops);
static struct drm_driver meson_driver = { static struct drm_driver meson_driver = {
.driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | .driver_features = DRIVER_GEM |
DRIVER_MODESET | DRIVER_PRIME | DRIVER_MODESET | DRIVER_PRIME |
DRIVER_ATOMIC, DRIVER_ATOMIC,

View File

@ -1063,8 +1063,7 @@ static const struct file_operations fops = {
}; };
static struct drm_driver msm_driver = { static struct drm_driver msm_driver = {
.driver_features = DRIVER_HAVE_IRQ | .driver_features = DRIVER_GEM |
DRIVER_GEM |
DRIVER_PRIME | DRIVER_PRIME |
DRIVER_RENDER | DRIVER_RENDER |
DRIVER_ATOMIC | DRIVER_ATOMIC |

View File

@ -322,8 +322,7 @@ DEFINE_DRM_GEM_CMA_FOPS(fops);
static struct drm_driver mxsfb_driver = { static struct drm_driver mxsfb_driver = {
.driver_features = DRIVER_GEM | DRIVER_MODESET | .driver_features = DRIVER_GEM | DRIVER_MODESET |
DRIVER_PRIME | DRIVER_ATOMIC | DRIVER_PRIME | DRIVER_ATOMIC,
DRIVER_HAVE_IRQ,
.irq_handler = mxsfb_irq_handler, .irq_handler = mxsfb_irq_handler,
.irq_preinstall = mxsfb_irq_preinstall, .irq_preinstall = mxsfb_irq_preinstall,
.irq_uninstall = mxsfb_irq_preinstall, .irq_uninstall = mxsfb_irq_preinstall,

View File

@ -245,7 +245,7 @@ static struct pci_driver qxl_pci_driver = {
static struct drm_driver qxl_driver = { static struct drm_driver qxl_driver = {
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_IRQ_SHARED |
DRIVER_ATOMIC, DRIVER_ATOMIC,
.dumb_create = qxl_mode_dumb_create, .dumb_create = qxl_mode_dumb_create,

View File

@ -535,7 +535,7 @@ radeon_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe,
static struct drm_driver kms_driver = { static struct drm_driver kms_driver = {
.driver_features = .driver_features =
DRIVER_USE_AGP | DRIVER_USE_AGP |
DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | DRIVER_IRQ_SHARED | DRIVER_GEM |
DRIVER_PRIME | DRIVER_RENDER, DRIVER_PRIME | DRIVER_RENDER,
.load = radeon_driver_load_kms, .load = radeon_driver_load_kms,
.open = radeon_driver_open_kms, .open = radeon_driver_open_kms,

View File

@ -127,7 +127,7 @@ static irqreturn_t shmob_drm_irq(int irq, void *arg)
DEFINE_DRM_GEM_CMA_FOPS(shmob_drm_fops); DEFINE_DRM_GEM_CMA_FOPS(shmob_drm_fops);
static struct drm_driver shmob_drm_driver = { static struct drm_driver shmob_drm_driver = {
.driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET .driver_features = DRIVER_GEM | DRIVER_MODESET
| DRIVER_PRIME, | DRIVER_PRIME,
.irq_handler = shmob_drm_irq, .irq_handler = shmob_drm_irq,
.gem_free_object_unlocked = drm_gem_cma_free_object, .gem_free_object_unlocked = drm_gem_cma_free_object,

View File

@ -512,7 +512,7 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
DEFINE_DRM_GEM_CMA_FOPS(fops); DEFINE_DRM_GEM_CMA_FOPS(fops);
static struct drm_driver tilcdc_driver = { static struct drm_driver tilcdc_driver = {
.driver_features = (DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET | .driver_features = (DRIVER_GEM | DRIVER_MODESET |
DRIVER_PRIME | DRIVER_ATOMIC), DRIVER_PRIME | DRIVER_ATOMIC),
.irq_handler = tilcdc_irq, .irq_handler = tilcdc_irq,
.gem_free_object_unlocked = drm_gem_cma_free_object, .gem_free_object_unlocked = drm_gem_cma_free_object,

View File

@ -175,7 +175,6 @@ static struct drm_driver vc4_drm_driver = {
.driver_features = (DRIVER_MODESET | .driver_features = (DRIVER_MODESET |
DRIVER_ATOMIC | DRIVER_ATOMIC |
DRIVER_GEM | DRIVER_GEM |
DRIVER_HAVE_IRQ |
DRIVER_RENDER | DRIVER_RENDER |
DRIVER_PRIME | DRIVER_PRIME |
DRIVER_SYNCOBJ), DRIVER_SYNCOBJ),

View File

@ -1582,7 +1582,7 @@ static const struct file_operations vmwgfx_driver_fops = {
}; };
static struct drm_driver driver = { static struct drm_driver driver = {
.driver_features = DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | .driver_features = DRIVER_IRQ_SHARED |
DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER | DRIVER_ATOMIC, DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER | DRIVER_ATOMIC,
.load = vmw_driver_load, .load = vmw_driver_load,
.unload = vmw_driver_unload, .unload = vmw_driver_unload,

View File

@ -221,7 +221,7 @@ static void vbox_master_drop(struct drm_device *dev, struct drm_file *file_priv)
static struct drm_driver driver = { static struct drm_driver driver = {
.driver_features = .driver_features =
DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_MODESET | DRIVER_GEM | DRIVER_IRQ_SHARED |
DRIVER_PRIME | DRIVER_ATOMIC, DRIVER_PRIME | DRIVER_ATOMIC,
.dev_priv_size = 0, .dev_priv_size = 0,