From 60270c83b5e759e4b5edbe5270fe26d52a3967d0 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 24 Feb 2019 06:28:39 +0000 Subject: panfrost: Identify 4-bit channel texture formats Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/include/panfrost-job.h | 3 +++ src/gallium/drivers/panfrost/pan_format.c | 2 ++ src/gallium/drivers/panfrost/pan_pretty_print.c | 1 + 3 files changed, 6 insertions(+) diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h index 1a2ba5529aa..1d738486617 100644 --- a/src/gallium/drivers/panfrost/include/panfrost-job.h +++ b/src/gallium/drivers/panfrost/include/panfrost-job.h @@ -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, diff --git a/src/gallium/drivers/panfrost/pan_format.c b/src/gallium/drivers/panfrost/pan_format.c index b81206412ae..cac8a3d0859 100644 --- a/src/gallium/drivers/panfrost/pan_format.c +++ b/src/gallium/drivers/panfrost/pan_format.c @@ -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: diff --git a/src/gallium/drivers/panfrost/pan_pretty_print.c b/src/gallium/drivers/panfrost/pan_pretty_print.c index 8d7f38b4b8c..d590f267d1c 100644 --- a/src/gallium/drivers/panfrost/pan_pretty_print.c +++ b/src/gallium/drivers/panfrost/pan_pretty_print.c @@ -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); -- cgit v1.2.3