Mesa (master): winsys/amdgpu: move amdgpu_winsys_bo::use_reusable_pool to the u.real union

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Feb 6 05:57:18 UTC 2021


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Feb  3 00:03:22 2021 -0500

winsys/amdgpu: move amdgpu_winsys_bo::use_reusable_pool to the u.real union

It's never true with slab and sparse 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/8849>

---

 src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 6 +++---
 src/gallium/winsys/amdgpu/drm/amdgpu_bo.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index 8cb785be064..0963690c689 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -237,7 +237,7 @@ static void amdgpu_bo_destroy_or_cache(struct pb_buffer *_buf)
 
    assert(bo->bo); /* slab buffers have a separate vtbl */
 
-   if (bo->use_reusable_pool)
+   if (bo->u.real.use_reusable_pool)
       pb_cache_add_buffer(bo->cache_entry);
    else
       amdgpu_bo_destroy(_buf);
@@ -502,7 +502,7 @@ static struct amdgpu_winsys_bo *amdgpu_create_bo(struct amdgpu_winsys *ws,
    }
 
    if (init_pb_cache) {
-      bo->use_reusable_pool = true;
+      bo->u.real.use_reusable_pool = true;
       pb_cache_init_entry(&ws->bo_cache, bo->cache_entry, &bo->base,
                           heap);
    }
@@ -1629,7 +1629,7 @@ static bool amdgpu_bo_get_handle(struct radeon_winsys *rws,
    if (!bo->bo)
       return false;
 
-   bo->use_reusable_pool = false;
+   bo->u.real.use_reusable_pool = false;
 
    switch (whandle->type) {
    case WINSYS_HANDLE_TYPE_SHARED:
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h
index 176d2e1583b..cdd0ffda466 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h
@@ -68,6 +68,7 @@ struct amdgpu_winsys_bo {
          int map_count;
 
          bool is_user_ptr;
+         bool use_reusable_pool;
 
          /* Whether buffer_get_handle or buffer_from_handle has been called,
           * it can only transition from false to true. Protected by lock.
@@ -94,7 +95,6 @@ struct amdgpu_winsys_bo {
    struct amdgpu_winsys *ws;
 
    amdgpu_bo_handle bo; /* NULL for slab entries and sparse buffers */
-   bool use_reusable_pool;
 
    uint32_t unique_id;
    uint64_t va;



More information about the mesa-commit mailing list