From: Joshua Ashton <[email protected]>

Userspace might not aware whether we're sending RGB or YCbCr
data to the display. If COLOR_SPACE_2020_RGB_FULLRANGE is
requested but the output encoding is YCbCr we should
send COLOR_SPACE_2020_YCBCR.

Signed-off-by: Joshua Ashton <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Cc: Pekka Paalanen <[email protected]>
Cc: Sebastian Wick <[email protected]>
Cc: [email protected]
Cc: Joshua Ashton <[email protected]>
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Harry Wentland <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index a15b26962496..d5e1f3423cce 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5324,10 +5324,11 @@ get_output_color_space(const struct dc_crtc_timing 
*dc_crtc_timing,
                color_space = COLOR_SPACE_ADOBERGB;
                break;
        case DRM_MODE_COLORIMETRY_BT2020:
-               color_space = COLOR_SPACE_2020_RGB_FULLRANGE;
-               break;
        case DRM_MODE_COLORIMETRY_BT2020_DEPRECATED:
-               color_space = COLOR_SPACE_2020_YCBCR;
+               if (dc_crtc_timing->pixel_encoding == PIXEL_ENCODING_RGB)
+                       color_space = COLOR_SPACE_2020_RGB_FULLRANGE;
+               else
+                       color_space = COLOR_SPACE_2020_YCBCR;
                break;
        case DRM_MODE_COLORIMETRY_DEFAULT: // ITU601
        default:
-- 
2.39.2

Reply via email to