From 447cdd536fe4539b724e8a7024659e3f4cd724d1 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 13 Oct 2004 19:56:15 +0000 Subject: Initial support for PowerPC specific code in Mesa and DRI drivers. DRI drivers built on PowerPC systems should now show things like "PowerPC" or "PowerPC/Altivec" in the GL_RENDERER string. The VMX moniker is used for Altivec/Velocity Engine/VMX SIMD additions. I chose this not because I work for IBM but because it's a LOT shorter to type. :) --- src/mesa/drivers/dri/common/utils.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/common') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 59401073ec..0e8e54a202 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -20,11 +20,14 @@ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file utils.c + * Utility functions for DRI drivers. * - * Authors: - * Ian Romanick + * \author Ian Romanick */ -/* $XFree86:$ */ #include #include @@ -40,6 +43,10 @@ #include "x86/common_x86_asm.h" #endif +#if defined(USE_PPC_ASM) +#include "ppc/common_ppc_features.h" +#endif + unsigned driParseDebugString( const char * debug, const struct dri_debug_control * control ) @@ -141,6 +148,23 @@ driGetRendererString( char * buffer, const char * hardware_name, 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++ ) { -- cgit v1.2.3