diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c index 1545fd82637..f59b5399e4c 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c @@ -593,18 +593,20 @@ static int radeon_drm_cs_flush(struct radeon_winsys_cs *rcs, fence = radeon_cs_create_fence(rcs); } - if (pfence) - radeon_fence_reference(pfence, fence); - - mtx_lock(&cs->ws->bo_fence_lock); - for (unsigned i = 0; i < cs->csc->num_slab_buffers; ++i) { - struct radeon_bo *bo = cs->csc->slab_buffers[i].bo; - p_atomic_inc(&bo->num_active_ioctls); - radeon_bo_slab_fence(bo, (struct radeon_bo *)fence); - } - mtx_unlock(&cs->ws->bo_fence_lock); + if (fence) { + if (pfence) + radeon_fence_reference(pfence, fence); + + mtx_lock(&cs->ws->bo_fence_lock); + for (unsigned i = 0; i < cs->csc->num_slab_buffers; ++i) { + struct radeon_bo *bo = cs->csc->slab_buffers[i].bo; + p_atomic_inc(&bo->num_active_ioctls); + radeon_bo_slab_fence(bo, (struct radeon_bo *)fence); + } + mtx_unlock(&cs->ws->bo_fence_lock); - radeon_fence_reference(&fence, NULL); + radeon_fence_reference(&fence, NULL); + } } else { radeon_fence_reference(&cs->next_fence, NULL); } |