diff options
author | Alexandre Marquet <tb@a-marquet.fr> | 2024-05-04 21:46:16 +0930 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-06-27 12:21:03 +0000 |
commit | f5b44838a15efa557c0716e21452bb9a5b9f457a (patch) | |
tree | 4c69db80fb9e6074f421fb64a029cf661126b371 /src/panfrost | |
parent | 965627bc48969fc4178f3ba2605e35b79a7be640 (diff) |
panfrost: implement SFBD raw format support on v4
For v4 GPUs, raw formats support is currently advertised as "not finished for SFBD".
This patch implements it.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10571
Signed-off-by: Alexandre Marquet <tb@a-marquet.fr>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29062>
Diffstat (limited to 'src/panfrost')
-rw-r--r-- | src/panfrost/lib/pan_desc.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/panfrost/lib/pan_desc.c b/src/panfrost/lib/pan_desc.c index 7cfeefd4e97..c2a7484fd2b 100644 --- a/src/panfrost/lib/pan_desc.c +++ b/src/panfrost/lib/pan_desc.c @@ -826,6 +826,21 @@ GENX(pan_emit_fbd)(const struct pan_fb_info *fb, unsigned layer_idx, return tag.opaque[0]; } #else /* PAN_ARCH == 4 */ +static enum mali_color_format +pan_sfbd_raw_format(unsigned bits) +{ + /* clang-format off */ + switch (bits) { + case 16: return MALI_COLOR_FORMAT_1_16B_CHANNEL; + case 32: return MALI_COLOR_FORMAT_1_32B_CHANNEL; + case 48: return MALI_COLOR_FORMAT_3_16B_CHANNELS; + case 64: return MALI_COLOR_FORMAT_2_32B_CHANNELS; + case 96: return MALI_COLOR_FORMAT_3_32B_CHANNELS; + case 128: return MALI_COLOR_FORMAT_4_32B_CHANNELS; + default: unreachable("invalid raw bpp"); + } + /* clang-format on */ +} unsigned GENX(pan_emit_fbd)(const struct pan_fb_info *fb, unsigned layer_idx, const struct pan_tls_info *tls, @@ -872,7 +887,11 @@ GENX(pan_emit_fbd)(const struct pan_fb_info *fb, unsigned layer_idx, cfg.internal_format = fmt.internal; cfg.color_writeback_format = fmt.writeback; } else { - unreachable("raw formats not finished for SFBD"); + /* Construct RAW internal/writeback */ + unsigned bits = desc->block.bits; + + cfg.internal_format = MALI_COLOR_BUFFER_INTERNAL_FORMAT_RAW_VALUE; + cfg.color_writeback_format = pan_sfbd_raw_format(bits); } unsigned level = rt->first_level; |