Module: Mesa
Branch: master
Commit: 35e25ea1d07c5af7ec99c65db06010338af369aa
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=35e25ea1d07c5af7ec99c65db06010338af369aa

Author: Simon Ser <[email protected]>
Date:   Fri Apr  9 14:07:29 2021 +0200

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 <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Acked-by: Leo Liu <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>

---

 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;
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to