drm/irq: Don't check for DRIVER_HAVE_IRQ in drm_irq_(un)install
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 29 Jan 2019 10:42:46 +0000 (11:42 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 29 Jan 2019 14:45:06 +0000 (15:45 +0100)
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
18 files changed:
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/arm/hdlcd_drv.c
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
drivers/gpu/drm/drm_irq.c
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
drivers/gpu/drm/gma500/psb_drv.c
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/meson/meson_drv.c
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/mxsfb/mxsfb_drv.c
drivers/gpu/drm/qxl/qxl_drv.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/shmobile/shmob_drm_drv.c
drivers/gpu/drm/tilcdc/tilcdc_drv.c
drivers/gpu/drm/vc4/vc4_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/staging/vboxvideo/vbox_drv.c

index 0c22bae0c7368d7ea5c4d30a0bd24d2ba15b4f0e..22502417c18cdce6a9ffdf671a0ccd4a3480da04 100644 (file)
@@ -1189,7 +1189,7 @@ amdgpu_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe,
 static struct drm_driver kms_driver = {
        .driver_features =
            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,
        .load = amdgpu_driver_load_kms,
        .open = amdgpu_driver_open_kms,
index e68935b80917e375aab055dfd3c79948a9ee13b6..8fc0b884c42885bb7141709828a34424264df417 100644 (file)
@@ -229,7 +229,7 @@ static int hdlcd_debugfs_init(struct drm_minor *minor)
 DEFINE_DRM_GEM_CMA_FOPS(fops);
 
 static struct drm_driver hdlcd_driver = {
-       .driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM |
+       .driver_features = DRIVER_GEM |
                           DRIVER_MODESET | DRIVER_PRIME |
                           DRIVER_ATOMIC,
        .irq_handler = hdlcd_irq,
index 034a91112098d87848fd26c26749680d49c50b07..0be13eceedba927283a8f8e504022eb75a6fba14 100644 (file)
@@ -720,7 +720,7 @@ static void atmel_hlcdc_dc_irq_uninstall(struct drm_device *dev)
 DEFINE_DRM_GEM_CMA_FOPS(fops);
 
 static struct drm_driver atmel_hlcdc_dc_driver = {
-       .driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM |
+       .driver_features = DRIVER_GEM |
                           DRIVER_MODESET | DRIVER_PRIME |
                           DRIVER_ATOMIC,
        .irq_handler = atmel_hlcdc_dc_irq_handler,
index 45a07652fa00e886bc11ae6dcf5766439ee0901a..c5babb3e4752c8f2af424ca375958eb065183438 100644 (file)
@@ -103,9 +103,6 @@ int drm_irq_install(struct drm_device *dev, int irq)
        int ret;
        unsigned long sh_flags = 0;
 
-       if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
-               return -EOPNOTSUPP;
-
        if (irq == 0)
                return -EINVAL;
 
@@ -174,9 +171,6 @@ int drm_irq_uninstall(struct drm_device *dev)
        bool irq_enabled;
        int i;
 
-       if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
-               return -EOPNOTSUPP;
-
        irq_enabled = dev->irq_enabled;
        dev->irq_enabled = false;
 
index 54ace3436605712c251aa036e5347f0eca6e5d38..dfc73aade32581c5306b74a87f00cc50affb233d 100644 (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);
 
 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,
        .load                   = fsl_dcu_load,
        .unload                 = fsl_dcu_unload,
index ac32ab5aa002705c69d0636fff461951fd4c283d..7cf14aeb1c28af7c34d420a02800f82e6aa0c03e 100644 (file)
@@ -468,7 +468,7 @@ static const struct file_operations psb_gem_fops = {
 };
 
 static struct drm_driver driver = {
-       .driver_features = DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | \
+       .driver_features = DRIVER_IRQ_SHARED | \
                           DRIVER_MODESET | DRIVER_GEM,
        .load = psb_driver_load,
        .unload = psb_driver_unload,
index 85a701af65304d19b8977958e4665f0b2a7c31da..8ed94fcd42a7fdc0a0bf0aaa0fd9ea05df98e9a8 100644 (file)
@@ -56,8 +56,7 @@ static irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 }
 
 static struct drm_driver hibmc_driver = {
-       .driver_features        = DRIVER_GEM | DRIVER_MODESET |
-                                 DRIVER_ATOMIC | DRIVER_HAVE_IRQ,
+       .driver_features        = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
        .fops                   = &hibmc_fops,
        .name                   = "hibmc",
        .date                   = "20160828",
index 9883921013b1404f150b8594721acc3ccbdac7c2..b7d71083e3207ee6d8e1e02884ef910f8e4cb3c9 100644 (file)
@@ -3209,7 +3209,7 @@ static struct drm_driver driver = {
         * deal with them for Intel hardware.
         */
        .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,
        .release = i915_driver_release,
        .open = i915_driver_open,
index a6af20884f03216f568f993b1aa681f4df0f9eb7..27f38bdc8677804376521a9b5e672bdfcacfb46c 100644 (file)
@@ -90,7 +90,7 @@ static irqreturn_t meson_irq(int irq, void *arg)
 DEFINE_DRM_GEM_CMA_FOPS(fops);
 
 static struct drm_driver meson_driver = {
-       .driver_features        = DRIVER_HAVE_IRQ | DRIVER_GEM |
+       .driver_features        = DRIVER_GEM |
                                  DRIVER_MODESET | DRIVER_PRIME |
                                  DRIVER_ATOMIC,
 
index d2cdc7b553feb4dd8b3864dfa69c3bad3502c273..8747fb32a1062997e2136839b5a54f8fa8977676 100644 (file)
@@ -1063,8 +1063,7 @@ static const struct file_operations fops = {
 };
 
 static struct drm_driver msm_driver = {
-       .driver_features    = DRIVER_HAVE_IRQ |
-                               DRIVER_GEM |
+       .driver_features    = DRIVER_GEM |
                                DRIVER_PRIME |
                                DRIVER_RENDER |
                                DRIVER_ATOMIC |
index 54c8cdaeb5769d04b0d65b0b5ca2422ad2976010..967379f3f571995f89393742dae4d0f559c7f834 100644 (file)
@@ -322,8 +322,7 @@ DEFINE_DRM_GEM_CMA_FOPS(fops);
 
 static struct drm_driver mxsfb_driver = {
        .driver_features        = DRIVER_GEM | DRIVER_MODESET |
-                                 DRIVER_PRIME | DRIVER_ATOMIC |
-                                 DRIVER_HAVE_IRQ,
+                                 DRIVER_PRIME | DRIVER_ATOMIC,
        .irq_handler            = mxsfb_irq_handler,
        .irq_preinstall         = mxsfb_irq_preinstall,
        .irq_uninstall          = mxsfb_irq_preinstall,
index a1eccefab830cc9b374c0a60711b7c96f4862e74..3b1487cfbb0ec282f0dc19dd7a807a7c4698f727 100644 (file)
@@ -245,7 +245,7 @@ static struct pci_driver qxl_pci_driver = {
 
 static struct drm_driver qxl_driver = {
        .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
-                          DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED |
+                          DRIVER_IRQ_SHARED |
                           DRIVER_ATOMIC,
 
        .dumb_create = qxl_mode_dumb_create,
index 8897c3d18fbbfbea2cc55a7dd49387ea376cd583..450a9d473c301737359ffec4c42907ef258fa1d7 100644 (file)
@@ -535,7 +535,7 @@ radeon_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe,
 static struct drm_driver kms_driver = {
        .driver_features =
            DRIVER_USE_AGP |
-           DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM |
+           DRIVER_IRQ_SHARED | DRIVER_GEM |
            DRIVER_PRIME | DRIVER_RENDER,
        .load = radeon_driver_load_kms,
        .open = radeon_driver_open_kms,
index 2002e7c55e8032a3dd6707232336a1e7bd2c4878..cb821adfc3211e57604e4239aaf44c7ecdfef08a 100644 (file)
@@ -127,7 +127,7 @@ static irqreturn_t shmob_drm_irq(int irq, void *arg)
 DEFINE_DRM_GEM_CMA_FOPS(shmob_drm_fops);
 
 static struct drm_driver shmob_drm_driver = {
-       .driver_features        = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET
+       .driver_features        = DRIVER_GEM | DRIVER_MODESET
                                | DRIVER_PRIME,
        .irq_handler            = shmob_drm_irq,
        .gem_free_object_unlocked = drm_gem_cma_free_object,
index 13b11acd4a5ef01db9e7b8ed6fcf81b0a51e0b0b..3030af9e7b350c47e4b8761f00ab536f53870675 100644 (file)
@@ -512,7 +512,7 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
 DEFINE_DRM_GEM_CMA_FOPS(fops);
 
 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),
        .irq_handler        = tilcdc_irq,
        .gem_free_object_unlocked = drm_gem_cma_free_object,
index f6f5cd80c04de355da85295457fc2a1a4011cdd9..5fcd2f0da7f7c56236150a1c2f4784ab6094a9eb 100644 (file)
@@ -175,7 +175,6 @@ static struct drm_driver vc4_drm_driver = {
        .driver_features = (DRIVER_MODESET |
                            DRIVER_ATOMIC |
                            DRIVER_GEM |
-                           DRIVER_HAVE_IRQ |
                            DRIVER_RENDER |
                            DRIVER_PRIME |
                            DRIVER_SYNCOBJ),
index 25afb1d594e326c10e435e19a8f4346db2561459..d159d0400013239adfe0394f9ea037418ff5bf23 100644 (file)
@@ -1582,7 +1582,7 @@ static const struct file_operations vmwgfx_driver_fops = {
 };
 
 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,
        .load = vmw_driver_load,
        .unload = vmw_driver_unload,
index cc6532d8c2fa3c998422f744feddfb577281b20b..78cbcd68d4f3281ea4ff71ea004607e707e7aa53 100644 (file)
@@ -221,7 +221,7 @@ static void vbox_master_drop(struct drm_device *dev, struct drm_file *file_priv)
 
 static struct drm_driver driver = {
        .driver_features =
-           DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED |
+           DRIVER_MODESET | DRIVER_GEM | DRIVER_IRQ_SHARED |
            DRIVER_PRIME | DRIVER_ATOMIC,
        .dev_priv_size = 0,