configs/debian-dri-default |    2 +-
 debian/changelog           |    9 +++++++++
 debian/rules               |    2 ++
 src/mesa/x86-64/x86-64.c   |   34 +++++++++++++++++++++++-----------
 src/mesa/x86-64/xform4.S   |   31 +++++++++++++++++++++++--------
 5 files changed, 58 insertions(+), 20 deletions(-)

New commits:
commit 0206e20240e5f3f48431567a1afc955272362321
Author: Julien Cristau <[EMAIL PROTECTED]>
Date:   Sun Oct 26 15:58:46 2008 +0100

    Also build the x86-specific dri drivers on kfreebsd (closes: #492894).

diff --git a/configs/debian-dri-default b/configs/debian-dri-default
index 2a01bf8..b42bfc3 100644
--- a/configs/debian-dri-default
+++ b/configs/debian-dri-default
@@ -22,7 +22,7 @@ DRI_DIRS = mach64 mga r128 r200 r300 radeon s3v savage tdfx 
trident
 
 ARCH_X86 = i386 amd64
 
-ifneq ($(findstring $(DEB_BUILD_ARCH), $(ARCH_X86)),)
+ifneq ($(filter $(DEB_HOST_ARCH_CPU), $(ARCH_X86)),)
        DRI_DIRS += i810 i915 i965 sis unichrome
 endif
 
diff --git a/debian/changelog b/debian/changelog
index cf2fd6d..640eb61 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ mesa (7.0.3-7) UNRELEASED; urgency=low
   * Cherry-pick patch from upstream:
     Use 3Dnow! x86-64 routines only on processors that support 3Dnow!
     (closes: #484180).
+  * Also build the x86-specific dri drivers on kfreebsd (closes: #492894).
 
  -- Julien Cristau <[EMAIL PROTECTED]>  Sun, 26 Oct 2008 15:27:10 +0100
 
diff --git a/debian/rules b/debian/rules
index 3d00bb7..6a66df1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,9 +22,11 @@ endif
 
 DEB_BUILD_ARCH     ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_ARCH_CPU  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
 DEB_BUILD_DIR      ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
 
 export DEB_BUILD_ARCH
+export DEB_HOST_ARCH_CPU
 
 # choose which configurations to build
 SWX11_GLU_CONFIGS =

commit 83a4719056284993a5c441c1b1d662d1c2c69de1
Author: Julien Cristau <[EMAIL PROTECTED]>
Date:   Sun Oct 26 15:34:37 2008 +0100

    Update changelog

diff --git a/debian/changelog b/debian/changelog
index 299a63d..cf2fd6d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+mesa (7.0.3-7) UNRELEASED; urgency=low
+
+  * Cherry-pick patch from upstream:
+    Use 3Dnow! x86-64 routines only on processors that support 3Dnow!
+    (closes: #484180).
+
+ -- Julien Cristau <[EMAIL PROTECTED]>  Sun, 26 Oct 2008 15:27:10 +0100
+
 mesa (7.0.3-6) unstable; urgency=high
 
   * Update debian/copyright to the SGI Free Software License B, version 2.0.

commit 6cfe871c754b896a2a9993e33d5056705ae7f486
Author: Ian Romanick <[EMAIL PROTECTED]>
Date:   Sun Sep 28 20:31:46 2008 -0700

    Use 3Dnow! x86-64 routines only on processors that support 3Dnow!
    
    Added an x86-64 CPUID function and use it to detect 3Dnow!  If 3Dnow!
    is available, use _mesa_3dnow_transform_points4_3d_no_rot,
    _mesa_3dnow_transform_points4_perspective,
    _mesa_3dnow_transform_points4_2d_no_rot, and 
_mesa_3dnow_transform_points4_2d.
    
    This fixes long standing bug #8724.
    (cherry picked from commit 2b8d8989fb6f9c36baf166fc715182a1407ebadb)

diff --git a/src/mesa/x86-64/x86-64.c b/src/mesa/x86-64/x86-64.c
index 09508b6..d15c076 100644
--- a/src/mesa/x86-64/x86-64.c
+++ b/src/mesa/x86-64/x86-64.c
@@ -42,7 +42,10 @@
 #include "math/m_debug.h"
 #endif
 
+extern void _mesa_x86_64_cpuid(unsigned int *regs);
+
 DECLARE_XFORM_GROUP( x86_64, 4 )
+DECLARE_XFORM_GROUP( 3dnow, 4 )
 
 #else
 /* just to silence warning below */
@@ -82,6 +85,7 @@ static void message( const char *msg )
 void _mesa_init_all_x86_64_transform_asm(void)
 {
 #ifdef USE_X86_64_ASM
+   unsigned int regs[4];
 
    if ( _mesa_getenv( "MESA_NO_ASM" ) ) {
      return;
@@ -89,24 +93,32 @@ void _mesa_init_all_x86_64_transform_asm(void)
 
    message("Initializing x86-64 optimizations\n");
 
-   ASSIGN_XFORM_GROUP( x86_64, 4 );
 
-   /*
    _mesa_transform_tab[4][MATRIX_GENERAL] =
       _mesa_x86_64_transform_points4_general;
    _mesa_transform_tab[4][MATRIX_IDENTITY] =
       _mesa_x86_64_transform_points4_identity;
    _mesa_transform_tab[4][MATRIX_3D] =
       _mesa_x86_64_transform_points4_3d;
-   _mesa_transform_tab[4][MATRIX_3D_NO_ROT] =
-      _mesa_x86_64_transform_points4_3d_no_rot;
-   _mesa_transform_tab[4][MATRIX_PERSPECTIVE] =
-      _mesa_x86_64_transform_points4_perspective;
-   _mesa_transform_tab[4][MATRIX_2D_NO_ROT] =
-      _mesa_x86_64_transform_points4_2d_no_rot;
-   _mesa_transform_tab[4][MATRIX_2D] =
-      _mesa_x86_64_transform_points4_2d;
-   */
+
+   regs[0] = 0x80000001;
+   regs[1] = 0x00000000;
+   regs[2] = 0x00000000;
+   regs[3] = 0x00000000;
+   _mesa_x86_64_cpuid(regs);
+   if (regs[3] & (1U << 31)) {
+      message("3Dnow! detected\n");
+      _mesa_transform_tab[4][MATRIX_3D_NO_ROT] =
+         _mesa_3dnow_transform_points4_3d_no_rot;
+      _mesa_transform_tab[4][MATRIX_PERSPECTIVE] =
+         _mesa_3dnow_transform_points4_perspective;
+      _mesa_transform_tab[4][MATRIX_2D_NO_ROT] =
+         _mesa_3dnow_transform_points4_2d_no_rot;
+      _mesa_transform_tab[4][MATRIX_2D] =
+         _mesa_3dnow_transform_points4_2d;
+
+   }
+
    
 #ifdef DEBUG_MATH
    _math_test_all_transform_functions("x86_64");
diff --git a/src/mesa/x86-64/xform4.S b/src/mesa/x86-64/xform4.S
index f512b3a..51aeb99 100644
--- a/src/mesa/x86-64/xform4.S
+++ b/src/mesa/x86-64/xform4.S
@@ -29,7 +29,22 @@
 .text
 
 .align 16
+.globl _mesa_x86_64_cpuid
+_mesa_x86_64_cpuid:
+       pushq   %rbx
+       movl    (%rdi), %eax
+       movl    8(%rdi), %ecx
+
+       cpuid
+
+       movl    %ebx, 4(%rdi)
+       movl    %eax, (%rdi)
+       movl    %ecx, 8(%rdi)
+       movl    %edx, 12(%rdi)
+       popq    %rbx
+       ret
 
+.align 16
 .globl _mesa_x86_64_transform_points4_general
 _mesa_x86_64_transform_points4_general:
 /*
@@ -204,8 +219,8 @@ p4_identity_done:
 
        
 .align 16
-.globl _mesa_x86_64_transform_points4_3d_no_rot
-_mesa_x86_64_transform_points4_3d_no_rot:
+.globl _mesa_3dnow_transform_points4_3d_no_rot
+_mesa_3dnow_transform_points4_3d_no_rot:
 
        movl V4F_COUNT(%rdx), %ecx      /* count */
        movzx V4F_STRIDE(%rdx), %eax    /* stride */
@@ -268,8 +283,8 @@ p4_3d_no_rot_done:
 
        
 .align 16
-.globl _mesa_x86_64_transform_points4_perspective
-_mesa_x86_64_transform_points4_perspective:
+.globl _mesa_3dnow_transform_points4_perspective
+_mesa_3dnow_transform_points4_perspective:
 
        movl V4F_COUNT(%rdx), %ecx      /* count */
        movzx V4F_STRIDE(%rdx), %eax    /* stride */
@@ -334,8 +349,8 @@ p4_perspective_done:
        ret
 
 .align 16
-.globl _mesa_x86_64_transform_points4_2d_no_rot
-_mesa_x86_64_transform_points4_2d_no_rot:
+.globl _mesa_3dnow_transform_points4_2d_no_rot
+_mesa_3dnow_transform_points4_2d_no_rot:
 
        movl V4F_COUNT(%rdx), %ecx      /* count */
        movzx V4F_STRIDE(%rdx), %eax    /* stride */
@@ -389,8 +404,8 @@ p4_2d_no_rot_done:
 
        
 .align 16
-.globl _mesa_x86_64_transform_points4_2d
-_mesa_x86_64_transform_points4_2d:
+.globl _mesa_3dnow_transform_points4_2d
+_mesa_3dnow_transform_points4_2d:
 
        movl V4F_COUNT(%rdx), %ecx      /* count */
        movzx V4F_STRIDE(%rdx), %eax    /* stride */


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to