Re: [Mesa-dev] [PATCH] gallium: remove unused 'buf' parameter in pipe_buffer_unmap

2010-12-20 Thread Keith Whitwell
Looks good, Marek.

Keith

On Sun, 2010-12-19 at 04:02 -0800, Marek Olšák wrote:
 ---
  src/gallium/auxiliary/util/u_index_modify.c  |   12 ++--
  src/gallium/auxiliary/util/u_inlines.h   |3 +--
  src/gallium/auxiliary/util/u_upload_mgr.c|4 ++--
  src/gallium/drivers/nv50/nv50_shader_state.c |2 +-
  src/gallium/drivers/nv50/nv50_vbo.c  |2 +-
  src/gallium/drivers/r300/r300_render.c   |   11 +--
  src/gallium/drivers/r300/r300_render_translate.c |5 ++---
  src/gallium/drivers/r600/r600_translate.c|5 ++---
  src/gallium/drivers/svga/svga_draw_arrays.c  |4 ++--
  src/gallium/drivers/svga/svga_draw_elements.c|8 
  src/gallium/drivers/svga/svga_state_constants.c  |2 +-
  src/gallium/drivers/svga/svga_state_vs.c |4 +---
  src/gallium/drivers/svga/svga_swtnl_backend.c|2 +-
  src/gallium/drivers/svga/svga_swtnl_draw.c   |9 +++--
  src/mesa/state_tracker/st_cb_bufferobjects.c |6 +++---
  src/mesa/state_tracker/st_cb_drawtex.c   |2 +-
  src/mesa/state_tracker/st_draw_feedback.c|8 +++-
  17 files changed, 39 insertions(+), 50 deletions(-)
 
 diff --git a/src/gallium/auxiliary/util/u_index_modify.c 
 b/src/gallium/auxiliary/util/u_index_modify.c
 index 65b079e..3822f60 100644
 --- a/src/gallium/auxiliary/util/u_index_modify.c
 +++ b/src/gallium/auxiliary/util/u_index_modify.c
 @@ -52,8 +52,8 @@ void util_shorten_ubyte_elts(struct pipe_context *context,
  out_map++;
  }
 
 -pipe_buffer_unmap(context, *elts, src_transfer);
 -pipe_buffer_unmap(context, new_elts, dst_transfer);
 +pipe_buffer_unmap(context, src_transfer);
 +pipe_buffer_unmap(context, dst_transfer);
 
  *elts = new_elts;
  }
 @@ -86,8 +86,8 @@ void util_rebuild_ushort_elts(struct pipe_context *context,
  out_map++;
  }
 
 -pipe_buffer_unmap(context, *elts, in_transfer);
 -pipe_buffer_unmap(context, new_elts, out_transfer);
 +pipe_buffer_unmap(context, in_transfer);
 +pipe_buffer_unmap(context, out_transfer);
 
  *elts = new_elts;
  }
 @@ -120,8 +120,8 @@ void util_rebuild_uint_elts(struct pipe_context *context,
  out_map++;
  }
 
 -pipe_buffer_unmap(context, *elts, in_transfer);
 -pipe_buffer_unmap(context, new_elts, out_transfer);
 +pipe_buffer_unmap(context, in_transfer);
 +pipe_buffer_unmap(context, out_transfer);
 
  *elts = new_elts;
  }
 diff --git a/src/gallium/auxiliary/util/u_inlines.h 
 b/src/gallium/auxiliary/util/u_inlines.h
 index e55aafe..9184b6a 100644
 --- a/src/gallium/auxiliary/util/u_inlines.h
 +++ b/src/gallium/auxiliary/util/u_inlines.h
 @@ -242,7 +242,6 @@ pipe_buffer_map(struct pipe_context *pipe,
 
  static INLINE void
  pipe_buffer_unmap(struct pipe_context *pipe,
 -  struct pipe_resource *buf,
struct pipe_transfer *transfer)
  {
 if (transfer) {
 @@ -341,7 +340,7 @@ pipe_buffer_read(struct pipe_context *pipe,
 if (map)
memcpy(data, map + offset, size);
 
 -   pipe_buffer_unmap(pipe, buf, src_transfer);
 +   pipe_buffer_unmap(pipe, src_transfer);
  }
 
  static INLINE struct pipe_transfer *
 diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c 
 b/src/gallium/auxiliary/util/u_upload_mgr.c
 index af229e6..4daa55d 100644
 --- a/src/gallium/auxiliary/util/u_upload_mgr.c
 +++ b/src/gallium/auxiliary/util/u_upload_mgr.c
 @@ -108,7 +108,7 @@ my_buffer_write(struct pipe_context *pipe,
 
 memcpy(map + offset, data, size);
 pipe_buffer_flush_mapped_range(pipe, transfer, offset, dirty_size);
 -   pipe_buffer_unmap(pipe, buf, transfer);
 +   pipe_buffer_unmap(pipe, transfer);
 
 return PIPE_OK;
  }
 @@ -243,7 +243,7 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr 
 *upload,
 
  done:
 if (map)
 -  pipe_buffer_unmap( upload-pipe, inbuf, transfer );
 +  pipe_buffer_unmap( upload-pipe, transfer );
 
 return ret;
  }
 diff --git a/src/gallium/drivers/nv50/nv50_shader_state.c 
 b/src/gallium/drivers/nv50/nv50_shader_state.c
 index 306aa81..1c1b66d 100644
 --- a/src/gallium/drivers/nv50/nv50_shader_state.c
 +++ b/src/gallium/drivers/nv50/nv50_shader_state.c
 @@ -71,7 +71,7 @@ nv50_transfer_constbuf(struct nv50_context *nv50,
map += nr;
 }
 
 -   pipe_buffer_unmap(pipe, buf, transfer);
 +   pipe_buffer_unmap(pipe, transfer);
  }
 
  static void
 diff --git a/src/gallium/drivers/nv50/nv50_vbo.c 
 b/src/gallium/drivers/nv50/nv50_vbo.c
 index d41a59d..53f319a 100644
 --- a/src/gallium/drivers/nv50/nv50_vbo.c
 +++ b/src/gallium/drivers/nv50/nv50_vbo.c
 @@ -284,7 +284,7 @@ nv50_draw_elements_inline(struct pipe_context *pipe,
 nzi = TRUE;
 }
 
 -   pipe_buffer_unmap(pipe, indexBuffer, transfer);
 +   pipe_buffer_unmap(pipe, transfer);
  }
 
  static void
 diff --git a/src/gallium/drivers/r300/r300_render.c 
 

