xorg/nouveau: blacklist all pre NV30 cards
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(-)
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +93 -7
@@ -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 );
Signature · 1 line
1.7.4.1
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(-)
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +35 -9
@@ -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 );
Signature · 1 line
1.7.4.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Marcin Slusarz
Bail out early in probe, so other driver can take control of the card. Doing it in
screen_createwould be too late.--- src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 44 ++++++++++++++++++----- 1 files changed, 35 insertions(+), 9 deletions(-)
ping
Quoted 9 lines · Marcin Slusarz
Quoted 5 lines · Marcin Slusarz
Bail out early in probe, so other driver can take control of the card. Doing it in
screen_createwould 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
2011/6/5 Stéphane Marchesin <[email protected]>:
Quoted 11 lines · Marcin Slusarz
Quoted 9 lines · Marcin Slusarz
Quoted 5 lines
Bail out early in probe, so other driver can take control of the card. Doing it in
screen_createwould be too late.
---
src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 44 ++++++++++++++++++-----1 files changed, 35 insertions(+), 9 deletions(-)ping
Quoted 8 lines
Why do you need a list of cards for that, as opposed to reading the reg?
Stéphane
_______________________________________________
mesa-dev mailing list
[email protected]
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.
Signature · 2 lines
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.
Quoted 9 lines · Maarten Maathuis
2011/6/5 Stéphane Marchesin <[email protected]>:
Quoted 8 lines · Marcin Slusarz
Quoted 7 lines · Marcin Slusarz
Quoted 5 lines
Bail out early in probe, so other driver can take control of the card. Doing it in
screen_createwould be too late.
---
src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 44 ++++++++++++++++++-----1 files changed, 35 insertions(+), 9 deletions(-)
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
ping
Why do you need a list of cards for that, as opposed to reading the reg?
I agree with Stephane, checking register 0 should work fine. First check for NV04/05, then for NV10-NV2F.
I did it this way because I didn't have access to device file descriptor - it's created somewhere near InitScreen and passed to nouveau_drm_screen_create - too late to exit gracefully (something which I believe is a bug, but I couldn't track it).
But now I see xf86-video-nouveau is in exactly the same situation - it opens fd temporarily in PciProbe. I'll adapt its code to target/xorg-nouveau.
Marcin
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Quoted 20 lines · Marcin Slusarz
Quoted 9 lines · Maarten Maathuis
2011/6/5 Stéphane Marchesin <[email protected]>:
Quoted 8 lines · Marcin Slusarz
Quoted 7 lines · Marcin Slusarz
Quoted 5 lines
Bail out early in probe, so other driver can take control of the card. Doing it in
screen_createwould be too late.
---
src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 44 ++++++++++++++++++-----1 files changed, 35 insertions(+), 9 deletions(-)Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
ping
Why do you need a list of cards for that, as opposed to reading the reg?
I agree with Stephane, checking register 0 should work fine. First check for NV04/05, then for NV10-NV2F.
Quoted 6 lines
I did it this way because I didn't have access to device file descriptor - it's created somewhere near InitScreen and passed to
nouveau_drm_screen_create- too late to exit gracefully (something which I believe is a bug, but I couldn't track it).But now I see xf86-video-nouveau is in exactly the same situation - it opens fd temporarily in PciProbe. I'll adapt its code to target/xorg-nouveau.
I was incorrect in saying that you should check registers yourself (which would require root), but opening the device should give you the chipset type.
Quoted 3 lines
Marcin
Signature · 2 lines
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.
PATCH v3 2/2 xorg/nouveau: blacklist all pre NV30 cards
Quoted 25 lines · Maarten Maathuis
Quoted 24 lines · Marcin Slusarz
Quoted 9 lines · Maarten Maathuis
2011/6/5 Stéphane Marchesin <[email protected]>:
Quoted 8 lines · Marcin Slusarz
Quoted 7 lines · Marcin Slusarz
Quoted 5 lines
Bail out early in probe, so other driver can take control of the card. Doing it in
screen_createwould be too late.
---
src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 44 ++++++++++++++++++-----1 files changed, 35 insertions(+), 9 deletions(-)Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
ping
Why do you need a list of cards for that, as opposed to reading the reg?
I agree with Stephane, checking register 0 should work fine. First check for NV04/05, then for NV10-NV2F.
I did it this way because I didn't have access to device file descriptor - it's created somewhere near InitScreen and passed to
nouveau_drm_screen_create- too late to exit gracefully (something which I believe is a bug, but I couldn't track it).
Quoted 7 lines
Quoted 2 lines
But now I see xf86-video-nouveau is in exactly the same situation - it opens fd temporarily in PciProbe. I'll adapt its code to target/xorg-nouveau.
I was incorrect in saying that you should check registers yourself (which would require root), but opening the device should give you the chipset type.
Yeah. New patch below.
Thanks!
---
From: Marcin Slusarz <[email protected]>
Subject: [PATCH] xorg/nouveau: blacklist all pre NV30 cards
Bail out early in probe, so other driver (xf86-video-nouveau) can take control of the card. Doing it in screen_create would be too late.
--- src/gallium/targets/xorg-nouveau/Makefile | 3 + src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 63 +++++++++++++++++++--- 2 files changed, 57 insertions(+), 9 deletions(-)
src/gallium/targets/xorg-nouveau/Makefile +3 -0
@@ -23,4 +23,7 @@ DRIVER_PIPES = \ DRIVER_LINKS = \ $(shell pkg-config --libs libdrm libdrm_nouveau) +DRIVER_INCLUDES = \ + $(shell pkg-config --cflags-only-I libdrm libdrm_nouveau xf86driproto) + include ../Makefile.xorg
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +54 -9
90 lines not on this page · raw message
Signature · 7 lines
1.7.4.1 _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 111 lines
---
From: Marcin Slusarz <[email protected]>
Subject: [PATCH] xorg/nouveau: blacklist all pre NV30 cardsBail out early in probe, so other driver (xf86-video-nouveau) can take control
of the card. Doing it inscreen_createwould be too late.--- src/gallium/targets/xorg-nouveau/Makefile | 3 + src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 63 +++++++++++++++++++--- 2 files changed, 57 insertions(+), 9 deletions(-)src/gallium/targets/xorg-nouveau/Makefile +3
-0@@ -23,4 +23,7 @@ DRIVER_PIPES = \ DRIVER_LINKS = \ $(shell pkg-config --libs libdrm libdrm_nouveau) +DRIVER_INCLUDES = \ + $(shell pkg-config --cflags-only-I libdrm libdrm_nouveau xf86driproto) +include ../Makefile.xorg
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +3
-7@@ -29,6 +29,9 @@*/ #include "../../state_trackers/xorg/xorg_winsys.h" +#include <nouveau_drmif.h> +#include <xorg/dri.h> +#include <xf86drmMode.h> static void nouveau_xorg_identify (int flags); static Bool nouveau_xorg_pci_probe(DriverPtr driver, int entity_num,@@ -38,16 +41,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}src/gallium/targets/xorg-nouveau/nouveau_xorg.c +1
-2@@ -121,8 +117,7 @@ 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");}
static Bool
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +34
-0@@ -131,6 +126,56 @@ nouveau_xorg_pci_probe(DriverPtr driver, {ScrnInfoPtr scrn =NULL ;EntityInfoPtr entity; +struct nouveau_device *dev =NULL ; +char *busid; +int chipset, ret; + +if (device->vendor_id !=0x10DE ) +return FALSE; + +if (!xf86LoaderCheckSymbol ("DRICreatePCIBusID" )) { +xf86DrvMsg (-1 ,X_ERROR ,"[drm] No DRICreatePCIBusID symbol\n" ); +return FALSE; + } + busid =DRICreatePCIBusID (device); + + ret =nouveau_device_open (&dev, busid); +if (ret) { +xf86DrvMsg (-1 ,X_ERROR ,"[drm] failed to open device\n" ); +free (busid); +return FALSE; + } + + chipset = dev->chipset; +nouveau_device_close (&dev); + + ret =drmCheckModesettingSupported (busid); +free (busid); +if (ret) { +xf86DrvMsg (-1 ,X_ERROR ,"[drm] KMS not enabled\n" ); +return FALSE; + } + +switch (chipset &0xf0 ) { +case 0x00 : +case 0x10 : +case 0x20 :
src/gallium/targets/xorg-nouveau/nouveau_xorg.c nouveau_xorg_pci_probe(DriverPtr driver, · line 172
Quoted 10 lines
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +10
-0+xf86DrvMsg (-1 ,X_NOTICE ,"Too old chipset: NV%02x\n" , chipset); +return FALSE; +case 0x30 : +case 0x40 : +case 0x60 : +case 0x50 : +case 0x80 : +case 0x90 : +case 0xa0 : +case 0xc0 :
0xd0 should be added here, there's NVD9 already.
Quoted 10 lines
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +6
-0+xf86DrvMsg (-1 ,X_INFO ,"Detected chipset: NV%02x\n" , chipset); +break ; +default : +xf86DrvMsg (-1 ,X_ERROR ,"Unknown chipset: NV%02x\n" , chipset); +return FALSE; + } scrn = xf86ConfigPciEntity(scrn, 0, entity_num, nouveau_xorg_pci_devices,NULL, NULL, NULL, NULL, NULL);
Quoted 114 lines · Marcin Kościelnicki
Quoted 114 lines
---
From: Marcin Slusarz <[email protected]>
Subject: [PATCH] xorg/nouveau: blacklist all pre NV30 cardsBail out early in probe, so other driver (xf86-video-nouveau) can take control
of the card. Doing it inscreen_createwould be too late.--- src/gallium/targets/xorg-nouveau/Makefile | 3 + src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 63 +++++++++++++++++++--- 2 files changed, 57 insertions(+), 9 deletions(-)src/gallium/targets/xorg-nouveau/Makefile +3
-0@@ -23,4 +23,7 @@ DRIVER_PIPES = \ DRIVER_LINKS = \ $(shell pkg-config --libs libdrm libdrm_nouveau) +DRIVER_INCLUDES = \ + $(shell pkg-config --cflags-only-I libdrm libdrm_nouveau xf86driproto) +include ../Makefile.xorg
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +3
-7@@ -29,6 +29,9 @@*/ #include "../../state_trackers/xorg/xorg_winsys.h" +#include <nouveau_drmif.h> +#include <xorg/dri.h> +#include <xf86drmMode.h> static void nouveau_xorg_identify (int flags); static Bool nouveau_xorg_pci_probe(DriverPtr driver, int entity_num,@@ -38,16 +41,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}src/gallium/targets/xorg-nouveau/nouveau_xorg.c +1
-2@@ -121,8 +117,7 @@ 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");}
static Bool
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +37
-0@@ -131,6 +126,56 @@ nouveau_xorg_pci_probe(DriverPtr driver, {ScrnInfoPtr scrn =NULL ;EntityInfoPtr entity; +struct nouveau_device *dev =NULL ; +char *busid; +int chipset, ret; + +if (device->vendor_id !=0x10DE ) +return FALSE; + +if (!xf86LoaderCheckSymbol ("DRICreatePCIBusID" )) { +xf86DrvMsg (-1 ,X_ERROR ,"[drm] No DRICreatePCIBusID symbol\n" ); +return FALSE; + } + busid =DRICreatePCIBusID (device); + + ret =nouveau_device_open (&dev, busid); +if (ret) { +xf86DrvMsg (-1 ,X_ERROR ,"[drm] failed to open device\n" ); +free (busid); +return FALSE; + } + + chipset = dev->chipset; +nouveau_device_close (&dev); + + ret =drmCheckModesettingSupported (busid); +free (busid); +if (ret) { +xf86DrvMsg (-1 ,X_ERROR ,"[drm] KMS not enabled\n" ); +return FALSE; + } + +switch (chipset &0xf0 ) { +case 0x00 : +case 0x10 : +case 0x20 : +xf86DrvMsg (-1 ,X_NOTICE ,"Too old chipset: NV%02x\n" , chipset); +return FALSE; +case 0x30 :
Quoted 8 lines
src/gallium/targets/xorg-nouveau/nouveau_xorg.c nouveau_xorg_pci_probe(DriverPtr driver, · line 172
Quoted 7 lines
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +7
-0+case 0x40 : +case 0x60 : +case 0x50 : +case 0x80 : +case 0x90 : +case 0xa0 : +case 0xc0 :
0xd0should be added here, there's NVD9 already.
There's no point in adding it now - mesa does not support it...
(see nouveau_drm_screen_create in src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c)
Quoted 11 lines
Quoted 10 lines
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +6
-0+xf86DrvMsg (-1 ,X_INFO ,"Detected chipset: NV%02x\n" , chipset); +break ; +default : +xf86DrvMsg (-1 ,X_ERROR ,"Unknown chipset: NV%02x\n" , chipset); +return FALSE; + } scrn = xf86ConfigPciEntity(scrn, 0, entity_num, nouveau_xorg_pci_devices,NULL, NULL, NULL, NULL, NULL);
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Quoted 111 lines · Marcin Slusarz
From: Marcin Slusarz <[email protected]>
Subject: [PATCH] xorg/nouveau: blacklist all pre NV30 cardsBail out early in probe, so other driver (xf86-video-nouveau) can take control of the card. Doing it in
screen_createwould be too late.--- src/gallium/targets/xorg-nouveau/Makefile | 3 + src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 63 +++++++++++++++++++--- 2 files changed, 57 insertions(+), 9 deletions(-)src/gallium/targets/xorg-nouveau/Makefile +3
-0@@ -23,4 +23,7 @@ DRIVER_PIPES = \ DRIVER_LINKS = \ $(shell pkg-config --libs libdrm libdrm_nouveau) +DRIVER_INCLUDES = \ + $(shell pkg-config --cflags-only-I libdrm libdrm_nouveau xf86driproto) + include ../Makefile.xorgsrc/gallium/targets/xorg-nouveau/nouveau_xorg.c +47
-9@@ -29,6 +29,9 @@*/ #include "../../state_trackers/xorg/xorg_winsys.h" +#include <nouveau_drmif.h> +#include <xorg/dri.h> +#include <xf86drmMode.h> static void nouveau_xorg_identify (int flags); static Bool nouveau_xorg_pci_probe(DriverPtr driver, int entity_num,@@ -38,16 +41,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,8 +117,7 @@ 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" ); } static Bool@@ -131,6 +126,56 @@ nouveau_xorg_pci_probe(DriverPtr driver, {ScrnInfoPtr scrn =NULL ;EntityInfoPtr entity; +struct nouveau_device *dev =NULL ; +char *busid; +int chipset, ret; + +if (device->vendor_id !=0x10DE ) +return FALSE; + +if (!xf86LoaderCheckSymbol ("DRICreatePCIBusID" )) { +xf86DrvMsg (-1 ,X_ERROR ,"[drm] No DRICreatePCIBusID symbol\n" ); +return FALSE; + } + busid =DRICreatePCIBusID (device); + + ret =nouveau_device_open (&dev, busid); +if (ret) { +xf86DrvMsg (-1 ,X_ERROR ,"[drm] failed to open device\n" ); +free (busid); +return FALSE; + } + + chipset = dev->chipset; +nouveau_device_close (&dev); + + ret =drmCheckModesettingSupported (busid); +free (busid); +if (ret) { +xf86DrvMsg (-1 ,X_ERROR ,"[drm] KMS not enabled\n" ); +return FALSE; + } + +switch (chipset &0xf0 ) { +case 0x00 : +case 0x10 : +case 0x20 : +xf86DrvMsg (-1 ,X_NOTICE ,"Too old chipset: NV%02x\n" , chipset); +return FALSE; +case 0x30 : +case 0x40 : +case 0x60 : +case 0x50 : +case 0x80 : +case 0x90 : +case 0xa0 :
src/gallium/targets/xorg-nouveau/nouveau_xorg.c nouveau_xorg_pci_probe(DriverPtr driver, · line 181
Quoted 10 lines
src/gallium/targets/xorg-nouveau/nouveau_xorg.c +7
-0+case 0xc0 : +xf86DrvMsg (-1 ,X_INFO ,"Detected chipset: NV%02x\n" , chipset); +break ; +default : +xf86DrvMsg (-1 ,X_ERROR ,"Unknown chipset: NV%02x\n" , chipset); +return FALSE; + } scrn =xf86ConfigPciEntity (scrn,0 , entity_num, nouveau_xorg_pci_devices,NULL ,NULL ,NULL ,NULL ,NULL );
Can someone commit this patch?
Marcin
Wasn't nouveau targeted to provide HW acceleration for old cards like the TNT2, or has that idea been killed?
Patrick
Quoted 6 lines · Marcin Slusarz
Quoted 4 lines · Marcin Slusarz
Bail out early in probe, so other driver can take control of the card. Doing it in
screen_createwould be too late.--- src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 44++++++++++++++++++-----
Quoted 9 lines
Quoted 1 line
1 files changed, 35 insertions(+), 9 deletions(-)ping
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Quoted 4 lines · Patrick Baggett
Wasn't nouveau targeted to provide HW acceleration for old cards like the TNT2, or has that idea been killed?
Patrick
NV04-NV2F support went into a "classic" driver.
Quoted 25 lines
Quoted 9 lines · Marcin Slusarz
Quoted 6 lines · Marcin Slusarz
Bail out early in probe, so other driver can take control of the card. Doing it in
screen_createwould be too late.
---
src/gallium/targets/xorg-nouveau/nouveau_xorg.c | 44
++++++++++++++++++-----1 files changed, 35 insertions(+), 9 deletions(-)Quoted 6 lines
ping
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Signature · 2 lines
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.
Quoted 3 lines · Patrick Baggett
Wasn't nouveau targeted to provide HW acceleration for old cards like the TNT2, or has that idea been killed?
This patch is for Gallium3D accelerated 2D xorg driver. Nobody is killing support for old cards from xf86-video-nouveau.
Marcin