From: Alyssa Rosenzweig Date: Tue, 26 May 2020 23:48:29 +0000 (-0400) Subject: panfrost: Identify Bifrost texture format swizzle X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d45936c01cd1811fb0ca927858bca404f1292791;p=mesa.git panfrost: Identify Bifrost texture format swizzle We don't force w=1 for Bifrost textures. We already compose this into the swizzle as necessary, so we can just ignore this field I think. But let's identify it so we don't forget what it is. The blob uses it to force w=1 for <= 3-channel formats (0x10), as well as a flag to swap r/b for BGRA (0x4). There are probably other flags here but it doesn't.. really matter to us. Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/encoder/pan_texture.c b/src/panfrost/encoder/pan_texture.c index 9fb134e48ed..fd9e1ea9e3a 100644 --- a/src/panfrost/encoder/pan_texture.c +++ b/src/panfrost/encoder/pan_texture.c @@ -333,7 +333,6 @@ panfrost_new_texture_bifrost( descriptor->format_unk = 0x2; descriptor->type = type; - descriptor->format_unk2 = 0x100; descriptor->format = mali_format; descriptor->srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB); descriptor->format_unk3 = 0x0; diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h index bb835a13b00..1234d3bbfa9 100644 --- a/src/panfrost/include/panfrost-job.h +++ b/src/panfrost/include/panfrost-job.h @@ -1253,7 +1253,8 @@ struct mali_texture_descriptor { struct bifrost_texture_descriptor { unsigned format_unk : 4; /* 2 */ enum mali_texture_type type : 2; - unsigned format_unk2 : 16; /* 0 */ + unsigned zero : 4; + unsigned format_swizzle : 12; enum mali_format format : 8; unsigned srgb : 1; unsigned format_unk3 : 1; /* 0 */ diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c index 02f320c7fe4..1bd1273f735 100644 --- a/src/panfrost/pandecode/decode.c +++ b/src/panfrost/pandecode/decode.c @@ -2210,7 +2210,13 @@ pandecode_bifrost_texture( pandecode_prop("format_unk = 0x%" PRIx32, t->format_unk); pandecode_prop("type = %" PRId32, t->type); - pandecode_prop("format_unk2 = 0x%" PRIx32, t->format_unk2); + + if (t->zero) { + pandecode_msg("XXX: zero tripped\n"); + pandecode_prop("zero = 0x%" PRIx32, t->zero); + } + + pandecode_prop("format_swizzle = 0x%" PRIx32, t->format_swizzle); pandecode_prop("format = 0x%" PRIx32, t->format); pandecode_prop("srgb = 0x%" PRIx32, t->srgb); pandecode_prop("format_unk3 = 0x%" PRIx32, t->format_unk3);