[Mesa-dev] [Bug 32528] New: X server crashes in VMware guest when KDE started with kwin OpenGLIsUnsafe=false

2010-12-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=32528

   Summary: X server crashes in VMware guest when KDE started with
kwin OpenGLIsUnsafe=false
   Product: Mesa
   Version: 7.9
  Platform: x86-64 (AMD64)
OS/Version: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/X11
AssignedTo: mesa-dev@lists.freedesktop.org
ReportedBy: hda...@gmail.com


X server running in a VMware guest crashes (SIGSEGV) during KDE initialization.
 Here's the backtrace. 

Backtrace:
[ 82931.960] 0: /usr/bin/X (xorg_backtrace+0x3b) [0x80e5e7b]
[ 82931.960] 1: /usr/bin/X (0x8048000+0x5cd35) [0x80a4d35]
[ 82931.960] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0xb771840c]
[ 82931.960] 3: /usr/lib/xorg/modules/libfb.so (fbBltStip+0x73) [0xb72ca3f3]
[ 82931.960] 4: /usr/lib/xorg/modules/libfb.so (fbGetImage+0x199) [0xb72cf679]
[ 82931.960] 5: /usr/lib/xorg/modules/drivers/vmwlegacy_drv.so
(0xb72f5000+0x6c44) [0xb72fbc44]
[ 82931.960] 6: /usr/bin/X (0x8048000+0x15f86d) [0x81a786d]
[ 82931.960] 7: /usr/lib/xorg/modules/extensions/libglx.so (0xb7312000+0x3814b)
[0xb734a14b]
[ 82931.960] 8: /usr/lib/xorg/modules/dri/swrast_dri.so (0xaedde000+0xf81c)
[0xaeded81c]
[ 82931.960] 9: /usr/lib/xorg/modules/dri/swrast_dri.so (0xaedde000+0xf887)
[0xaeded887]
[ 82931.960] 10: /usr/lib/xorg/modules/extensions/libglx.so
(0xb7312000+0x380ad) [0xb734a0ad]
[ 82931.960] 11: /usr/lib/xorg/modules/extensions/libglx.so
(0xb7312000+0x34802) [0xb7346802]
[ 82931.960] 12: /usr/lib/xorg/modules/extensions/libglx.so
(0xb7312000+0x3567a) [0xb734767a]
[ 82931.960] 13: /usr/lib/xorg/modules/extensions/libglx.so
(0xb7312000+0x3766f) [0xb734966f]
[ 82931.960] 14: /usr/bin/X (0x8048000+0x27187) [0x806f187]
[ 82931.960] 15: /usr/bin/X (0x8048000+0x1a1b5) [0x80621b5]
[ 82931.960] 16: /lib/libc.so.6 (__libc_start_main+0xe6) [0xb743dc76]
[ 82931.960] 17: /usr/bin/X (0x8048000+0x19d91) [0x8061d91]
[ 82931.960] Segmentation fault at address (nil)
[ 82931.960] 
Fatal server error:
[ 82931.961] Caught signal 11 (Segmentation fault). Server aborting

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 32528] X server crashes in VMware guest when KDE started with kwin OpenGLIsUnsafe=false

