[Mesa-dev] [PATCH] ac/surface: fix CMASK fast clear for NPOT textures with mipmapping on SI/CI/VI

Dylan Baker dylan at pnwbakers.com
Wed Aug 29 15:29:52 UTC 2018


Quoting Marek Olšák (2018-08-28 11:41:03)
> From: Marek Olšák <marek.olsak at amd.com>
> 
> This fixes VM faults and corruption.
> 
> Cc: 18.1 18.2 <mesa-stable at lists.freedesktop.org>
> ---
>  src/amd/common/ac_surface.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
> index 2f4f0f8884f..94723dc9c09 100644
> --- a/src/amd/common/ac_surface.c
> +++ b/src/amd/common/ac_surface.c
> @@ -581,22 +581,22 @@ void ac_compute_cmask(const struct radeon_info *info,
>                 cl_width = 64;
>                 cl_height = 64;
>                 break;
>         default:
>                 assert(0);
>                 return;
>         }
>  
>         unsigned base_align = num_pipes * pipe_interleave_bytes;
>  
> -       unsigned width = align(config->info.width, cl_width*8);
> -       unsigned height = align(config->info.height, cl_height*8);
> +       unsigned width = align(surf->u.legacy.level[0].nblk_x, cl_width*8);
> +       unsigned height = align(surf->u.legacy.level[0].nblk_y, cl_height*8);
>         unsigned slice_elements = (width * height) / (8*8);
>  
>         /* Each element of CMASK is a nibble. */
>         unsigned slice_bytes = slice_elements / 2;
>  
>         surf->u.legacy.cmask_slice_tile_max = (width * height) / (128*128);
>         if (surf->u.legacy.cmask_slice_tile_max)
>                 surf->u.legacy.cmask_slice_tile_max -= 1;
>  
>         unsigned num_layers;
> -- 
> 2.17.1
> 

Hi Marek,

This doesn't apply cleanly to 18.1, this function is still in si_texture.c in
18.1, and it's not clear to me how to port it. If you'd still like this applied
to 18.1 please provide a backport.

Thanks,
Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180829/878c8fff/attachment.sig>


More information about the mesa-dev mailing list