radeon: Provide a more detailled GL_RENDERER string.
authorNicolai Hähnle <nhaehnle@gmail.com>
Sun, 31 May 2009 14:32:58 +0000 (16:32 +0200)
committerNicolai Hähnle <nhaehnle@gmail.com>
Mon, 1 Jun 2009 17:02:17 +0000 (19:02 +0200)
Display the chip family and PCI ID. This can be parsed easily,
and essentially all information that the driver has about the chip can be
deduced from it.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
src/mesa/drivers/dri/radeon/radeon_common_context.c
src/mesa/drivers/dri/radeon/radeon_screen.c
src/mesa/drivers/dri/radeon/radeon_screen.h

index e9967986a3faecd7e235665e934dd4984141667c..eb0e5b35e5ecc6decc6b9f01c4034efecd8eb730 100644 (file)
@@ -52,6 +52,40 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 int RADEON_DEBUG = (0);
 #endif
 
+
+static const char* get_chip_family_name(int chip_family)
+{
+       switch(chip_family) {
+       case CHIP_FAMILY_R100: return "R100";
+       case CHIP_FAMILY_RV100: return "RV100";
+       case CHIP_FAMILY_RS100: return "RS100";
+       case CHIP_FAMILY_RV200: return "RV200";
+       case CHIP_FAMILY_RS200: return "RS200";
+       case CHIP_FAMILY_R200: return "R200";
+       case CHIP_FAMILY_RV250: return "RV250";
+       case CHIP_FAMILY_RS300: return "RS300";
+       case CHIP_FAMILY_RV280: return "RV280";
+       case CHIP_FAMILY_R300: return "R300";
+       case CHIP_FAMILY_R350: return "R350";
+       case CHIP_FAMILY_RV350: return "RV350";
+       case CHIP_FAMILY_RV380: return "RV380";
+       case CHIP_FAMILY_R420: return "R420";
+       case CHIP_FAMILY_RV410: return "RV410";
+       case CHIP_FAMILY_RS400: return "RS400";
+       case CHIP_FAMILY_RS600: return "RS600";
+       case CHIP_FAMILY_RS690: return "RS690";
+       case CHIP_FAMILY_RS740: return "RS740";
+       case CHIP_FAMILY_RV515: return "RV515";
+       case CHIP_FAMILY_R520: return "R520";
+       case CHIP_FAMILY_RV530: return "RV530";
+       case CHIP_FAMILY_R580: return "R580";
+       case CHIP_FAMILY_RV560: return "RV560";
+       case CHIP_FAMILY_RV570: return "RV570";
+       default: return "unknown";
+       }
+}
+
+
 /* Return various strings for glGetString().
  */
 static const GLubyte *radeonGetString(GLcontext * ctx, GLenum name)
@@ -71,16 +105,22 @@ static const GLubyte *radeonGetString(GLcontext * ctx, GLenum name)
                unsigned offset;
                GLuint agp_mode = (radeon->radeonScreen->card_type==RADEON_CARD_PCI) ? 0 :
                        radeon->radeonScreen->AGPMode;
-               const char* chipname;
+               const char* chipclass;
+               char hardwarename[32];
 
                if (IS_R300_CLASS(radeon->radeonScreen))
-                       chipname = "R300";
+                       chipclass = "R300";
                else if (IS_R200_CLASS(radeon->radeonScreen))
-                       chipname = "R200";
+                       chipclass = "R200";
                else
-                       chipname = "R100";
+                       chipclass = "R100";
+
+               sprintf(hardwarename, "%s (%s %04X)",
+                       chipclass,
+                       get_chip_family_name(radeon->radeonScreen->chip_family),
+                       radeon->radeonScreen->device_id);
 
-               offset = driGetRendererString(buffer, chipname, DRIVER_DATE,
+               offset = driGetRendererString(buffer, hardwarename, DRIVER_DATE,
                                              agp_mode);
 
                if (IS_R300_CLASS(radeon->radeonScreen)) {
index 3ba11e848e3a5448031f3f584712d11237de27a4..12ae4ada5db4898a808f1446aa4c74cba4809271 100644 (file)
@@ -400,6 +400,7 @@ static const __DRItexBufferExtension r300TexBufferExtension = {
 
 static int radeon_set_screen_flags(radeonScreenPtr screen, int device_id)
 {
+   screen->device_id = device_id;
    screen->chip_flags = 0;
    switch ( device_id ) {
    case PCI_CHIP_RADEON_LY:
index 8605eb4f0756486b43a905d1a895430992cbcc2a..fe5c7d875a0577f772037f0f455fcc458bd91eaa 100644 (file)
@@ -59,6 +59,7 @@ typedef struct radeon_screen {
    int chip_flags;
    int cpp;
    int card_type;
+   int device_id; /* PCI ID */
    int AGPMode;
    unsigned int irq;                   /* IRQ number (0 means none) */