Skip to content

Commit

Permalink
drm/amd/display: Handle Y carry-over in VCP X.Y calculation
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
George Shen authored and Alex Deucher committed Sep 29, 2021
1 parent c01baf2 commit 3626a6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,12 @@ void enc1_stream_encoder_set_throttled_vcp_size(
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);
Expand Down

0 comments on commit 3626a6a

Please sign in to comment.