From e5fc8a28dc77b1eecc12f11a351ae6f321a135f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 3 Feb 2021 02:07:15 -0500 Subject: [PATCH] winsys/amdgpu: try not to skip any code with RADEON_NOOP=1 to test CPU perf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This enables more accurate estimation of the maximum achievable CPU-bound performance. Reviewed-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Zoltán Böszörményi Part-of: --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index 1ad951b33de..f59e65e47fa 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -1614,8 +1614,8 @@ static void amdgpu_cs_submit_ib(void *job, int thread_index) chunks[num_chunks].chunk_data = (uintptr_t)&cs->ib[IB_PARALLEL_COMPUTE]; num_chunks++; - r = amdgpu_cs_submit_raw2(ws->dev, acs->ctx->ctx, bo_list, - num_chunks, chunks, NULL); + r = acs->noop ? 0 : amdgpu_cs_submit_raw2(ws->dev, acs->ctx->ctx, bo_list, + num_chunks, chunks, NULL); if (r) goto finalize; @@ -1677,11 +1677,10 @@ static void amdgpu_cs_submit_ib(void *job, int thread_index) assert(num_chunks <= ARRAY_SIZE(chunks)); - r = amdgpu_cs_submit_raw2(ws->dev, acs->ctx->ctx, bo_list, - num_chunks, chunks, &seq_no); + r = acs->noop ? 0 : amdgpu_cs_submit_raw2(ws->dev, acs->ctx->ctx, bo_list, + num_chunks, chunks, &seq_no); } finalize: - if (r) { if (r == -ENOMEM) fprintf(stderr, "amdgpu: Not enough memory for command submission.\n"); @@ -1693,7 +1692,7 @@ finalize: acs->ctx->num_rejected_cs++; ws->num_total_rejected_cs++; - } else { + } else if (!acs->noop) { /* Success. */ uint64_t *user_fence = NULL; @@ -1715,7 +1714,7 @@ finalize: cleanup: /* If there was an error, signal the fence, because it won't be signalled * by the hardware. */ - if (r) + if (r || acs->noop) amdgpu_fence_signalled(cs->fence); cs->error_code = r; @@ -1808,7 +1807,6 @@ static int amdgpu_cs_flush(struct radeon_cmdbuf *rcs, /* If the CS is not empty or overflowed.... */ if (likely(radeon_emitted(rcs, 0) && rcs->current.cdw <= rcs->current.max_dw && - !cs->noop && !(flags & RADEON_FLUSH_NOOP))) { struct amdgpu_cs_context *cur = cs->csc;