drm/amd/display: Fix timing bandwidth calculation for HDMI
authorLeo (Hanghong) Ma <hanghong.ma@amd.com>
Thu, 4 Jan 2024 18:29:32 +0000 (13:29 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 22 Jan 2024 22:13:26 +0000 (17:13 -0500)
[Why && How]
The current bandwidth calculation for timing doesn't account for
certain HDMI modes overhead which leads to DSC can't be enabled.
Add support to calculate the actual bandwidth for these HDMI modes.

Reviewed-by: Chris Park <chris.park@amd.com>
Acked-by: Roman Li <roman.li@amd.com>
Signed-off-by: Leo (Hanghong) Ma <hanghong.ma@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/dc_hw_types.h
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c

index 811474f4419bd264a7774676542e09a4f2e1f328..fb4db3158e8fb335ecaaf98412d3da20977f86c0 100644 (file)
@@ -942,6 +942,7 @@ struct dc_crtc_timing {
        uint32_t hdmi_vic;
        uint32_t rid;
        uint32_t fr_index;
+       uint32_t frl_uncompressed_video_bandwidth_in_kbps;
        enum dc_timing_3d_format timing_3d_format;
        enum dc_color_depth display_color_depth;
        enum dc_pixel_encoding pixel_encoding;
index 0df6c55eb32608e95b927a70a4b15ff3fec9e3f3..ac41f9c0a2834189ecfba441cdb463ce1d745bfc 100644 (file)
@@ -137,6 +137,11 @@ uint32_t dc_bandwidth_in_kbps_from_timing(
        if (link_encoding == DC_LINK_ENCODING_DP_128b_132b)
                kbps = apply_128b_132b_stream_overhead(timing, kbps);
 
+       if (link_encoding == DC_LINK_ENCODING_HDMI_FRL &&
+                       timing->vic == 0 && timing->hdmi_vic == 0 &&
+                       timing->frl_uncompressed_video_bandwidth_in_kbps != 0)
+               kbps = timing->frl_uncompressed_video_bandwidth_in_kbps;
+
        return kbps;
 }