summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2009-06-19 21:14:45 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2009-10-15 18:34:31 +0100
commit741920b239663896c3f47b24b84de3107d076ebd (patch)
tree6ffef5d97b4ab04af1d9abb6d9ef8bb671a0955c
parentbb9359d0a9e0e2aa41167fd5af2a4c2b67bb5224 (diff)
Remove GL dispatcher symbols which are defined in libGL, and link with libGL for them instead (as dri_swrast.so is linked with libGL)
Paper over the cracks. Avoid a crash when we have a broken context. Turn on GLX null context debugging Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r--configure.ac4
-rw-r--r--glx/Makefile.am2
-rw-r--r--glx/single2.c3
-rw-r--r--hw/xwin/InitOutput.c24
4 files changed, 29 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 16a290f0b..c923a4294 100644
--- a/configure.ac
+++ b/configure.ac
@@ -830,7 +830,7 @@ if test "x$GLX" = xyes; then
AC_SUBST(XLIB_CFLAGS)
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
GLX_LIBS='$(top_builddir)/glx/libglx.la'
- GLX_SYS_LIBS="$GLX_SYS_LIBS $DLOPEN_LIBS"
+ GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS $DLOPEN_LIBS"
else
GLX=no
fi
@@ -1503,7 +1503,7 @@ if test "x$XWIN" = xyes; then
XWIN_SYS_LIBS=-lwinsock2
;;
esac
- XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS"
+ XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS $GLX_SYS_LIBS"
AC_SUBST(XWIN_SERVER_NAME)
AC_SUBST(XWIN_SYS_LIBS)
diff --git a/glx/Makefile.am b/glx/Makefile.am
index 6facc2011..bf20e33db 100644
--- a/glx/Makefile.am
+++ b/glx/Makefile.am
@@ -41,11 +41,9 @@ glapi_sources = \
dispatch.h \
glapitable.h \
glapitemp.h \
- glapi.c \
glapi.h \
glapioffsets.h \
glprocs.h \
- glthread.c \
glthread.h
libglxdri_la_SOURCES = \
diff --git a/glx/single2.c b/glx/single2.c
index d8b259269..bbf82552d 100644
--- a/glx/single2.c
+++ b/glx/single2.c
@@ -336,6 +336,9 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
string = (const char *) CALL_GetString( GET_DISPATCH(), (name) );
client = cl->client;
+ if (string == NULL)
+ string = "";
+
/*
** Restrict extensions to those that are supported by both the
** implementation and the connection. That is, return the
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 79afec366..fc5ea9309 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -131,6 +131,9 @@ const char *
winGetBaseDir(void);
#endif
+static
+void glx_debugging(void);
+
/*
* For the depth 24 pixmap we default to 32 bits per pixel, but
* we change this pixmap format later if we detect that the display
@@ -1028,6 +1031,8 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
* Apply locale specified in LANG environment variable.
*/
setlocale (LC_ALL, "");
+
+ glx_debugging();
}
#endif
@@ -1035,3 +1040,22 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
winDebug ("InitOutput - Returning.\n");
#endif
}
+
+/* GLX debugging helpers */
+#include <../glx/glapi.h>
+
+static
+void warn_func(void * p1, const char *format, ...) {
+ va_list v;
+ va_start(v, format);
+ vfprintf(stderr, format, v);
+ va_end(v);
+ fprintf(stderr,"\n");
+}
+
+static
+void glx_debugging(void)
+{
+ _glapi_set_warning_func(warn_func);
+ _glapi_noop_enable_warnings(TRUE);
+}