diff options
author | Thomas Hellström <thomas@tungstengraphics.com> | 2006-03-29 13:20:50 +0000 |
---|---|---|
committer | Thomas Hellström <thomas@tungstengraphics.com> | 2006-03-29 13:20:50 +0000 |
commit | 9cf5945b836fe7eea707ec0b00a11270a059fa2d (patch) | |
tree | abf196e14c4aee6c01bbd73e0028b0b61938fb24 | |
parent | d6ddc33f072a49c5745eec65cf5b4ec25936986f (diff) |
Age the last_swap_fence properly.
Should be safe unless the client idles without rendering for some
time, while another client renders.
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_batchbuffer.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_blit.c | 9 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_context.c | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_context.h | 1 |
4 files changed, 21 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/src/mesa/drivers/dri/i915/intel_batchbuffer.c index 2fefdd4ee7..9f875c6b34 100644 --- a/src/mesa/drivers/dri/i915/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.c @@ -175,6 +175,17 @@ static void do_flush_locked( struct intel_batchbuffer *batch, allow_unlock); #endif batch->last_fence = bmFenceBufferList(batch->bm, batch->list); + if (!batch->intel->last_swap_fence_retired) { + int retired; + drmFence dFence = {0,batch->intel->last_swap_fence}; + + /*FIXME: Temporary fix for fence ageing + * + */ + if (!drmTestFence(batch->intel->driFd, dFence, 0, &retired)) { + batch->intel->last_swap_fence_retired = retired; + } + } } diff --git a/src/mesa/drivers/dri/i915/intel_blit.c b/src/mesa/drivers/dri/i915/intel_blit.c index aefc3b3918..6c0c666f55 100644 --- a/src/mesa/drivers/dri/i915/intel_blit.c +++ b/src/mesa/drivers/dri/i915/intel_blit.c @@ -67,7 +67,13 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv ) } intel = (struct intel_context *) ctx; - bmFinishFence(intel->bm, intel->last_swap_fence); + /* FIXME: Temporary fix for fence ageing. + * + */ + + if (!intel->last_swap_fence_retired) { + bmFinishFence(intel->bm, intel->last_swap_fence); + } /* The LOCK_HARDWARE is required for the cliprects. Buffer offsets * should work regardless. @@ -138,6 +144,7 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv ) } intel->last_swap_fence = intel_batchbuffer_flush( intel->batch ); + intel->last_swap_fence_retired = GL_FALSE; } UNLOCK_HARDWARE( intel ); } diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index 4e7e5b82eb..c699e6a8fb 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -422,6 +422,7 @@ GLboolean intelInitContext( struct intel_context *intel, intelScreen->height); intel->batch = intel_batchbuffer_alloc( intel ); + intel->last_swap_fence_retired = GL_TRUE; intel->last_swap_fence = bmInitFence(intel->bm); intel_bufferobj_init( intel ); intel_fbo_init( intel ); diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index ce6d9fa360..df44db83d4 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -172,6 +172,7 @@ struct intel_context GLuint last_fence; GLuint last_swap_fence; + GLboolean last_swap_fence_retired; struct intel_batchbuffer *batch; |