[xserver-commit] xserver/hw/kdrive/ati ati.c,1.10,1.11 ati.h,1.5,1.6 ati_draw.c,1.11,1.12 ati_draw.h,1.3,1.4 ati_dri.c,1.2,1.3
Eric Anholt
xserver-commit@pdx.freedesktop.org
Fri, 09 Jan 2004 00:44:07 -0800
Committed by: anholt
Update of /cvs/xserver/xserver/hw/kdrive/ati
In directory pdx:/home/anholt/xserver/hw/kdrive/ati
Modified Files:
ati.c ati.h ati_draw.c ati_draw.h ati_dri.c
Log Message:
Change PCI ID information field to be one of r128, r100, r200, r300.
This is all the information we need so far. Put that information
into atic, and use it correctly in the code (unlike before).
Index: ati.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/ati/ati.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- ati.c 8 Jan 2004 08:25:49 -0000 1.10
+++ ati.c 9 Jan 2004 08:43:48 -0000 1.11
@@ -29,115 +29,120 @@
#include "ati.h"
#include "ati_reg.h"
+#define CAP_R128 0x1 /* If it's a Rage 128 */
+#define CAP_R100 0x2 /* If it's an r100 series radeon. */
+#define CAP_R200 0x3 /* If it's an r200 series radeon. */
+#define CAP_R300 0x4 /* If it's an r300 series radeon. */
+
struct pci_id_entry ati_pci_ids[] = {
- {0x1002, 0x4136, 0x1, "ATI Radeon RS100"},
- {0x1002, 0x4137, 0x3, "ATI Radeon RS200"},
- {0x1002, 0x4237, 0x3, "ATI Radeon RS250"},
- {0x1002, 0x4144, 0x5, "ATI Radeon R300 AD"},
- {0x1002, 0x4145, 0x5, "ATI Radeon R300 AE"},
- {0x1002, 0x4146, 0x5, "ATI Radeon R300 AF"},
- {0x1002, 0x4147, 0x5, "ATI Radeon R300 AG"},
- {0x1002, 0x4148, 0x5, "ATI Radeon R350 AH"},
- {0x1002, 0x4149, 0x5, "ATI Radeon R350 AI"},
- {0x1002, 0x414a, 0x5, "ATI Radeon R350 AJ"},
- {0x1002, 0x414b, 0x5, "ATI Radeon R350 AK"},
- {0x1002, 0x4150, 0x5, "ATI Radeon RV350 AP"},
- {0x1002, 0x4151, 0x5, "ATI Radeon RV350 AQ"},
- {0x1002, 0x4152, 0x5, "ATI Radeon RV350 AR"},
- {0x1002, 0x4153, 0x5, "ATI Radeon RV350 AS"},
- {0x1002, 0x4154, 0x5, "ATI Radeon RV350 AT"},
- {0x1002, 0x4156, 0x5, "ATI Radeon RV350 AV"},
+ {0x1002, 0x4136, 0x2, "ATI Radeon RS100"},
+ {0x1002, 0x4137, 0x2, "ATI Radeon RS200"},
+ {0x1002, 0x4237, 0x2, "ATI Radeon RS250"},
+ {0x1002, 0x4144, 0x4, "ATI Radeon R300 AD"},
+ {0x1002, 0x4145, 0x4, "ATI Radeon R300 AE"},
+ {0x1002, 0x4146, 0x4, "ATI Radeon R300 AF"},
+ {0x1002, 0x4147, 0x4, "ATI Radeon R300 AG"},
+ {0x1002, 0x4148, 0x4, "ATI Radeon R350 AH"},
+ {0x1002, 0x4149, 0x4, "ATI Radeon R350 AI"},
+ {0x1002, 0x414a, 0x4, "ATI Radeon R350 AJ"},
+ {0x1002, 0x414b, 0x4, "ATI Radeon R350 AK"},
+ {0x1002, 0x4150, 0x4, "ATI Radeon RV350 AP"},
+ {0x1002, 0x4151, 0x4, "ATI Radeon RV350 AQ"},
+ {0x1002, 0x4152, 0x4, "ATI Radeon RV350 AR"},
+ {0x1002, 0x4153, 0x4, "ATI Radeon RV350 AS"},
+ {0x1002, 0x4154, 0x4, "ATI Radeon RV350 AT"},
+ {0x1002, 0x4156, 0x4, "ATI Radeon RV350 AV"},
{0x1002, 0x4242, 0x3, "ATI Radeon R200 BB"},
{0x1002, 0x4243, 0x3, "ATI Radeon R200 BC"},
- {0x1002, 0x4336, 0x1, "ATI Radeon RS100"},
- {0x1002, 0x4337, 0x3, "ATI Radeon RS200"},
- {0x1002, 0x4437, 0x3, "ATI Radeon RS250"},
- {0x1002, 0x4964, 0x3, "ATI Radeon RV250 Id"},
- {0x1002, 0x4965, 0x3, "ATI Radeon RV250 Ie"},
- {0x1002, 0x4966, 0x3, "ATI Radeon RV250 If"},
- {0x1002, 0x4967, 0x3, "ATI Radeon RV250 Ig"},
- {0x1002, 0x4c45, 0x0, "ATI Rage 128 LE"},
- {0x1002, 0x4c46, 0x0, "ATI Rage 128 LF"},
- {0x1002, 0x4c57, 0x3, "ATI Radeon RV200 LW"},
- {0x1002, 0x4c58, 0x3, "ATI Radeon RV200 LX"},
- {0x1002, 0x4c59, 0x3, "ATI Radeon Mobility M6 LY"},
- {0x1002, 0x4c5a, 0x3, "ATI Radeon Mobility LZ"},
+ {0x1002, 0x4336, 0x2, "ATI Radeon RS100"},
+ {0x1002, 0x4337, 0x2, "ATI Radeon RS200"},
+ {0x1002, 0x4437, 0x2, "ATI Radeon RS250"},
+ {0x1002, 0x4964, 0x2, "ATI Radeon RV250 Id"},
+ {0x1002, 0x4965, 0x2, "ATI Radeon RV250 Ie"},
+ {0x1002, 0x4966, 0x2, "ATI Radeon RV250 If"},
+ {0x1002, 0x4967, 0x2, "ATI Radeon RV250 Ig"},
+ {0x1002, 0x4c45, 0x1, "ATI Rage 128 LE"},
+ {0x1002, 0x4c46, 0x1, "ATI Rage 128 LF"},
+ {0x1002, 0x4c57, 0x2, "ATI Radeon RV200 LW"},
+ {0x1002, 0x4c58, 0x2, "ATI Radeon RV200 LX"},
+ {0x1002, 0x4c59, 0x2, "ATI Radeon Mobility M6 LY"},
+ {0x1002, 0x4c5a, 0x2, "ATI Radeon Mobility LZ"},
{0x1002, 0x4c64, 0x3, "ATI Radeon RV250 Ld"},
{0x1002, 0x4c65, 0x3, "ATI Radeon RV250 Le"},
{0x1002, 0x4c66, 0x3, "ATI Radeon Mobility M9 RV250 Lf"},
{0x1002, 0x4c67, 0x3, "ATI Radeon RV250 Lg"},
- {0x1002, 0x4d46, 0x0, "ATI Rage 128 MF"},
- {0x1002, 0x4d46, 0x0, "ATI Rage 128 ML"},
- {0x1002, 0x4e44, 0x5, "ATI Radeon R300 ND"},
- {0x1002, 0x4e45, 0x5, "ATI Radeon R300 NE"},
- {0x1002, 0x4e46, 0x5, "ATI Radeon R300 NF"},
- {0x1002, 0x4e47, 0x5, "ATI Radeon R300 NG"},
- {0x1002, 0x4e48, 0x5, "ATI Radeon R350 NH"},
- {0x1002, 0x4e49, 0x5, "ATI Radeon R350 NI"},
- {0x1002, 0x4e4a, 0x5, "ATI Radeon R350 NJ"},
- {0x1002, 0x4e4b, 0x5, "ATI Radeon R350 NK"},
- {0x1002, 0x4e50, 0x5, "ATI Radeon Mobility RV350 NP"},
- {0x1002, 0x4e51, 0x5, "ATI Radeon Mobility RV350 NQ"},
- {0x1002, 0x4e52, 0x5, "ATI Radeon Mobility RV350 NR"},
- {0x1002, 0x4e53, 0x5, "ATI Radeon Mobility RV350 NS"},
- {0x1002, 0x4e54, 0x5, "ATI Radeon Mobility RV350 NT"},
- {0x1002, 0x4e56, 0x5, "ATI Radeon Mobility RV350 NV"},
- {0x1002, 0x5041, 0x0, "ATI Rage 128 PA"},
- {0x1002, 0x5042, 0x0, "ATI Rage 128 PB"},
- {0x1002, 0x5043, 0x0, "ATI Rage 128 PC"},
- {0x1002, 0x5044, 0x0, "ATI Rage 128 PD"},
- {0x1002, 0x5045, 0x0, "ATI Rage 128 PE"},
- {0x1002, 0x5046, 0x0, "ATI Rage 128 PF"},
- {0x1002, 0x5047, 0x0, "ATI Rage 128 PG"},
- {0x1002, 0x5048, 0x0, "ATI Rage 128 PH"},
- {0x1002, 0x5049, 0x0, "ATI Rage 128 PI"},
- {0x1002, 0x504a, 0x0, "ATI Rage 128 PJ"},
- {0x1002, 0x504b, 0x0, "ATI Rage 128 PK"},
- {0x1002, 0x504c, 0x0, "ATI Rage 128 PL"},
- {0x1002, 0x504d, 0x0, "ATI Rage 128 PM"},
- {0x1002, 0x504e, 0x0, "ATI Rage 128 PN"},
- {0x1002, 0x504f, 0x0, "ATI Rage 128 PO"},
- {0x1002, 0x5050, 0x0, "ATI Rage 128 PP"},
- {0x1002, 0x5051, 0x0, "ATI Rage 128 PQ"},
- {0x1002, 0x5052, 0x0, "ATI Rage 128 PR"},
- {0x1002, 0x5053, 0x0, "ATI Rage 128 PS"},
- {0x1002, 0x5054, 0x0, "ATI Rage 128 PT"},
- {0x1002, 0x5055, 0x0, "ATI Rage 128 PU"},
- {0x1002, 0x5056, 0x0, "ATI Rage 128 PV"},
- {0x1002, 0x5057, 0x0, "ATI Rage 128 PW"},
- {0x1002, 0x5058, 0x0, "ATI Rage 128 PX"},
- {0x1002, 0x5144, 0x1, "ATI Radeon R100 QD"},
- {0x1002, 0x5145, 0x1, "ATI Radeon R100 QE"},
- {0x1002, 0x5146, 0x1, "ATI Radeon R100 QF"},
- {0x1002, 0x5147, 0x1, "ATI Radeon R100 QG"},
- {0x1002, 0x5148, 0x1, "ATI Radeon R200 QH"},
- {0x1002, 0x514c, 0x1, "ATI Radeon R200 QL"},
- {0x1002, 0x514d, 0x1, "ATI Radeon R200 QM"},
- {0x1002, 0x5157, 0x1, "ATI Radeon RV200 QW"},
- {0x1002, 0x5158, 0x1, "ATI Radeon RV200 QX"},
- {0x1002, 0x5159, 0x1, "ATI Radeon RV100 QY"},
- {0x1002, 0x515a, 0x1, "ATI Radeon RV100 QZ"},
- {0x1002, 0x5245, 0x0, "ATI Rage 128 RE"},
- {0x1002, 0x5246, 0x0, "ATI Rage 128 RF"},
- {0x1002, 0x5247, 0x0, "ATI Rage 128 RG"},
- {0x1002, 0x524b, 0x0, "ATI Rage 128 RK"},
- {0x1002, 0x524c, 0x0, "ATI Rage 128 RL"},
- {0x1002, 0x5345, 0x0, "ATI Rage 128 SE"},
- {0x1002, 0x5346, 0x0, "ATI Rage 128 SF"},
- {0x1002, 0x5347, 0x0, "ATI Rage 128 SG"},
- {0x1002, 0x5348, 0x0, "ATI Rage 128 SH"},
- {0x1002, 0x534b, 0x0, "ATI Rage 128 SK"},
- {0x1002, 0x534c, 0x0, "ATI Rage 128 SL"},
- {0x1002, 0x534d, 0x0, "ATI Rage 128 SM"},
- {0x1002, 0x534e, 0x0, "ATI Rage 128 SN"},
- {0x1002, 0x5446, 0x0, "ATI Rage 128 TF"},
- {0x1002, 0x544c, 0x0, "ATI Rage 128 TL"},
- {0x1002, 0x5452, 0x0, "ATI Rage 128 TR"},
- {0x1002, 0x5453, 0x0, "ATI Rage 128 TS"},
- {0x1002, 0x5454, 0x0, "ATI Rage 128 TT"},
- {0x1002, 0x5455, 0x0, "ATI Rage 128 TU"},
- {0x1002, 0x5834, 0x5, "ATI Radeon RS300"},
- {0x1002, 0x5835, 0x5, "ATI Radeon RS300 Mobility"},
+ {0x1002, 0x4d46, 0x1, "ATI Rage 128 MF"},
+ {0x1002, 0x4d46, 0x1, "ATI Rage 128 ML"},
+ {0x1002, 0x4e44, 0x4, "ATI Radeon R300 ND"},
+ {0x1002, 0x4e45, 0x4, "ATI Radeon R300 NE"},
+ {0x1002, 0x4e46, 0x4, "ATI Radeon R300 NF"},
+ {0x1002, 0x4e47, 0x4, "ATI Radeon R300 NG"},
+ {0x1002, 0x4e48, 0x4, "ATI Radeon R350 NH"},
+ {0x1002, 0x4e49, 0x4, "ATI Radeon R350 NI"},
+ {0x1002, 0x4e4a, 0x4, "ATI Radeon R350 NJ"},
+ {0x1002, 0x4e4b, 0x4, "ATI Radeon R350 NK"},
+ {0x1002, 0x4e50, 0x4, "ATI Radeon Mobility RV350 NP"},
+ {0x1002, 0x4e51, 0x4, "ATI Radeon Mobility RV350 NQ"},
+ {0x1002, 0x4e52, 0x4, "ATI Radeon Mobility RV350 NR"},
+ {0x1002, 0x4e53, 0x4, "ATI Radeon Mobility RV350 NS"},
+ {0x1002, 0x4e54, 0x4, "ATI Radeon Mobility RV350 NT"},
+ {0x1002, 0x4e56, 0x4, "ATI Radeon Mobility RV350 NV"},
+ {0x1002, 0x5041, 0x1, "ATI Rage 128 PA"},
+ {0x1002, 0x5042, 0x1, "ATI Rage 128 PB"},
+ {0x1002, 0x5043, 0x1, "ATI Rage 128 PC"},
+ {0x1002, 0x5044, 0x1, "ATI Rage 128 PD"},
+ {0x1002, 0x5045, 0x1, "ATI Rage 128 PE"},
+ {0x1002, 0x5046, 0x1, "ATI Rage 128 PF"},
+ {0x1002, 0x5047, 0x1, "ATI Rage 128 PG"},
+ {0x1002, 0x5048, 0x1, "ATI Rage 128 PH"},
+ {0x1002, 0x5049, 0x1, "ATI Rage 128 PI"},
+ {0x1002, 0x504a, 0x1, "ATI Rage 128 PJ"},
+ {0x1002, 0x504b, 0x1, "ATI Rage 128 PK"},
+ {0x1002, 0x504c, 0x1, "ATI Rage 128 PL"},
+ {0x1002, 0x504d, 0x1, "ATI Rage 128 PM"},
+ {0x1002, 0x504e, 0x1, "ATI Rage 128 PN"},
+ {0x1002, 0x504f, 0x1, "ATI Rage 128 PO"},
+ {0x1002, 0x5050, 0x1, "ATI Rage 128 PP"},
+ {0x1002, 0x5051, 0x1, "ATI Rage 128 PQ"},
+ {0x1002, 0x5052, 0x1, "ATI Rage 128 PR"},
+ {0x1002, 0x5053, 0x1, "ATI Rage 128 PS"},
+ {0x1002, 0x5054, 0x1, "ATI Rage 128 PT"},
+ {0x1002, 0x5055, 0x1, "ATI Rage 128 PU"},
+ {0x1002, 0x5056, 0x1, "ATI Rage 128 PV"},
+ {0x1002, 0x5057, 0x1, "ATI Rage 128 PW"},
+ {0x1002, 0x5058, 0x1, "ATI Rage 128 PX"},
+ {0x1002, 0x5144, 0x2, "ATI Radeon R100 QD"},
+ {0x1002, 0x5145, 0x2, "ATI Radeon R100 QE"},
+ {0x1002, 0x5146, 0x2, "ATI Radeon R100 QF"},
+ {0x1002, 0x5147, 0x2, "ATI Radeon R100 QG"},
+ {0x1002, 0x5148, 0x3, "ATI Radeon R200 QH"},
+ {0x1002, 0x514c, 0x3, "ATI Radeon R200 QL"},
+ {0x1002, 0x514d, 0x3, "ATI Radeon R200 QM"},
+ {0x1002, 0x5157, 0x2, "ATI Radeon RV200 QW"},
+ {0x1002, 0x5158, 0x2, "ATI Radeon RV200 QX"},
+ {0x1002, 0x5159, 0x2, "ATI Radeon RV100 QY"},
+ {0x1002, 0x515a, 0x2, "ATI Radeon RV100 QZ"},
+ {0x1002, 0x5245, 0x1, "ATI Rage 128 RE"},
+ {0x1002, 0x5246, 0x1, "ATI Rage 128 RF"},
+ {0x1002, 0x5247, 0x1, "ATI Rage 128 RG"},
+ {0x1002, 0x524b, 0x1, "ATI Rage 128 RK"},
+ {0x1002, 0x524c, 0x1, "ATI Rage 128 RL"},
+ {0x1002, 0x5345, 0x1, "ATI Rage 128 SE"},
+ {0x1002, 0x5346, 0x1, "ATI Rage 128 SF"},
+ {0x1002, 0x5347, 0x1, "ATI Rage 128 SG"},
+ {0x1002, 0x5348, 0x1, "ATI Rage 128 SH"},
+ {0x1002, 0x534b, 0x1, "ATI Rage 128 SK"},
+ {0x1002, 0x534c, 0x1, "ATI Rage 128 SL"},
+ {0x1002, 0x534d, 0x1, "ATI Rage 128 SM"},
+ {0x1002, 0x534e, 0x1, "ATI Rage 128 SN"},
+ {0x1002, 0x5446, 0x1, "ATI Rage 128 TF"},
+ {0x1002, 0x544c, 0x1, "ATI Rage 128 TL"},
+ {0x1002, 0x5452, 0x1, "ATI Rage 128 TR"},
+ {0x1002, 0x5453, 0x1, "ATI Rage 128 TS"},
+ {0x1002, 0x5454, 0x1, "ATI Rage 128 TT"},
+ {0x1002, 0x5455, 0x1, "ATI Rage 128 TU"},
+ {0x1002, 0x5834, 0x3, "ATI Radeon RS300"},
+ {0x1002, 0x5835, 0x3, "ATI Radeon RS300 Mobility"},
{0x1002, 0x5941, 0x3, "ATI Radeon RV280 (9200)"},
{0x1002, 0x5961, 0x3, "ATI Radeon RV280 (9200 SE)"},
{0x1002, 0x5964, 0x3, "ATI Radeon RV280 (9200 SE)"},
@@ -216,8 +221,10 @@
}
atic->busid = make_busid(&card->attr);
- if (atic->busid == NULL)
+ if (atic->busid == NULL) {
+ xfree(atic);
return FALSE;
+ }
#ifdef USE_DRI
/* We demand identification by busid, not driver name */
@@ -229,15 +236,23 @@
card->driver = atic;
for (i = 0; ati_pci_ids[i].name != NULL; i++) {
- struct pci_id_entry *id = &ati_pci_ids[i];
- if (id->device == card->attr.deviceID) {
- if (id->caps & CAP_RADEON) {
- if (id->caps & CAP_R200)
- atic->is_r200 = TRUE;
- atic->is_radeon = TRUE;
- }
+ if (ati_pci_ids[i].device == card->attr.deviceID) {
+ atic->pci_id = &ati_pci_ids[i];
+ break;
}
}
+
+ if (atic->pci_id->caps != CAP_R128)
+ atic->is_radeon = TRUE;
+ if (atic->pci_id->caps == CAP_R100)
+ atic->is_r100 = TRUE;
+ if (atic->pci_id->caps == CAP_R200)
+ atic->is_r200 = TRUE;
+ if (atic->pci_id->caps == CAP_R300)
+ atic->is_r300 = TRUE;
+
+ ErrorF("Using ATI card: %s at %s\n", atic->pci_id->name, atic->busid);
+
return TRUE;
}
Index: ati.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/ati/ati.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ati.h 8 Jan 2004 08:16:24 -0000 1.5
+++ ati.h 9 Jan 2004 08:43:48 -0000 1.6
@@ -81,10 +81,6 @@
typedef volatile CARD16 VOL16;
typedef volatile CARD32 VOL32;
-#define CAP_RADEON 0x1 /* Whether it's a Radeon vs R128 */
-#define CAP_R200 0x2 /* If CAP_RADEON, whether it's an R200 */
-#define CAP_NODRM 0x4 /* Set if no initialization for the DRM yet. */
-
struct pci_id_entry {
CARD16 vendor;
CARD16 device;
@@ -121,7 +117,9 @@
struct pci_id_entry *pci_id;
CARD8 *reg_base;
Bool is_radeon;
+ Bool is_r100;
Bool is_r200;
+ Bool is_r300;
char *busid;
#ifdef USE_DRI
int drmFd;
Index: ati_draw.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/ati/ati_draw.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ati_draw.c 8 Jan 2004 20:18:13 -0000 1.11
+++ ati_draw.c 9 Jan 2004 08:43:48 -0000 1.12
@@ -504,7 +504,7 @@
if (atis->using_dri)
ATIDMAStart(pScreen);
else {
- if (ATIDRIScreenInit(pScreen))
+ if (!atic->is_r300 && ATIDRIScreenInit(pScreen))
atis->using_dri = TRUE;
}
#endif /* USE_DRI */
Index: ati_draw.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/ati/ati_draw.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ati_draw.h 30 Dec 2003 08:23:56 -0000 1.3
+++ ati_draw.h 9 Jan 2004 08:43:48 -0000 1.4
@@ -84,7 +84,7 @@
void
ATIWaitIdle(void);
-#if 0
+#if 1
#define ATI_FALLBACK(x) \
do { \
ErrorF x; \
Index: ati_dri.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/ati/ati_dri.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ati_dri.c 29 Dec 2003 06:24:01 -0000 1.2
+++ ati_dri.c 9 Jan 2004 08:43:48 -0000 1.3
@@ -539,7 +539,7 @@
pDRIInfo->busIdString = atic->busid;
if (atic->is_radeon) {
pDRIInfo->drmDriverName = "radeon";
- if (atic->is_r200)
+ if (atic->is_r100)
pDRIInfo->clientDriverName = "radeon";
else
pDRIInfo->clientDriverName = "r200";
@@ -562,7 +562,7 @@
*/
pDRIInfo->SAREASize = SAREA_MAX;
- if (atic->is_radeon) {
+ if (!atic->is_radeon) {
pDRIInfo->devPrivateSize = sizeof(R128DRIRec);
devSareaSize = sizeof(R128SAREAPriv);
} else {
@@ -862,7 +862,7 @@
}
/* De-allocate all kernel resources */
- if (atic->is_radeon) {
+ if (!atic->is_radeon) {
memset(&drmR128Info, 0, sizeof(drmR128Init));
drmR128Info.func = DRM_R128_CLEANUP_CCE;
drmCommandWrite(atic->drmFd, DRM_R128_INIT, &drmR128Info,