mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
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:
parent
d6ddc33f07
commit
9cf5945b83
4 changed files with 21 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ struct intel_context
|
|||
|
||||
GLuint last_fence;
|
||||
GLuint last_swap_fence;
|
||||
GLboolean last_swap_fence_retired;
|
||||
|
||||
struct intel_batchbuffer *batch;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue