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 Let upstream code attempt matc...



details:   https://anonhg.NetBSD.org/src/rev/1dec7062258a
branches:  trunk
changeset: 992942:1dec7062258a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:12:29 2018 +0000

description:
Let upstream code attempt match for nouveau.

diffstat:

 sys/external/bsd/drm2/nouveau/nouveau_pci.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r c89a5dd39913 -r 1dec7062258a sys/external/bsd/drm2/nouveau/nouveau_pci.c
--- a/sys/external/bsd/drm2/nouveau/nouveau_pci.c       Mon Aug 27 14:12:14 2018 +0000
+++ b/sys/external/bsd/drm2/nouveau/nouveau_pci.c       Mon Aug 27 14:12:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_pci.c,v 1.18 2018/08/27 14:12:14 riastradh Exp $       */
+/*     $NetBSD: nouveau_pci.c,v 1.19 2018/08/27 14:12:29 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.18 2018/08/27 14:12:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.19 2018/08/27 14:12:29 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/device.h>
@@ -84,6 +84,9 @@
 nouveau_pci_match(device_t parent, cfdata_t match, void *aux)
 {
        const struct pci_attach_args *const pa = aux;
+       struct pci_dev pdev;
+       struct nvkm_device *device;
+       int ret;
 
        if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_NVIDIA &&
            PCI_VENDOR(pa->pa_id) != PCI_VENDOR_NVIDIA_SGS)
@@ -122,6 +125,15 @@
                return 0;
 #undef IS_BETWEEN
 
+       linux_pci_dev_init(&pdev, NULL, parent, pa, 0);
+       ret = nvkm_device_pci_new(&pdev, NULL, "error", true, false, 0,
+           &device);
+       if (ret == 0)           /* don't want to hang onto it */
+               nvkm_device_del(&device);
+       linux_pci_dev_destroy(&pdev);
+       if (ret)                /* failure */
+               return 0;
+
        return 6;               /* XXX Beat genfb_pci...  */
 }
 



Home | Main Index | Thread Index | Old Index