From f0d31eda2544099864781acbb69588a1756d1912 Mon Sep 17 00:00:00 2001 From: Yogesh Mohan Marimuthu Date: Thu, 24 Oct 2024 20:18:32 +0530 Subject: [PATCH] winsys/amdgpu: keep has_local_buffers true for userq MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In case of userqueue, kernel bo kms_handle will not hold fences for non shared bo. Non shared bo fences are taken care within mesa. Hence need to copy the data to another shared buffer for export. Keeping has_local_buffers true for userq will make non shared bo to be copied to shared bo for export in si_texture_get_handle(). Reviewed-by: Marek Olšák Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c index 639e57b5c85..053815a4416 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c @@ -39,10 +39,6 @@ static bool do_winsys_init(struct amdgpu_winsys *aws, if (!ac_query_gpu_info(fd, aws->dev, &aws->info, false)) goto fail; - /* TODO: Enable this once the kernel handles it efficiently. */ - if (aws->info.has_dedicated_vram) - aws->info.has_local_buffers = false; - aws->addrlib = ac_addrlib_create(&aws->info, &aws->info.max_alignment); if (!aws->addrlib) { fprintf(stderr, "amdgpu: Cannot create addrlib.\n"); @@ -65,6 +61,10 @@ static bool do_winsys_init(struct amdgpu_winsys *aws, for (unsigned i = 0; i < ARRAY_SIZE(aws->queues); i++) simple_mtx_init(&aws->queues[i].userq.lock, mtx_plain); + /* TODO: Enable this once the kernel handles it efficiently. */ + if (aws->info.has_dedicated_vram && !aws->info.use_userq) + aws->info.has_local_buffers = false; + return true; fail: