Module Name: src Committed By: riastradh Date: Mon Aug 27 14:12:30 UTC 2018
Modified Files: src/sys/external/bsd/drm2/nouveau: nouveau_pci.c Log Message: Let upstream code attempt match for nouveau. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/drm2/nouveau/nouveau_pci.c diff -u src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.18 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.19 --- src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.18 Mon Aug 27 14:12:14 2018 +++ src/sys/external/bsd/drm2/nouveau/nouveau_pci.c Mon Aug 27 14:12:29 2018 @@ -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 @@ static int 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 @@ nouveau_pci_match(device_t parent, cfdat 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... */ }