]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Overwriting dualDPP UBF values before usage
authorAusef Yousof <Ausef.Yousof@amd.com>
Tue, 26 Nov 2024 20:26:01 +0000 (15:26 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Dec 2024 15:32:12 +0000 (10:32 -0500)
[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: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Ausef Yousof <Ausef.Yousof@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core_structs.h

index be87dc0f077996785af15a52cb05d53bb80ddb4f..6822b07951204b03f77d7e2c79e6739678d693e8 100644 (file)
@@ -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]);
                }
 
index f951936bb579e62ef862d71aec94dcf0b39619fa..504c427b3b31919c845e2eb212090780746703c6 100644 (file)
@@ -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;