Marcin Slusarz
2011-May-16 19:51 UTC
[Nouveau] [PATCH 2/2] xorg/nouveau: blacklist all pre NV30 cards
Bail out early in probe, so other driver can take control of the card. Doing it in screen_create would be too late. PCIID list taken from xf86-video-nv, so it's probably complete. --- src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 100 +++++++++++++++++++++-- 1 files changed, 93 insertions(+), 7 deletions(-) diff --git a/src/gallium/targets/xorg-nouveau/nouveau_xorg.c b/src/gallium/targets/xorg-nouveau/nouveau_xorg.c index a25254a..6d3b8f2 100644 --- a/src/gallium/targets/xorg-nouveau/nouveau_xorg.c +++ b/src/gallium/targets/xorg-nouveau/nouveau_xorg.c @@ -43,11 +43,6 @@ static const struct pci_id_match nouveau_xorg_device_match[] = { {0, 0, 0}, }; -static SymTabRec nouveau_xorg_chipsets[] = { - {PCI_MATCH_ANY, "NVIDIA Graphics Device"}, - {-1, NULL} -}; - static PciChipsets nouveau_xorg_pci_devices[] = { {PCI_MATCH_ANY, PCI_MATCH_ANY, NULL}, {-1, -1, NULL} @@ -121,16 +116,107 @@ nouveau_xorg_setup(pointer module, pointer opts, int *errmaj, int *errmin) static void nouveau_xorg_identify(int flags) { - xf86PrintChipsets("nouveau2", "Driver for Modesetting Kernel Drivers", - nouveau_xorg_chipsets); + xf86DrvMsg(0, X_INFO, "nouveau2: Gallium3D based 2D driver for NV30+ NVIDIA chipsets\n"); } +/* List of cards we DO NOT SUPPORT. */ +static SymTabRec NVPreNV30Chipsets[] +{ + { 0x12D20018, "RIVA 128" }, + + { 0x10DE0020, "RIVA TNT" }, + + { 0x10DE0028, "RIVA TNT2" }, + { 0x10DE002A, "Unknown TNT2" }, + { 0x10DE002C, "Vanta" }, + { 0x10DE0029, "RIVA TNT2 Ultra" }, + { 0x10DE002D, "RIVA TNT2 Model 64" }, + + { 0x10DE00A0, "Aladdin TNT2" }, + + { 0x10DE0100, "GeForce 256" }, + { 0x10DE0101, "GeForce DDR" }, + { 0x10DE0103, "Quadro" }, + + { 0x10DE0110, "GeForce2 MX/MX 400" }, + { 0x10DE0111, "GeForce2 MX 100/200" }, + { 0x10DE0112, "GeForce2 Go" }, + { 0x10DE0113, "Quadro2 MXR/EX/Go" }, + + { 0x10DE01A0, "GeForce2 Integrated GPU" }, + + { 0x10DE0150, "GeForce2 GTS" }, + { 0x10DE0151, "GeForce2 Ti" }, + { 0x10DE0152, "GeForce2 Ultra" }, + { 0x10DE0153, "Quadro2 Pro" }, + + { 0x10DE0170, "GeForce4 MX 460" }, + { 0x10DE0171, "GeForce4 MX 440" }, + { 0x10DE0172, "GeForce4 MX 420" }, + { 0x10DE0173, "GeForce4 MX 440-SE" }, + { 0x10DE0174, "GeForce4 440 Go" }, + { 0x10DE0175, "GeForce4 420 Go" }, + { 0x10DE0176, "GeForce4 420 Go 32M" }, + { 0x10DE0177, "GeForce4 460 Go" }, + { 0x10DE0178, "Quadro4 550 XGL" }, + { 0x10DE0179, "GeForce4 MX (Mac) / 440 Go 64M" }, + { 0x10DE017A, "Quadro NVS" }, + { 0x10DE017C, "Quadro4 500 GoGL" }, + { 0x10DE017D, "GeForce4 410 Go 16M" }, + + { 0x10DE0181, "GeForce4 MX 440 with AGP8X" }, + { 0x10DE0182, "GeForce4 MX 440SE with AGP8X" }, + { 0x10DE0183, "GeForce4 MX 420 with AGP8X" }, + { 0x10DE0185, "GeForce4 MX 4000" }, + { 0x10DE0186, "GeForce4 448 Go" }, + { 0x10DE0187, "GeForce4 488 Go" }, + { 0x10DE0188, "Quadro4 580 XGL" }, + { 0x10DE0189, "GeForce4 MX with AGP8X (Mac)" }, + { 0x10DE018A, "Quadro4 NVS 280 SD" }, + { 0x10DE018B, "Quadro4 380 XGL" }, + { 0x10DE018C, "Quadro NVS 50 PCI" }, + { 0x10DE018D, "GeForce4 448 Go" }, + + { 0x10DE01F0, "GeForce4 MX Integrated GPU" }, + + { 0x10DE0200, "GeForce3" }, + { 0x10DE0201, "GeForce3 Ti 200" }, + { 0x10DE0202, "GeForce3 Ti 500" }, + { 0x10DE0203, "Quadro DCC" }, + + { 0x10DE0250, "GeForce4 Ti 4600" }, + { 0x10DE0251, "GeForce4 Ti 4400" }, + { 0x10DE0253, "GeForce4 Ti 4200" }, + { 0x10DE0258, "Quadro4 900 XGL" }, + { 0x10DE0259, "Quadro4 750 XGL" }, + { 0x10DE025B, "Quadro4 700 XGL" }, + + { 0x10DE0280, "GeForce4 Ti 4800" }, + { 0x10DE0281, "GeForce4 Ti 4200 with AGP8X" }, + { 0x10DE0282, "GeForce4 Ti 4800 SE" }, + { 0x10DE0286, "GeForce4 4200 Go" }, + { 0x10DE028C, "Quadro4 700 GoGL" }, + { 0x10DE0288, "Quadro4 980 XGL" }, + { 0x10DE0289, "Quadro4 780 XGL" }, + + {-1, NULL} +}; + + static Bool nouveau_xorg_pci_probe(DriverPtr driver, int entity_num, struct pci_device *device, intptr_t match_data) { ScrnInfoPtr scrn = NULL; EntityInfoPtr entity; + SymTabRec *cur; + + int pciid = device->vendor_id << 16 | device->device_id; + + for (cur = &NVPreNV30Chipsets[0]; cur->token != -1; cur++) { + if (cur->token == pciid) + return FALSE; + } scrn = xf86ConfigPciEntity(scrn, 0, entity_num, nouveau_xorg_pci_devices, NULL, NULL, NULL, NULL, NULL); -- 1.7.4.1
Marcin Slusarz
2011-May-16 22:20 UTC
[Nouveau] [PATCH v2 2/2] xorg/nouveau: blacklist all pre NV30 cards
Bail out early in probe, so other driver can take control of the card. Doing it in screen_create would be too late. --- src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 44 ++++++++++++++++++----- 1 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/gallium/targets/xorg-nouveau/nouveau_xorg.c b/src/gallium/targets/xorg-nouveau/nouveau_xorg.c index a25254a..5392e50 100644 --- a/src/gallium/targets/xorg-nouveau/nouveau_xorg.c +++ b/src/gallium/targets/xorg-nouveau/nouveau_xorg.c @@ -38,16 +38,9 @@ static Bool nouveau_xorg_pci_probe(DriverPtr driver, int entity_num, static const struct pci_id_match nouveau_xorg_device_match[] = { { 0x10de, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0x00030000, 0x00ffffff, 0 }, - { 0x12d2, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, - 0x00030000, 0x00ffffff, 0 }, {0, 0, 0}, }; -static SymTabRec nouveau_xorg_chipsets[] = { - {PCI_MATCH_ANY, "NVIDIA Graphics Device"}, - {-1, NULL} -}; - static PciChipsets nouveau_xorg_pci_devices[] = { {PCI_MATCH_ANY, PCI_MATCH_ANY, NULL}, {-1, -1, NULL} @@ -121,16 +114,49 @@ nouveau_xorg_setup(pointer module, pointer opts, int *errmaj, int *errmin) static void nouveau_xorg_identify(int flags) { - xf86PrintChipsets("nouveau2", "Driver for Modesetting Kernel Drivers", - nouveau_xorg_chipsets); + xf86DrvMsg(0, X_INFO, "nouveau2: Gallium3D based 2D driver for NV30+ NVIDIA chipsets\n"); } +struct pcirange { + unsigned int low; + unsigned int high; +}; + +/* List of cards we DO NOT SUPPORT. */ +static struct pcirange NVPreNV30Chipsets[] +{ + {0x0020, 0x002F}, /* NV04/05 */ + {0x00A0, 0x00AF}, /* ? */ + {0x0100, 0x010F}, /* NV10 */ + {0x0110, 0x011F}, /* NV11 */ + {0x01A0, 0x01AF}, /* NV1A */ + {0x0150, 0x015F}, /* NV15 */ + {0x0170, 0x017F}, /* NV17 */ + {0x0180, 0x018F}, /* NV18 */ + {0x01F0, 0x01FF}, /* NV1F */ + {0x0200, 0x020F}, /* NV20 */ + {0x02A0, 0x02AF}, /* NV2A */ + {0x0250, 0x025F}, /* NV25 */ + {0x0280, 0x028F}, /* NV28 */ + {0, 0} +}; + + static Bool nouveau_xorg_pci_probe(DriverPtr driver, int entity_num, struct pci_device *device, intptr_t match_data) { ScrnInfoPtr scrn = NULL; EntityInfoPtr entity; + struct pcirange *cur; + + if (device->vendor_id != 0x10DE) + return FALSE; + + for (cur = &NVPreNV30Chipsets[0]; cur->low != 0; cur++) { + if (device->device_id >= cur->low && device->device_id <= cur->high) + return FALSE; + } scrn = xf86ConfigPciEntity(scrn, 0, entity_num, nouveau_xorg_pci_devices, NULL, NULL, NULL, NULL, NULL); -- 1.7.4.1
Marcin Slusarz
2011-Jun-05 19:06 UTC
[Nouveau] [PATCH v2 2/2] xorg/nouveau: blacklist all pre NV30 cards
On Tue, May 17, 2011 at 12:20:14AM +0200, Marcin Slusarz wrote:> Bail out early in probe, so other driver can take control of the card. > Doing it in screen_create would be too late. > --- > src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 44 ++++++++++++++++++----- > 1 files changed, 35 insertions(+), 9 deletions(-)ping
Stéphane Marchesin
2011-Jun-05 19:10 UTC
[Nouveau] [PATCH v2 2/2] xorg/nouveau: blacklist all pre NV30 cards
On Sun, Jun 5, 2011 at 12:06, Marcin Slusarz <marcin.slusarz at gmail.com> wrote:> On Tue, May 17, 2011 at 12:20:14AM +0200, Marcin Slusarz wrote: >> Bail out early in probe, so other driver can take control of the card. >> Doing it in screen_create would be too late. >> --- >> ?src/gallium/targets/xorg-nouveau/nouveau_xorg.c | ? 44 ++++++++++++++++++----- >> ?1 files changed, 35 insertions(+), 9 deletions(-) > > ping >Why do you need a list of cards for that, as opposed to reading the reg? St?phane
Maarten Maathuis
2011-Jun-05 19:15 UTC
[Nouveau] [Mesa-dev] [PATCH v2 2/2] xorg/nouveau: blacklist all pre NV30 cards
2011/6/5 St?phane Marchesin <stephane.marchesin at gmail.com>:> On Sun, Jun 5, 2011 at 12:06, Marcin Slusarz <marcin.slusarz at gmail.com> wrote: >> On Tue, May 17, 2011 at 12:20:14AM +0200, Marcin Slusarz wrote: >>> Bail out early in probe, so other driver can take control of the card. >>> Doing it in screen_create would be too late. >>> --- >>> ?src/gallium/targets/xorg-nouveau/nouveau_xorg.c | ? 44 ++++++++++++++++++----- >>> ?1 files changed, 35 insertions(+), 9 deletions(-) >> >> ping >> > > Why do you need a list of cards for that, as opposed to reading the reg? > > St?phane > _______________________________________________ > mesa-dev mailing list > mesa-dev at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev >I agree with Stephane, checking register 0 should work fine. First check for NV04/05, then for NV10-NV2F. Maarten. -- Far away from the primal instinct, the song seems to fade away, the river get wider between your thoughts and the things we do and say.