panfrost: Identify texture layout field
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 21 Apr 2020 20:20:55 +0000 (16:20 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Fri, 24 Apr 2020 04:55:02 +0000 (06:55 +0200)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4680>

src/panfrost/encoder/pan_texture.c
src/panfrost/include/panfrost-job.h
src/panfrost/pandecode/decode.c

index b0b630c7b934e1108dde201e69dcc7ae56978df3..147cf41c948acfb7e03fd1d3ed3a8156e9fd7c74 100644 (file)
@@ -271,7 +271,7 @@ panfrost_new_texture_bifrost(
         descriptor->width = MALI_POSITIVE(u_minify(width, first_level));
         descriptor->height = MALI_POSITIVE(u_minify(height, first_level));
         descriptor->swizzle = swizzle;
-        descriptor->unk0 = 0x1;
+        descriptor->layout = layout;
         descriptor->levels = last_level - first_level;
         descriptor->unk1 = 0x0;
         descriptor->levels_unk = 0;
index 5ff3007dbf3ce116e30ea28c6df148a28f42de16..7ab4b4749a88aedf59490eed1ea745374970e31b 100644 (file)
@@ -1255,7 +1255,7 @@ struct bifrost_texture_descriptor {
 
         /* OpenGL swizzle */
         unsigned swizzle : 12;
-        unsigned unk0 : 4; /* 1 */
+        enum mali_texture_layout layout : 4;
         uint8_t levels : 8; /* Number of levels-1 if mipmapped, 0 if not */
         unsigned unk1 : 4;
 
index 567da3d13ea5300eb396796d22a6592106e265c3..73a5324951b1545fc9e809672a3e732625e24aa2 100644 (file)
@@ -2161,7 +2161,6 @@ pandecode_bifrost_texture(const struct bifrost_texture_descriptor *t, unsigned j
         pandecode_prop("width = %" PRId32, t->width);
         pandecode_prop("height = %" PRId32, t->height);
         pandecode_prop("swizzle = 0x%" PRIx32, t->swizzle);
-        pandecode_prop("unk0 = 0x%" PRIx32, t->unk0);
         pandecode_prop("levels = %" PRId32, t->levels);
         pandecode_prop("unk1 = 0x%" PRIx32, t->unk1);
         pandecode_prop("levels_unk = %" PRId32, t->levels_unk);
@@ -2178,19 +2177,17 @@ pandecode_bifrost_texture(const struct bifrost_texture_descriptor *t, unsigned j
         bool is_cube = t->type == MALI_TEX_CUBE;
         unsigned dimension = is_cube ? 2 : t->type;
 
-#if 0
         /* Print the layout. Default is linear; a modifier can denote AFBC or
          * u-interleaved/tiled modes */
 
-        if (f.layout == MALI_TEXTURE_AFBC)
+        if (t->layout == MALI_TEXTURE_AFBC)
                 pandecode_log_cont("afbc");
-        else if (f.layout == MALI_TEXTURE_TILED)
+        else if (t->layout == MALI_TEXTURE_TILED)
                 pandecode_log_cont("tiled");
-        else if (f.layout == MALI_TEXTURE_LINEAR)
+        else if (t->layout == MALI_TEXTURE_LINEAR)
                 pandecode_log_cont("linear");
         else
-                pandecode_msg("XXX: invalid texture layout 0x%X\n", f.layout);
-#endif
+                pandecode_msg("XXX: invalid texture layout 0x%X\n", t->layout);
 
         pandecode_swizzle(t->swizzle, t->format);
         pandecode_log_cont(" ");