From 35e25ea1d07c5af7ec99c65db06010338af369aa Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 9 Apr 2021 14:07:29 +0200 Subject: [PATCH] ac/surface: allow non-DCC modifiers for YUV on GFX9+ Accept non-linear tiling for multi-planar formats on GFX9+, as long as DCC is disabled. DCC support is possible in theory, but untested for now. GFX8 is still restricted to linear tiling because it's not yet clear how modifiers should be handled on these chips for multi-planar formats. Each plane may need a different modifier. Signed-off-by: Simon Ser Reviewed-by: Bas Nieuwenhuizen Acked-by: Leo Liu Part-of: --- src/amd/common/ac_surface.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index b4274c880a2..b24a7591945 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -194,7 +194,8 @@ bool ac_is_modifier_supported(const struct radeon_info *info, if(modifier == DRM_FORMAT_MOD_LINEAR) return true; - if (util_format_get_num_planes(format) > 1) + /* GFX8 may need a different modifier for each plane */ + if (info->chip_class < GFX9 && util_format_get_num_planes(format) > 1) return false; uint32_t allowed_swizzles = 0xFFFFFFFF; @@ -214,6 +215,10 @@ bool ac_is_modifier_supported(const struct radeon_info *info, return false; if (ac_modifier_has_dcc(modifier)) { + /* TODO: support multi-planar formats with DCC */ + if (util_format_get_num_planes(format) > 1) + return false; + if (!info->has_graphics) return false;