panfrost: Add support for R3G3B2
authorIcecream95 <ixn@keemail.me>
Tue, 24 Mar 2020 00:25:19 +0000 (13:25 +1300)
committerMarge Bot <eric+marge@anholt.net>
Tue, 31 Mar 2020 00:48:58 +0000 (00:48 +0000)
Tested with texenv from mesa-demos.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4292>

src/gallium/drivers/panfrost/pan_screen.c
src/panfrost/encoder/pan_format.c
src/panfrost/include/panfrost-job.h
src/panfrost/pandecode/pan_pretty_print.c

index 72156cb1b6774c948eabcca167c5bf7bb82a863a..b6f8c6466029dc939da919fa1e8969c358f14436 100644 (file)
@@ -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 */
index 26d3f7951ebc8a70d293c6318d7773af2a3e8ff4..89f4695deaa14f8a28758e80f129d6f3c799c823 100644 (file)
@@ -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;
 
index 355eca9491a68514ae4033dc458345fbd5831159..a409f15147e830b3500b13ef55c686facda9eee4 100644 (file)
@@ -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,
 
index 9f9852a7917e5911aad46b8cbf7ce6a044969056..96ef7d7b2c33df1ed2f397a90d53aafb8c09be7d 100644 (file)
@@ -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);