I just compiled dri from the CVS for my radeon 9000 Mobbility card (r250 lf) and it wont work as good as it is expected to (I.E : 30 fps in Quake3) The thing is when i do a glxinfo it is reported as a r200 chip which it isn't... So i'd like to know if you are aware of this and what solutions do i have. I also wanted to know if support should be better or if this is normal. For information i'm running Gentoo linux 1.4_RC4 with 2.4.21-ac3 patched kernel (patched for the mmu_cr4 problem) I'm running Xfree 4.3.0. If you need more informations let me know.
Here's a patch that should clear some of that up, at least for the R200-family of chips. I did change the code to include xf86PciInfo.h. In spite of the comment there, it doesn't seem to produce any errors. Is this a safe change to make? Also, do we really need to check the device ID against R100-family IDs in the R200 driver?
Anyway, if this is acceptable I'll expand it to include the R100 driver & commit it.
Index: lib/GL/mesa/src/drv/r200/r200_context.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/r200/r200_context.c,v
retrieving revision 1.25
diff -u -d -r1.25 r200_context.c
--- lib/GL/mesa/src/drv/r200/r200_context.c 21 May 2003 17:32:07 -0000 1.25
+++ lib/GL/mesa/src/drv/r200/r200_context.c 30 Jul 2003 01:00:09 -0000
@@ -100,8 +100,8 @@
return (GLubyte *)"Tungsten Graphics, Inc.";
case GL_RENDERER:
- offset = driGetRendererString( buffer, "R200", DRIVER_DATE,
- agp_mode );
+ offset = driGetRendererString( buffer, rmesa->r200Screen->device_name,
+ DRIVER_DATE, agp_mode );
sprintf( & buffer[ offset ], " %sTCL",
!(rmesa->TclFallback & R200_TCL_FALLBACK_TCL_DISABLE)
Index: lib/GL/mesa/src/drv/r200/r200_screen.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/r200/r200_screen.c,v
retrieving revision 1.11
diff -u -d -r1.11 r200_screen.c
--- lib/GL/mesa/src/drv/r200/r200_screen.c 21 May 2003 17:32:08 -0000 1.11
+++ lib/GL/mesa/src/drv/r200/r200_screen.c 30 Jul 2003 01:00:10 -0000
@@ -49,19 +49,35 @@
#include "glxextensions.h"
-#if 1
-/* Including xf86PciInfo.h introduces a bunch of errors...
+#include "xf86PciInfo.h"
+
+#ifndef PCI_CHIP_RV250_In
+#define PCI_CHIP_RV250_In 0x496E /* Undocumented in ATI docs, but listed in
+ * the Linux kernel's pci.ids.
+ */
+#define PCI_CHIP_RV250_Io 0x496F /* Undocumented in ATI docs, but listed on
+ *
http://www.yourvote.com/pci/pciread.asp?venid=0x1002
+ */
+#define PCI_CHIP_R200_Qm 0x516D /* Undocumented in ATI docs, but listed on
+ *
http://www.yourvote.com/pci/pciread.asp?venid=0x1002
+ */
+#endif /* PCI_CHIP_RV250_In */
+
+/* This can be removed after XFree86 merges back to DRI.
*/
-#define PCI_CHIP_R200_QD 0x5144
-#define PCI_CHIP_R200_QE 0x5145
-#define PCI_CHIP_R200_QF 0x5146
-#define PCI_CHIP_R200_QG 0x5147
-#define PCI_CHIP_R200_QY 0x5159
-#define PCI_CHIP_R200_QZ 0x515A
-#define PCI_CHIP_R200_LW 0x4C57
-#define PCI_CHIP_R200_LY 0x4C59
-#define PCI_CHIP_R200_LZ 0x4C5A
-#define PCI_CHIP_RV200_QW 0x5157 /* Radeon 7500 - not an R200 at all */
+#ifndef PCI_CHIP_RV280_5960
+#define PCI_CHIP_RV280_5960 0x5960
+#define PCI_CHIP_RV280_5961 0x5961
+#define PCI_CHIP_RV280_5962 0x5962
+#define PCI_CHIP_RV280_5963 0x5963
+#define PCI_CHIP_RV280_5968 0x5968
+#define PCI_CHIP_RV280_5969 0x5969
+#define PCI_CHIP_RV280_596A 0x596A
+#define PCI_CHIP_RV280_596B 0x596B
+
+#define PCI_CHIP_RV280_5941 0x5941 /* Undocumented in ATI docs, but listed on
+ *
http://www.yourvote.com/pci/pciread.asp?venid=0x1002
+ */
#endif
static r200ScreenPtr __r200Screen;
@@ -75,10 +91,21 @@
{
r200ScreenPtr screen;
RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
+ int subsys_id;
+ int subsys_vendor;
if ( ! driCheckDriDdxDrmVersions( sPriv, "R200", 4, 0, 4, 0, 1, 5 ) )
return NULL;
+ if ( (sPriv->ddxMajor == 4) && (sPriv->ddxMinor >= 1) ) {
+ subsys_id = dri_priv->deviceSubID;
+ subsys_vendor = dri_priv->deviceSubVendor;
+ }
+ else {
+ subsys_id = 0;
+ subsys_vendor = 0;
+ }
+
/* Allocate the private area */
screen = (r200ScreenPtr) CALLOC( sizeof(*screen) );
if ( !screen ) {
@@ -88,24 +115,92 @@
}
switch ( dri_priv->deviceID ) {
- case PCI_CHIP_R200_QD:
- case PCI_CHIP_R200_QE:
- case PCI_CHIP_R200_QF:
- case PCI_CHIP_R200_QG:
- case PCI_CHIP_R200_QY:
- case PCI_CHIP_R200_QZ:
+ case PCI_CHIP_RADEON_QD:
+ case PCI_CHIP_RADEON_QE:
+ case PCI_CHIP_RADEON_QF:
+ case PCI_CHIP_RADEON_QG:
case PCI_CHIP_RV200_QW:
- case PCI_CHIP_R200_LW:
- case PCI_CHIP_R200_LY:
- case PCI_CHIP_R200_LZ:
+ case PCI_CHIP_RV200_QX:
+ case PCI_CHIP_RV100_QY:
+ case PCI_CHIP_RV100_QZ:
+ case PCI_CHIP_RADEON_LW:
+ case PCI_CHIP_RADEON_LX:
+ case PCI_CHIP_RADEON_LY:
+ case PCI_CHIP_RADEON_LZ:
__driUtilMessage("r200CreateScreen(): Device isn't an r200!\n");
FREE( screen );
return NULL;
+ case PCI_CHIP_R200_BB:
+ screen->device_name = "R200 (Radeon 8500DV)";
+ break;
+ case PCI_CHIP_RV250_Id:
+ case PCI_CHIP_RV250_Ie:
+ case PCI_CHIP_RV250_If:
+ case PCI_CHIP_RV250_Ig:
+ screen->device_name = "RV250 (Radeon 9000)";
+ break;
+ case PCI_CHIP_RV250_Ld:
+ case PCI_CHIP_RV250_Le:
+ case PCI_CHIP_RV250_Lg:
+ screen->device_name = "RV250 (Radeon Mobility M9)";
+ break;
+ case PCI_CHIP_RV250_Lf:
+ screen->device_name = "RV250 (Radeon Mobility M9-GL)";
+ break;
+ case PCI_CHIP_R200_QH:
+ if ( subsys_vendor == 0x1002 ) {
+ if ( subsys_id == 0x0152 ) {
+ screen->device_name = "R200 (FireGL 8800)";
+ break;
+ }
+ else if ( subsys_id == 0x0152 ) {
+ screen->device_name = "R200 (FireGL 8700)";
+ break;
+ }
+ }
+ /* FALLTHROUGH */
+ case PCI_CHIP_R200_QI:
+ case PCI_CHIP_R200_QJ:
+ case PCI_CHIP_R200_QK:
+ case PCI_CHIP_R200_QN: /* Is this actually a 9100? */
+ case PCI_CHIP_R200_QO: /* Is this actually a 9100? */
+ case PCI_CHIP_R200_Qh:
+ case PCI_CHIP_R200_Qi:
+ case PCI_CHIP_R200_Qj:
+ case PCI_CHIP_R200_Qk:
+ case PCI_CHIP_R200_Ql:
+ screen->device_name = "R200 (Radeon 8500)";
+ break;
+ case PCI_CHIP_R200_QL:
+ screen->device_name = "R200 (Radeon 8500LE)";
+ break;
+ case PCI_CHIP_R200_QM:
+ screen->device_name = "R200 (Radeon 9100)";
+ break;
+ case PCI_CHIP_R200_Qm:
+ screen->device_name = "R200 (Radeon 9100 - Secondary)";
+ break;
+ case PCI_CHIP_RV250_In:
+ case PCI_CHIP_RV250_Io:
+ screen->device_name = "RV250 (Radeon 9000 - Secondary)";
+ break;
+ case PCI_CHIP_RV280_5941:
+ case PCI_CHIP_RV280_5960:
+ case PCI_CHIP_RV280_5961:
+ case PCI_CHIP_RV280_5962:
+ case PCI_CHIP_RV280_5963:
+ case PCI_CHIP_RV280_5968:
+ case PCI_CHIP_RV280_5969:
+ case PCI_CHIP_RV280_596A:
+ case PCI_CHIP_RV280_596B:
+ screen->device_name = "RV280 (Radeon 9200)";
+ break;
default:
- screen->chipset = R200_CHIPSET_R200;
+ screen->device_name = "R200 (Unknown Radeon)";
break;
}
+ screen->chipset = R200_CHIPSET_R200;
/* This is first since which regions we map depends on whether or
* not we are using a PCI card.
Index: lib/GL/mesa/src/drv/r200/r200_screen.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/r200/r200_screen.h,v
retrieving revision 1.6
diff -u -d -r1.6 r200_screen.h
--- lib/GL/mesa/src/drv/r200/r200_screen.h 30 Apr 2003 01:50:48 -0000 1.6
+++ lib/GL/mesa/src/drv/r200/r200_screen.h 30 Jul 2003 01:00:10 -0000
@@ -59,6 +59,7 @@
typedef struct {
int chipset;
+ const char * device_name;
int cpp;
int IsPCI; /* Current card is a PCI card */
int AGPMode;
Index: programs/Xserver/hw/xfree86/drivers/ati/radeon.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v
retrieving revision 1.35
diff -u -d -r1.35 radeon.h
--- programs/Xserver/hw/xfree86/drivers/ati/radeon.h 25 Mar 2003 11:19:48 -0000
1.35
+++ programs/Xserver/hw/xfree86/drivers/ati/radeon.h 30 Jul 2003 01:00:10 -0000
@@ -263,6 +263,8 @@
pciVideoPtr PciInfo;
PCITAG PciTag;
int Chipset;
+ int SubChipset;
+ int SubVendor;
RADEONChipFamily ChipFamily;
Bool FBDev;
Index: programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.h,v
retrieving revision 1.11
diff -u -d -r1.11 radeon_dri.h
--- programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.h 25 Mar 2003 11:19:52
-0000 1.11
+++ programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.h 30 Jul 2003 01:00:10
-0000
@@ -102,6 +102,8 @@
#ifdef PER_CONTEXT_SAREA
drmSize perctx_sarea_size;
#endif
+ int deviceSubID; /* PCI device subsystem ID */
+ int deviceSubVendor; /* PCI device subsystem vendor */
} RADEONDRIRec, *RADEONDRIPtr;
#endif
Index: programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v
retrieving revision 1.58
diff -u -d -r1.58 radeon_driver.c
--- programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c 14 Jul 2003 22:09:45
-0000 1.58
+++ programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c 30 Jul 2003 01:00:10
-0000
@@ -1332,15 +1332,21 @@
unsigned char *RADEONMMIO;
/* Chipset */
- from = X_PROBED;
if (dev->chipset && *dev->chipset) {
- info->Chipset = xf86StringToToken(RADEONChipsets, dev->chipset);
- from = X_CONFIG;
+ info->Chipset = xf86StringToToken(RADEONChipsets, dev->chipset);
+ info->SubChipset = 0;
+ info->SubVendor = 0;
+ from = X_CONFIG;
} else if (dev->chipID >= 0) {
- info->Chipset = dev->chipID;
- from = X_CONFIG;
+ info->Chipset = dev->chipID;
+ info->SubChipset = 0;
+ info->SubVendor = 0;
+ from = X_CONFIG;
} else {
- info->Chipset = info->PciInfo->chipType;
+ info->Chipset = info->PciInfo->chipType;
+ info->SubChipset = info->PciInfo->subsysCard;
+ info->SubVendor = info->PciInfo->subsysVendor;
+ from = X_PROBED;
}
pScrn->chipset = (char *)xf86TokenToString(RADEONChipsets, info->Chipset);
Index: programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h,v
retrieving revision 1.5
diff -u -d -r1.5 radeon_version.h
--- programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h 25 Mar 2003 11:19:53
-0000 1.5
+++ programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h 30 Jul 2003 01:00:10
-0000
@@ -41,8 +41,8 @@
#define RV250_DRIVER_NAME "r200"
#define RADEON_VERSION_MAJOR 4
-#define RADEON_VERSION_MINOR 0
-#define RADEON_VERSION_PATCH 1
+#define RADEON_VERSION_MINOR 1
+#define RADEON_VERSION_PATCH 0
#ifndef RADEON_VERSION_EXTRA
#define RADEON_VERSION_EXTRA ""
