From 65866896615547fd7b99f80c3f53e189363c5803 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 15 Apr 2025 12:31:16 +0200 Subject: [PATCH] radeonsi/vpe: Use studio range for YUV and full for RGB by default If application doesn't specify color range, use studio for YUV and full for RGB. Also stop always forcing full for RGB as that's wrong. Reviewed-by: Peyton Lee Part-of: --- src/gallium/drivers/radeonsi/si_vpe.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_vpe.c b/src/gallium/drivers/radeonsi/si_vpe.c index 328b86d068f..a8530e697af 100644 --- a/src/gallium/drivers/radeonsi/si_vpe.c +++ b/src/gallium/drivers/radeonsi/si_vpe.c @@ -481,16 +481,17 @@ si_vpe_set_color_space(const struct pipe_vpp_desc *process_properties, case PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_REDUCED: color_space->range = VPE_COLOR_RANGE_STUDIO; break; - default: case PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_FULL: color_space->range = VPE_COLOR_RANGE_FULL; break; - } - - /* Force RGB output range is Full to have better color performance */ - /* TO-DO: Should Mesa have to know the display console is TV or PC Monitor? */ - if (!util_format_is_yuv(format) && (which_surface == USE_DST_SURFACE)) + case PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_NONE: + default: + if (util_format_is_yuv(format)) + color_space->range = VPE_COLOR_RANGE_STUDIO; + else color_space->range = VPE_COLOR_RANGE_FULL; + break; + } /* Default use VPE_CHROMA_COSITING_NONE (CENTER | CENTER) */ color_space->cositing = VPE_CHROMA_COSITING_NONE;