amd/common: switch to 3-spaces style Follow-up of !4319 using the same clang-format config. Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5310>
ac/surface: adapt surf_size when modifying surf_pitch Otherwise we might get VM_L2_PROTECTION_FAULT_STATUS errors. Fixes: 8275dc1ed57 ("ac/surface: fix epitch when modifying surf_pitch") Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5841>
amd/addrlib: Clean up unused colorFlags argument Cleanup. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5865>
amd/common: Cache intra-tile addresses for retile map. However complicated DCC addressing is it is still based on tiles. If we have the intra-tile offsets + tile dimensions we can expand that to the full image ourselves. Behavior around ~1080p on a 2500U: old: 30-60 ms on every miss new: 5 ms initally (miss in the tile cache) <0.5 ms afterwards The most common case is that the tile cache only contains data for 2 tiles, which for Raven/Renoir/Navi14 will be 4 KiB each, so the size increase is fairly modest. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5865>
Revert "ac/surface: require that gfx8 doesn't have DCC in order to be displayable" This reverts commit 7406ea37e6b666d474ab62982ca333d518c84231. Fixes: 7406ea37 "ac/surface: require that gfx8 doesn't have DCC in order to be displayable" Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3190 Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5780>
ac/surface: don't free dcc_retile_map on failure because the hash table now owns it. Fixes: bd553f0546d - ac/surface: cache DCC retile maps (v2) Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5424>
ac/surface: enable DCC for the first level in the mip tail on gfx10 Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5424>
ac/surface: require that gfx8 doesn't have DCC in order to be displayable Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5424>
ac/surface: don't set is_displayable if displayable DCC is missing If flags.display isn't set, then displayable DCC will not be computed, so is_displayable will always be false. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5424>
ac/surface: cache DCC retile maps (v2) This reduces overhead when resizing windows or when allocating similar image sizes over and over again. v2: optimize the memory footprint of the cache Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5398>
ac/surface: add a wrapper structure to hold ADDR_HANDLE and more things in the future. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5398>
amd/addrlib: remove unused members of ADDR2_COMPUTE_DCC_ADDRFROMCOORD_INPUT Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5398>
amd/addrlib: don't recompute DCC info for every ComputeDccAddrFromCoord call This decreases the DCC retile map overhead from 23% to 18%. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5398>
ac/surface: don't recompute the DCC retile map for imported textures The retile map is not used in this case, and the retile map computation takes 39% of CPU time when resizing a window. This brings it down to 23%. The dcc_retile_use_uint16 setting has to be derived from DCC sizes. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5398>
ac/surface: fix epitch when modifying surf_pitch This is needed otherwise it can cause bad rendering of UYVY files. The align(..., 256 / surf->bpe) constraint comes from addrlib. Fixes: 69aadc49331 ("radeonsi: fix surf_pitch for subsampled surface") Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5314>
ac/surface: set SCANOUT if surf->is_displayable Fixes: ba10fb3f7f4 ("radeonsi: preserve the scanout flag for shared resources on gfx9 and gfx10") Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5314>
ac/surface: add displayable DCC code for gfx10.3 Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5383>
ac,radeonsi: start adding support for gfx10.3 Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5383>
amd/common: Add total alignment calculation. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5194>
radv: Rely on ac_surface for avoiding cmask for linear images. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5194>