Module: Mesa Branch: main Commit: b2b7603ecbf35b5c805d5bf5bcc51f85bc5ca8e2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b2b7603ecbf35b5c805d5bf5bcc51f85bc5ca8e2
Author: Marek Olšák <[email protected]> Date: Sun Jan 7 16:07:35 2024 -0500 winsys/amdgpu: don't clear fence list elements after IB submission Same idea as with the buffer lists. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27060> --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index acdad8bca0d..c67322b4681 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -882,7 +882,7 @@ static bool amdgpu_init_cs_context(struct amdgpu_winsys *ws, static void cleanup_fence_list(struct amdgpu_fence_list *fences) { for (unsigned i = 0; i < fences->num; i++) - amdgpu_fence_reference(&fences->list[i], NULL); + amdgpu_fence_drop_reference(fences->list[i]); fences->num = 0; } @@ -1181,11 +1181,8 @@ static void add_fence_to_list(struct amdgpu_fence_list *fences, fences->max = idx + increment; size = fences->max * sizeof(fences->list[0]); fences->list = realloc(fences->list, size); - /* Clear the newly-allocated elements. */ - memset(fences->list + idx, 0, - increment * sizeof(fences->list[0])); } - amdgpu_fence_reference(&fences->list[idx], (struct pipe_fence_handle*)fence); + amdgpu_fence_set_reference(&fences->list[idx], (struct pipe_fence_handle*)fence); } static void amdgpu_cs_add_fence_dependency(struct radeon_cmdbuf *rcs,
