[Mesa-dev] [PATCH] radeonsi: don't forget to add HTILE to the buffer list for texturing

Edward O'Callaghan funfunctor at folklore1984.net
Thu Jan 19 08:21:12 UTC 2017


Ah nice catch,
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>

On 01/19/2017 08:21 AM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> This fixes VM faults. Discovered by Samuel Pitoiset.
> 
> Cc: 17.0 13.0 <mesa-stable at lists.freedesktop.org>
> ---
>  src/gallium/drivers/radeonsi/si_descriptors.c | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
> index df0905d..4a9fcd0 100644
> --- a/src/gallium/drivers/radeonsi/si_descriptors.c
> +++ b/src/gallium/drivers/radeonsi/si_descriptors.c
> @@ -313,28 +313,35 @@ static void si_sampler_view_add_buffer(struct si_context *sctx,
>  	rres = (struct r600_resource*)resource;
>  	priority = r600_get_sampler_view_priority(rres);
>  
>  	radeon_add_to_buffer_list_check_mem(&sctx->b, &sctx->b.gfx,
>  					    rres, usage, priority,
>  					    check_mem);
>  
>  	if (resource->target == PIPE_BUFFER)
>  		return;
>  
> -	/* Now add separate DCC if it's present. */
> +	/* Now add separate DCC or HTILE. */
>  	rtex = (struct r600_texture*)resource;
> -	if (!rtex->dcc_separate_buffer)
> -		return;
> +	if (rtex->dcc_separate_buffer) {
> +		radeon_add_to_buffer_list_check_mem(&sctx->b, &sctx->b.gfx,
> +						    rtex->dcc_separate_buffer, usage,
> +						    RADEON_PRIO_DCC, check_mem);
> +	}
>  
> -	radeon_add_to_buffer_list_check_mem(&sctx->b, &sctx->b.gfx,
> -					    rtex->dcc_separate_buffer, usage,
> -					    RADEON_PRIO_DCC, check_mem);
> +	if (rtex->htile_buffer &&
> +	    rtex->tc_compatible_htile &&
> +	    !is_stencil_sampler) {
> +		radeon_add_to_buffer_list_check_mem(&sctx->b, &sctx->b.gfx,
> +						    rtex->htile_buffer, usage,
> +						    RADEON_PRIO_HTILE, check_mem);
> +	}
>  }
>  
>  static void si_sampler_views_begin_new_cs(struct si_context *sctx,
>  					  struct si_sampler_views *views)
>  {
>  	unsigned mask = views->enabled_mask;
>  
>  	/* Add buffers to the CS. */
>  	while (mask) {
>  		int i = u_bit_scan(&mask);
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170119/f31bd6f1/attachment.sig>


More information about the mesa-dev mailing list