From: Icecream95 Date: Tue, 24 Mar 2020 00:25:19 +0000 (+1300) Subject: panfrost: Add support for R3G3B2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd87bcb8ac9039dcae675cef977c08eadb75c438;p=mesa.git panfrost: Add support for R3G3B2 Tested with texenv from mesa-demos. Reviewed-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 72156cb1b67..b6f8c646602 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -461,7 +461,9 @@ panfrost_is_format_supported( struct pipe_screen *screen, if (format == PIPE_FORMAT_X8Z24_UNORM) return false; - if (format == PIPE_FORMAT_A1B5G5R5_UNORM || format == PIPE_FORMAT_X1B5G5R5_UNORM) + if (format == PIPE_FORMAT_A1B5G5R5_UNORM || + format == PIPE_FORMAT_X1B5G5R5_UNORM || + format == PIPE_FORMAT_B2G3R3_UNORM) return false; /* TODO */ diff --git a/src/panfrost/encoder/pan_format.c b/src/panfrost/encoder/pan_format.c index 26d3f7951eb..89f4695deaa 100644 --- a/src/panfrost/encoder/pan_format.c +++ b/src/panfrost/encoder/pan_format.c @@ -124,6 +124,9 @@ panfrost_find_format(const struct util_format_description *desc) /* Z32F = R32F to the hardware */ return MALI_R32F; + case PIPE_FORMAT_R3G3B2_UNORM: + return MALI_RGB332_UNORM; + case PIPE_FORMAT_B5G6R5_UNORM: return MALI_RGB565; diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h index 355eca9491a..a409f15147e 100644 --- a/src/panfrost/include/panfrost-job.h +++ b/src/panfrost/include/panfrost-job.h @@ -294,6 +294,8 @@ enum mali_format { MALI_RGB10_A2UI = MALI_FORMAT_SPECIAL | 0x7, MALI_RGB10_A2I = MALI_FORMAT_SPECIAL | 0x9, + MALI_RGB332_UNORM = MALI_FORMAT_SPECIAL | 0xb, + /* YUV formats */ MALI_NV12 = MALI_FORMAT_SPECIAL | 0xc, diff --git a/src/panfrost/pandecode/pan_pretty_print.c b/src/panfrost/pandecode/pan_pretty_print.c index 9f9852a7917..96ef7d7b2c3 100644 --- a/src/panfrost/pandecode/pan_pretty_print.c +++ b/src/panfrost/pandecode/pan_pretty_print.c @@ -52,6 +52,7 @@ char *pandecode_format(enum mali_format format) DEFINE_CASE(RGB10_A2_SNORM); DEFINE_CASE(RGB10_A2UI); DEFINE_CASE(RGB10_A2I); + DEFINE_CASE(RGB332_UNORM); DEFINE_CASE(NV12); DEFINE_CASE(Z32_UNORM); DEFINE_CASE(R32_FIXED);