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 Hook up the nouveau pci driver...



details:   https://anonhg.NetBSD.org/src/rev/80c01b6c0fca
branches:  trunk
changeset: 366262:80c01b6c0fca
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:17:21 2018 +0000

description:
Hook up the nouveau pci driver so it does anything.

diffstat:

 sys/external/bsd/drm2/nouveau/nouveau_module.c |  19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diffs (51 lines):

diff -r 5f7aeed19fd0 -r 80c01b6c0fca sys/external/bsd/drm2/nouveau/nouveau_module.c
--- a/sys/external/bsd/drm2/nouveau/nouveau_module.c    Mon Aug 27 14:17:04 2018 +0000
+++ b/sys/external/bsd/drm2/nouveau/nouveau_module.c    Mon Aug 27 14:17:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_module.c,v 1.6 2018/08/27 13:43:52 riastradh Exp $     */
+/*     $NetBSD: nouveau_module.c,v 1.7 2018/08/27 14:17:21 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.6 2018/08/27 13:43:52 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_module.c,v 1.7 2018/08/27 14:17:21 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/module.h>
@@ -49,11 +49,23 @@
 
 struct drm_sysctl_def nouveau_def = DRM_SYSCTL_INIT();
 
-extern struct drm_driver *const nouveau_drm_driver; /* XXX */
+extern struct drm_driver *const nouveau_drm_driver_stub; /* XXX */
+extern struct drm_driver *const nouveau_drm_driver_pci;         /* XXX */
 
 static int
 nouveau_init(void)
 {
+       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;
+
        nvkm_devices_init();
        drm_sysctl_init(&nouveau_def);
 
@@ -66,6 +78,7 @@
 
        drm_sysctl_fini(&nouveau_def);
        nvkm_devices_fini();
+       drm_pci_exit(nouveau_drm_driver_pci, NULL);
 }
 
 static int



Home | Main Index | Thread Index | Old Index