linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/meson: Convert to Linux IRQ interfaces
@ 2021-07-06  7:45 Thomas Zimmermann
  2021-07-07  6:13 ` Neil Armstrong
  2021-07-08 13:31 ` Martin Blumenstingl
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2021-07-06  7:45 UTC (permalink / raw)
  To: narmstrong, airlied, daniel, khilman, jbrunet, martin.blumenstingl
  Cc: dri-devel, linux-amlogic, linux-arm-kernel, 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.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/meson/meson_drv.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index 3d0ccc7eef1b..bc0d60df04ae 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -21,7 +21,6 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
-#include <drm/drm_irq.h>
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_vblank.h>
@@ -94,9 +93,6 @@ DEFINE_DRM_GEM_CMA_FOPS(fops);
 static const struct drm_driver meson_driver = {
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
 
-	/* IRQ */
-	.irq_handler		= meson_irq,
-
 	/* CMA Ops */
 	DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE(meson_dumb_create),
 
@@ -335,7 +331,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
 	if (ret)
 		goto free_drm;
 
-	ret = drm_irq_install(drm, priv->vsync_irq);
+	ret = request_irq(priv->vsync_irq, meson_irq, 0, drm->driver->name, drm);
 	if (ret)
 		goto free_drm;
 
@@ -354,7 +350,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
 	return 0;
 
 uninstall_irq:
-	drm_irq_uninstall(drm);
+	free_irq(priv->vsync_irq, drm);
 free_drm:
 	drm_dev_put(drm);
 
@@ -382,7 +378,7 @@ static void meson_drv_unbind(struct device *dev)
 	drm_kms_helper_poll_fini(drm);
 	drm_atomic_helper_shutdown(drm);
 	component_unbind_all(dev, drm);
-	drm_irq_uninstall(drm);
+	free_irq(priv->vsync_irq, drm);
 	drm_dev_put(drm);
 
 	if (priv->afbcd.ops) {
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/meson: Convert to Linux IRQ interfaces
  2021-07-06  7:45 [PATCH] drm/meson: Convert to Linux IRQ interfaces Thomas Zimmermann
@ 2021-07-07  6:13 ` Neil Armstrong
  2021-07-08 13:31 ` Martin Blumenstingl
  1 sibling, 0 replies; 4+ messages in thread
From: Neil Armstrong @ 2021-07-07  6:13 UTC (permalink / raw)
  To: Thomas Zimmermann, airlied, daniel, khilman, jbrunet,
	martin.blumenstingl
  Cc: dri-devel, linux-amlogic, linux-arm-kernel

Hi,

Le 06/07/2021 à 09:45, Thomas Zimmermann a écrit :
> 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.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>  drivers/gpu/drm/meson/meson_drv.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
> index 3d0ccc7eef1b..bc0d60df04ae 100644
> --- a/drivers/gpu/drm/meson/meson_drv.c
> +++ b/drivers/gpu/drm/meson/meson_drv.c
> @@ -21,7 +21,6 @@
>  #include <drm/drm_fb_helper.h>
>  #include <drm/drm_gem_cma_helper.h>
>  #include <drm/drm_gem_framebuffer_helper.h>
> -#include <drm/drm_irq.h>
>  #include <drm/drm_modeset_helper_vtables.h>
>  #include <drm/drm_probe_helper.h>
>  #include <drm/drm_vblank.h>
> @@ -94,9 +93,6 @@ DEFINE_DRM_GEM_CMA_FOPS(fops);
>  static const struct drm_driver meson_driver = {
>  	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
>  
> -	/* IRQ */
> -	.irq_handler		= meson_irq,
> -
>  	/* CMA Ops */
>  	DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE(meson_dumb_create),
>  
> @@ -335,7 +331,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
>  	if (ret)
>  		goto free_drm;
>  
> -	ret = drm_irq_install(drm, priv->vsync_irq);
> +	ret = request_irq(priv->vsync_irq, meson_irq, 0, drm->driver->name, drm);
>  	if (ret)
>  		goto free_drm;
>  
> @@ -354,7 +350,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
>  	return 0;
>  
>  uninstall_irq:
> -	drm_irq_uninstall(drm);
> +	free_irq(priv->vsync_irq, drm);
>  free_drm:
>  	drm_dev_put(drm);
>  
> @@ -382,7 +378,7 @@ static void meson_drv_unbind(struct device *dev)
>  	drm_kms_helper_poll_fini(drm);
>  	drm_atomic_helper_shutdown(drm);
>  	component_unbind_all(dev, drm);
> -	drm_irq_uninstall(drm);
> +	free_irq(priv->vsync_irq, drm);
>  	drm_dev_put(drm);
>  
>  	if (priv->afbcd.ops) {
> 

Looks good !

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

Thanks,
Neil

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/meson: Convert to Linux IRQ interfaces
  2021-07-06  7:45 [PATCH] drm/meson: Convert to Linux IRQ interfaces Thomas Zimmermann
  2021-07-07  6:13 ` Neil Armstrong
@ 2021-07-08 13:31 ` Martin Blumenstingl
  2021-07-08 13:48   ` Thomas Zimmermann
  1 sibling, 1 reply; 4+ messages in thread
From: Martin Blumenstingl @ 2021-07-08 13:31 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: Neil Armstrong, airlied, daniel, khilman, jbrunet, dri-devel,
	linux-amlogic, linux-arm-kernel

Hi Thomas,

On Tue, Jul 6, 2021 at 9:45 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>
> 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.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
and also (although I am no drm subsystem expert):
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

[...]
> -       ret = drm_irq_install(drm, priv->vsync_irq);
> +       ret = request_irq(priv->vsync_irq, meson_irq, 0, drm->driver->name, drm);
I'd like to use dev_name(dev) instead of drm->driver->name in the
future as that'll make it much easier to identify the corresponding
IRQ in /proc/interrupts for example
your patch makes this possible - thanks for this!


Best regards,
Martin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/meson: Convert to Linux IRQ interfaces
  2021-07-08 13:31 ` Martin Blumenstingl
@ 2021-07-08 13:48   ` Thomas Zimmermann
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2021-07-08 13:48 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: Neil Armstrong, airlied, khilman, dri-devel, linux-amlogic,
	linux-arm-kernel, jbrunet


[-- Attachment #1.1.1: Type: text/plain, Size: 1535 bytes --]

Hi

Am 08.07.21 um 15:31 schrieb Martin Blumenstingl:
> Hi Thomas,
> 
> On Tue, Jul 6, 2021 at 9:45 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>
>> 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.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> and also (although I am no drm subsystem expert):
> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> 

Oh, just when I committed the patch. But thanks for your reply.


> [...]
>> -       ret = drm_irq_install(drm, priv->vsync_irq);
>> +       ret = request_irq(priv->vsync_irq, meson_irq, 0, drm->driver->name, drm);
> I'd like to use dev_name(dev) instead of drm->driver->name in the
> future as that'll make it much easier to identify the corresponding
> IRQ in /proc/interrupts for example
> your patch makes this possible - thanks for this!

I also thought about this, but every driver in DRM and apparently most 
drivers in general pass the driver's name here. I think the change would 
make a lot of sense, but it's probably worth a kernel-wide effort.

Best regards
Thomas

> 
> 
> Best regards,
> Martin
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-08 13:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06  7:45 [PATCH] drm/meson: Convert to Linux IRQ interfaces Thomas Zimmermann
2021-07-07  6:13 ` Neil Armstrong
2021-07-08 13:31 ` Martin Blumenstingl
2021-07-08 13:48   ` Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).