summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-02-03 01:46:39 -0500
committerMarge Bot <eric+marge@anholt.net>2021-02-06 05:41:23 +0000
commit7d76b912bc382840cdc9fba0b44d09030f232c83 (patch)
tree9d445f18a548e738e3d355a4b986ca2f57087788
parent77d111fcbf8adcc8cdef7506bbaa3d844aa58668 (diff)
winsys/amdgpu: don't inc/dec num_active_ioctls for backing BOs of sparse BOs
It's not correct. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8849>
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_cs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index baeaa649ccc..fb0954ae38c 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -1420,7 +1420,6 @@ static bool amdgpu_add_sparse_backing_buffers(struct amdgpu_cs_context *cs)
cs->real_buffers[idx].usage = buffer->usage & ~RADEON_USAGE_SYNCHRONIZED;
cs->real_buffers[idx].u.real.priority_usage = buffer->u.real.priority_usage;
- p_atomic_inc(&backing->bo->num_active_ioctls);
}
simple_mtx_unlock(&bo->lock);
@@ -1440,6 +1439,7 @@ static void amdgpu_cs_submit_ib(void *job, int thread_index)
bool has_user_fence = amdgpu_cs_has_user_fence(cs);
bool use_bo_list_create = ws->info.drm_minor < 27;
struct drm_amdgpu_bo_list_in bo_list_in;
+ unsigned initial_num_real_buffers = cs->num_real_buffers;
#if DEBUG
/* Prepare the buffer list. */
@@ -1721,7 +1721,8 @@ cleanup:
cs->error_code = r;
- for (i = 0; i < cs->num_real_buffers; i++)
+ /* Only decrement num_active_ioctls for those buffers where we incremented it. */
+ for (i = 0; i < initial_num_real_buffers; i++)
p_atomic_dec(&cs->real_buffers[i].bo->num_active_ioctls);
for (i = 0; i < cs->num_slab_buffers; i++)
p_atomic_dec(&cs->slab_buffers[i].bo->num_active_ioctls);