[Mesa-dev] [PATCH 2/9] winsys/amdgpu: always update gfx_bo_list_counter

Marek Olšák maraeo at gmail.com
Thu Jul 12 05:26:33 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index 9aa489adaa4..77b372d2cea 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -1336,39 +1336,39 @@ void amdgpu_cs_submit_ib(void *job, int thread_index)
 	 if (buffer->bo->is_local)
             continue;
 
          assert(buffer->u.real.priority_usage != 0);
 
          handles[num_handles] = buffer->bo->bo;
          flags[num_handles] = (util_last_bit64(buffer->u.real.priority_usage) - 1) / 4;
 	 ++num_handles;
       }
 
-      if (acs->ring_type == RING_GFX)
-         ws->gfx_bo_list_counter += cs->num_real_buffers;
-
       if (num_handles) {
          r = amdgpu_bo_list_create(ws->dev, num_handles,
                                    handles, flags, &bo_list);
       } else {
          r = 0;
       }
    }
 bo_list_error:
 
    if (r) {
       fprintf(stderr, "amdgpu: buffer list creation failed (%d)\n", r);
       amdgpu_fence_signalled(cs->fence);
       cs->error_code = r;
       goto cleanup;
    }
 
+   if (acs->ring_type == RING_GFX)
+      ws->gfx_bo_list_counter += cs->num_real_buffers;
+
    if (acs->ctx->num_rejected_cs) {
       r = -ECANCELED;
    } else {
       struct drm_amdgpu_cs_chunk chunks[5];
       unsigned num_chunks = 0;
 
       /* Convert from dwords to bytes. */
       cs->ib[IB_MAIN].ib_bytes *= 4;
 
       /* IB */
-- 
2.17.1



More information about the mesa-dev mailing list