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 Move linux_pci_dev_init into callers o...



details:   https://anonhg.NetBSD.org/src/rev/2aba818844ec
branches:  trunk
changeset: 366239:2aba818844ec
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:11:21 2018 +0000

description:
Move linux_pci_dev_init into callers of drm_pci_attach.

The order in nouveau has to be

- linux_pci_dev_init
- nvkm_device_pci_new
- rest of drm_pci_attach

diffstat:

 sys/external/bsd/drm2/amdgpu/amdgpu_pci.c   |  7 +++++--
 sys/external/bsd/drm2/i915drm/i915_pci.c    |  7 +++++--
 sys/external/bsd/drm2/nouveau/nouveau_pci.c |  7 +++++--
 sys/external/bsd/drm2/pci/drm_pci.c         |  7 ++-----
 sys/external/bsd/drm2/radeon/radeon_pci.c   |  7 +++++--
 5 files changed, 22 insertions(+), 13 deletions(-)

diffs (140 lines):

diff -r d02c32854e06 -r 2aba818844ec sys/external/bsd/drm2/amdgpu/amdgpu_pci.c
--- a/sys/external/bsd/drm2/amdgpu/amdgpu_pci.c Mon Aug 27 14:11:04 2018 +0000
+++ b/sys/external/bsd/drm2/amdgpu/amdgpu_pci.c Mon Aug 27 14:11:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_pci.c,v 1.1 2018/08/27 14:02:32 riastradh Exp $ */
+/*     $NetBSD: amdgpu_pci.c,v 1.2 2018/08/27 14:11:21 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_pci.c,v 1.1 2018/08/27 14:02:32 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_pci.c,v 1.2 2018/08/27 14:11:21 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/queue.h>
@@ -156,6 +156,9 @@
        sc->sc_task_state = AMDGPU_TASK_ATTACH;
        SIMPLEQ_INIT(&sc->sc_task_u.attach);
 
+       /* Initialize the Linux PCI device descriptor.  */
+       linux_pci_dev_init(&sc->sc_pci_dev, self, pa, 0);
+
        /* XXX errno Linux->NetBSD */
        error = -drm_pci_attach(self, pa, &sc->sc_pci_dev, amdgpu_drm_driver,
            flags, &sc->sc_drm_dev);
diff -r d02c32854e06 -r 2aba818844ec sys/external/bsd/drm2/i915drm/i915_pci.c
--- a/sys/external/bsd/drm2/i915drm/i915_pci.c  Mon Aug 27 14:11:04 2018 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_pci.c  Mon Aug 27 14:11:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_pci.c,v 1.17 2018/08/27 13:40:03 riastradh Exp $  */
+/*     $NetBSD: i915_pci.c,v 1.18 2018/08/27 14:11:21 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.17 2018/08/27 13:40:03 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.18 2018/08/27 14:11:21 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/queue.h>
@@ -174,6 +174,9 @@
        sc->sc_task_state = I915DRMKMS_TASK_ATTACH;
        SIMPLEQ_INIT(&sc->sc_task_u.attach);
 
+       /* Initialize the Linux PCI device descriptor.  */
+       linux_pci_dev_init(&sc->sc_pci_dev, self, pa, 0);
+
        /* XXX errno Linux->NetBSD */
        error = -drm_pci_attach(self, pa, &sc->sc_pci_dev, i915_drm_driver,
            cookie, &sc->sc_drm_dev);
diff -r d02c32854e06 -r 2aba818844ec sys/external/bsd/drm2/nouveau/nouveau_pci.c
--- a/sys/external/bsd/drm2/nouveau/nouveau_pci.c       Mon Aug 27 14:11:04 2018 +0000
+++ b/sys/external/bsd/drm2/nouveau/nouveau_pci.c       Mon Aug 27 14:11:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_pci.c,v 1.15 2018/08/27 13:39:07 riastradh Exp $       */
+/*     $NetBSD: nouveau_pci.c,v 1.16 2018/08/27 14:11:21 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.15 2018/08/27 13:39:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.16 2018/08/27 14:11:21 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/device.h>
@@ -139,6 +139,9 @@
 
        sc->sc_dev = self;
 
+       /* Initialize the Linux PCI device descriptor.  */
+       linux_pci_dev_init(&sc->sc_pci_dev, self, pa, 0);
+
        if (!pmf_device_register(self, &nouveau_pci_suspend,
                &nouveau_pci_resume))
                aprint_error_dev(self, "unable to establish power handler\n");
diff -r d02c32854e06 -r 2aba818844ec sys/external/bsd/drm2/pci/drm_pci.c
--- a/sys/external/bsd/drm2/pci/drm_pci.c       Mon Aug 27 14:11:04 2018 +0000
+++ b/sys/external/bsd/drm2/pci/drm_pci.c       Mon Aug 27 14:11:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_pci.c,v 1.24 2018/08/27 07:55:59 riastradh Exp $   */
+/*     $NetBSD: drm_pci.c,v 1.25 2018/08/27 14:11:21 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.24 2018/08/27 07:55:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.25 2018/08/27 14:11:21 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/errno.h>
@@ -82,9 +82,6 @@
        if (ret)
                goto fail0;
 
-       /* Initialize the Linux PCI device descriptor.  */
-       linux_pci_dev_init(pdev, self, pa, 0);
-
        /* Create a DRM device.  */
        dev = drm_dev_alloc(driver, self);
        if (dev == NULL) {
diff -r d02c32854e06 -r 2aba818844ec sys/external/bsd/drm2/radeon/radeon_pci.c
--- a/sys/external/bsd/drm2/radeon/radeon_pci.c Mon Aug 27 14:11:04 2018 +0000
+++ b/sys/external/bsd/drm2/radeon/radeon_pci.c Mon Aug 27 14:11:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_pci.c,v 1.10 2015/05/29 05:48:46 mrg Exp $      */
+/*     $NetBSD: radeon_pci.c,v 1.11 2018/08/27 14:11:22 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.10 2015/05/29 05:48:46 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.11 2018/08/27 14:11:22 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "vga.h"
@@ -228,6 +228,9 @@
        sc->sc_task_state = RADEON_TASK_ATTACH;
        SIMPLEQ_INIT(&sc->sc_task_u.attach);
 
+       /* Initialize the Linux PCI device descriptor.  */
+       linux_pci_dev_init(&sc->sc_pci_dev, self, pa, 0);
+
        /* XXX errno Linux->NetBSD */
        error = -drm_pci_attach(self, pa, &sc->sc_pci_dev, radeon_drm_driver,
            flags, &sc->sc_drm_dev);



Home | Main Index | Thread Index | Old Index