2010-12-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=32528

--- Comment #1 from Hugh Daschbach hda...@gmail.com 2010-12-20 08:25:25 PST 
---
Before finding that it's common to simply disable OpenGL in
.kde4/share/config/kwinrc:

OpenGLIsUnsafe=true

I poked around the crash a bit.  I believe the crash happens when
swrastSetTexBuffer2() passes a NULL texImage-Data value down to
sPriv-swrast_loader-getImage().  Here's the backtrace from gdb just before
the crash:


Breakpoint 1, 0xb747da06 in VMWAREGetImage ()
   from /usr/lib/xorg/modules/drivers/vmwlegacy_drv.so
(gdb) bt
#0  0xb747da06 in VMWAREGetImage ()
   from /usr/lib/xorg/modules/drivers/vmwlegacy_drv.so
#1  0x081a786d in miSpriteGetImage ()
#2  0xb74cc14b in swrastGetImage ()
   from /usr/lib/xorg/modules/extensions/libglx.so
#3  0xaef6f81c in swrastSetTexBuffer2 (pDRICtx=0xa31e888, target=3553, 
texture_format=8410, dPriv=0xa0a9068) at swrast.c:97
#4  0xaef6f887 in swrastSetTexBuffer (pDRICtx=0xa31e888, target=3553, 
dPriv=0xa0a9068) at swrast.c:106
#5  0xb74cc0ad in __glXDRIbindTexImage ()
   from /usr/lib/xorg/modules/extensions/libglx.so
#6  0xb74c8802 in __glXDisp_BindTexImageEXT ()
   from /usr/lib/xorg/modules/extensions/libglx.so
#7  0xb74c967a in __glXDisp_VendorPrivate ()
   from /usr/lib/xorg/modules/extensions/libglx.so
#8  0xb74cb66f in __glXDispatch ()
   from /usr/lib/xorg/modules/extensions/libglx.so
#9  0x0806f187 in Dispatch ()
#10 0x080621b5 in main ()
(gdb) c
Continuing.

