panfrost: Identify 4-bit channel texture formats
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 24 Feb 2019 06:28:39 +0000 (06:28 +0000)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Wed, 27 Feb 2019 03:56:17 +0000 (03:56 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/gallium/drivers/panfrost/include/panfrost-job.h
src/gallium/drivers/panfrost/pan_format.c
src/gallium/drivers/panfrost/pan_pretty_print.c

index 1a2ba5529aa914fae9f73ecdd7f893b48d8e1a23..1d738486617105f17bcd1d68bf53fdc0f13f2236 100644 (file)
@@ -294,6 +294,8 @@ struct mali_channel_swizzle {
  * bits mean.
  */
 
+#define MALI_CHANNEL_4 2
+
 #define MALI_CHANNEL_8 3
 
 #define MALI_CHANNEL_16 4
@@ -367,6 +369,7 @@ enum mali_format {
        MALI_RGB16_UNORM  = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(3) | MALI_CHANNEL_16,
        MALI_RGB32_UNORM  = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(3) | MALI_CHANNEL_32,
        MALI_RGB32F = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(3) | MALI_CHANNEL_FLOAT,
+       MALI_RGBA4_UNORM  = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(4) | MALI_CHANNEL_4,
        MALI_RGBA8_UNORM  = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(4) | MALI_CHANNEL_8,
        MALI_RGBA16_UNORM = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(4) | MALI_CHANNEL_16,
        MALI_RGBA32_UNORM = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(4) | MALI_CHANNEL_32,
index b81206412ae0c8ac6d3d7118bbdabf2c0977dd56..cac8a3d08599ee324d782b3abc1e907d9a9df132 100644 (file)
@@ -91,6 +91,8 @@ static unsigned
 panfrost_translate_channel_width(unsigned size)
 {
         switch (size) {
+                case 4:
+                        return MALI_CHANNEL_4;
                 case 8:
                         return MALI_CHANNEL_8;
                 case 16:
index 8d7f38b4b8c99f496f9ede7544d73ba259e1e176..d590f267d1c1456cad39510a70e61fe6095faa81 100644 (file)
@@ -90,6 +90,7 @@ char *pandecode_format_name(enum mali_format format)
        DEFINE_CASE(RGB16_UNORM);
        DEFINE_CASE(RGB32_UNORM);
        DEFINE_CASE(RGB32F);
+       DEFINE_CASE(RGBA4_UNORM);
        DEFINE_CASE(RGBA8_UNORM);
        DEFINE_CASE(RGBA16_UNORM);
        DEFINE_CASE(RGBA32_UNORM);