From 861e7dcae6b1156f9eca5ad28b6e21a1e62358da Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 15 May 2020 18:43:41 -0400 Subject: panfrost: Switch formats to table Rather than heuristically guessing what PIPE formats correspond to what in the hardware, hardcode a table. This is more verbose, but a lot more obvious -- the previous format support code was a source of endless silent bugs. v2: Don't report RGB233 (icecream95). Allow RGB5 for texturing (icecream95). Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/encoder/pan_texture.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/panfrost/encoder/pan_texture.h') diff --git a/src/panfrost/encoder/pan_texture.h b/src/panfrost/encoder/pan_texture.h index b0238aeb888..f84e0a484a5 100644 --- a/src/panfrost/encoder/pan_texture.h +++ b/src/panfrost/encoder/pan_texture.h @@ -114,8 +114,12 @@ panfrost_texture_offset(struct panfrost_slice *slices, bool is_3d, unsigned cube /* Formats */ -enum mali_format -panfrost_find_format(const struct util_format_description *desc); +struct panfrost_format { + enum mali_format hw; + unsigned bind; +}; + +extern struct panfrost_format panfrost_pipe_format_table[PIPE_FORMAT_COUNT]; bool panfrost_is_z24s8_variant(enum pipe_format fmt); -- cgit v1.2.3