Commit 9857bb94 authored by Victor Lu's avatar Victor Lu Committed by Alex Deucher

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: default avatarLaktyushkin Dmytro <dmytro.laktyushkin@amd.com>
Acked-by: default avatarSolomon Chiu <solomon.chiu@amd.com>
Signed-off-by: default avatarVictor Lu <victorchengchi.lu@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 91b03fc6
...@@ -841,6 +841,9 @@ static bool CalculatePrefetchSchedule( ...@@ -841,6 +841,9 @@ static bool CalculatePrefetchSchedule(
else else
*DestinationLinesForPrefetch = dst_y_prefetch_equ; *DestinationLinesForPrefetch = dst_y_prefetch_equ;
// Limit to prevent overflow in DST_Y_PREFETCH register
*DestinationLinesForPrefetch = dml_min(*DestinationLinesForPrefetch, 63.75);
dml_print("DML: VStartup: %d\n", VStartup); dml_print("DML: VStartup: %d\n", VStartup);
dml_print("DML: TCalc: %f\n", TCalc); dml_print("DML: TCalc: %f\n", TCalc);
dml_print("DML: TWait: %f\n", TWait); dml_print("DML: TWait: %f\n", TWait);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment