From d8fde8ffede9bfc96b9f7071dd4e779540dba61d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 4 Mar 2014 12:42:37 +0100 Subject: [PATCH] gallium: rename R4A4 and A4R4 formats to match their swizzle Like L4A4. Reviewed-by: Brian Paul --- src/gallium/auxiliary/util/u_format.csv | 4 ++-- src/gallium/auxiliary/util/u_format.h | 3 +-- src/gallium/drivers/ilo/ilo_format.c | 2 +- src/gallium/include/pipe/p_format.h | 4 ++-- src/gallium/state_trackers/vdpau/vdpau_private.h | 4 ++-- src/gallium/state_trackers/xvmc/subpicture.c | 6 +++--- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 8d04b00c452..8fb068b8177 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -272,8 +272,8 @@ PIPE_FORMAT_NV12 , other, 1, 1, x8 , x8 , x8 , x8 , xyzw, y PIPE_FORMAT_NV21 , other, 1, 1, x8 , x8 , x8 , x8 , xyzw, yuv # Usually used to implement IA44 and AI44 formats in video decoding -PIPE_FORMAT_R4A4_UNORM , plain, 1, 1, un4 , un4 , , , y00x, rgb -PIPE_FORMAT_A4R4_UNORM , plain, 1, 1, un4 , un4 , , , x00y, rgb +PIPE_FORMAT_A4R4_UNORM , plain, 1, 1, un4 , un4 , , , y00x, rgb +PIPE_FORMAT_R4A4_UNORM , plain, 1, 1, un4 , un4 , , , x00y, rgb PIPE_FORMAT_R8A8_UNORM , plain, 1, 1, un8 , un8 , , , x00y, rgb PIPE_FORMAT_A8R8_UNORM , plain, 1, 1, un8 , un8 , , , y00x, rgb diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index e36a9e2370e..747e1429d48 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -1060,8 +1060,7 @@ util_format_luminance_to_red(enum pipe_format format) return PIPE_FORMAT_RGTC1_SNORM; case PIPE_FORMAT_L4A4_UNORM: - /* XXX A4R4 is defined as x00y in u_format.csv */ - return PIPE_FORMAT_A4R4_UNORM; + return PIPE_FORMAT_R4A4_UNORM; case PIPE_FORMAT_L8A8_UNORM: return PIPE_FORMAT_R8A8_UNORM; diff --git a/src/gallium/drivers/ilo/ilo_format.c b/src/gallium/drivers/ilo/ilo_format.c index 72575f43fb4..30e495837d5 100644 --- a/src/gallium/drivers/ilo/ilo_format.c +++ b/src/gallium/drivers/ilo/ilo_format.c @@ -504,8 +504,8 @@ ilo_translate_color_format(enum pipe_format format) [PIPE_FORMAT_IYUV] = 0, [PIPE_FORMAT_NV12] = 0, [PIPE_FORMAT_NV21] = 0, - [PIPE_FORMAT_R4A4_UNORM] = 0, [PIPE_FORMAT_A4R4_UNORM] = 0, + [PIPE_FORMAT_R4A4_UNORM] = 0, [PIPE_FORMAT_R8A8_UNORM] = 0, [PIPE_FORMAT_A8R8_UNORM] = 0, [PIPE_FORMAT_R10G10B10A2_SSCALED] = BRW_SURFACEFORMAT_R10G10B10A2_SSCALED, diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index daa3be20d93..34ab66250fd 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -236,8 +236,8 @@ enum pipe_format { PIPE_FORMAT_NV12 = 166, PIPE_FORMAT_NV21 = 167, - PIPE_FORMAT_R4A4_UNORM = 168, - PIPE_FORMAT_A4R4_UNORM = 169, + PIPE_FORMAT_A4R4_UNORM = 168, + PIPE_FORMAT_R4A4_UNORM = 169, PIPE_FORMAT_R8A8_UNORM = 170, PIPE_FORMAT_A8R8_UNORM = 171, diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h index 078f0f9270c..ce6852b586a 100644 --- a/src/gallium/state_trackers/vdpau/vdpau_private.h +++ b/src/gallium/state_trackers/vdpau/vdpau_private.h @@ -209,9 +209,9 @@ FormatIndexedToPipe(VdpRGBAFormat vdpau_format) { switch (vdpau_format) { case VDP_INDEXED_FORMAT_A4I4: - return PIPE_FORMAT_A4R4_UNORM; - case VDP_INDEXED_FORMAT_I4A4: return PIPE_FORMAT_R4A4_UNORM; + case VDP_INDEXED_FORMAT_I4A4: + return PIPE_FORMAT_A4R4_UNORM; case VDP_INDEXED_FORMAT_A8I8: return PIPE_FORMAT_A8R8_UNORM; case VDP_INDEXED_FORMAT_I8A8: diff --git a/src/gallium/state_trackers/xvmc/subpicture.c b/src/gallium/state_trackers/xvmc/subpicture.c index 34973998d01..7a951fa7d77 100644 --- a/src/gallium/state_trackers/xvmc/subpicture.c +++ b/src/gallium/state_trackers/xvmc/subpicture.c @@ -55,10 +55,10 @@ static enum pipe_format XvIDToPipe(int xvimage_id) return PIPE_FORMAT_B8G8R8X8_UNORM; case FOURCC_AI44: - return PIPE_FORMAT_A4R4_UNORM; + return PIPE_FORMAT_R4A4_UNORM; case FOURCC_IA44: - return PIPE_FORMAT_R4A4_UNORM; + return PIPE_FORMAT_A4R4_UNORM; default: XVMC_MSG(XVMC_ERR, "[XvMC] Unrecognized Xv image ID 0x%08X.\n", xvimage_id); @@ -90,8 +90,8 @@ static int PipeToComponentOrder(enum pipe_format format, char *component_order) case PIPE_FORMAT_B8G8R8X8_UNORM: return 0; - case PIPE_FORMAT_R4A4_UNORM: case PIPE_FORMAT_A4R4_UNORM: + case PIPE_FORMAT_R4A4_UNORM: component_order[0] = 'Y'; component_order[1] = 'U'; component_order[2] = 'V'; -- 2.30.2