From d9e5e8f5fc715f6595d1b2ad5ea24ab2ff8650b3 Mon Sep 17 00:00:00 2001 From: Yogesh Mohan Marimuthu Date: Mon, 7 Jul 2025 13:44:06 +0530 Subject: [PATCH] winsys/amdgpu: pass r/w bo to w/r list in userq_wait ioctl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bo with write usage should wait for read and write fence. bo with read usage should wait for write fence. Currently wrote bos are passed to write list and read bos are passed to read like. This patch fixes the issue. Reviewed-by: Marek Olšák Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp index 88d8f2cd05a..7d5005be04c 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp @@ -1495,13 +1495,15 @@ static int amdgpu_cs_submit_ib_userq(struct amdgpu_userq *userq, .syncobj_handles = (uintptr_t)syncobj_dependencies_list, .syncobj_timeline_handles = (uintptr_t)&syncobj_timeline_dependency, .syncobj_timeline_points = (uintptr_t)&syncobj_timeline_dependency_point, - .bo_read_handles = (uintptr_t)shared_buf_kms_handles_read, - .bo_write_handles = (uintptr_t)shared_buf_kms_handles_write, + /* Wait for previous reads/writes to complete before writing to these BOs. */ + .bo_read_handles = (uintptr_t)shared_buf_kms_handles_write, + /* Wait for previous writes to complete before reading from these BOs. */ + .bo_write_handles = (uintptr_t)shared_buf_kms_handles_read, .num_syncobj_timeline_handles = num_syncobj_timeline_dependencies, .num_fences = 0, .num_syncobj_handles = num_syncobj_dependencies, - .num_bo_read_handles = num_shared_buf_read, - .num_bo_write_handles = num_shared_buf_write, + .num_bo_read_handles = num_shared_buf_write, + .num_bo_write_handles = num_shared_buf_read, .out_fences = (uintptr_t)NULL, };