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/nouveau Move nouveau pci initializatio...



details:   https://anonhg.NetBSD.org/src/rev/87e72c3ff54c
branches:  trunk
changeset: 366457:87e72c3ff54c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Aug 28 03:34:07 2018 +0000

description:
Move nouveau pci initialization to nouveau_pci where it belongs.

Somehow I forgot this was a separate module.

diffstat:

 sys/external/bsd/drm2/nouveau/nouveau_module.c |  28 +------------------------
 sys/external/bsd/drm2/nouveau/nouveau_pci.c    |  19 ++++++++---------
 2 files changed, 11 insertions(+), 36 deletions(-)

diffs (119 lines):

diff -r 1c9547fdf0f8 -r 87e72c3ff54c sys/external/bsd/drm2/nouveau/nouveau_module.c
--- a/sys/external/bsd/drm2/nouveau/nouveau_module.c    Tue Aug 28 03:33:54 2018 +0000
+++ b/sys/external/bsd/drm2/nouveau/nouveau_module.c    Tue Aug 28 03:34:07 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_module.c,v 1.8 2018/08/27 15:31:27 riastradh Exp $     */
+/*     $NetBSD: nouveau_module.c,v 1.9 2018/08/28 03:34:07 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_module.c,v 1.8 2018/08/27 15:31:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_module.c,v 1.9 2018/08/28 03:34:07 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/module.h>
@@ -41,10 +41,6 @@
 
 #include <core/device.h>
 
-#ifdef _KERNEL_OPT
-#include "opt_drmkms_pci.h"
-#endif
-
 MODULE(MODULE_CLASS_DRIVER, nouveau, "drmkms"); /* XXX drmkms_i2c, drmkms_ttm */
 
 #ifdef _MODULE
@@ -53,26 +49,9 @@
 
 struct drm_sysctl_def nouveau_def = DRM_SYSCTL_INIT();
 
-#if NDRMKMS_PCI > 0
-extern struct drm_driver *const nouveau_drm_driver_stub; /* XXX */
-extern struct drm_driver *const nouveau_drm_driver_pci;         /* XXX */
-#endif
-
 static int
 nouveau_init(void)
 {
-#if NDRMKMS_PCI > 0
-       int error;
-
-       *nouveau_drm_driver_pci = *nouveau_drm_driver_stub;
-       nouveau_drm_driver_pci->set_busid = drm_pci_set_busid;
-       nouveau_drm_driver_pci->request_irq = drm_pci_request_irq;
-       nouveau_drm_driver_pci->free_irq = drm_pci_free_irq;
-
-       error = drm_pci_init(nouveau_drm_driver_pci, NULL);
-       if (error)
-               return error;
-#endif
 
        nvkm_devices_init();
        drm_sysctl_init(&nouveau_def);
@@ -86,9 +65,6 @@
 
        drm_sysctl_fini(&nouveau_def);
        nvkm_devices_fini();
-#if NDRMKMS_PCI > 0
-       drm_pci_exit(nouveau_drm_driver_pci, NULL);
-#endif
 }
 
 static int
diff -r 1c9547fdf0f8 -r 87e72c3ff54c sys/external/bsd/drm2/nouveau/nouveau_pci.c
--- a/sys/external/bsd/drm2/nouveau/nouveau_pci.c       Tue Aug 28 03:33:54 2018 +0000
+++ b/sys/external/bsd/drm2/nouveau/nouveau_pci.c       Tue Aug 28 03:34:07 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_pci.c,v 1.20 2018/08/27 14:18:54 riastradh Exp $       */
+/*     $NetBSD: nouveau_pci.c,v 1.21 2018/08/28 03:34:07 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.20 2018/08/27 14:18:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.21 2018/08/28 03:34:07 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/device.h>
@@ -286,19 +286,19 @@
        }
 }
 
+extern struct drm_driver *const nouveau_drm_driver_stub; /* XXX */
+extern struct drm_driver *const nouveau_drm_driver_pci;         /* XXX */
+
 static int
 nouveau_pci_modcmd(modcmd_t cmd, void *arg __unused)
 {
-       int error;
 
        switch (cmd) {
        case MODULE_CMD_INIT:
-               error = drm_pci_init(nouveau_drm_driver_pci, NULL);
-               if (error) {
-                       aprint_error("nouveau_pci: failed to init: %d\n",
-                           error);
-                       return error;
-               }
+               *nouveau_drm_driver_pci = *nouveau_drm_driver_stub;
+               nouveau_drm_driver_pci->set_busid = drm_pci_set_busid;
+               nouveau_drm_driver_pci->request_irq = drm_pci_request_irq;
+               nouveau_drm_driver_pci->free_irq = drm_pci_free_irq;
 #if 0          /* XXX nouveau acpi */
                nouveau_register_dsm_handler();
 #endif
@@ -307,7 +307,6 @@
 #if 0          /* XXX nouveau acpi */
                nouveau_unregister_dsm_handler();
 #endif
-               drm_pci_exit(nouveau_drm_driver_pci, NULL);
                break;
        default:
                return ENOTTY;



Home | Main Index | Thread Index | Old Index