[Mesa-stable] [Mesa-dev] [PATCH] radv: fix HTILE metadata initialization in presence of subpass clears

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Jun 25 11:58:34 UTC 2018



On 06/25/2018 01:51 PM, Bas Nieuwenhuizen wrote:
> Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
> 
> Still not sure why that would cause VM faults though.

Me neither, especially because the VM faults only happen when running 
CTS with multithreads...

> 
> On Mon, Jun 25, 2018 at 1:34 PM, Samuel Pitoiset
> <samuel.pitoiset at gmail.com> wrote:
>> If the driver ends up by performing a slow depthstencil clear,
>> the HTILE metadata won't be initialized correctly.
>>
>> This fixes random VM faults on Polaris while running CTS
>> with Bas's runner. This doesn't seem to regress performance.
>>
>> CC: <mesa-stable at lists.freedesktop.org>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> ---
>>   src/amd/vulkan/radv_cmd_buffer.c | 9 +--------
>>   1 file changed, 1 insertion(+), 8 deletions(-)
>>
>> diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
>> index 8bd41bc41a..0388e4b6e0 100644
>> --- a/src/amd/vulkan/radv_cmd_buffer.c
>> +++ b/src/amd/vulkan/radv_cmd_buffer.c
>> @@ -3987,14 +3987,7 @@ static void radv_handle_depth_image_transition(struct radv_cmd_buffer *cmd_buffe
>>          if (!radv_image_has_htile(image))
>>                  return;
>>
>> -       if (dst_layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL &&
>> -           (pending_clears & vk_format_aspects(image->vk_format)) == vk_format_aspects(image->vk_format) &&
>> -           cmd_buffer->state.render_area.offset.x == 0 && cmd_buffer->state.render_area.offset.y == 0 &&
>> -           cmd_buffer->state.render_area.extent.width == image->info.width &&
>> -           cmd_buffer->state.render_area.extent.height == image->info.height) {
>> -               /* The clear will initialize htile. */
>> -               return;
>> -       } else if (src_layout == VK_IMAGE_LAYOUT_UNDEFINED &&
>> +       if (src_layout == VK_IMAGE_LAYOUT_UNDEFINED &&
>>                     radv_layout_has_htile(image, dst_layout, dst_queue_mask)) {
>>                  /* TODO: merge with the clear if applicable */
>>                  radv_initialize_htile(cmd_buffer, image, range, 0);
>> --
>> 2.18.0
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-stable mailing list