Mesa (main): panfrost: Handle AFBC Tiled
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu May 26 16:12:43 UTC 2022
Module: Mesa
Branch: main
Commit: 5fa274fee4451421eed3fc4d3138362fb54c2109
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5fa274fee4451421eed3fc4d3138362fb54c2109
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Thu Apr 7 17:04:58 2022 -0400
panfrost: Handle AFBC Tiled
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16697>
---
src/panfrost/lib/pan_cs.c | 6 +++++-
src/panfrost/lib/pan_texture.c | 4 ++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/panfrost/lib/pan_cs.c b/src/panfrost/lib/pan_cs.c
index e3f2be599b8..4353980d806 100644
--- a/src/panfrost/lib/pan_cs.c
+++ b/src/panfrost/lib/pan_cs.c
@@ -42,9 +42,13 @@ mod_to_block_fmt(uint64_t mod)
return MALI_BLOCK_FORMAT_TILED_U_INTERLEAVED;
default:
#if PAN_ARCH >= 5
- if (drm_is_afbc(mod))
+ if (drm_is_afbc(mod) && !(mod & AFBC_FORMAT_MOD_TILED))
return MALI_BLOCK_FORMAT_AFBC;
#endif
+#if PAN_ARCH >= 7
+ if (drm_is_afbc(mod) && (mod & AFBC_FORMAT_MOD_TILED))
+ return MALI_BLOCK_FORMAT_AFBC_TILED;
+#endif
unreachable("Unsupported modifer");
}
diff --git a/src/panfrost/lib/pan_texture.c b/src/panfrost/lib/pan_texture.c
index 37c7eef4ec9..91c29b53b62 100644
--- a/src/panfrost/lib/pan_texture.c
+++ b/src/panfrost/lib/pan_texture.c
@@ -86,6 +86,10 @@ panfrost_compression_tag(const struct util_format_description *desc,
#endif
#if PAN_ARCH >= 7
+ /* Tiled headers */
+ if (modifier & AFBC_FORMAT_MOD_TILED)
+ flags |= MALI_AFBC_SURFACE_FLAG_TILED_HEADER;
+
/* Used to make sure AFBC headers don't point outside the AFBC
* body. HW is using the AFBC surface stride to do this check,
* which doesn't work for 3D textures because the surface
More information about the mesa-commit
mailing list