diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2006-03-24 14:42:04 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2006-03-24 14:42:04 +0000 |
commit | 1854ebe77ebfc2a92912b018ae553f8e0228d3b1 (patch) | |
tree | b4aa0f4943af26f20ec5fbe0a0d7a078b0902ae4 | |
parent | 3500f2e3c4a1a18298d0ee3124631d6f218daddf (diff) |
more fixes and clean-up in intelCopyBuffer()
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_blit.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_blit.c b/src/mesa/drivers/dri/i915/intel_blit.c index e02b581192..271a9eda1f 100644 --- a/src/mesa/drivers/dri/i915/intel_blit.c +++ b/src/mesa/drivers/dri/i915/intel_blit.c @@ -50,25 +50,22 @@ */ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv ) { + GET_CURRENT_CONTEXT(ctx); struct intel_context *intel; DBG("%s\n", __FUNCTION__); assert(dPriv); - assert(dPriv->driContextPriv); - assert(dPriv->driContextPriv->driverPrivate); -#if 00 - /* XXX This context may not be the current one! Leads to nested locking - * if threading. + /* We need a rendering context in order to issue the blit cmd. + * Use the current context. + * XXX need to fix this someday. */ - intel = (struct intel_context *) dPriv->driContextPriv->driverPrivate; -#else - { - GET_CURRENT_CONTEXT(ctx); - intel = (struct intel_context *) ctx; + if (!ctx) { + _mesa_problem(NULL, "No current context in intelCopyBuffer()"); + return; } -#endif + intel = (struct intel_context *) ctx; bmFinishFence(intel->bm, intel->last_swap_fence); @@ -81,8 +78,6 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv ) intel->driDrawable->numClipRects) { const intelScreenPrivate *intelScreen = intel->intelScreen; - /* XXX why are we declaring a new dPriv (already passed as param!) */ - const __DRIdrawablePrivate *dPriv = intel->driDrawable; struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate; const struct intel_region *frontRegion @@ -92,7 +87,7 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv ) const int nbox = dPriv->numClipRects; const drm_clip_rect_t *pbox = dPriv->pClipRects; const int pitch = frontRegion->pitch; - const int cpp= frontRegion->cpp; + const int cpp = frontRegion->cpp; int BR13, CMD; int i; |