[8/9] winsys/amdgpu: rename rfence, rsrc, rdst -> afence, asrc, adst

Submitted by Marek Olšák on Jan. 19, 2019, 12:40 a.m.

Details

Message ID 20190119004022.6950-8-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák Jan. 19, 2019, 12:40 a.m.
From: Marek Olšák <marek.olsak@amd.com>

---
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 36 +++++++++++------------
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.h | 10 +++----
 2 files changed, 23 insertions(+), 23 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index 72cf1e6c639..b4e62acbae4 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -165,99 +165,99 @@  static int amdgpu_export_signalled_sync_file(struct radeon_winsys *rws)
    }
 
    amdgpu_cs_destroy_syncobj(ws->dev, syncobj);
    return fd;
 }
 
 static void amdgpu_fence_submitted(struct pipe_fence_handle *fence,
                                    uint64_t seq_no,
                                    uint64_t *user_fence_cpu_address)
 {
-   struct amdgpu_fence *rfence = (struct amdgpu_fence*)fence;
+   struct amdgpu_fence *afence = (struct amdgpu_fence*)fence;
 
-   rfence->fence.fence = seq_no;
-   rfence->user_fence_cpu_address = user_fence_cpu_address;
-   util_queue_fence_signal(&rfence->submitted);
+   afence->fence.fence = seq_no;
+   afence->user_fence_cpu_address = user_fence_cpu_address;
+   util_queue_fence_signal(&afence->submitted);
 }
 
 static void amdgpu_fence_signalled(struct pipe_fence_handle *fence)
 {
-   struct amdgpu_fence *rfence = (struct amdgpu_fence*)fence;
+   struct amdgpu_fence *afence = (struct amdgpu_fence*)fence;
 
-   rfence->signalled = true;
-   util_queue_fence_signal(&rfence->submitted);
+   afence->signalled = true;
+   util_queue_fence_signal(&afence->submitted);
 }
 
 bool amdgpu_fence_wait(struct pipe_fence_handle *fence, uint64_t timeout,
                        bool absolute)
 {
-   struct amdgpu_fence *rfence = (struct amdgpu_fence*)fence;
+   struct amdgpu_fence *afence = (struct amdgpu_fence*)fence;
    uint32_t expired;
    int64_t abs_timeout;
    uint64_t *user_fence_cpu;
    int r;
 
-   if (rfence->signalled)
+   if (afence->signalled)
       return true;
 
    /* Handle syncobjs. */
-   if (amdgpu_fence_is_syncobj(rfence)) {
+   if (amdgpu_fence_is_syncobj(afence)) {
       /* Absolute timeouts are only be used by BO fences, which aren't
        * backed by syncobjs.
        */
       assert(!absolute);
 
-      if (amdgpu_cs_syncobj_wait(rfence->ws->dev, &rfence->syncobj, 1,
+      if (amdgpu_cs_syncobj_wait(afence->ws->dev, &afence->syncobj, 1,
                                  timeout, 0, NULL))
          return false;
 
-      rfence->signalled = true;
+      afence->signalled = true;
       return true;
    }
 
    if (absolute)
       abs_timeout = timeout;
    else
       abs_timeout = os_time_get_absolute_timeout(timeout);
 
    /* The fence might not have a number assigned if its IB is being
     * submitted in the other thread right now. Wait until the submission
     * is done. */
-   if (!util_queue_fence_wait_timeout(&rfence->submitted, abs_timeout))
+   if (!util_queue_fence_wait_timeout(&afence->submitted, abs_timeout))
       return false;
 
-   user_fence_cpu = rfence->user_fence_cpu_address;
+   user_fence_cpu = afence->user_fence_cpu_address;
    if (user_fence_cpu) {
-      if (*user_fence_cpu >= rfence->fence.fence) {
-         rfence->signalled = true;
+      if (*user_fence_cpu >= afence->fence.fence) {
+         afence->signalled = true;
          return true;
       }
 
       /* No timeout, just query: no need for the ioctl. */
       if (!absolute && !timeout)
          return false;
    }
 
    /* Now use the libdrm query. */
-   r = amdgpu_cs_query_fence_status(&rfence->fence,
+   r = amdgpu_cs_query_fence_status(&afence->fence,
 				    abs_timeout,
 				    AMDGPU_QUERY_FENCE_TIMEOUT_IS_ABSOLUTE,
 				    &expired);
    if (r) {
       fprintf(stderr, "amdgpu: amdgpu_cs_query_fence_status failed.\n");
       return false;
    }
 
    if (expired) {
       /* This variable can only transition from false to true, so it doesn't
        * matter if threads race for it. */
-      rfence->signalled = true;
+      afence->signalled = true;
       return true;
    }
    return false;
 }
 
 static bool amdgpu_fence_wait_rel_timeout(struct radeon_winsys *rws,
                                           struct pipe_fence_handle *fence,
                                           uint64_t timeout)
 {
    return amdgpu_fence_wait(fence, timeout, false);
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
index 5de770c89e7..07b5d4b350c 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
@@ -163,35 +163,35 @@  static inline void amdgpu_ctx_unref(struct amdgpu_ctx *ctx)
    if (p_atomic_dec_zero(&ctx->refcount)) {
       amdgpu_cs_ctx_free(ctx->ctx);
       amdgpu_bo_free(ctx->user_fence_bo);
       FREE(ctx);
    }
 }
 
 static inline void amdgpu_fence_reference(struct pipe_fence_handle **dst,
                                           struct pipe_fence_handle *src)
 {
-   struct amdgpu_fence **rdst = (struct amdgpu_fence **)dst;
-   struct amdgpu_fence *rsrc = (struct amdgpu_fence *)src;
+   struct amdgpu_fence **adst = (struct amdgpu_fence **)dst;
+   struct amdgpu_fence *asrc = (struct amdgpu_fence *)src;
 
-   if (pipe_reference(&(*rdst)->reference, &rsrc->reference)) {
-      struct amdgpu_fence *fence = *rdst;
+   if (pipe_reference(&(*adst)->reference, &asrc->reference)) {
+      struct amdgpu_fence *fence = *adst;
 
       if (amdgpu_fence_is_syncobj(fence))
          amdgpu_cs_destroy_syncobj(fence->ws->dev, fence->syncobj);
       else
          amdgpu_ctx_unref(fence->ctx);
 
       util_queue_fence_destroy(&fence->submitted);
       FREE(fence);
    }
-   *rdst = rsrc;
+   *adst = asrc;
 }
 
 int amdgpu_lookup_buffer(struct amdgpu_cs_context *cs, struct amdgpu_winsys_bo *bo);
 
 static inline struct amdgpu_ib *
 amdgpu_ib(struct radeon_cmdbuf *base)
 {
    return (struct amdgpu_ib *)base;
 }