drm/amd/pp: Reset memory levels table before populating values

Submitted by Nicholas Kazlauskas on Aug. 1, 2018, 8:30 p.m.


Message ID 20180801203033.5811-1-nicholas.kazlauskas@amd.com
State New
Headers show
Series "drm/amd/pp: Reset memory levels table before populating values" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Nicholas Kazlauskas Aug. 1, 2018, 8:30 p.m.

On POLARIS10 powerplay can fail to retrieve minimum memory clocks.
This cascades into failing to find the MinVddc value when
populating a single memory level. When this is called during
polaris10_populate_all_memory_levels the function exits early leaving
the previously used values in the smc_state_table.

Under these conditions visual corruption can be observed on the screen
during modesets between specific bandwidth thresholds.


There seems to be a similar problem and solution for Tonga: a memset
on the levels table before populating its values. This change fixes
the visual corruption that seems to occur when changing from a low
clock mode (640x480@75Hz) to a medium clock mode (1920x1200@60Hz).

However, this is a small fix for a symptom of the larger issue of
failing to find the MinVddc. Other hardware would seem to encounter
the same issue if the table is empty, so significant refactoring
would likely be needed.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
 drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
index 1276f168ff68..68356479dac1 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
@@ -1134,6 +1134,8 @@  static int polaris10_populate_all_memory_levels(struct pp_hwmgr *hwmgr)
 	uint32_t i;
+	memset(levels, 0, array_size);
 	for (i = 0; i < dpm_table->mclk_table.count; i++) {
 		PP_ASSERT_WITH_CODE((0 != dpm_table->mclk_table.dpm_levels[i].value),
 				"can not populate memory level as memory clock is zero",