intel/gen12: Fix memory corruption issues in fused Gen12 parts.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 21 Jan 2021 22:21:50 +0000 (14:21 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 26 Jan 2021 00:01:27 +0000 (00:01 +0000)
commite2c5ef6cd6571a8522b9b75a99d245a538cf6183
treeb8b8c7eb6dd0f7558165a4a8aaf905cf5677ea46
parent1d967132f3c4aefa72224d1029aa64a34053bf6b
intel/gen12: Fix memory corruption issues in fused Gen12 parts.

According to the BSpec page for MEDIA_VFE_STATE, on Gen12 platforms
"if a fused configuration has fewer threads than the native POR
configuration, the scratch space allocation is based on the number of
threads in the base native POR configuration".  However we currently
use the subslice count from devinfo->num_subslices[0], which only
includes the subslices currently enabled by the platform fusing.  This
leads to scratch space underallocation and occasional hangs.

The problem is likely to affect most Gen12 GPUs with less than 96 EUs.
GFXBench5 Aztec Ruins is able to reproduce the issue fairly reliably.

Fixes: 9e5ce30da7fa3f1cc3badf "intel: fix the gen 12 compute shader scratch IDs"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8636>
src/gallium/drivers/iris/iris_program.c
src/intel/vulkan/anv_allocator.c