Mesa (master): winsys/radeon: rename radeon_bo_reference -> radeon_ws_bo_reference

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 6 22:53:21 UTC 2021


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Tue Mar 23 02:06:46 2021 -0400

winsys/radeon: rename radeon_bo_reference -> radeon_ws_bo_reference

radeon_bo_reference will be a new function in radeon_winsys.h.

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

---

 src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 14 +++++++-------
 src/gallium/winsys/radeon/drm/radeon_drm_bo.h |  2 +-
 src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 14 +++++++-------
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 0ff282e8519..a56a9b28352 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -83,7 +83,7 @@ static bool radeon_bo_is_busy(struct radeon_bo *bo)
          busy = true;
          break;
       }
-      radeon_bo_reference(&bo->u.slab.fences[num_idle], NULL);
+      radeon_ws_bo_reference(&bo->u.slab.fences[num_idle], NULL);
    }
    memmove(&bo->u.slab.fences[0], &bo->u.slab.fences[num_idle],
          (bo->u.slab.num_fences - num_idle) * sizeof(bo->u.slab.fences[0]));
@@ -110,7 +110,7 @@ static void radeon_bo_wait_idle(struct radeon_bo *bo)
       mtx_lock(&bo->rws->bo_fence_lock);
       while (bo->u.slab.num_fences) {
          struct radeon_bo *fence = NULL;
-         radeon_bo_reference(&fence, bo->u.slab.fences[0]);
+         radeon_ws_bo_reference(&fence, bo->u.slab.fences[0]);
          mtx_unlock(&bo->rws->bo_fence_lock);
 
          /* Wait without holding the fence lock. */
@@ -118,12 +118,12 @@ static void radeon_bo_wait_idle(struct radeon_bo *bo)
 
          mtx_lock(&bo->rws->bo_fence_lock);
          if (bo->u.slab.num_fences && fence == bo->u.slab.fences[0]) {
-            radeon_bo_reference(&bo->u.slab.fences[0], NULL);
+            radeon_ws_bo_reference(&bo->u.slab.fences[0], NULL);
             memmove(&bo->u.slab.fences[0], &bo->u.slab.fences[1],
                   (bo->u.slab.num_fences - 1) * sizeof(bo->u.slab.fences[0]));
             bo->u.slab.num_fences--;
          }
-         radeon_bo_reference(&fence, NULL);
+         radeon_ws_bo_reference(&fence, NULL);
       }
       mtx_unlock(&bo->rws->bo_fence_lock);
    }
