Age the last_swap_fence properly.

Should be safe unless the client idles without rendering for some
time, while another client renders.
This commit is contained in:
Thomas Hellström 2006-03-29 13:20:50 +00:00
parent d6ddc33f07
commit 9cf5945b83
4 changed files with 21 additions and 1 deletions

View file

@ -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;
}
}
}

View file

@ -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 );
}

View file

@ -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 );

View file

@ -172,6 +172,7 @@ struct intel_context
GLuint last_fence;
GLuint last_swap_fence;
GLboolean last_swap_fence_retired;
struct intel_batchbuffer *batch;