Add support for optimized versions of the code underlying ReadPixels
[mesa.git] / src / mesa / drivers / dri / common / utils.c
index 59401073ece6ac2d579d85ac919d6d7e48bf3dd1..0e8e54a2028fde1a5f847d9fed5b3e1c27e897ae 100644 (file)
  * 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 <idr@us.ibm.com>
+ * \author Ian Romanick <idr@us.ibm.com>
  */
-/* $XFree86:$ */
 
 #include <string.h>
 #include <stdlib.h>
 #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++ ) {