Skip to contentSkip to conversation

drm/ingenic: Convert to Linux IRQ interfaces

PATCH Superseded Thomas Zimmermann 2 participants 2 messages Jul 15, 2021

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

PATCH v2 1/1 drm/ingenic: Convert to Linux IRQ interfaces

Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it.

This patch also fixes a bug where the driver didn't release the IRQ.

v2:
* automatically release IRQ via devm_request_irq() (Paul)
* mention the bugfix (Sam)

---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +1 -4
index c296472164d9..857ed070b21b 100644
@@ -33,7 +33,6 @@
 #include <drm/drm_fourcc.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
-#include <drm/drm_irq.h>
 #include <drm/drm_managed.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
@@ -799,8 +798,6 @@ static const struct drm_driver ingenic_drm_driver_data = {
 	.fops			= &ingenic_drm_fops,
 	.gem_create_object	= ingenic_drm_gem_create_object,
 	DRM_GEM_CMA_DRIVER_OPS,
-
-	.irq_handler		= ingenic_drm_irq_handler,
 };
 
 static const struct drm_plane_funcs ingenic_drm_primary_plane_funcs = {
@@ -1098,7 +1095,7 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)
 		encoder->possible_clones = clone_mask;
 	}
 
-	ret = drm_irq_install(drm, irq);
+	ret = devm_request_irq(dev, irq, ingenic_drm_irq_handler, 0, drm->driver->name, drm);
 	if (ret) {
 		dev_err(dev, "Unable to install IRQ handler\n");
 		return ret;
Signature · 1 line
2.32.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Thomas Zimmermann

Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it.

This patch also fixes a bug where the driver didn't release the IRQ.

Quoted 6 lines

v2:
* automatically release IRQ via devm_request_irq() (Paul)
* mention the bugfix (Sam)

Cheers,
-Paul

Quoted 39 lines
---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +0 -3
index c296472164d9..857ed070b21b 100644
@@ -33,7 +33,6 @@
 #include <drm/drm_fourcc.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
-#include <drm/drm_irq.h>
 #include <drm/drm_managed.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
@@ -799,8 +798,6 @@ static const struct drm_driver 
 ingenic_drm_driver_data = {
 	.fops			= &ingenic_drm_fops,
 	.gem_create_object	= ingenic_drm_gem_create_object,
 	DRM_GEM_CMA_DRIVER_OPS,
-
-	.irq_handler		= ingenic_drm_irq_handler,
 };
 

static const struct drm_plane_funcs ingenic_drm_primary_plane_funcs =
{

drivers/gpu/drm/ingenic/ingenic-drm-drv.c +1 -1
@@ -1098,7 +1095,7 @@ static int ingenic_drm_bind(struct device *dev,
 bool has_components)
 		encoder->possible_clones = clone_mask;
 	}
 
-	ret = drm_irq_install(drm, irq);
+	ret = devm_request_irq(dev, irq, ingenic_drm_irq_handler, 0,
 drm->driver->name, drm);
 	if (ret) {
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +0 -0
 		dev_err(dev, "Unable to install IRQ handler\n");
 		return ret;