list the PCI ID range for new nvidia TU117 and TU116.

adjust the check to simply be >= 0x1580, which is the
first pciid not support.

should fix PR#54600.
This commit is contained in:
mrg 2019-10-05 22:37:49 +00:00
parent 0e74c10957
commit 21f80204df

View File

@ -1,4 +1,4 @@
/* $NetBSD: nouveau_pci.c,v 1.24 2019/07/03 20:47:22 wiz Exp $ */
/* $NetBSD: nouveau_pci.c,v 1.25 2019/10/05 22:37:49 mrg 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.24 2019/07/03 20:47:22 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.25 2019/10/05 22:37:49 mrg Exp $");
#include <sys/types.h>
#include <sys/device.h>
@ -97,8 +97,6 @@ nouveau_pci_match(device_t parent, cfdata_t match, void *aux)
if (PCI_CLASS(pa->pa_class) != PCI_CLASS_DISPLAY)
return 0;
#define IS_BETWEEN(x,y) \
(PCI_PRODUCT(pa->pa_id) >= (x) && PCI_PRODUCT(pa->pa_id) <= (y))
/*
* NetBSD drm2 doesn't support Pascal, Volta or Turing based cards:
* 0x1580-0x15ff GP100
@ -111,20 +109,16 @@ nouveau_pci_match(device_t parent, cfdata_t match, void *aux)
* 0x1e00-0x1e7f TU102
* 0x1e80-0x1eff TU104
* 0x1f00-0x1f7f TU106
* 0x1f80-0x1fff TU117
* 0x2180-0x21ff TU116
*
* reduce this to >= 1580, so that new chipsets not explictly
* listed above will be picked up.
*
* XXX perhaps switch this to explicitly match known list.
*/
if (IS_BETWEEN(0x1580, 0x15ff) ||
IS_BETWEEN(0x1b00, 0x1b7f) ||
IS_BETWEEN(0x1b80, 0x1bff) ||
IS_BETWEEN(0x1c00, 0x1c7f) ||
IS_BETWEEN(0x1c80, 0x1cff) ||
IS_BETWEEN(0x1d00, 0x1d7f) ||
IS_BETWEEN(0x1d80, 0x1dff) ||
IS_BETWEEN(0x1e00, 0x1e7f) ||
IS_BETWEEN(0x1e80, 0x1eff) ||
IS_BETWEEN(0x1f00, 0x1f7f))
if (PCI_PRODUCT(pa->pa_id) >= 0x1580)
return 0;
#undef IS_BETWEEN
linux_pci_dev_init(&pdev, parent /* XXX bogus */, parent, pa, 0);
ret = nvkm_device_pci_new(&pdev, NULL, "error",