radeonsi: fix si_get_dmabuf_modifier_planes for gfx12

DCC_RETILE/DCC only makes sense if TILE_VERSION is lower than
AMD_FMT_MOD_TILE_VER_GFX12.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30159>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2024-07-12 20:11:09 +02:00 committed by Marge Bot
parent 0bb83a4060
commit 252485b0e2

View file

@ -1588,13 +1588,15 @@ si_get_dmabuf_modifier_planes(struct pipe_screen *pscreen, uint64_t modifier,
{
unsigned planes = util_format_get_num_planes(format);
if (IS_AMD_FMT_MOD(modifier) && planes == 1) {
if (AMD_FMT_MOD_GET(DCC_RETILE, modifier))
return 3;
else if (AMD_FMT_MOD_GET(DCC, modifier))
return 2;
else
return 1;
if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) < AMD_FMT_MOD_TILE_VER_GFX12) {
if (IS_AMD_FMT_MOD(modifier) && planes == 1) {
if (AMD_FMT_MOD_GET(DCC_RETILE, modifier))
return 3;
else if (AMD_FMT_MOD_GET(DCC, modifier))
return 2;
else
return 1;
}
}
return planes;