dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/vmwgfx: Convert to Linux IRQ interfaces
@ 2021-07-06  7:22 Thomas Zimmermann
  2021-07-06 15:23 ` Zack Rusin
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Zimmermann @ 2021-07-06  7:22 UTC (permalink / raw)
  To: linux-graphics-maintainer, zackr, airlied, daniel
  Cc: Thomas Zimmermann, dri-devel

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.

Vmwgfx already uses Linux IRQ functions. All that's left to replace
is the reference to struct drm_device.irq. Use irq value of struct
pci_dev instead.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_irq.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
index 4b82f5995452..c5191de365ca 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
@@ -25,6 +25,7 @@
  *
  **************************************************************************/

+#include <linux/pci.h>
 #include <linux/sched/signal.h>

 #include "vmwgfx_drv.h"
@@ -287,6 +288,7 @@ static void vmw_irq_preinstall(struct drm_device *dev)
 void vmw_irq_uninstall(struct drm_device *dev)
 {
 	struct vmw_private *dev_priv = vmw_priv(dev);
+	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	uint32_t status;

 	if (!(dev_priv->capabilities & SVGA_CAP_IRQMASK))
@@ -297,7 +299,7 @@ void vmw_irq_uninstall(struct drm_device *dev)
 	status = vmw_irq_status_read(dev_priv);
 	vmw_irq_status_write(dev_priv, status);

-	free_irq(dev->irq, dev);
+	free_irq(pdev->irq, dev);
 }

 /**
@@ -309,16 +311,8 @@ void vmw_irq_uninstall(struct drm_device *dev)
  */
 int vmw_irq_install(struct drm_device *dev, int irq)
 {
-	int ret;
-
 	vmw_irq_preinstall(dev);

-	ret = request_threaded_irq(irq, vmw_irq_handler, vmw_thread_fn,
-				   IRQF_SHARED, VMWGFX_DRIVER_NAME, dev);
-	if (ret < 0)
-		return ret;
-
-	dev->irq = irq;
-
-	return ret;
+	return request_threaded_irq(irq, vmw_irq_handler, vmw_thread_fn,
+				    IRQF_SHARED, VMWGFX_DRIVER_NAME, dev);
 }
--
2.32.0


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

* Re: [PATCH] drm/vmwgfx: Convert to Linux IRQ interfaces
  2021-07-06  7:22 [PATCH] drm/vmwgfx: Convert to Linux IRQ interfaces Thomas Zimmermann
@ 2021-07-06 15:23 ` Zack Rusin
  0 siblings, 0 replies; 2+ messages in thread
From: Zack Rusin @ 2021-07-06 15:23 UTC (permalink / raw)
  To: Thomas Zimmermann, linux-graphics-maintainer, airlied, daniel; +Cc: dri-devel

On 7/6/21 3:22 AM, Thomas Zimmermann 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.
> 
> Vmwgfx already uses Linux IRQ functions. All that's left to replace
> is the reference to struct drm_device.irq. Use irq value of struct
> pci_dev instead.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

Looks great. Thank you.

Reviewed-by: Zack Rusin <zackr@vmware.com>

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

end of thread, other threads:[~2021-07-06 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06  7:22 [PATCH] drm/vmwgfx: Convert to Linux IRQ interfaces Thomas Zimmermann
2021-07-06 15:23 ` Zack Rusin

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).