summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/xlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys/xlib')
-rw-r--r--src/gallium/winsys/xlib/Makefile4
-rw-r--r--src/gallium/winsys/xlib/SConscript50
-rw-r--r--src/gallium/winsys/xlib/xm_api.c14
3 files changed, 44 insertions, 24 deletions
diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile
index c4433309420..ec92c790685 100644
--- a/src/gallium/winsys/xlib/Makefile
+++ b/src/gallium/winsys/xlib/Makefile
@@ -1,5 +1,9 @@
# src/gallium/winsys/xlib/Makefile
+# This makefile produces a "stand-alone" libGL.so which is based on
+# Xlib (no DRI HW acceleration)
+
+
TOP = ../../../..
include $(TOP)/configs/current
diff --git a/src/gallium/winsys/xlib/SConscript b/src/gallium/winsys/xlib/SConscript
index 218b89285f7..5e98a36abc2 100644
--- a/src/gallium/winsys/xlib/SConscript
+++ b/src/gallium/winsys/xlib/SConscript
@@ -3,30 +3,32 @@
Import('*')
-env = env.Clone()
+if env['platform'] == 'linux' and 'mesa' in env['statetrackers'] and not env['dri']:
-env.Append(CPPPATH = [
- '#/src/mesa',
- '#/src/mesa/main',
-])
+ env = env.Clone()
-sources = [
- 'glxapi.c',
- 'fakeglx.c',
- 'xfonts.c',
- 'xm_api.c',
- 'xm_winsys.c',
- 'xm_winsys_aub.c',
- 'brw_aub.c',
-]
-
-drivers = [
- softpipe,
-]
+ env.Append(CPPPATH = [
+ '#/src/mesa',
+ '#/src/mesa/main',
+ ])
-# TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
-env.SharedLibrary(
- target ='GL',
- source = sources,
- LIBS = glapi + mesa + drivers + auxiliaries + env['LIBS'],
-)
+ sources = [
+ 'glxapi.c',
+ 'fakeglx.c',
+ 'xfonts.c',
+ 'xm_api.c',
+ 'xm_winsys.c',
+ 'xm_winsys_aub.c',
+ 'brw_aub.c',
+ ]
+
+ drivers = [
+ softpipe,
+ ]
+
+ # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
+ env.SharedLibrary(
+ target ='GL',
+ source = sources,
+ LIBS = glapi + mesa + drivers + auxiliaries + env['LIBS'],
+ )
diff --git a/src/gallium/winsys/xlib/xm_api.c b/src/gallium/winsys/xlib/xm_api.c
index 26b722f3439..8a32c54349b 100644
--- a/src/gallium/winsys/xlib/xm_api.c
+++ b/src/gallium/winsys/xlib/xm_api.c
@@ -797,8 +797,14 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
pipe = xmesa_create_i965simple(xmesa_get_pipe_winsys_aub(v));
}
+ if (pipe == NULL)
+ goto fail;
+
c->st = st_create_context(pipe, &v->mesa_visual,
share_list ? share_list->st : NULL);
+ if (c->st == NULL)
+ goto fail;
+
mesaCtx = c->st->ctx;
c->st->ctx->DriverCtx = c;
@@ -818,6 +824,14 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
#endif
return c;
+
+ fail:
+ if (c->st)
+ st_destroy_context(c->st);
+ if (pipe)
+ pipe->destroy(pipe);
+ FREE(c);
+ return NULL;
}