]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Handle Y carry-over in VCP X.Y calculation
authorGeorge Shen <george.shen@amd.com>
Thu, 16 Sep 2021 23:55:39 +0000 (19:55 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jul 2024 07:08:14 +0000 (09:08 +0200)
[ Upstream commit 3626a6aebe62ce7067cdc460c0c644e9445386bb ]

[Why/How]
Theoretically rare corner case where ceil(Y) results in rounding
up to an integer. If this happens, the 1 should be carried over to
the X value.

Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Acked-by: Anson Jacob <Anson.Jacob@amd.com>
Signed-off-by: George Shen <george.shen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c

index 6718777c826dc672ade455c4b7e5cd27cb444b12..5d2013f1c072987dcb3c323ec9d50a2cea5e83a2 100644 (file)
@@ -635,6 +635,12 @@ void enc1_stream_encoder_set_mst_bandwidth(
                                x),
                        26));
 
+       // If y rounds up to integer, carry it over to x.
+       if (y >> 26) {
+               x += 1;
+               y = 0;
+       }
+
        REG_SET_2(DP_MSE_RATE_CNTL, 0,
                DP_MSE_RATE_X, x,
                DP_MSE_RATE_Y, y);