6569508 Mesa 3D driver for Intel 965 nv_70
authorDaniel Zhu <Daniel.Zhu@Sun.COM>
Thu, 12 Jul 2007 17:30:30 -0700
changeset 183 722ed220347e
parent 182 b0fbde156bb3
child 184 cad260ba517e
6569508 Mesa 3D driver for Intel 965 6577118 Xorg drops its gid from 0 to login user's gid 6577124 Xorg gets killed when a non-root user runs 3D apps 6579084 Increasing multi-texture upper limit in Mesa
open-src/lib/mesa/Makefile
open-src/lib/mesa/maxtexunit.patch
open-src/lib/mesa/mesa965.patch
open-src/lib/mesa/sun-src/configs/solaris-x86-gcc-dri
open-src/xserver/xorg/6577124.patch
open-src/xserver/xorg/Makefile
open-src/xserver/xorg/sun-src/IA/interactive.c
packages/SUNWxorg-mesa/prototype
--- a/open-src/lib/mesa/Makefile	Thu Jul 12 11:14:27 2007 -0700
+++ b/open-src/lib/mesa/Makefile	Thu Jul 12 17:30:30 2007 -0700
@@ -28,7 +28,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.8	07/06/01
+# @(#)Makefile	1.9	07/07/11
 #
 
 PWD:sh=pwd
@@ -53,9 +53,11 @@
 	solaris-paths.patch	\
 	mklib.patch		\
 	solaris-dri-port.patch	\