Now that I've turned on OpenGLIsSafe, this isn't a big issue for me.  But I'm
left wondering, is this a bug, an incomplete feature, or an unsupported
configuration?  Is it an itch worth scratching further?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 32528] X server crashes in VMware guest when KDE started with kwin OpenGLIsUnsafe=false

2010-12-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=32528

--- Comment #2 from Hugh Daschbach hda...@gmail.com 2010-12-20 08:28:27 PST 
---
One more thing.  This is Arch Linux running Mesa built from the 7.9 git tree at
dc4956922dfbec2fb2f60539be97760022bd4613.  I tried backporting to the 7.9 tar
file and had similar results.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] Patch: check for updated version of libdrm

2010-12-20 Thread Adenilson Cavalcanti
Friends

Trying to compile mesa this weekend failed at one of the Intel drivers (IIRC, a 
missing enumeration was to blame).

Compiling and installing libdrm from git repository solved the issue, but I 
believe that the autotools buildsystem should check for the correct version at 
configure time (and fail if not found).

Environment: pre-installed libdrm 2.4.21 (drm from repository is at version 
2.4.23)

This really simple patch does this:

adenil...@macblack:~/apps/mesa$ git diff configure.ac
diff --git a/configure.ac b/configure.ac
index bd81775..c17c0f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,11 +18,11 @@ AC_CONFIG_AUX_DIR([bin])
 AC_CANONICAL_HOST
 
 dnl Versions for external dependencies
-LIBDRM_REQUIRED=2.4.15
-LIBDRM_RADEON_REQUIRED=2.4.17
+LIBDRM_REQUIRED=2.4.23
+LIBDRM_RADEON_REQUIRED=2.4.23
 DRI2PROTO_REQUIRED=2.1
 GLPROTO_REQUIRED=1.4.11
-LIBDRM_XORG_REQUIRED=2.4.17
+LIBDRM_XORG_REQUIRED=2.4.23
 LIBKMS_XORG_REQUIRED=1.0.0
 
 dnl Check for progs


Best regards


Adenilson


  
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] XvMC gets iDCT support (at least on R600)

2010-12-20 Thread Andy Furniss

Andy Furniss wrote:

Christian König wrote:

A fix is checked in, so please try again.


Working now without debug.


With current git this is crashing again for me on quit. Also seeing 
extra artifacts on the Pendulum.mpg.


*** glibc detected *** /home/andy/Src/Mplayer-svn/mplayer/mplayer: 
corrupted double-linked list: 0x0ac54e58 ***

=== Backtrace: =
/lib/libc.so.6[0xb6e55d9a]
/lib/libc.so.6[0xb6e573d4]
/lib/libc.so.6(cfree+0x6e)[0xb6e5797e]
/mnt/sda8/xvmc/xvmc-r600/lib/gallium/libXvMCg3dvl.so[0xb6880d8e]
/mnt/sda8/xvmc/xvmc-r600/lib/gallium/libXvMCg3dvl.so[0xb6889dd8]
/mnt/sda8/xvmc/xvmc-r600/lib/gallium/libXvMCg3dvl.so[0xb687f111]
/mnt/sda8/xvmc/xvmc-r600/lib/gallium/libXvMCg3dvl.so[0xb68e67ab]
/mnt/sda8/xvmc/xvmc-r600/lib/gallium/libXvMCg3dvl.so[0xb68e7303]
/mnt/sda8/xvmc/xvmc-r600/lib/gallium/libXvMCg3dvl.so[0xb68ccf55]
/mnt/sda8/xvmc/xvmc-r600/lib/gallium/libXvMCg3dvl.so[0xb68968e7]
/mnt/sda8/xvmc/xvmc-r600/lib/gallium/libXvMCg3dvl.so[0xb688b227]
/mnt/sda8/xvmc/xvmc-r600/lib/gallium/libXvMCg3dvl.so(XvMCDestroyContext+0xbc)[0xb686a44c]
/home/andy/Src/Xorg-git/modular/lib/libXvMCW.so.1(XvMCDestroyContext+0x34)[0xb70b8e04]
/home/andy/Src/Mplayer-svn/mplayer/mplayer[0x811bdc8]
=== Memory map: 
SNIP


Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb6c6a6d0 (LWP 25377)]
0xe424 in __kernel_vsyscall ()
(gdb) bt
#0  0xe424 in __kernel_vsyscall ()
#1  0xb6e1b15a in raise () from /lib/libc.so.6
#2  0xb6e1c787 in abort () from /lib/libc.so.6
#3  0xb6e504cf in __libc_message () from /lib/libc.so.6
#4  0xb6e55d9a in malloc_printerr () from /lib/libc.so.6
#5  0xb6e573d4 in _int_free () from /lib/libc.so.6
#6  0xb6e5797e in free () from /lib/libc.so.6
#7  0xb6880d8e in r600_bc_clear (bc=0xac6d584) at r600_asm.c:940
#8  0xb6889dd8 in r600_pipe_shader_destroy (ctx=0xa0e78f0, 
shader=0xac6d580) at r600_shader.c:257
#9  0xb687f111 in r600_delete_vs_shader (ctx=0x0, state=0xac6d580) at 
r600_state_common.c:310

