Commit 24909d9e authored by Ausef Yousof's avatar Ausef Yousof Committed by Alex Deucher
Browse files

drm/amd/display: Overwriting dualDPP UBF values before usage



[WHY]
Right now in dml2 mode validation we are calculating UBF parameters for
prefetch calculation for single and dual DPP scenarios. Data structure
to store such values are just 1D arrays, the single DPP values are
overwritten by the dualDPP values, and we end up using dualDPP for
prefetch calculations twice (once in place of singleDPP support check
and again for dual).

This naturally leads to many problems, one of which validating a mode in
"singleDPP" (when we used dual DPP parameters) and sending the singleDPP
parameters to mode programming, if we cannot support then we observe the
corruption as described in the ticket.

[HOW]
UBF values need to have 2d arrays to store values specific to single and
dual DPP states to avoid single DPP values being overwritten. Other
parameters are recorded on a per state basis such as prefetch UBF values
but they are in the same loop used for calculation and at that point its
fine to overwrite them, its not the case for plain UBF values.

Reviewed-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: default avatarAusef Yousof <Ausef.Yousof@amd.com>
Signed-off-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 5a498172
Loading
Loading
Loading
Loading
+15 −15
Original line number Diff line number Diff line
@@ -6301,9 +6301,9 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib)
			mode_lib->ms.meta_row_bandwidth_this_state,
			mode_lib->ms.dpte_row_bandwidth_this_state,
			mode_lib->ms.NoOfDPPThisState,
			mode_lib->ms.UrgentBurstFactorLuma,
			mode_lib->ms.UrgentBurstFactorChroma,
			mode_lib->ms.UrgentBurstFactorCursor);
			mode_lib->ms.UrgentBurstFactorLuma[j],
			mode_lib->ms.UrgentBurstFactorChroma[j],
			mode_lib->ms.UrgentBurstFactorCursor[j]);
		s->VMDataOnlyReturnBWPerState = dml_get_return_bw_mbps_vm_only(
																	&mode_lib->ms.soc,
@@ -6458,9 +6458,9 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib)
				mode_lib->ms.cursor_bw_pre,
				mode_lib->ms.prefetch_vmrow_bw,
				mode_lib->ms.NoOfDPPThisState,
				mode_lib->ms.UrgentBurstFactorLuma,
				mode_lib->ms.UrgentBurstFactorChroma,
				mode_lib->ms.UrgentBurstFactorCursor,
				mode_lib->ms.UrgentBurstFactorLuma[j],
				mode_lib->ms.UrgentBurstFactorChroma[j],
				mode_lib->ms.UrgentBurstFactorCursor[j],
				mode_lib->ms.UrgentBurstFactorLumaPre,
				mode_lib->ms.UrgentBurstFactorChromaPre,
				mode_lib->ms.UrgentBurstFactorCursorPre,
@@ -6517,9 +6517,9 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib)
						mode_lib->ms.cursor_bw,
						mode_lib->ms.cursor_bw_pre,
						mode_lib->ms.NoOfDPPThisState,
						mode_lib->ms.UrgentBurstFactorLuma,
						mode_lib->ms.UrgentBurstFactorChroma,
						mode_lib->ms.UrgentBurstFactorCursor,
						mode_lib->ms.UrgentBurstFactorLuma[j],
						mode_lib->ms.UrgentBurstFactorChroma[j],
						mode_lib->ms.UrgentBurstFactorCursor[j],
						mode_lib->ms.UrgentBurstFactorLumaPre,
						mode_lib->ms.UrgentBurstFactorChromaPre,
						mode_lib->ms.UrgentBurstFactorCursorPre);
@@ -6586,9 +6586,9 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib)
													mode_lib->ms.cursor_bw_pre,
													mode_lib->ms.prefetch_vmrow_bw,
													mode_lib->ms.NoOfDPP[j], // VBA_ERROR DPPPerSurface is not assigned at this point, should use NoOfDpp here
													mode_lib->ms.UrgentBurstFactorLuma,
													mode_lib->ms.UrgentBurstFactorChroma,
													mode_lib->ms.UrgentBurstFactorCursor,
													mode_lib->ms.UrgentBurstFactorLuma[j],
													mode_lib->ms.UrgentBurstFactorChroma[j],
													mode_lib->ms.UrgentBurstFactorCursor[j],
													mode_lib->ms.UrgentBurstFactorLumaPre,
													mode_lib->ms.UrgentBurstFactorChromaPre,
													mode_lib->ms.UrgentBurstFactorCursorPre,
@@ -7809,9 +7809,9 @@ dml_bool_t dml_core_mode_support(struct display_mode_lib_st *mode_lib)
				mode_lib->ms.DETBufferSizeYThisState[k],
				mode_lib->ms.DETBufferSizeCThisState[k],
				/* Output */
				&mode_lib->ms.UrgentBurstFactorCursor[k],
				&mode_lib->ms.UrgentBurstFactorLuma[k],
				&mode_lib->ms.UrgentBurstFactorChroma[k],
				&mode_lib->ms.UrgentBurstFactorCursor[j][k],
				&mode_lib->ms.UrgentBurstFactorLuma[j][k],
				&mode_lib->ms.UrgentBurstFactorChroma[j][k],
				&mode_lib->ms.NotUrgentLatencyHiding[k]);
		}
+3 −3
Original line number Diff line number Diff line
@@ -884,11 +884,11 @@ struct mode_support_st {
	dml_uint_t meta_row_height[__DML_NUM_PLANES__];
	dml_uint_t meta_row_height_chroma[__DML_NUM_PLANES__];
	dml_float_t UrgLatency;
	dml_float_t UrgentBurstFactorCursor[__DML_NUM_PLANES__];
	dml_float_t UrgentBurstFactorCursor[2][__DML_NUM_PLANES__];
	dml_float_t UrgentBurstFactorCursorPre[__DML_NUM_PLANES__];
	dml_float_t UrgentBurstFactorLuma[__DML_NUM_PLANES__];
	dml_float_t UrgentBurstFactorLuma[2][__DML_NUM_PLANES__];
	dml_float_t UrgentBurstFactorLumaPre[__DML_NUM_PLANES__];
	dml_float_t UrgentBurstFactorChroma[__DML_NUM_PLANES__];
	dml_float_t UrgentBurstFactorChroma[2][__DML_NUM_PLANES__];
	dml_float_t UrgentBurstFactorChromaPre[__DML_NUM_PLANES__];
	dml_float_t MaximumSwathWidthInLineBufferLuma;
	dml_float_t MaximumSwathWidthInLineBufferChroma;