@@ -821,7 +821,7 @@ struct pb_slab *radeon_bo_slab_alloc(void *priv, unsigned heap,
    return &slab->base;
 
 fail_buffer:
-   radeon_bo_reference(&slab->buffer, NULL);
+   radeon_ws_bo_reference(&slab->buffer, NULL);
 fail:
    FREE(slab);
    return NULL;
@@ -834,12 +834,12 @@ void radeon_bo_slab_free(void *priv, struct pb_slab *pslab)
    for (unsigned i = 0; i < slab->base.num_entries; ++i) {
       struct radeon_bo *bo = &slab->entries[i];
       for (unsigned j = 0; j < bo->u.slab.num_fences; ++j)
-         radeon_bo_reference(&bo->u.slab.fences[j], NULL);
+         radeon_ws_bo_reference(&bo->u.slab.fences[j], NULL);
       FREE(bo->u.slab.fences);
    }
 
    FREE(slab->entries);
-   radeon_bo_reference(&slab->buffer, NULL);
+   radeon_ws_bo_reference(&slab->buffer, NULL);
    FREE(slab);
 }
 
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.h b/src/gallium/winsys/radeon/drm/radeon_drm_bo.h
index 98d1d04b9d9..84052f43b69 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.h
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.h
@@ -87,7 +87,7 @@ struct pb_slab *radeon_bo_slab_alloc(void *priv, unsigned heap,
 void radeon_bo_slab_free(void *priv, struct pb_slab *slab);
 
 static inline
-void radeon_bo_reference(struct radeon_bo **dst, struct radeon_bo *src)
+void radeon_ws_bo_reference(struct radeon_bo **dst, struct radeon_bo *src)
 {
    pb_reference((struct pb_buffer**)dst, (struct pb_buffer*)src);
 }
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
index 31aded6db9c..4bddf7310a5 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
@@ -135,11 +135,11 @@ static void radeon_cs_context_cleanup(struct radeon_cs_context *csc)
 
    for (i = 0; i < csc->num_relocs; i++) {
       p_atomic_dec(&csc->relocs_bo[i].bo->num_cs_references);
-      radeon_bo_reference(&csc->relocs_bo[i].bo, NULL);
+      radeon_ws_bo_reference(&csc->relocs_bo[i].bo, NULL);
    }
    for (i = 0; i < csc->num_slab_buffers; ++i) {
       p_atomic_dec(&csc->slab_buffers[i].bo->num_cs_references);
-      radeon_bo_reference(&csc->slab_buffers[i].bo, NULL);
+      radeon_ws_bo_reference(&csc->slab_buffers[i].bo, NULL);
    }
 
    csc->num_relocs = 0;
@@ -289,7 +289,7 @@ static unsigned radeon_lookup_or_add_real_buffer(struct radeon_drm_cs *cs,
    /* Initialize the new relocation. */
    csc->relocs_bo[csc->num_relocs].bo = NULL;
    csc->relocs_bo[csc->num_relocs].u.real.priority_usage = 0;
-   radeon_bo_reference(&csc->relocs_bo[csc->num_relocs].bo, bo);
+   radeon_ws_bo_reference(&csc->relocs_bo[csc->num_relocs].bo, bo);
    p_atomic_inc(&bo->num_cs_references);
    reloc = &csc->relocs[csc->num_relocs];
    reloc->handle = bo->handle;
@@ -342,7 +342,7 @@ static int radeon_lookup_or_add_slab_buffer(struct radeon_drm_cs *cs,
 
    item->bo = NULL;
    item->u.slab.real_idx = real_idx;
-   radeon_bo_reference(&item->bo, bo);
+   radeon_ws_bo_reference(&item->bo, bo);
    p_atomic_inc(&bo->num_cs_references);
 
    hash = bo->hash & (ARRAY_SIZE(csc->reloc_indices_hashlist)-1);
@@ -423,7 +423,7 @@ static bool radeon_drm_cs_validate(struct radeon_cmdbuf *rcs)
 
       for (i = cs->csc->num_validated_relocs; i < cs->csc->num_relocs; i++) {
          p_atomic_dec(&cs->csc->relocs_bo[i].bo->num_cs_references);
-         radeon_bo_reference(&cs->csc->relocs_bo[i].bo, NULL);
+         radeon_ws_bo_reference(&cs->csc->relocs_bo[i].bo, NULL);
       }
       cs->csc->num_relocs = cs->csc->num_validated_relocs;
 
@@ -536,7 +536,7 @@ static void radeon_bo_slab_fence(struct radeon_bo *bo, struct radeon_bo *fence)
          bo->u.slab.fences[dst] = bo->u.slab.fences[src];
          dst++;
       } else {
-         radeon_bo_reference(&bo->u.slab.fences[src], NULL);
+         radeon_ws_bo_reference(&bo->u.slab.fences[src], NULL);
       }
    }
    bo->u.slab.num_fences = dst;
@@ -558,7 +558,7 @@ static void radeon_bo_slab_fence(struct radeon_bo *bo, struct radeon_bo *fence)
 
    /* Add the new fence */
    bo->u.slab.fences[bo->u.slab.num_fences] = NULL;
-   radeon_bo_reference(&bo->u.slab.fences[bo->u.slab.num_fences], fence);
+   radeon_ws_bo_reference(&bo->u.slab.fences[bo->u.slab.num_fences], fence);
    bo->u.slab.num_fences++;
 }
 



More information about the mesa-commit mailing list