-	glext.h.patch           \
-	6538497.patch           \
-	6559710.patch
+	glext.h.patch		\
+	6538497.patch		\
+	6559710.patch		\
+	mesa965.patch		\
+	maxtexunit.patch
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/Mesa-$(MESA_VERS)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/lib/mesa/maxtexunit.patch	Thu Jul 12 17:30:30 2007 -0700
@@ -0,0 +1,16 @@
+--- src/mesa/main/texenvprogram.c	Fri Nov 17 05:31:59 2006
++++ src/mesa/main/texenvprogram.c	Tue Jun 26 10:09:24 2007
+@@ -34,10 +34,10 @@
+ #include "shader/program_instruction.h"
+ 
+ /**
+- * According to Glean's texCombine test, no more than 21 instructions
+- * are needed.  Allow a few extra just in case.
++ * Intel 965 allows maximum 8 textures, so 24 instructions are needed now.
++ * Allow a few extra just in case.
+  */
+-#define MAX_INSTRUCTIONS 24
++#define MAX_INSTRUCTIONS 27
+ 
+ #define DISASSEM (MESA_VERBOSE & VERBOSE_DISASSEM)
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/lib/mesa/mesa965.patch	Thu Jul 12 17:30:30 2007 -0700
@@ -0,0 +1,83 @@
+--- src/mesa/drivers/dri/i965/server/i830_common.h	Fri Sep 29 00:42:14 2006
++++ src/mesa/drivers/dri/i965/server/i830_common.h	Wed Apr  4 09:59:55 2007
+@@ -89,6 +89,7 @@
+         int pf_current_page;	/* which buffer is being displayed? */
+         int perf_boxes;	        /* performance boxes to be displayed */   
+ 	int width, height;      /* screen size in pixels */
++	int pad0;
+ 
+ 	drm_handle_t front_handle;
+ 	int front_offset;
+
+--- src/mesa/drivers/dri/i965/server/i830_dri.h		Wed Jun 13 14:55:59 2007
++++ src/mesa/drivers/dri/i965/server/i830_dri.h		Wed Jun 13 14:55:09 2007
+@@ -19,19 +19,23 @@
+    drmSize regsSize;
+ 
+    drmSize unused1; /* backbufferSize */
++   drmSize pad0;
+    drm_handle_t unused2; /* backbuffer */
+ 
+    drmSize unused3; /* depthbufferSize */
+    drm_handle_t unused4; /* depthbuffer */
+ 
+-   drmSize unused5; /* rotatedSize /*/
++   drmSize unused5; /* rotatedSize */
++   drmSize pad1;
+    drm_handle_t unused6; /* rotatedbuffer */
+ 
+    drm_handle_t unused7; /* textures */
+    int unused8; /* textureSize */
++   drmSize pad2;
+ 
+    drm_handle_t unused9; /* agp_buffers */
+    drmSize unused10; /* agp_buf_size */
++   drmSize pad3;
+ 
+    int deviceID;
+    int width;
+--- src/mesa/drivers/dri/i965/brw_draw_upload.c	2006-11-21 23:03:46.000000000 +0800
++++ src/mesa/drivers/dri/i965/brw_draw_upload.c	2007-06-20 16:24:44.984501652 +0800
+@@ -26,6 +26,7 @@
+  **************************************************************************/
+ 
+ #include <stdlib.h>
++#include <string.h>
+ 
+ #include "glheader.h"
+ #include "context.h"
+@@ -187,6 +188,23 @@
+    BRW_SURFACEFORMAT_R8G8B8A8_SSCALED
+ };
+ 
++#if defined (sun)
++/* Solaris does not have ffsll in libc */
++#define	NBITS_INT	(CHAR_BIT * sizeof (int))
++static int ffsll(long long i)
++{
++	int i1;
++	int ret;
++
++	i1 = i & UINT_MAX;
++	ret = ffs(i1);
++	if (ret == 0) {
++		i1 = (i & 0xffffffff00000000) >> NBITS_INT;
++		ret = ffs(i1) + NBITS_INT;
++	}
++	return ret;
++}
++#endif
+ 
+ static GLuint get_surface_type( GLenum type, GLuint size, GLboolean normalized )
+ {
+--- src/mesa/drivers/dri/i965/brw_aub.c	Mon Jun 11 09:57:08 2007
++++ src/mesa/drivers/dri/i965/brw_aub.c	Mon Jun 11 09:57:23 2007
+@@ -34,7 +34,7 @@
+ #include "intel_regions.h"
+ #include <stdio.h>
+ 
+-extern char *__progname;
++char *__progname = "testaub";
+ 
+ 
+ /* Registers to control page table
--- a/open-src/lib/mesa/sun-src/configs/solaris-x86-gcc-dri	Thu Jul 12 11:14:27 2007 -0700
+++ b/open-src/lib/mesa/sun-src/configs/solaris-x86-gcc-dri	Thu Jul 12 17:30:30 2007 -0700
@@ -14,7 +14,7 @@
 X11_INCLUDES = -I /usr/X11/include
 
 DEFINES = -DUSE_XSHM -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-        -DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DGLX_INDIRECT_RENDERING
+        -DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DGLX_INDIRECT_RENDERING -Dsun
 # -DGLX_USE_TLS
 
 CFLAGS = $(PASSED_CFLAGS) $(X11_INCLUDES) \
@@ -37,7 +37,7 @@
 
 DRM_SOURCE_PATH=$(TOP)/../drm
 
-DRI_DIRS = i915
+DRI_DIRS = i915 i965
 
 #ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
 #ASM_SOURCES = $(X86_SOURCES)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xorg/6577124.patch	Thu Jul 12 17:30:30 2007 -0700
@@ -0,0 +1,28 @@
+--- GL/glx/glxdri.c	Tue Jan 23 13:39:15 2007
++++ GL/glx/glxdri.c	Thu Jul  5 09:18:56 2007
+@@ -231,9 +231,12 @@
+ {
+     __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
+ 
+-    context->driContext.destroyContext(NULL,
+-				       context->base.pScreen->myNum,
+-				       context->driContext.private);
++
++    if (context->driContext.destroyContext != NULL) {
++	    context->driContext.destroyContext(NULL,
++		context->base.pScreen->myNum,
++		context->driContext.private);
++    }
+     __glXContextDestroy(&context->base);
+     xfree(context);
+ }
+@@ -243,6 +246,9 @@
+ {
+     __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
+ 
++    if (context->driContext.bindContext == NULL)
++	    return GL_FALSE;
++
+     return (*context->driContext.bindContext)(NULL,
+ 					      context->base.pScreen->myNum,
+ 					      baseContext->drawPriv->drawId,
--- a/open-src/xserver/xorg/Makefile	Thu Jul 12 11:14:27 2007 -0700
+++ b/open-src/xserver/xorg/Makefile	Thu Jul 12 17:30:30 2007 -0700
@@ -30,7 +30,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.48	07/07/12
+# @(#)Makefile	1.49	07/07/13
 #
 
 PWD:sh=pwd
@@ -101,7 +101,8 @@
 	signal-handler.patch \
 	kbd-driver.patch  \
 	6559710.patch \
-	6561019.patch
+	6561019.patch \
+	6577124.patch
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(XORGSERVER_VERS)
--- a/open-src/xserver/xorg/sun-src/IA/interactive.c	Thu Jul 12 11:14:27 2007 -0700
+++ b/open-src/xserver/xorg/sun-src/IA/interactive.c	Thu Jul 12 17:30:30 2007 -0700
@@ -27,7 +27,7 @@
  * of the copyright holder.
  */
 
-#pragma ident   "@(#)interactive.c 35.16     07/01/24 SMI"
+#pragma ident   "@(#)interactive.c 35.17     07/07/11 SMI"
 
 /************************************************************
 	Basic boilerplate extension.
@@ -287,11 +287,11 @@
 
     REQUEST(xIASetProcessInfoReq);
     register int length;
-    static uid_t ServerUid = -1;
+    static uid_t ServerUid = (uid_t)-1;
 
     REQUEST_AT_LEAST_SIZE(xIASetProcessInfoReq);
 
-    if (ServerUid < 0)
+    if (ServerUid == (uid_t)-1)
 	ServerUid=getuid();
 
     if ((stuff->flags & INTERACTIVE_INFO) && 
--- a/packages/SUNWxorg-mesa/prototype	Thu Jul 12 11:14:27 2007 -0700
+++ b/packages/SUNWxorg-mesa/prototype	Thu Jul 12 17:30:30 2007 -0700
@@ -29,7 +29,7 @@
 #
 ##########################################################################
 #
-# ident	"@(#)prototype	1.17	07/01/31 SMI"
+# ident	"@(#)prototype	1.18	07/07/11 SMI"
 #
 # Mesa - OpenGL Workalike for Solaris
 
@@ -151,6 +151,7 @@
 d none X11/lib/modules/dri 0755 root bin
 !search $HOME/lib/modules/dri
 f none X11/lib/modules/dri/i915_dri.so 0755 root bin
+f none X11/lib/modules/dri/i965_dri.so 0755 root bin
 !search $HOME/lib/X11/xserver
 d none X11/lib/X11 0755 root bin
 d none X11/lib/X11/xserver 0755 root bin
@@ -170,6 +171,7 @@
 d none X11/lib/modules/dri/amd64 0755 root bin
 !search $HOME/lib/modules/dri/amd64
 f none X11/lib/modules/dri/amd64/i915_dri.so 0755 root bin
+f none X11/lib/modules/dri/amd64/i965_dri.so 0755 root bin
 !search $HOME/lib/X11/xserver/amd64
 d none X11/lib/X11/xserver/amd64 0755 root bin
 f none X11/lib/X11/xserver/amd64/libdrm.so.2 0755 root bin