diff options
author | Brian Paul <brianp@vmware.com> | 2009-03-04 16:48:05 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-03-04 16:48:05 -0700 |
commit | bed3a8e1f6049a5c01d16004fc9a65225103ab9b (patch) | |
tree | b216cd58d959425fe9637a57b7ae44d0d3270842 | |
parent | 7979c6024ca81257164d3560a0366c1c52529b0e (diff) |
mesa: call _mesa_get_cpu_string() to get CPU info for GL_RENDERER string
-rw-r--r-- | src/mesa/drivers/dri/common/utils.c | 74 |
1 files changed, 8 insertions, 66 deletions
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 6b44ed9a67..c9acd81be7 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -32,19 +32,14 @@ #include <string.h> #include <stdlib.h> #include "main/mtypes.h" +#include "main/cpuinfo.h" #include "main/extensions.h" #include "glapi/dispatch.h" #include "utils.h" -int driDispatchRemapTable[ driDispatchRemapTable_size ]; -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif +int driDispatchRemapTable[ driDispatchRemapTable_size ]; -#if defined(USE_PPC_ASM) -#include "ppc/common_ppc_features.h" -#endif unsigned driParseDebugString( const char * debug, @@ -93,12 +88,8 @@ unsigned driGetRendererString( char * buffer, const char * hardware_name, const char * driver_date, GLuint agp_mode ) { -#define MAX_INFO 4 - const char * cpu[MAX_INFO]; - unsigned next = 0; - unsigned i; - unsigned offset; - + unsigned offset; + char *cpu; offset = sprintf( buffer, "Mesa DRI %s %s", hardware_name, driver_date ); @@ -118,59 +109,10 @@ driGetRendererString( char * buffer, const char * hardware_name, /* Append any CPU-specific information. */ -#ifdef USE_X86_ASM - if ( _mesa_x86_cpu_features ) { - cpu[next] = " x86"; - next++; - } -# ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - cpu[next] = (cpu_has_mmxext) ? "/MMX+" : "/MMX"; - next++; - } -# endif -# ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - cpu[next] = (cpu_has_3dnowext) ? "/3DNow!+" : "/3DNow!"; - next++; - } -# endif -# ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - cpu[next] = (cpu_has_xmm2) ? "/SSE2" : "/SSE"; - next++; - } -# endif - -#elif defined(USE_SPARC_ASM) - - cpu[0] = " SPARC"; - next = 1; - -#elif defined(USE_PPC_ASM) - if ( _mesa_ppc_cpu_features ) { - cpu[next] = (cpu_has_64) ? " PowerPC 64" : " PowerPC"; - next++; - } - -# ifdef USE_VMX_ASM - if ( cpu_has_vmx ) { - cpu[next] = "/Altivec"; - next++; - } -# endif - - if ( ! cpu_has_fpu ) { - cpu[next] = "/No FPU"; - next++; - } -#endif - - for ( i = 0 ; i < next ; i++ ) { - const size_t len = strlen( cpu[i] ); - - strncpy( & buffer[ offset ], cpu[i], len ); - offset += len; + cpu = _mesa_get_cpu_string(); + if (cpu) { + offset += sprintf(buffer + offset, " %s", cpu); + _mesa_free(cpu); } return offset; |