Skip to content

Commit

Permalink
drm/vmwgfx: Convert to Linux IRQ interfaces
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Zack Rusin <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
Thomas Zimmermann committed Jul 8, 2021
1 parent 9ca41d1 commit b0fee7d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*
**************************************************************************/

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

#include "vmwgfx_drv.h"
Expand Down Expand Up @@ -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))
Expand All @@ -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);
}

/**
Expand All @@ -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);
}

0 comments on commit b0fee7d

Please sign in to comment.