#10 0xb68e67ab in cleanup_shaders (idct=0xac4bfac) at vl/vl_idct.c:347
#11 0xb68e7303 in vl_idct_cleanup (idct=0xac4bfac) at vl/vl_idct.c:585
#12 0xb68ccf55 in vl_mpeg12_mc_renderer_cleanup (renderer=0xac4bef0) at 
vl/vl_mpeg12_mc_renderer.c:618
#13 0xb68968e7 in sp_mpeg12_destroy (vpipe=0xac4be80) at 
sp_video_context.c:126

#14 0xb688b227 in vl_video_destroy (vctx=0xa0e78e0) at dri_winsys.c:280
#15 0xb686a44c in XvMCDestroyContext (dpy=0xa94e6e0, context=0x8ac0a9c) 
at context.c:290
#16 0xb70b8e04 in XvMCDestroyContext (display=0xa94e6e0, 
context=0x8ac0a9c) at XvMCWrapper.c:442

#17 0x0811bdc8 in xvmc_free ()
#18 0xbfd89fec in ?? ()
#19 0x0a0e4bc0 in ?? ()
#20 0xb6f1bff4 in ?? () from /lib/libc.so.6
#21 0xb6f1d120 in ?? () from /lib/libc.so.6
#22 0x in ?? ()
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH Resend] mesa: Optionally build a dricore support library.

2010-12-20 Thread Christopher James Halse Rogers
This an adds --enable-shared-dricore option to configure.  When enabled,
DRI modules will link against a shared copy of the common mesa routines
rather than statically linking these.

This saves about 30MB on disc with a full complement of classic DRI
drivers.
---

Resending as it seems to have been ignored the first time.
We've applied this in Ubuntu as we are (as always) scrabbling for
CD space on the LiveCDs, but Fedora had a similar patch in the dim
distant past.

This seems to be something that distros generally will be interested
in.

 configs/autoconf.in|8 -
 configs/default|3 ++
 configs/freebsd-dri|4 ++-
 configs/linux-dri  |4 ++-
 configs/linux-dri-xcb  |4 ++-
 configs/linux-egl  |4 ++-
 configs/linux-indirect |3 +-
 configure.ac   |   32 +-
 src/glsl/Makefile  |   20 ++-
 src/mesa/Makefile  |   57 +++
 src/mesa/drivers/dri/Makefile.template |   12 +++
 src/mesa/drivers/osmesa/Makefile   |2 +-
 src/mesa/x86/read_rgba_span_x86.S  |8 
 13 files changed, 136 insertions(+), 25 deletions(-)

