Mesa (master): panfrost: Add tentative bifrost_texture_descriptor

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 24 05:34:40 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Mon Mar  9 09:45:52 2020 -0400

panfrost: Add tentative bifrost_texture_descriptor

It looks very similar to the Midgard texture descriptor, just with a
bunch of fields moved around and the whole descriptor flattened (so
basically just memory access optimizations, from what I can tell).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4680>

---

 src/panfrost/include/panfrost-job.h | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h
index 71beac01e6b..c5934ab824e 100644
--- a/src/panfrost/include/panfrost-job.h
+++ b/src/panfrost/include/panfrost-job.h
@@ -1238,6 +1238,38 @@ struct mali_texture_descriptor {
         uint32_t unknown7;
 } __attribute__((packed));
 
+/* While Midgard texture descriptors are variable length, Bifrost descriptors
+ * are fixed like samplers with more pointers to expand if necessary */
+
+struct bifrost_texture_descriptor {
+        unsigned format_unk : 4; /* 2 */
+        enum mali_texture_type type : 2;
+        unsigned format_unk2 : 16; /* 0 */
+        enum mali_format format : 8;
+        unsigned srgb : 1;
+        unsigned format_unk3 : 1; /* 0 */
+
+        uint16_t width; /* MALI_POSITIVE */
+        uint16_t height; /* MALI_POSITIVE */
+
+        /* OpenGL swizzle */
+        unsigned swizzle : 12;
+        unsigned unk0 : 4; /* 1 */
+        uint8_t levels : 8; /* Number of levels-1 if mipmapped, 0 if not */
+        unsigned unk1 : 4;
+
+        unsigned levels_unk : 24; /* 0 */
+        unsigned level_2 : 8; /* Number of levels, again? */
+
+        mali_ptr payload;
+
+        uint16_t array_size;
+        uint16_t unk4;
+
+        uint16_t depth;
+        uint16_t unk5;
+} __attribute__((packed));
+
 /* filter_mode */
 
 #define MALI_SAMP_MAG_NEAREST (1 << 0)



More information about the mesa-commit mailing list