drm/amd/display: Add YCBCR2020 coefficients to CSC matrix
authorRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Thu, 3 Nov 2022 13:38:14 +0000 (09:38 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 23 Nov 2022 14:47:14 +0000 (09:47 -0500)
When some of the IGT tests are executed in DCN31, it is possible to see
multiple occurrences of this warning:

 WARNING: CPU: 9 PID: 3482 at
 drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dcn30/dcn30_dpp.c:154
 dpp3_program_post_csc+0x196/0x220 [amdgpu]
 [..]
 PU: 9 PID: 3482 Comm: amd_hdr Tainted: G       W        5.18.0+ #3
 IP: 0010:dpp3_program_post_csc+0x196/0x220 [amdgpu]
 [..]
 all Trace:
 <TASK>
 dpp3_cnv_setup+0x5d9/0x5f0 [amdgpu]
 ? dcn20_blank_pixel_data+0x30a/0x330 [amdgpu]
 dcn20_program_pipe+0x259/0xb40 [amdgpu]
 ? offset_to_id+0x1b0/0x1c0 [amdgpu]
 dcn20_program_front_end_for_ctx+0x36a/0x450 [amdgpu]
 commit_planes_for_stream+0x8eb/0x13e0 [amdgpu]

This commit fix the above issue by adding YCBCR2020 coefficients to the
DPP Color Space Converter (CSC) matrix.

Reviewed-by: Nawwar Ali <nawwar.ali@amd.com>
Acked-by: Brian Chang <Brian.Chang@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h

index dcb80c4747b04cd281736684bf358303d4f550aa..131fcfa28bca1a8d11a6e892d4d4e7a9d4ed3c8d 100644 (file)
@@ -83,10 +83,15 @@ static const struct dpp_input_csc_matrix __maybe_unused dpp_input_csc_matrix[] =
        {COLOR_SPACE_YCBCR709,
                {0x3265, 0x2000, 0, 0xe6ce, 0xf105, 0x2000, 0xfa01, 0xa7d, 0,
                                                0x2000, 0x3b61, 0xe24f} },
-
        {COLOR_SPACE_YCBCR709_LIMITED,
                {0x39a6, 0x2568, 0, 0xe0d6, 0xeedd, 0x2568, 0xf925, 0x9a8, 0,
-                                               0x2568, 0x43ee, 0xdbb2} }
+                                               0x2568, 0x43ee, 0xdbb2} },
+       {COLOR_SPACE_2020_YCBCR,
+               {0x2F30, 0x2000, 0, 0xE869, 0xEDB7, 0x2000, 0xFABC, 0xBC6, 0,
+                                               0x2000, 0x3C34, 0xE1E6} },
+       {COLOR_SPACE_2020_RGB_LIMITEDRANGE,
+               {0x35E0, 0x255F, 0, 0xE2B3, 0xEB20, 0x255F, 0xF9FD, 0xB1E, 0,
+                                               0x255F, 0x44BD, 0xDB43} }
 };
 
 struct dpp_grph_csc_adjustment {