mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-01-04 05:10:20 +01:00
Manage fences in user-mode bufmgr_fake to clean buffers
When using bufmgr_fake without DRM, the X server idles the ring whenever it wants to wait for something to complete (brutal, but effective). In this case, bufmgr_fake must treat the pending fence as having passed. However, it wasn't recording the fences as it emitted them, nor cleaning buffers as they passed. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
3169d9639b
commit
94c88c151c
1 changed files with 7 additions and 4 deletions
|
|
@ -256,8 +256,10 @@ _fence_emit_internal(dri_bufmgr_fake *bufmgr_fake)
|
|||
struct drm_i915_irq_emit ie;
|
||||
int ret, seq = 1;
|
||||
|
||||
if (bufmgr_fake->fence_emit != NULL)
|
||||
return bufmgr_fake->fence_emit(bufmgr_fake->fence_priv);
|
||||
if (bufmgr_fake->fence_emit != NULL) {
|
||||
seq = bufmgr_fake->fence_emit(bufmgr_fake->fence_priv);
|
||||
return seq;
|
||||
}
|
||||
|
||||
ie.irq_seq = &seq;
|
||||
ret = drmCommandWriteRead(bufmgr_fake->fd, DRM_I915_IRQ_EMIT,
|
||||
|
|
@ -268,8 +270,7 @@ _fence_emit_internal(dri_bufmgr_fake *bufmgr_fake)
|
|||
}
|
||||
|
||||
DBG("emit 0x%08x\n", seq);
|
||||
bufmgr_fake->last_fence = seq;
|
||||
return bufmgr_fake->last_fence;
|
||||
return seq;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -282,6 +283,7 @@ _fence_wait_internal(dri_bufmgr_fake *bufmgr_fake, int seq)
|
|||
|
||||
if (bufmgr_fake->fence_wait != NULL) {
|
||||
bufmgr_fake->fence_wait(seq, bufmgr_fake->fence_priv);
|
||||
clear_fenced(bufmgr_fake, seq);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -571,6 +573,7 @@ static int clear_fenced(dri_bufmgr_fake *bufmgr_fake,
|
|||
struct block *block, *tmp;
|
||||
int ret = 0;
|
||||
|
||||
bufmgr_fake->last_fence = fence_cookie;
|
||||
DRMLISTFOREACHSAFE(block, tmp, &bufmgr_fake->fenced) {
|
||||
assert(block->fenced);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue