[1/3] panfrost: Add RGB555, RGB5A1 texture formats

Submitted by Alyssa Rosenzweig on Feb. 24, 2019, 6:35 a.m.

Details

Message ID 20190224063558.6363-2-alyssa@rosenzweig.io
State New
Headers show
Series "panfrost: Decode new formats" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Alyssa Rosenzweig Feb. 24, 2019, 6:35 a.m.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
---
 src/gallium/drivers/panfrost/include/panfrost-job.h | 2 ++
 src/gallium/drivers/panfrost/pan_pretty_print.c     | 2 ++
 2 files changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h
index 82b3cfb2a4f..072f0258bea 100644
--- a/src/gallium/drivers/panfrost/include/panfrost-job.h
+++ b/src/gallium/drivers/panfrost/include/panfrost-job.h
@@ -306,6 +306,8 @@  struct mali_channel_swizzle {
 #define MALI_CHANNEL_FLOAT 7
 
 enum mali_format {
+	MALI_RGB555         = MALI_FORMAT_SPECIAL | 0x0,
+	MALI_RGB5_A1_UNORM  = MALI_FORMAT_SPECIAL | 0x2,
 	MALI_RGB10_A2_UNORM = MALI_FORMAT_SPECIAL | 0x3,
 	MALI_RGB10_A2_SNORM = MALI_FORMAT_SPECIAL | 0x5,
 	MALI_RGB10_A2UI     = MALI_FORMAT_SPECIAL | 0x7,
diff --git a/src/gallium/drivers/panfrost/pan_pretty_print.c b/src/gallium/drivers/panfrost/pan_pretty_print.c
index f9fd2c0e6da..e2a8d9e1461 100644
--- a/src/gallium/drivers/panfrost/pan_pretty_print.c
+++ b/src/gallium/drivers/panfrost/pan_pretty_print.c
@@ -36,6 +36,8 @@  char *pandecode_format_name(enum mali_format format)
 	static char unk_format_str[5];
 
 	switch (format) {
+	DEFINE_CASE(RGB555);
+	DEFINE_CASE(RGB5_A1_UNORM);
 	DEFINE_CASE(RGB10_A2_UNORM);
 	DEFINE_CASE(RGB10_A2_SNORM);
 	DEFINE_CASE(RGB10_A2UI);

Comments

On Sun, Feb 24, 2019 at 1:36 AM Alyssa Rosenzweig <alyssa@rosenzweig.io> wrote:
>
> Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
> ---
>  src/gallium/drivers/panfrost/include/panfrost-job.h | 2 ++
>  src/gallium/drivers/panfrost/pan_pretty_print.c     | 2 ++
>  2 files changed, 4 insertions(+)
>
> diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h
> index 82b3cfb2a4f..072f0258bea 100644
> --- a/src/gallium/drivers/panfrost/include/panfrost-job.h
> +++ b/src/gallium/drivers/panfrost/include/panfrost-job.h
> @@ -306,6 +306,8 @@ struct mali_channel_swizzle {
>  #define MALI_CHANNEL_FLOAT 7
>
>  enum mali_format {
> +       MALI_RGB555         = MALI_FORMAT_SPECIAL | 0x0,

Just a thought -- RGB565, which is a fairly popular 16-bit color
variant, would fit nicely into the space here, and is probably also
one of the "special" formats. (Slightly surprising there's a separate
RGB555 and RGB5_A1 - normally that's handled by swizzling. Could it be
the difference between where the A1 bit is -- first vs last? Perhaps
that's also why there's a space after each of the RGB10A2 formats --
to also allow A2RGB10.)

Another good candidate for special handling is RGB9_E5 (shared
exponent), and I don't see a Z24 in the list.

Cheers,

  -ilia
> Just a thought -- RGB565, which is a fairly popular 16-bit color
> variant, would fit nicely into the space here, and is probably also
> one of the "special" formats. 

Oh, dear, this is embarassing -- I misread my notes. The format code in
question is for RGB565, not RGB555. Thank you for pointing that out!