summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/glx
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-01-08 15:42:57 +0000
committerJosé Fonseca <jfonseca@vmware.com>2010-01-08 15:42:57 +0000
commit080c40ab32b2abd6d8381b4a0cc143d36a1652b2 (patch)
treee173767ebc5a82d81b9fc086449d915e29348976 /src/gallium/state_trackers/glx
parent9cdf6f025b2ed55cfb13dd09f870f01d0c7947d3 (diff)
parenta1de400e8de06a80ab140bb0fa950e990607572d (diff)
Merge remote branch 'origin/master' into lp-binning
Conflicts: src/gallium/auxiliary/util/u_surface.c src/gallium/drivers/llvmpipe/Makefile src/gallium/drivers/llvmpipe/SConscript src/gallium/drivers/llvmpipe/lp_bld_arit.c src/gallium/drivers/llvmpipe/lp_bld_flow.c src/gallium/drivers/llvmpipe/lp_bld_interp.c src/gallium/drivers/llvmpipe/lp_clear.c src/gallium/drivers/llvmpipe/lp_context.c src/gallium/drivers/llvmpipe/lp_context.h src/gallium/drivers/llvmpipe/lp_draw_arrays.c src/gallium/drivers/llvmpipe/lp_jit.c src/gallium/drivers/llvmpipe/lp_jit.h src/gallium/drivers/llvmpipe/lp_prim_vbuf.c src/gallium/drivers/llvmpipe/lp_setup.c src/gallium/drivers/llvmpipe/lp_setup_point.c src/gallium/drivers/llvmpipe/lp_state.h src/gallium/drivers/llvmpipe/lp_state_blend.c src/gallium/drivers/llvmpipe/lp_state_derived.c src/gallium/drivers/llvmpipe/lp_state_fs.c src/gallium/drivers/llvmpipe/lp_state_sampler.c src/gallium/drivers/llvmpipe/lp_state_surface.c src/gallium/drivers/llvmpipe/lp_tex_cache.c src/gallium/drivers/llvmpipe/lp_tex_cache.h src/gallium/drivers/llvmpipe/lp_tex_sample.h src/gallium/drivers/llvmpipe/lp_tile_cache.c
Diffstat (limited to 'src/gallium/state_trackers/glx')
-rw-r--r--src/gallium/state_trackers/glx/xlib/glx_api.c11
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.c23
2 files changed, 26 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c
index 556eefb1b1..228ac9a20e 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -644,6 +644,7 @@ register_with_display(Display *dpy)
XExtCodes *c = XAddExtension(dpy);
ext = dpy->ext_procs; /* new extension is at head of list */
assert(c->extension == ext->codes.extension);
+ (void) c;
ext->name = _mesa_strdup(extName);
ext->close_display = close_display_callback;
}
@@ -1311,13 +1312,15 @@ glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
Bool
glXQueryExtension( Display *dpy, int *errorBase, int *eventBase )
{
+ int op, ev, err;
/* Mesa's GLX isn't really an X extension but we try to act like one. */
- (void) dpy;
+ if (!XQueryExtension(dpy, GLX_EXTENSION_NAME, &op, &ev, &err))
+ ev = err = 0;
if (errorBase)
- *errorBase = 0;
+ *errorBase = err;
if (eventBase)
- *eventBase = 0;
- return True;
+ *eventBase = ev;
+ return True; /* we're faking GLX so always return success */
}
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c
index c76dfb31d2..1783bc504d 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
@@ -67,6 +67,10 @@
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
+#include "trace/tr_screen.h"
+#include "trace/tr_context.h"
+#include "trace/tr_texture.h"
+
#include "xm_winsys.h"
#include <GL/glx.h>
@@ -87,6 +91,8 @@ void xmesa_set_driver( const struct xm_driver *templ )
*/
pipe_mutex _xmesa_lock;
+static struct pipe_screen *_screen = NULL;
+static struct pipe_screen *screen = NULL;
/**********************************************************************/
@@ -754,7 +760,7 @@ PUBLIC
XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
{
static GLboolean firstTime = GL_TRUE;
- static struct pipe_screen *screen = NULL;
+ struct pipe_context *_pipe = NULL;
struct pipe_context *pipe = NULL;
XMesaContext c;
GLcontext *mesaCtx;
@@ -762,7 +768,8 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
if (firstTime) {
pipe_mutex_init(_xmesa_lock);
- screen = driver.create_pipe_screen();
+ _screen = driver.create_pipe_screen();
+ screen = trace_screen_create( _screen );
firstTime = GL_FALSE;
}
@@ -781,9 +788,11 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
if (screen == NULL)
goto fail;
- pipe = driver.create_pipe_context(screen, (void *) c);
- if (pipe == NULL)
+ _pipe = driver.create_pipe_context(_screen, (void *) c);
+ if (_pipe == NULL)
goto fail;
+ pipe = trace_context_create(screen, _pipe);
+ pipe->priv = c;
c->st = st_create_context(pipe,
&v->mesa_visual,
@@ -1110,6 +1119,12 @@ void XMesaSwapBuffers( XMesaBuffer b )
st_swapbuffers(b->stfb, &frontLeftSurf, NULL);
if (frontLeftSurf) {
+ if (_screen != screen) {
+ struct trace_surface *tr_surf = trace_surface( frontLeftSurf );
+ struct pipe_surface *surf = tr_surf->surface;
+ frontLeftSurf = surf;
+ }
+
driver.display_surface(b, frontLeftSurf);
}