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

Nicolai Hähnle nhaehnle at gmail.com
Wed Apr 20 01:46:02 UTC 2016


On 19.04.2016 17:50, Bas Nieuwenhuizen wrote:
> 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;
> +		}

Here and below, please change the "Warning" into "radeonsi" so 
unsuspecting users will be more likely to understand what's going on. 
With that changed, the patch is

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

>   	}
>
>   	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;
>   		}
>
>


More information about the mesa-dev mailing list