[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

mesa: Changes to 'debian-experimental'



 Makefile                                                          |    8 
 configs/autoconf.in                                               |    5 
 configs/default                                                   |    2 
 configure.ac                                                      |   14 +
 debian/changelog                                                  |    4 
 debian/patches/08-kfreebsd-gallium.diff                           |   26 +++
 debian/patches/09-intel-fix-invalidate-before-initialisation.diff |   73 ++++++++
 debian/patches/series                                             |    2 
 src/gallium/state_trackers/egl/x11/glxinit.c                      |    4 
 src/gallium/state_trackers/egl/x11/native_dri2.c                  |   14 +
 src/gallium/state_trackers/egl/x11/native_x11.c                   |    2 
 src/gallium/state_trackers/egl/x11/x11_screen.c                   |   76 +++++---
 src/gallium/state_trackers/egl/x11/x11_screen.h                   |   26 +--
 src/gallium/winsys/drm/Makefile.egl                               |    2 
 src/glw/Makefile                                                  |    2 
 src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c         |   86 +++++++---
 16 files changed, 275 insertions(+), 71 deletions(-)

New commits:
commit 9b09a71f80d03f158889fae041c2f40325612a38
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue Jul 20 14:35:29 2010 +0100

    Bump changelog

diff --git a/debian/changelog b/debian/changelog
index 5bb9d8f..7047ab7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ mesa (7.8.2-2) UNRELEASED; urgency=low
   * gallium: handle kfreebsd like freebsd, fixing FTBFS (closes: #585618)
   * intel: Fix invalidate before initialisation (stolen from fdo bugzilla
     #29091, fixes server 1.9rc crash when starting an app using GLX 1.3)
+  * Pull from 7.8-branch up to commit d06e011.
 
  -- Julien Cristau <jcristau@debian.org>  Thu, 15 Jul 2010 17:05:56 +0100
 

commit 51282b0ad8f4605c6e28ddcd79901baed0bd0e40
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue Jul 20 14:30:51 2010 +0100

    intel: Fix invalidate before initialisation
    
    Stolen from fdo bugzilla #29091
    Fixes server 1.9rc crash when starting an app using GLX 1.3

diff --git a/debian/changelog b/debian/changelog
index 545b21f..5bb9d8f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ mesa (7.8.2-2) UNRELEASED; urgency=low
   * Add missing dependencies to libegl1-mesa-dev, thanks to Alexandros
     Frantzis (LP: #600243).
   * gallium: handle kfreebsd like freebsd, fixing FTBFS (closes: #585618)
+  * intel: Fix invalidate before initialisation (stolen from fdo bugzilla
+    #29091, fixes server 1.9rc crash when starting an app using GLX 1.3)
 
  -- Julien Cristau <jcristau@debian.org>  Thu, 15 Jul 2010 17:05:56 +0100
 
diff --git a/debian/patches/09-intel-fix-invalidate-before-initialisation.diff b/debian/patches/09-intel-fix-invalidate-before-initialisation.diff
new file mode 100644
index 0000000..3af5eed
--- /dev/null
+++ b/debian/patches/09-intel-fix-invalidate-before-initialisation.diff
@@ -0,0 +1,73 @@
+From dd7853f327ad7a286a59c9c5956d4989c31a58fa Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Fri, 16 Jul 2010 12:24:53 +0100
+Subject: [PATCH] intel: Fix invalidate before initialisation
+
+Fixes:
+
+  Bug 29091 - 1.9RC5 server crash when starting GLX 1.3 app with mesa 7.8
+              Intel dri2 driver.
+  https://bugs.freedesktop.org/show_bug.cgi?id=29091
+
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+---
+ src/mesa/drivers/dri/common/dri_util.c    |    2 +-
+ src/mesa/drivers/dri/intel/intel_screen.c |   19 +++++++++++++++----
+ 2 files changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
+index 75c9882..9a9bfed 100644
+--- a/src/mesa/drivers/dri/common/dri_util.c
++++ b/src/mesa/drivers/dri/common/dri_util.c
+@@ -432,7 +432,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config,
+      */
+     (void) attrs;
+ 
+-    pdp = malloc(sizeof *pdp);
++    pdp = calloc(1, sizeof *pdp);
+     if (!pdp) {
+ 	return NULL;
+     }
+diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
+index 6e4bb64..083b7bb 100644
+--- a/src/mesa/drivers/dri/intel/intel_screen.c
++++ b/src/mesa/drivers/dri/intel/intel_screen.c
+@@ -102,10 +102,21 @@ static const __DRItexBufferExtension intelTexBufferExtension = {
+    intelSetTexBuffer2,
+ };
+ 
++static inline struct intel_context *
++to_intel_context(__DRIdrawable *drawable)
++{
++   if (drawable->driContextPriv == NULL)
++      return NULL;
++
++   return drawable->driContextPriv->driverPrivate;
++}
++
+ static void
+ intelDRI2Flush(__DRIdrawable *drawable)
+ {
+-   struct intel_context *intel = drawable->driContextPriv->driverPrivate;
++   struct intel_context *intel = to_intel_context(drawable);
++   if (!intel)
++      return;
+ 
+    if (intel->gen < 4)
+       INTEL_FIREVERTICES(intel);
+@@ -117,9 +128,9 @@ intelDRI2Flush(__DRIdrawable *drawable)
+ static void
+ intelDRI2Invalidate(__DRIdrawable *drawable)
+ {
+-   struct intel_context *intel = drawable->driContextPriv->driverPrivate;
+-
+-   intel->using_dri2_swapbuffers = GL_TRUE;
++   struct intel_context *intel = to_intel_context(drawable);
++   if (intel)
++      intel->using_dri2_swapbuffers = GL_TRUE;
+    dri2InvalidateDrawable(drawable);
+ }
+ 
+-- 
+1.7.1
+
diff --git a/debian/patches/series b/debian/patches/series
index ccf4830..e8da51e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 06_kfreebsd-ftbfs.diff
 07-nouveau-update.diff
 08-kfreebsd-gallium.diff
+09-intel-fix-invalidate-before-initialisation.diff

commit 1487dab78d7f037ca17e43bdf8c99f4f371630d5
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue Jul 20 14:25:53 2010 +0100

    gallium: handle kfreebsd like freebsd, fixing FTBFS (closes: #585618)

diff --git a/debian/changelog b/debian/changelog
index fb4c950..545b21f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ mesa (7.8.2-2) UNRELEASED; urgency=low
 
   * Add missing dependencies to libegl1-mesa-dev, thanks to Alexandros
     Frantzis (LP: #600243).
+  * gallium: handle kfreebsd like freebsd, fixing FTBFS (closes: #585618)
 
  -- Julien Cristau <jcristau@debian.org>  Thu, 15 Jul 2010 17:05:56 +0100
 
diff --git a/debian/patches/08-kfreebsd-gallium.diff b/debian/patches/08-kfreebsd-gallium.diff
new file mode 100644
index 0000000..baeb123
--- /dev/null
+++ b/debian/patches/08-kfreebsd-gallium.diff
@@ -0,0 +1,26 @@
+Index: mesa/src/gallium/auxiliary/rtasm/rtasm_execmem.c
+===================================================================
+--- mesa.orig/src/gallium/auxiliary/rtasm/rtasm_execmem.c
++++ mesa/src/gallium/auxiliary/rtasm/rtasm_execmem.c
+@@ -37,7 +37,7 @@
+ 
+ #include "rtasm_execmem.h"
+ 
+-#if defined(PIPE_OS_BSD)
++#ifndef MAP_ANONYMOUS
+ #define MAP_ANONYMOUS MAP_ANON
+ #endif
+ 
+Index: mesa/src/gallium/include/pipe/p_config.h
+===================================================================
+--- mesa.orig/src/gallium/include/pipe/p_config.h
++++ mesa/src/gallium/include/pipe/p_config.h
+@@ -128,7 +128,7 @@
+ #define PIPE_OS_UNIX
+ #endif
+ 
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #define PIPE_OS_FREEBSD
+ #define PIPE_OS_BSD
+ #define PIPE_OS_UNIX
diff --git a/debian/patches/series b/debian/patches/series
index d4df6df..ccf4830 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@
 05_hurd-ftbfs.diff
 06_kfreebsd-ftbfs.diff
 07-nouveau-update.diff
+08-kfreebsd-gallium.diff

commit d06e0117e302bc314baa75e02e8268936982e6c6
Author: Chia-I Wu <olv@lunarg.com>
Date:   Fri Jul 16 20:09:29 2010 +0800

    st/egl: Fix build on FreeBSD.
    
    There is no libdl on FreeBSD.  Based on patch from Thinker
    <thinker@branda.to>, which is against 7.8.
    
    This fixes fdo bug #29093.
    (cherry picked from commit 08f4bc07e424aaeb35eb58736fdca64b1398c190)

diff --git a/configs/autoconf.in b/configs/autoconf.in
index b6071f8..6218be9 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -29,6 +29,9 @@ X11_CFLAGS = @X11_CFLAGS@
 GLW_CFLAGS = @GLW_CFLAGS@
 GLUT_CFLAGS = @GLUT_CFLAGS@
 
+# dlopen
+DLOPEN_LIBS = @DLOPEN_LIBS@
+
 # Assembler
 MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
 GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
diff --git a/configs/default b/configs/default
index f12bec8..d4b45a3 100644
--- a/configs/default
+++ b/configs/default
@@ -121,6 +121,8 @@ APP_LIB_DEPS    = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LI
 APP_LIB_DEPS = -lm
 X11_LIBS = -lX11
 
+DLOPEN_LIBS = -ldl
+
 # Installation directories (for make install)
 INSTALL_DIR = /usr/local
 INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR)
diff --git a/configure.ac b/configure.ac
index 81fd320..e15371f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -398,6 +398,7 @@ dnl Check to see if dlopen is in default libraries (like Solaris, which
 dnl has it in libc), or if libdl is needed to get it.
 AC_CHECK_FUNC([dlopen], [],
     [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
+AC_SUBST([DLOPEN_LIBS])
 
 dnl See if posix_memalign is available
 AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
diff --git a/src/gallium/winsys/drm/Makefile.egl b/src/gallium/winsys/drm/Makefile.egl
index 8363de6..c48967f 100644
--- a/src/gallium/winsys/drm/Makefile.egl
+++ b/src/gallium/winsys/drm/Makefile.egl
@@ -11,7 +11,7 @@
 
 EGL_DRIVER_OBJECTS = $(EGL_DRIVER_SOURCES:.c=.o)
 
-common_LIBS = -ldrm -lm -ldl
+common_LIBS = -ldrm -lm $(DLOPEN_LIBS)
 
 x11_ST = $(TOP)/src/gallium/state_trackers/egl/libeglx11.a
 x11_LIBS = $(common_LIBS) -lX11 -lXext -lXfixes

commit b69d5414aa6ed1a816fc2a15a287325b376cebef
Author: Tom Stellard <tstellar@gmail.com>
Date:   Sun Jul 4 12:30:52 2010 -0700

    r300/compiler: Fix scheduling of TEX instructions.
    
    The following instruction sequence will no longer be emitted in separate
    TEX blocks:
    
    0: TEX temp[0].xyz, temp[1].xy__, 2D[0];
    1: TEX temp[1].xyz, temp[2].xy__, 2D[0];
    
    This fixes fdo bug #25109
    (cherry picked from commit 3724a2e65f5b3aa6e123889342a3e9c4d05903f5)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c
index df67aaf..b8ee288 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c
@@ -141,12 +141,28 @@ static void add_inst_to_list(struct schedule_instruction ** list, struct schedul
 	*list = inst;
 }
 
+static void add_inst_to_list_end(struct schedule_instruction ** list,
+					struct schedule_instruction * inst)
+{
+	if(!*list){
+		*list = inst;
+	}else{
+		struct schedule_instruction * temp = *list;
+		while(temp->NextReady){
+			temp = temp->NextReady;
+		}
+		temp->NextReady = inst;
+	}
+}
+
 static void instruction_ready(struct schedule_state * s, struct schedule_instruction * sinst)
 {
 	DBG("%i is now ready\n", sinst->Instruction->IP);
 
+	/* Adding Ready TEX instructions to the end of the "Ready List" helps
+	 * us emit TEX instructions in blocks without losing our place. */
 	if (sinst->Instruction->Type == RC_INSTRUCTION_NORMAL)
-		add_inst_to_list(&s->ReadyTEX, sinst);
+		add_inst_to_list_end(&s->ReadyTEX, sinst);
 	else if (sinst->Instruction->U.P.Alpha.Opcode == RC_OPCODE_NOP)
 		add_inst_to_list(&s->ReadyRGB, sinst);
 	else if (sinst->Instruction->U.P.RGB.Opcode == RC_OPCODE_NOP)
@@ -163,11 +179,14 @@ static void decrease_dependencies(struct schedule_state * s, struct schedule_ins
 		instruction_ready(s, sinst);
 }
 
-static void commit_instruction(struct schedule_state * s, struct schedule_instruction * sinst)
-{
-	DBG("%i: commit\n", sinst->Instruction->IP);
-
-	for(unsigned int i = 0; i < sinst->NumReadValues; ++i) {
+/**
+ * This function decreases the dependencies of the next instruction that
+ * wants to write to each of sinst's read values.
+ */
+static void commit_update_reads(struct schedule_state * s,
+					struct schedule_instruction * sinst){
+	unsigned int i;
+	for(i = 0; i < sinst->NumReadValues; ++i) {
 		struct reg_value * v = sinst->ReadValues[i];
 		assert(v->NumReaders > 0);
 		v->NumReaders--;
@@ -176,8 +195,12 @@ static void commit_instruction(struct schedule_state * s, struct schedule_instru
 				decrease_dependencies(s, v->Next->Writer);
 		}
 	}
+}
 
-	for(unsigned int i = 0; i < sinst->NumWriteValues; ++i) {
+static void commit_update_writes(struct schedule_state * s,
+					struct schedule_instruction * sinst){
+	unsigned int i;
+	for(i = 0; i < sinst->NumWriteValues; ++i) {
 		struct reg_value * v = sinst->WriteValues[i];
 		if (v->NumReaders) {
 			for(struct reg_value_reader * r = v->Readers; r; r = r->Next) {
@@ -196,6 +219,15 @@ static void commit_instruction(struct schedule_state * s, struct schedule_instru
 	}
 }
 
+static void commit_alu_instruction(struct schedule_state * s, struct schedule_instruction * sinst)
+{
+	DBG("%i: commit\n", sinst->Instruction->IP);
+
+	commit_update_reads(s, sinst);
+
+	commit_update_writes(s, sinst);
+}
+
 /**
  * Emit all ready texture instructions in a single block.
  *
@@ -208,21 +240,37 @@ static void emit_all_tex(struct schedule_state * s, struct rc_instruction * befo
 
 	assert(s->ReadyTEX);
 
-	/* Don't let the ready list change under us! */
-	readytex = s->ReadyTEX;
-	s->ReadyTEX = 0;
-
 	/* Node marker for R300 */
 	struct rc_instruction * inst_begin = rc_insert_new_instruction(s->C, before->Prev);
 	inst_begin->U.I.Opcode = RC_OPCODE_BEGIN_TEX;
 
 	/* Link texture instructions back in */
+	readytex = s->ReadyTEX;
 	while(readytex) {
-		struct schedule_instruction * tex = readytex;
+		rc_insert_instruction(before->Prev, readytex->Instruction);
+		DBG("%i: commit TEX reads\n", readytex->Instruction->IP);
+
+		/* All of the TEX instructions in the same TEX block have
+		 * their source registers read from before any of the
+		 * instructions in that block write to their destination
+		 * registers.  This means that when we commit a TEX
+		 * instruction, any other TEX instruction that wants to write
+		 * to one of the committed instruction's source register can be
+		 * marked as ready and should be emitted in the same TEX
+		 * block. This prevents the following sequence from being
+		 * emitted in two different TEX blocks:
+		 * 0: TEX temp[0].xyz, temp[1].xy__, 2D[0];
+		 * 1: TEX temp[1].xyz, temp[2].xy__, 2D[0];
+		 */
+		commit_update_reads(s, readytex);
+		readytex = readytex->NextReady;
+	}
+	readytex = s->ReadyTEX;
+	s->ReadyTEX = 0;
+	while(readytex){
+		DBG("%i: commit TEX writes\n", readytex->Instruction->IP);
+		commit_update_writes(s, readytex);
 		readytex = readytex->NextReady;
-
-		rc_insert_instruction(before->Prev, tex->Instruction);
-		commit_instruction(s, tex);
 	}
 }
 
@@ -328,7 +376,7 @@ static void emit_one_alu(struct schedule_state *s, struct rc_instruction * befor
 		}
 
 		rc_insert_instruction(before->Prev, sinst->Instruction);
-		commit_instruction(s, sinst);
+		commit_alu_instruction(s, sinst);
 	} else {
 		struct schedule_instruction **prgb;
 		struct schedule_instruction **palpha;
@@ -346,8 +394,8 @@ static void emit_one_alu(struct schedule_state *s, struct rc_instruction * befor
 				*prgb = (*prgb)->NextReady;
 				*palpha = (*palpha)->NextReady;
 				rc_insert_instruction(before->Prev, psirgb->Instruction);
-				commit_instruction(s, psirgb);
-				commit_instruction(s, psialpha);
+				commit_alu_instruction(s, psirgb);
+				commit_alu_instruction(s, psialpha);
 				goto success;
 			}
 		}
@@ -357,7 +405,7 @@ static void emit_one_alu(struct schedule_state *s, struct rc_instruction * befor
 		s->ReadyRGB = s->ReadyRGB->NextReady;
 
 		rc_insert_instruction(before->Prev, sinst->Instruction);
-		commit_instruction(s, sinst);
+		commit_alu_instruction(s, sinst);
 	success: ;
 	}
 }

commit f6bba7b996b9a72fcf121e66b6317f5635b1a5c4
Author: Chia-I Wu <olv@lunarg.com>
Date:   Tue Jul 6 14:34:43 2010 +0800

    st/egl: Add support for !GLX_DIRECT_RENDERING.
    
    st/egl uses GLX code for DRI2 support.  It should honor
    GLX_DIRECT_RENDERING.
    
    Also updates configure.ac to define GLX_DIRECT_RENDERING for st/egl.
    (cherry picked from commit cf588ab3f1edb89be4cd57045a3888ff482fa817)

diff --git a/configure.ac b/configure.ac
index 121c386..81fd320 100644
--- a/configure.ac
+++ b/configure.ac
@@ -699,7 +699,7 @@ AC_SUBST([DRI_DRIVER_SEARCH_DIR])
 dnl Direct rendering or just indirect rendering
 AC_ARG_ENABLE([driglx-direct],
     [AS_HELP_STRING([--disable-driglx-direct],
-        [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
+        [enable direct rendering in GLX and EGL for DRI @<:@default=enabled@:>@])],
     [driglx_direct="$enableval"],
     [driglx_direct="yes"])
 dnl Which drivers to build - default is chosen by platform
@@ -1216,6 +1216,10 @@ yes)
             if test "x$enable_egl" != xyes; then
                 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
             fi
+            # define GLX_DIRECT_RENDERING even when the driver is not dri
+            if test "x$mesa_driver" != xdri -a "x$driglx_direct" = xyes; then
+                DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
+            fi
             ;;
         xorg)
             PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
diff --git a/src/gallium/state_trackers/egl/x11/glxinit.c b/src/gallium/state_trackers/egl/x11/glxinit.c
index 1ed2afd..dd35189 100644
--- a/src/gallium/state_trackers/egl/x11/glxinit.c
+++ b/src/gallium/state_trackers/egl/x11/glxinit.c
@@ -16,6 +16,8 @@
 
 #include "glxinit.h"
 
+#ifdef GLX_DIRECT_RENDERING
+
 typedef struct GLXGenericGetString
 {
    CARD8 reqType;
@@ -680,3 +682,5 @@ __glXInitialize(Display * dpy)
 
    return dpyPriv;
 }
+
+#endif /* GLX_DIRECT_RENDERING */
diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c
index 8d2a8b1..a8bdd34 100644
--- a/src/gallium/state_trackers/egl/x11/native_dri2.c
+++ b/src/gallium/state_trackers/egl/x11/native_dri2.c
@@ -37,6 +37,8 @@
 #include "native_x11.h"
 #include "x11_screen.h"
 
+#ifdef GLX_DIRECT_RENDERING
+
 enum dri2_surface_type {
    DRI2_SURFACE_TYPE_WINDOW,
    DRI2_SURFACE_TYPE_PIXMAP,
@@ -878,3 +880,15 @@ x11_create_dri2_display(EGLNativeDisplayType dpy,
 
    return &dri2dpy->base;
 }
+
+#else /* GLX_DIRECT_RENDERING */
+
+struct native_display *
+x11_create_dri2_display(EGLNativeDisplayType dpy,
+                        struct native_event_handler *event_handler,
+                        struct drm_api *api)
+{
+   return NULL;
+}
+
+#endif /* GLX_DIRECT_RENDERING */
diff --git a/src/gallium/state_trackers/egl/x11/native_x11.c b/src/gallium/state_trackers/egl/x11/native_x11.c
index 7b4fe63..0c25e4d 100644
--- a/src/gallium/state_trackers/egl/x11/native_x11.c
+++ b/src/gallium/state_trackers/egl/x11/native_x11.c
@@ -70,7 +70,9 @@ native_create_probe(EGLNativeDisplayType dpy)
    xscr = x11_screen_create(xdpy, scr);
    if (xscr) {
       if (x11_screen_support(xscr, X11_SCREEN_EXTENSION_DRI2)) {
+#ifdef GLX_DIRECT_RENDERING
          driver_name = x11_screen_probe_dri2(xscr, NULL, NULL);
+#endif
          if (driver_name)
             nprobe->data = strdup(driver_name);
       }
diff --git a/src/gallium/state_trackers/egl/x11/x11_screen.c b/src/gallium/state_trackers/egl/x11/x11_screen.c
index f409611..1706120 100644
--- a/src/gallium/state_trackers/egl/x11/x11_screen.c
+++ b/src/gallium/state_trackers/egl/x11/x11_screen.c
@@ -39,8 +39,10 @@
 #include "glxinit.h"
 
 struct x11_screen {
+#ifdef GLX_DIRECT_RENDERING
    /* dummy base class */
    struct __GLXDRIdisplayRec base;
+#endif
 
    Display *dpy;
    int number;
@@ -103,15 +105,19 @@ x11_screen_destroy(struct x11_screen *xscr)
    if (xscr->dri_device)
       Xfree(xscr->dri_device);
 
+#ifdef GLX_DIRECT_RENDERING
    /* xscr->glx_dpy will be destroyed with the X display */
    if (xscr->glx_dpy)
       xscr->glx_dpy->dri2Display = NULL;
+#endif
 
    if (xscr->visuals)
       XFree(xscr->visuals);
    free(xscr);
 }
 
+#ifdef GLX_DIRECT_RENDERING
+
 static boolean
 x11_screen_init_dri2(struct x11_screen *xscr)
 {
@@ -133,6 +139,8 @@ x11_screen_init_glx(struct x11_screen *xscr)
    return (xscr->glx_dpy != NULL);
 }
 
+#endif /* GLX_DIRECT_RENDERING */
+
 /**
  * Return true if the screen supports the extension.
  */
@@ -145,12 +153,14 @@ x11_screen_support(struct x11_screen *xscr, enum x11_screen_extension ext)
    case X11_SCREEN_EXTENSION_XSHM:
       supported = XShmQueryExtension(xscr->dpy);
       break;
+#ifdef GLX_DIRECT_RENDERING
    case X11_SCREEN_EXTENSION_GLX:
       supported = x11_screen_init_glx(xscr);
       break;
    case X11_SCREEN_EXTENSION_DRI2:
       supported = x11_screen_init_dri2(xscr);
       break;
+#endif
    default:
       break;
    }
@@ -234,6 +244,39 @@ x11_screen_convert_visual(struct x11_screen *xscr, const XVisualInfo *visual,
 }
 
 /**
+ * Return the depth of a drawable.
+ *
+ * Unlike other drawable functions, the drawable needs not be a DRI2 drawable.
+ */
+uint
+x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable)
+{
+   unsigned int depth;
+
+   if (drawable != xscr->last_drawable) {
+      Window root;
+      int x, y;
+      unsigned int w, h, border;
+      Status ok;
+
+      ok = XGetGeometry(xscr->dpy, drawable, &root,
+            &x, &y, &w, &h, &border, &depth);
+      if (!ok)
+         depth = 0;
+
+      xscr->last_drawable = drawable;
+      xscr->last_depth = depth;
+   }
+   else {
+      depth = xscr->last_depth;
+   }
+
+   return depth;
+}
+
+#ifdef GLX_DIRECT_RENDERING
+
+/**
  * Return the GLX fbconfigs.
  */
 const __GLcontextModes *
@@ -392,37 +435,6 @@ x11_drawable_get_buffers(struct x11_screen *xscr, Drawable drawable,
 }
 
 /**
- * Return the depth of a drawable.
- *
- * Unlike other drawable functions, the drawable needs not be a DRI2 drawable.
- */
-uint
-x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable)
-{
-   unsigned int depth;
-
-   if (drawable != xscr->last_drawable) {
-      Window root;
-      int x, y;
-      unsigned int w, h, border;
-      Status ok;
-
-      ok = XGetGeometry(xscr->dpy, drawable, &root,
-            &x, &y, &w, &h, &border, &depth);
-      if (!ok)
-         depth = 0;
-
-      xscr->last_drawable = drawable;
-      xscr->last_depth = depth;
-   }
-   else {
-      depth = xscr->last_depth;
-   }
-
-   return depth;
-}
-
-/**
  * Create a mode list of the given size.
  */
 __GLcontextModes *
@@ -489,3 +501,5 @@ dri2InvalidateBuffers(Display *dpy, XID drawable)
 
    xscr->dri_invalidate_buffers(xscr, drawable, xscr->dri_user_data);
 }
+
+#endif /* GLX_DIRECT_RENDERING */
diff --git a/src/gallium/state_trackers/egl/x11/x11_screen.h b/src/gallium/state_trackers/egl/x11/x11_screen.h
index 37e8d5a..55e1201 100644
--- a/src/gallium/state_trackers/egl/x11/x11_screen.h
+++ b/src/gallium/state_trackers/egl/x11/x11_screen.h
@@ -68,20 +68,18 @@ void
 x11_screen_convert_visual(struct x11_screen *xscr, const XVisualInfo *visual,
                           __GLcontextModes *mode);
 
+uint
+x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable);
+
+#ifdef GLX_DIRECT_RENDERING
+
+/* GLX */
 const __GLcontextModes *
 x11_screen_get_glx_configs(struct x11_screen *xscr);
 
 const __GLcontextModes *
 x11_screen_get_glx_visuals(struct x11_screen *xscr);
 
-const char *
-x11_screen_probe_dri2(struct x11_screen *xscr, int *major, int *minor);
-
-int
-x11_screen_enable_dri2(struct x11_screen *xscr,
-                       x11_drawable_invalidate_buffers invalidate_buffers,
-                       void *user_data);
-
 __GLcontextModes *
 x11_context_modes_create(unsigned count);
 
@@ -91,6 +89,15 @@ x11_context_modes_destroy(__GLcontextModes *modes);
 unsigned
 x11_context_modes_count(const __GLcontextModes *modes);
 
+/* DRI2 */
+const char *
+x11_screen_probe_dri2(struct x11_screen *xscr, int *major, int *minor);
+
+int
+x11_screen_enable_dri2(struct x11_screen *xscr,
+                       x11_drawable_invalidate_buffers invalidate_buffers,
+                       void *user_data);
+
 void
 x11_drawable_enable_dri2(struct x11_screen *xscr,
                          Drawable drawable, boolean on);
@@ -105,7 +112,6 @@ x11_drawable_get_buffers(struct x11_screen *xscr, Drawable drawable,
                          int *width, int *height, unsigned int *attachments,
                          boolean with_format, int num_ins, int *num_outs);
 
-uint
-x11_drawable_get_depth(struct x11_screen *xscr, Drawable drawable);
+#endif /* GLX_DIRECT_RENDERING */
 
 #endif /* _X11_SCREEN_H_ */

commit 6afe2936f72ae2327d176e63b2b3bee64fee43ca
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Jul 5 16:50:08 2010 -0600

    mesa: put progs/util into the MesaDemos package

diff --git a/Makefile b/Makefile
index 84d0038..e9c7970 100644
--- a/Makefile
+++ b/Makefile
@@ -285,9 +285,6 @@ MAIN_FILES = \
 	$(DIRECTORY)/src/mesa/x86-64/*.[chS]				\
 	$(DIRECTORY)/src/mesa/x86-64/Makefile				\
 	$(DIRECTORY)/progs/Makefile					\
-	$(DIRECTORY)/progs/util/README					\
-	$(DIRECTORY)/progs/util/*.[ch]					\
-	$(DIRECTORY)/progs/util/sampleMakefile				\
 	$(DIRECTORY)/windows/VC8/
 
 ES_FILES = \
@@ -438,7 +435,10 @@ DEMO_FILES = \
 	$(DIRECTORY)/progs/glsl/*.c			\
 	$(DIRECTORY)/progs/glsl/*.frag			\
 	$(DIRECTORY)/progs/glsl/*.vert			\
-	$(DIRECTORY)/progs/glsl/*.shtest
+	$(DIRECTORY)/progs/glsl/*.shtest		\
+	$(DIRECTORY)/progs/util/README			\
+	$(DIRECTORY)/progs/util/*.[ch]			\
+	$(DIRECTORY)/progs/util/sampleMakefile
 
 GLUT_FILES = \
 	$(DIRECTORY)/include/GL/glut.h			\

commit fd95ea52e59321bd1f78c338a95f501bff6e671a
Author: Dan Nicholson <dbn.lists@gmail.com>
Date:   Thu Jul 1 13:02:47 2010 -0700

    Use GLW_CFLAGS when building libGLw
    
    We check for libX11 and libXt, so we might as well use the CFLAGS
    pkg-config tells us about.
    (cherry picked from commit 442c37e2ef57d8dcf88c91d457df7f6516d76264)
    
    Conflicts:
    
    	configs/autoconf.in

diff --git a/configs/autoconf.in b/configs/autoconf.in
index 440b50b..b6071f8 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -26,6 +26,7 @@ INTEL_LIBS = @INTEL_LIBS@
 INTEL_CFLAGS = @INTEL_CFLAGS@
 X11_LIBS = @X11_LIBS@
 X11_CFLAGS = @X11_CFLAGS@
+GLW_CFLAGS = @GLW_CFLAGS@
 GLUT_CFLAGS = @GLUT_CFLAGS@
 
 # Assembler
diff --git a/src/glw/Makefile b/src/glw/Makefile
index 1fb3d3c..39352f0 100644
--- a/src/glw/Makefile
+++ b/src/glw/Makefile
@@ -17,7 +17,7 @@ OBJECTS = $(GLW_SOURCES:.c=.o)
 ##### RULES #####
 
 .c.o:
-	$(CC) -c $(INCDIRS) $(CFLAGS) $<
+	$(CC) -c $(INCDIRS) $(CFLAGS) $(GLW_CFLAGS) $<
 
 
 

commit 31799da47fc367ead5a0b74f579fc288b0f99c55
Author: Dan Nicholson <dbn.lists@gmail.com>
Date:   Thu Jul 1 13:02:09 2010 -0700

    Use GLUT_CFLAGS when building glut
    
    Fix this build error (in MesaGLUT-7.6.1)...
    glut_cmap.c:23:66: error: X11/Xmu/StdCmap.h: No such file or directory
    
    ...by not preventing the cflags that pkg-config finds for glut dependencies
    (including 'xmu') from being used.
    
    Defining GLUT_CFLAGS before running the pkg-config prevents the
    cflags found by pkg-config from being used.
    
    This patch lets GLUT_CFLAGS that configure & pkg-config work
    so hard to set actually get used.
    
    Also make sure the generated configs/autoconf defines GLUT_CFLAGS
    used in (at least) src/glut/glx/Makefile.
    
    Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
    (cherry picked from commit 9617254a1e5522615c96ab25c9e0a70e0d63d7e7)
    
    Conflicts:
    
    	configs/autoconf.in

diff --git a/configs/autoconf.in b/configs/autoconf.in
index fbd5faa..440b50b 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -26,6 +26,7 @@ INTEL_LIBS = @INTEL_LIBS@
 INTEL_CFLAGS = @INTEL_CFLAGS@
 X11_LIBS = @X11_LIBS@
 X11_CFLAGS = @X11_CFLAGS@
+GLUT_CFLAGS = @GLUT_CFLAGS@
 
 # Assembler
 MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
diff --git a/configure.ac b/configure.ac
index e711634..121c386 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1102,10 +1102,6 @@ fi
 
 if test "x$enable_glut" = xyes; then
     SRC_DIRS="$SRC_DIRS glut/glx"
-    GLUT_CFLAGS=""
-    if test "x$GCC" = xyes; then
-        GLUT_CFLAGS="-fexceptions"
-    fi
     if test "$x11_pkgconfig" = yes; then
         PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
         GLUT_PC_REQ_PRIV="x11 xmu xi"
@@ -1116,6 +1112,9 @@ if test "x$enable_glut" = xyes; then
         GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
         GLUT_PC_CFLAGS="$X11_INCLUDES"
     fi
+    if test "x$GCC" = xyes; then
+        GLUT_CFLAGS="$GLUT_CFLAGS -fexceptions"
+    fi
     GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
     GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm"
 


Reply to: