drm/qxl: Convert to Linux IRQ interfaces
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 6 Jul 2021 07:47:35 +0000 (09:47 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 15 Jul 2021 09:16:06 +0000 (11:16 +0200)
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>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210706074735.8849-1-tzimmermann@suse.de
drivers/gpu/drm/qxl/qxl_drv.c
drivers/gpu/drm/qxl/qxl_drv.h
drivers/gpu/drm/qxl/qxl_irq.c

index 18729e339c70c63b6f0ea0c23757043095b71cf1..fc47b0deb021da4f0ddeaa5169e434cb085a0539 100644 (file)
@@ -283,7 +283,6 @@ static struct drm_driver qxl_driver = {
        .gem_prime_import_sg_table = qxl_gem_prime_import_sg_table,
        .fops = &qxl_fops,
        .ioctls = qxl_ioctls,
-       .irq_handler = qxl_irq_handler,
        .name = DRIVER_NAME,
        .desc = DRIVER_DESC,
        .date = DRIVER_DATE,
index f95885a8bd2be6487f83615913590931fa8e704b..359266d9e8604b2685b1ce131415526ac3c7f736 100644 (file)
@@ -437,7 +437,6 @@ void qxl_gem_prime_vunmap(struct drm_gem_object *obj,
 
 /* qxl_irq.c */
 int qxl_irq_init(struct qxl_device *qdev);
-irqreturn_t qxl_irq_handler(int irq, void *arg);
 
 void qxl_debugfs_add_files(struct qxl_device *qdev,
                           struct drm_info_list *files,
index d312322cacd148f439a1e5fc7246bf5500557f42..665278ee3b6daaf832c45fa94079ec0bb048e28f 100644 (file)
 
 #include <linux/pci.h>
 
-#include <drm/drm_irq.h>
+#include <drm/drm_drv.h>
 
 #include "qxl_drv.h"
 
-irqreturn_t qxl_irq_handler(int irq, void *arg)
+static irqreturn_t qxl_irq_handler(int irq, void *arg)
 {
        struct drm_device *dev = (struct drm_device *) arg;
        struct qxl_device *qdev = to_qxl(dev);
@@ -81,7 +81,8 @@ static void qxl_client_monitors_config_work_func(struct work_struct *work)
 
 int qxl_irq_init(struct qxl_device *qdev)
 {
-       struct pci_dev *pdev = to_pci_dev(qdev->ddev.dev);
+       struct drm_device *ddev = &qdev->ddev;
+       struct pci_dev *pdev = to_pci_dev(ddev->dev);
        int ret;
 
        init_waitqueue_head(&qdev->display_event);
@@ -95,7 +96,7 @@ int qxl_irq_init(struct qxl_device *qdev)
        atomic_set(&qdev->irq_received_cursor, 0);
        atomic_set(&qdev->irq_received_io_cmd, 0);
        qdev->irq_received_error = 0;
-       ret = drm_irq_install(&qdev->ddev, pdev->irq);
+       ret = request_irq(pdev->irq, qxl_irq_handler, IRQF_SHARED, ddev->driver->name, ddev);
        qdev->ram_header->int_mask = QXL_INTERRUPT_MASK;
        if (unlikely(ret != 0)) {
                DRM_ERROR("Failed installing irq: %d\n", ret);