Skip to content

Commit c8f8e96

Browse files
victorlu-amdalexdeucher
authored andcommitted
drm/amd/display: Guard DST_Y_PREFETCH register overflow in DCN21
[why] DST_Y_PREFETCH can overflow when DestinationLinesForPrefetch values are too large due to the former being limited to 8 bits. [how] Set the maximum value of DestinationLinesForPrefetch to be 255 * refclk period. Reviewed-by: Laktyushkin Dmytro <[email protected]> Acked-by: Solomon Chiu <[email protected]> Signed-off-by: Victor Lu <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 91e2737 commit c8f8e96

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,9 @@ static bool CalculatePrefetchSchedule(
841841
else
842842
*DestinationLinesForPrefetch = dst_y_prefetch_equ;
843843

844+
// Limit to prevent overflow in DST_Y_PREFETCH register
845+
*DestinationLinesForPrefetch = dml_min(*DestinationLinesForPrefetch, 63.75);
846+
844847
dml_print("DML: VStartup: %d\n", VStartup);
845848
dml_print("DML: TCalc: %f\n", TCalc);
846849
dml_print("DML: TWait: %f\n", TWait);

0 commit comments

Comments
 (0)