]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amd/display: Clamp VStartup value at DML calculations time
authorNikola Cornij <nikola.cornij@amd.com>
Tue, 8 Jun 2021 00:36:05 +0000 (20:36 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 21 Jun 2021 21:45:14 +0000 (17:45 -0400)
[why]
Some timings with a large VBlank cause the value to overflow the
register related, while also producing other wrong values in DML output.

[how]
Clamp VStartup at the DCN3.1 maximum value

Signed-off-by: Nikola Cornij <nikola.cornij@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@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/dml/dcn31/display_mode_vba_31.c

index 06fac59a3d40ca0717a59833959a897e7faadc7e..718d5a99dadabe2644916b98120ad8267cf1f2cb 100644 (file)
@@ -2668,6 +2668,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
                                                                                                (double) v->WritebackDelay[v->VoltageLevel][k]
                                                                                                                / (v->HTotal[k] / v->PixelClock[k]),
                                                                                                1));
+               if (v->MaxVStartupLines[k] > 1023)
+                       v->MaxVStartupLines[k] = 1023;
 
 #ifdef __DML_VBA_DEBUG__
                dml_print("DML::%s: k=%d MaxVStartupLines = %d\n", __func__, k, v->MaxVStartupLines[k]);
@@ -5064,6 +5066,8 @@ void dml31_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
                                                                                                                                / (v->HTotal[k]
                                                                                                                                                / v->PixelClock[k]),
                                                                                                                1.0));
+                               if (v->MaximumVStartup[i][j][k] > 1023)
+                                       v->MaximumVStartup[i][j][k] = 1023;
                                v->MaxMaxVStartup[i][j] = dml_max(v->MaxMaxVStartup[i][j], v->MaximumVStartup[i][j][k]);
                        }
                }