Skip to contentSkip to conversation

drm/amd/display: Guard DST_Y_PREFETCH register overflow in DCN21

PATCH In review Solomon Chiu 1 participant 2 messages Jul 24, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/14 drm/amd/display: Guard DST_Y_PREFETCH register overflow in DCN21

From: Victor Lu <[email protected]>

[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.

---
 drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c +3 -0
index 506797c721ed..4136eb8256cb 100644
@@ -841,6 +841,9 @@ static bool CalculatePrefetchSchedule(
 	else
 		*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: TCalc: %f\n", TCalc);
 	dml_print("DML: TWait: %f\n", TWait);
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

PATCH 2/14 drm/amd/display: Add missing DCN21 IP parameter

From: Victor Lu <[email protected]>

[why]
IP parameter min_meta_chunk_size_bytes is read for bandwidth calculations but it was never defined.

[how]
Define min_meta_chunk_size_bytes and initialize value to 256.

---
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1 -0
index a5dd97a2c5a3..f27fc2acac57 100644
@@ -109,6 +109,7 @@ struct _vcs_dpi_ip_params_st dcn2_1_ip = {
 	.max_page_table_levels = 4,
 	.pte_chunk_size_kbytes = 2,
 	.meta_chunk_size_kbytes = 2,
+	.min_meta_chunk_size_bytes = 256,
 	.writeback_chunk_size_kbytes = 2,
 	.line_buffer_size_bits = 789504,
 	.is_line_buffer_bpp_fixed = 0,
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx