Mesa (master): winsys/amdgpu: disallow pb_cache for backing buffers of sparse buffers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Feb 13 04:54:58 UTC 2021


Module: Mesa
Branch: master
Commit: 8481a3414f690a57252097370a2f722ceb395a70
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8481a3414f690a57252097370a2f722ceb395a70

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Feb  6 00:32:31 2021 -0500

winsys/amdgpu: disallow pb_cache for backing buffers of sparse buffers

because amdgpu_bo_wait doesn't wait for active CS jobs using the buffers.
This fixes incorrect buffer reuse of busy buffers.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8895>

---

 src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index 0963690c689..abf1e7d75a9 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -968,7 +968,11 @@ sparse_backing_alloc(struct amdgpu_winsys_bo *bo, uint32_t *pstart_page, uint32_
 
       buf = amdgpu_bo_create(bo->ws, size, RADEON_SPARSE_PAGE_SIZE,
                              bo->base.placement,
-                             (bo->base.usage & ~RADEON_FLAG_SPARSE) | RADEON_FLAG_NO_SUBALLOC);
+                             (bo->base.usage & ~RADEON_FLAG_SPARSE &
+                              /* Set the interprocess sharing flag to disable pb_cache because
+                               * amdgpu_bo_wait doesn't wait for active CS jobs.
+                               */
+                              ~RADEON_FLAG_NO_INTERPROCESS_SHARING) | RADEON_FLAG_NO_SUBALLOC);
       if (!buf) {
          FREE(best_backing->chunks);
          FREE(best_backing);



More information about the mesa-commit mailing list