Mesa (master): radv: improve the error messages when a CS submission failed

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 17 15:53:49 UTC 2020


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

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Sun Jul 12 21:03:33 2020 +0200

radv: improve the error messages when a CS submission failed

While we are at it, do not duplicate the error messages for the
three different submission paths.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5876>

---

 src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c | 31 +++++++++------------------
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
index daebdf9cc5f..4dfccbb06e8 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
@@ -912,13 +912,6 @@ static int radv_amdgpu_winsys_cs_submit_chained(struct radeon_winsys_ctx *_ctx,
 
 	/* Submit the CS. */
 	r = radv_amdgpu_cs_submit(ctx, &request, sem_info);
-	if (r) {
-		if (r == -ENOMEM)
-			fprintf(stderr, "amdgpu: Not enough memory for command submission.\n");
-		else
-			fprintf(stderr, "amdgpu: The CS has been rejected, "
-					"see dmesg for more information.\n");
-	}
 
 	free(request.handles);
 
@@ -997,13 +990,6 @@ static int radv_amdgpu_winsys_cs_submit_fallback(struct radeon_winsys_ctx *_ctx,
 
 	/* Submit the CS. */
 	r = radv_amdgpu_cs_submit(ctx, &request, sem_info);
-	if (r) {
-		if (r == -ENOMEM)
-			fprintf(stderr, "amdgpu: Not enough memory for command submission.\n");
-		else
-			fprintf(stderr, "amdgpu: The CS has been rejected, "
-					"see dmesg for more information.\n");
-	}
 
 	free(request.handles);
 	free(ibs);
@@ -1195,13 +1181,6 @@ static int radv_amdgpu_winsys_cs_submit_sysmem(struct radeon_winsys_ctx *_ctx,
 
 		sem_info->cs_emit_signal = (i == cs_count - cnt) ? emit_signal_sem : false;
 		r = radv_amdgpu_cs_submit(ctx, &request, sem_info);
-		if (r) {
-			if (r == -ENOMEM)
-				fprintf(stderr, "amdgpu: Not enough memory for command submission.\n");
-			else
-				fprintf(stderr, "amdgpu: The CS has been rejected, "
-						"see dmesg for more information.\n");
-		}
 
 		free(request.handles);
 
@@ -1590,6 +1569,16 @@ static int radv_amdgpu_cs_submit(struct radv_amdgpu_ctx *ctx,
 	if (bo_list)
 		amdgpu_bo_list_destroy_raw(ctx->ws->dev, bo_list);
 
+	if (r) {
+		if (r == -ENOMEM)
+			fprintf(stderr, "amdgpu: Not enough memory for command submission.\n");
+		else if (r == -ECANCELED)
+			fprintf(stderr, "amdgpu: The CS has been cancelled because the context is lost.\n");
+		else
+			fprintf(stderr, "amdgpu: The CS has been rejected, "
+					"see dmesg for more information (%i).\n", r);
+	}
+
 error_out:
 	free(chunks);
 	free(chunk_data);



More information about the mesa-commit mailing list