Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <dmytro.laktyushkin@amd.com>
Acked-by: Solomon Chiu <solomon.chiu@amd.com>
Signed-off-by: Victor Lu <victorchengchi.lu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Victor Lu and committed by
Alex Deucher
c8f8e968 91e27371

+3
+3
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
··· 841 841 else 842 842 *DestinationLinesForPrefetch = dst_y_prefetch_equ; 843 843 844 + // Limit to prevent overflow in DST_Y_PREFETCH register 845 + *DestinationLinesForPrefetch = dml_min(*DestinationLinesForPrefetch, 63.75); 846 + 844 847 dml_print("DML: VStartup: %d\n", VStartup); 845 848 dml_print("DML: TCalc: %f\n", TCalc); 846 849 dml_print("DML: TWait: %f\n", TWait);