drm/amd/display: Uninitialized variables causing 4k60 UCLK to stay at DPM1 and not...
authorSamson Tam <samson.tam@amd.com>
Mon, 5 Dec 2022 16:08:40 +0000 (11:08 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 3 Jan 2023 22:20:04 +0000 (17:20 -0500)
[Why]
SwathSizePerSurfaceY[] and SwathSizePerSurfaceC[] values are uninitialized
 because we are using += instead of = operator.

[How]
Assign values in loop with = operator.

Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Samson Tam <samson.tam@amd.com>
Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.0.x, 6.1.x
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c

index 5af601cff1a0f7f2de8601c57ba287a6b0c1c8a9..b53feeaf5cf117031d531410830292f4dc9306f9 100644 (file)
@@ -6257,12 +6257,12 @@ bool dml32_CalculateDETSwathFillLatencyHiding(unsigned int NumberOfActiveSurface
        double SwathSizePerSurfaceC[DC__NUM_DPP__MAX];
        bool NotEnoughDETSwathFillLatencyHiding = false;
 
-       /* calculate sum of single swath size for all pipes in bytes*/
+       /* calculate sum of single swath size for all pipes in bytes */
        for (k = 0; k < NumberOfActiveSurfaces; k++) {
-               SwathSizePerSurfaceY[k] += SwathHeightY[k] * SwathWidthY[k] * BytePerPixelInDETY[k] * NumOfDPP[k];
+               SwathSizePerSurfaceY[k] = SwathHeightY[k] * SwathWidthY[k] * BytePerPixelInDETY[k] * NumOfDPP[k];
 
                if (SwathHeightC[k] != 0)
-                       SwathSizePerSurfaceC[k] += SwathHeightC[k] * SwathWidthC[k] * BytePerPixelInDETC[k] * NumOfDPP[k];
+                       SwathSizePerSurfaceC[k] = SwathHeightC[k] * SwathWidthC[k] * BytePerPixelInDETC[k] * NumOfDPP[k];
                else
                        SwathSizePerSurfaceC[k] = 0;