From 0800342296fb9eeb6bac8f24965441dff0e71812 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 6 Nov 2007 10:05:01 -0700 Subject: Remove last of core Mesa dependencies in intel_swapbuffers.c Use the "dummyContext" pointer (for now) instead of GET_CURRENT_CONTEXT(). --- .../drivers/dri/intel_winsys/intel_swapbuffers.c | 45 +++------------------- 1 file changed, 5 insertions(+), 40 deletions(-) (limited to 'src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c') diff --git a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c index 8e0f1113b8..9fcb2dac27 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c @@ -31,7 +31,6 @@ #include "intel_batchbuffer.h" #include "intel_reg.h" #include "intel_winsys.h" -#include "context.h" #include "pipe/p_context.h" #include "state_tracker/st_public.h" @@ -39,39 +38,6 @@ #include "state_tracker/st_cb_fbo.h" - -/** Cast wrapper */ -static INLINE struct intel_context * -intel_context_mesa(GLcontext * ctx) -{ - return (struct intel_context *) ctx->DriverCtx; -} - - -/** XXX temporary - want to get rid of this */ -static struct intel_context * -intelScreenContext(struct intel_screen *intelScreen) -{ - /* - * This should probably change to have the screen allocate a dummy - * context at screen creation. For now just use the current context. - */ - - GET_CURRENT_CONTEXT(ctx); - if (ctx == NULL) { - /* need a context for the first time makecurrent is called (for hw lock - when allocating priv buffers) */ - if (intelScreen->dummyctxptr == NULL) { - _mesa_problem(NULL, "No current context in intelScreenContext\n"); - return NULL; - } - return intelScreen->dummyctxptr; - } - - return intel_context_mesa(ctx); -} - - /** * Display a colorbuffer surface in an X window. * Used for SwapBuffers and flushing front buffer rendering. @@ -86,18 +52,17 @@ intelDisplaySurface(__DRIdrawablePrivate *dPriv, const drm_clip_rect_t *rect) { struct intel_screen *intelScreen = intel_screen(dPriv->driScreenPriv); - struct intel_context *intel; + struct intel_context *intel = intelScreen->dummyContext; DBG(SWAP, "%s\n", __FUNCTION__); - assert(dPriv); - - intel = intelScreenContext(intelScreen); - if (!intel) + if (!intel) { + /* XXX this is where some kind of extra/meta context could be useful */ return; + } if (intel->last_swap_fence) { - driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE); + driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, TRUE); driFenceUnReference(intel->last_swap_fence); intel->last_swap_fence = NULL; } -- cgit v1.2.3