Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2 struct drm_bus abstraction is no more....



details:   https://anonhg.NetBSD.org/src/rev/4ee2f11b0a8a
branches:  trunk
changeset: 834950:4ee2f11b0a8a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:03:25 2018 +0000

description:
struct drm_bus abstraction is no more.  Cope.

struct drm_driver now has the bus-specific intr establish routine
(called request_irq/free_irq to match Linux's style).

diffstat:

 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_drv.c |    8 +-
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_irq.c |    8 +-
 sys/external/bsd/drm2/dist/drm/drm_irq.c               |   30 ++-
 sys/external/bsd/drm2/dist/drm/i915/i915_drv.c         |    8 +-
 sys/external/bsd/drm2/dist/drm/i915/i915_irq.c         |    8 +-
 sys/external/bsd/drm2/dist/drm/mga/mga_drv.c           |    8 +-
 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c   |   11 +-
 sys/external/bsd/drm2/dist/drm/qxl/qxl_drv.c           |    8 +-
 sys/external/bsd/drm2/dist/drm/qxl/qxl_irq.c           |    8 +-
 sys/external/bsd/drm2/dist/drm/r128/r128_drv.c         |    8 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_drv.c     |    8 +-
 sys/external/bsd/drm2/dist/drm/radeon/radeon_irq_kms.c |    8 +-
 sys/external/bsd/drm2/dist/drm/via/via_drv.c           |    8 +-
 sys/external/bsd/drm2/dist/drm/vmwgfx/vmwgfx_drv.c     |   12 +-
 sys/external/bsd/drm2/dist/include/drm/drmP.h          |   15 +-
 sys/external/bsd/drm2/pci/drm_pci.c                    |  145 ++--------------
 16 files changed, 144 insertions(+), 157 deletions(-)

diffs (truncated from 773 to 300 lines):

diff -r c3d8d946881e -r 4ee2f11b0a8a sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_drv.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_drv.c    Mon Aug 27 07:03:11 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_drv.c    Mon Aug 27 07:03:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_drv.c,v 1.2 2018/08/27 04:58:19 riastradh Exp $ */
+/*     $NetBSD: amdgpu_drv.c,v 1.3 2018/08/27 07:03:25 riastradh Exp $ */
 
 /**
  * \file amdgpu_drv.c
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_drv.c,v 1.2 2018/08/27 04:58:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_drv.c,v 1.3 2018/08/27 07:03:25 riastradh Exp $");
 
 #include <drm/drmP.h>
 #include <drm/amdgpu_drm.h>
@@ -508,6 +508,10 @@
        .irq_postinstall = amdgpu_irq_postinstall,
        .irq_uninstall = amdgpu_irq_uninstall,
        .irq_handler = amdgpu_irq_handler,
+#ifdef __NetBSD__
+       .request_irq = drm_pci_request_irq,
+       .free_irq = drm_pci_free_irq,
+#endif
        .ioctls = amdgpu_ioctls_kms,
        .gem_free_object = amdgpu_gem_object_free,
        .gem_open_object = amdgpu_gem_object_open,
diff -r c3d8d946881e -r 4ee2f11b0a8a sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_irq.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_irq.c    Mon Aug 27 07:03:11 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_irq.c    Mon Aug 27 07:03:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_irq.c,v 1.2 2018/08/27 04:58:19 riastradh Exp $ */
+/*     $NetBSD: amdgpu_irq.c,v 1.3 2018/08/27 07:03:25 riastradh Exp $ */
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *          Jerome Glisse
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_irq.c,v 1.2 2018/08/27 04:58:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_irq.c,v 1.3 2018/08/27 07:03:25 riastradh Exp $");
 
 #include <linux/irq.h>
 #include <drm/drmP.h>
@@ -239,7 +239,11 @@
        INIT_WORK(&adev->reset_work, amdgpu_irq_reset_work_func);
 
        adev->irq.installed = true;
+#ifdef __NetBSD__
+       r = drm_irq_install(adev->ddev);
+#else
        r = drm_irq_install(adev->ddev, adev->ddev->pdev->irq);
+#endif
        if (r) {
                adev->irq.installed = false;
                flush_work(&adev->hotplug_work);
diff -r c3d8d946881e -r 4ee2f11b0a8a sys/external/bsd/drm2/dist/drm/drm_irq.c
--- a/sys/external/bsd/drm2/dist/drm/drm_irq.c  Mon Aug 27 07:03:11 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_irq.c  Mon Aug 27 07:03:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_irq.c,v 1.10 2018/08/27 06:53:36 riastradh Exp $   */
+/*     $NetBSD: drm_irq.c,v 1.11 2018/08/27 07:03:25 riastradh Exp $   */
 
 /*
  * drm_irq.c IRQ and vblank support
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_irq.c,v 1.10 2018/08/27 06:53:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_irq.c,v 1.11 2018/08/27 07:03:25 riastradh Exp $");
 
 #include <drm/drmP.h>
 #include "drm_trace.h"
@@ -524,7 +524,11 @@
  * Returns:
  * Zero on success or a negative error code on failure.
  */
+#ifdef __NetBSD__
+int drm_irq_install(struct drm_device *dev)
+#else
 int drm_irq_install(struct drm_device *dev, int irq)
+#endif
 {
        int ret;
        unsigned long sh_flags = 0;
@@ -532,8 +536,10 @@
        if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
                return -EINVAL;
 
+#ifndef __NetBSD__
        if (irq == 0)
                return -EINVAL;
+#endif
 
        /* Driver must have been initialized */
        if (!dev->dev_private)
@@ -543,7 +549,9 @@
                return -EBUSY;
        dev->irq_enabled = true;
 
+#ifndef __NetBSD__
        DRM_DEBUG("irq=%d\n", irq);
+#endif
 
        /* Before installing handler */
        if (dev->driver->irq_preinstall)
@@ -554,9 +562,7 @@
                sh_flags = IRQF_SHARED;
 
 #ifdef __NetBSD__
-       ret = (*dev->driver->bus->irq_install)(dev, dev->driver->irq_handler,
-           sh_flags, dev->devname ? dev->devname : dev->driver->name, dev,
-           &dev->irq_cookie);
+       ret = (*dev->driver->request_irq)(dev, sh_flags);
 #else
        ret = request_irq(irq, dev->driver->irq_handler,
                          sh_flags, dev->driver->name, dev);
@@ -579,12 +585,14 @@
                if (!drm_core_check_feature(dev, DRIVER_MODESET))
                        vga_client_register(dev->pdev, NULL, NULL, NULL);
 #ifdef __NetBSD__
-               (*dev->driver->bus->irq_uninstall)(dev, dev->irq_cookie);
+               (*dev->driver->free_irq)(dev);
 #else
                free_irq(irq, dev);
 #endif
        } else {
+#ifndef __NetBSD__
                dev->irq = irq;
+#endif
        }
 
        return ret;
@@ -657,7 +665,7 @@
                dev->driver->irq_uninstall(dev);
 
 #ifdef __NetBSD__
-       (*dev->driver->bus->irq_uninstall)(dev, dev->irq_cookie);
+       (*dev->driver->free_irq)(dev);
 #else
        free_irq(dev->irq, dev);
 #endif
@@ -697,13 +705,21 @@
 
        switch (ctl->func) {
        case DRM_INST_HANDLER:
+#ifdef __NetBSD__
+               irq = ctl->irq;
+#else
                irq = dev->pdev->irq;
+#endif
 
                if (dev->if_version < DRM_IF_VERSION(1, 2) &&
                    ctl->irq != irq)
                        return -EINVAL;
                mutex_lock(&dev->struct_mutex);
+#ifdef __NetBSD__
+               ret = drm_irq_install(dev);
+#else
                ret = drm_irq_install(dev, irq);
+#endif
                mutex_unlock(&dev->struct_mutex);
 
                return ret;
diff -r c3d8d946881e -r 4ee2f11b0a8a sys/external/bsd/drm2/dist/drm/i915/i915_drv.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c    Mon Aug 27 07:03:11 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c    Mon Aug 27 07:03:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_drv.c,v 1.8 2018/08/27 06:18:30 riastradh Exp $   */
+/*     $NetBSD: i915_drv.c,v 1.9 2018/08/27 07:03:25 riastradh Exp $   */
 
 /* i915_drv.c -- i830,i845,i855,i865,i915 driver -*- linux-c -*-
  */
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_drv.c,v 1.8 2018/08/27 06:18:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_drv.c,v 1.9 2018/08/27 07:03:25 riastradh Exp $");
 
 #include <linux/device.h>
 #include <linux/acpi.h>
@@ -1750,6 +1750,10 @@
        .preclose = i915_driver_preclose,
        .postclose = i915_driver_postclose,
        .set_busid = drm_pci_set_busid,
+#ifdef __NetBSD__
+       .request_irq = drm_pci_request_irq,
+       .free_irq = drm_pci_free_irq,
+#endif
 
 #if defined(CONFIG_DEBUG_FS)
        .debugfs_init = i915_debugfs_init,
diff -r c3d8d946881e -r 4ee2f11b0a8a sys/external/bsd/drm2/dist/drm/i915/i915_irq.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c    Mon Aug 27 07:03:11 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c    Mon Aug 27 07:03:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_irq.c,v 1.11 2018/08/27 04:58:23 riastradh Exp $  */
+/*     $NetBSD: i915_irq.c,v 1.12 2018/08/27 07:03:25 riastradh Exp $  */
 
 /* i915_irq.c -- IRQ support for the I915 -*- linux-c -*-
  */
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_irq.c,v 1.11 2018/08/27 04:58:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_irq.c,v 1.12 2018/08/27 07:03:25 riastradh Exp $");
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
@@ -4607,7 +4607,11 @@
         */
        dev_priv->pm.irqs_enabled = true;
 
+#ifdef __NetBSD__
+       return drm_irq_install(dev_priv->dev);
+#else
        return drm_irq_install(dev_priv->dev, dev_priv->dev->pdev->irq);
+#endif
 }
 
 /**
diff -r c3d8d946881e -r 4ee2f11b0a8a sys/external/bsd/drm2/dist/drm/mga/mga_drv.c
--- a/sys/external/bsd/drm2/dist/drm/mga/mga_drv.c      Mon Aug 27 07:03:11 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/mga/mga_drv.c      Mon Aug 27 07:03:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mga_drv.c,v 1.2 2018/08/27 04:58:24 riastradh Exp $    */
+/*     $NetBSD: mga_drv.c,v 1.3 2018/08/27 07:03:25 riastradh Exp $    */
 
 /* mga_drv.c -- Matrox G200/G400 driver -*- linux-c -*-
  * Created: Mon Dec 13 01:56:22 1999 by jhartmann%precisioninsight.com@localhost
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mga_drv.c,v 1.2 2018/08/27 04:58:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mga_drv.c,v 1.3 2018/08/27 07:03:25 riastradh Exp $");
 
 #include <linux/module.h>
 
@@ -79,6 +79,10 @@
        .irq_postinstall = mga_driver_irq_postinstall,
        .irq_uninstall = mga_driver_irq_uninstall,
        .irq_handler = mga_driver_irq_handler,
+#ifdef __NetBSD__
+       .request_irq = drm_pci_request_irq,
+       .free_irq = drm_pci_free_irq,
+#endif
        .ioctls = mga_ioctls,
        .dma_ioctl = mga_dma_buffers,
        .fops = &mga_driver_fops,
diff -r c3d8d946881e -r 4ee2f11b0a8a sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c      Mon Aug 27 07:03:11 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c      Mon Aug 27 07:03:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_drm.c,v 1.9 2018/08/27 04:58:24 riastradh Exp $        */
+/*     $NetBSD: nouveau_drm.c,v 1.10 2018/08/27 07:03:26 riastradh Exp $       */
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_drm.c,v 1.9 2018/08/27 04:58:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_drm.c,v 1.10 2018/08/27 07:03:26 riastradh Exp $");
 
 #include <linux/console.h>
 #include <linux/delay.h>
@@ -1154,8 +1154,15 @@
 {
        driver_pci = driver_stub;
        driver_pci.set_busid = drm_pci_set_busid;
+#ifdef __NetBSD__
+       driver_pci.request_irq = drm_pci_request_irq;
+       driver_pci.free_irq = drm_pci_free_irq;
+#endif
        driver_platform = driver_stub;
        driver_platform.set_busid = drm_platform_set_busid;
+#ifdef __NetBSD__
+       /* XXX platform intr establish?  */
+#endif
 
        nouveau_display_options();
 
diff -r c3d8d946881e -r 4ee2f11b0a8a sys/external/bsd/drm2/dist/drm/qxl/qxl_drv.c
--- a/sys/external/bsd/drm2/dist/drm/qxl/qxl_drv.c      Mon Aug 27 07:03:11 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/qxl/qxl_drv.c      Mon Aug 27 07:03:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: qxl_drv.c,v 1.2 2018/08/27 04:58:35 riastradh Exp $    */
+/*     $NetBSD: qxl_drv.c,v 1.3 2018/08/27 07:03:26 riastradh Exp $    */
 
 /* vim: set ts=8 sw=8 tw=78 ai noexpandtab */
 /* qxl_drv.c -- QXL driver -*- linux-c -*-
@@ -31,7 +31,7 @@



Home | Main Index | Thread Index | Old Index