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

Marek Olšák maraeo at gmail.com
Tue Aug 28 23:33:09 UTC 2018


BTW, radv doesn't use the function, so it will have this bug.

Marek

On Tue, Aug 28, 2018 at 5:47 PM, Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
> Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
> On Tue, Aug 28, 2018 at 8:41 PM Marek Olšák <maraeo at gmail.com> wrote:
>>
>> 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
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list