diff --git a/configs/autoconf.in b/configs/autoconf.in
index e2d70c6..37a137d 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -33,6 +33,8 @@ LLVM_LDFLAGS = @LLVM_LDFLAGS@
 LLVM_LIBS = @LLVM_LIBS@
 GLW_CFLAGS = @GLW_CFLAGS@
 GLUT_CFLAGS = @GLUT_CFLAGS@
+DRI_CFLAGS = @DRI_CFLAGS@
+DRI_CXXFLAGS = @DRI_CXXFLAGS@
 
 TALLOC_LIBS = @TALLOC_LIBS@
 TALLOC_CFLAGS = @TALLOC_CFLAGS@
@@ -103,7 +105,10 @@ GALLIUM_AUXILIARIES = 
$(TOP)/src/gallium/auxiliary/libgallium.a
 GALLIUM_DRIVERS = $(foreach 
DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
 
 # Driver specific build vars
-DRI_DIRS = @DRI_DIRS@ 
+DRI_DIRS = @DRI_DIRS@
+DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
+DRICORE_LIBS = @DRICORE_LIBS@
+DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
 EGL_PLATFORMS = @EGL_PLATFORMS@
 EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
 
@@ -131,6 +136,7 @@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
 VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
 
 # DRI dependencies
+MESA_MODULES = @MESA_MODULES@
 DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
 LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
 LIBDRM_LIB = @LIBDRM_LIBS@
diff --git a/configs/default b/configs/default
index 0301345..1feeb97 100644
--- a/configs/default
+++ b/configs/default
@@ -85,6 +85,9 @@ VG_LIB_GLOB = $(VG_LIB_NAME)*
 TALLOC_LIBS = `pkg-config --libs talloc`
 TALLOC_CFLAGS = `pkg-config --cflags talloc`
 
+DRI_CFLAGS = $(CFLAGS)
+DRI_CXXFLAGS = $(CXXFLAGS)
+
 # Optional assembly language optimization files for libGL
 MESA_ASM_SOURCES = 
 
diff --git a/configs/freebsd-dri b/configs/freebsd-dri
index a4aa82e..23cf58a 100644
--- a/configs/freebsd-dri
+++ b/configs/freebsd-dri
@@ -30,9 +30,11 @@ ASM_SOURCES =
 MESA_ASM_SOURCES = 
 
 # Library/program dependencies
+MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
+
 LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
 LIBDRM_LIB = `pkg-config --libs libdrm`
-DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
+DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat 
$(LIBDRM_LIB)
 GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)
 
diff --git a/configs/linux-dri b/configs/linux-dri
index 64fc407..caf0406 100644
--- a/configs/linux-dri
+++ b/configs/linux-dri
@@ -43,9 +43,11 @@ MESA_ASM_SOURCES =
 # Library/program dependencies
 EXTRA_LIB_PATH=-L/usr/X11R6/lib
 
+MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
+
 LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
 LIBDRM_LIB = $(shell pkg-config --libs libdrm)
-DRI_LIB_DEPS  = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl -ltalloc 
$(LIBDRM_LIB)
+DRI_LIB_DEPS  = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl 
-ltalloc $(LIBDRM_LIB)
 GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)
 
diff --git a/configs/linux-dri-xcb b/configs/linux-dri-xcb
index 8092a04..7518080 100644
--- a/configs/linux-dri-xcb
+++ b/configs/linux-dri-xcb
@@ -41,9 +41,11 @@ MESA_ASM_SOURCES =
 # Library/program dependencies
 EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11)
 
+MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
+
 LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
 LIBDRM_LIB = $(shell pkg-config --libs libdrm)
-DRI_LIB_DEPS  = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
+DRI_LIB_DEPS  = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl 
$(LIBDRM_LIB)
 GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
 $(LIBDRM_LIB) $(shell pkg-config --libs xcb) $(shell 
pkg-config --libs x11-xcb) $(shell pkg-config --libs xcb-glx)
 
diff --git a/configs/linux-egl