From: Nicholas Kazlauskas <[email protected]>

[Why]
For non-DSC streams the DSC padding is zero.

This causes the borrow-mode estimate to always borrow instead of
falling back to FRL_BORROW_MODE_NONE.

[How]
Return early in update_borrow_mode_from_dsc_padding() when both
hactive and htotal padding are zero.

Cc: Aric Cyr <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: [email protected]
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: James Lin <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/link/protocols/link_hdmi_frl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_hdmi_frl.c 
b/drivers/gpu/drm/amd/display/dc/link/protocols/link_hdmi_frl.c
index 2eaa830662b0..cb201c9ee3c6 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_hdmi_frl.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_hdmi_frl.c
@@ -1173,6 +1173,10 @@ static void update_borrow_mode_from_dsc_padding(struct 
dsc_padding_params *dsc_p
        uint32_t h_blank = timing->h_total - h_active;
        struct frl_borrow_params *borrow_params = 
&frl_link_settings->borrow_params;
 
+       if (dsc_padding_params->dsc_hactive_padding == 0 &&
+           dsc_padding_params->dsc_htotal_padding == 0)
+               return;
+
        borrow_params->borrow_mode = 
frl_modify_borrow_mode_for_dsc_padding(timing->pix_clk_100hz,
                h_active,
                h_active + dsc_padding_params->dsc_hactive_padding,
-- 
2.43.0

Reply via email to