[Mesa-dev] [PATCH 4/4] radeonsi: Print a message when scratch allocation fails.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Tue Apr 19 22:50:46 UTC 2016


Signed-off-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
---
 src/gallium/drivers/radeonsi/si_compute.c       | 5 ++++-
 src/gallium/drivers/radeonsi/si_state_shaders.c | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index b46a2fe..7d91ac6 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -215,8 +215,11 @@ static bool si_setup_compute_scratch_buffer(struct si_context *sctx,
 		                scratch_needed, 256, false, RADEON_DOMAIN_VRAM,
 		                RADEON_FLAG_NO_CPU_ACCESS);
 
-		if (!sctx->compute_scratch_buffer)
+		if (!sctx->compute_scratch_buffer) {
+			fprintf(stderr, "Warning: Failed to allocate the "
+			        "scratch buffer\n");
 			return false;
+		}
 	}
 
 	if (sctx->compute_scratch_buffer != shader->scratch_bo && scratch_needed) {
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index fef676b..2396b8e 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1692,8 +1692,11 @@ static bool si_update_spi_tmpring_size(struct si_context *sctx)
 			                            scratch_needed_size, 256, false,
 			                            RADEON_DOMAIN_VRAM,
 			                            RADEON_FLAG_NO_CPU_ACCESS);
-			if (!sctx->scratch_buffer)
+			if (!sctx->scratch_buffer) {
+				fprintf(stderr, "Warning: Failed to allocate the "
+			                "scratch buffer\n");
 				return false;
+			}
 			sctx->emit_scratch_reloc = true;
 		}
 
-- 
2.8.0



More information about the mesa-dev mailing list