Skip to content

Commit 1d2686d

Browse files
Hersen Wualexdeucher
authored andcommitted
drm/amdgpu/powerplay: nv1x, renior copy dcn clock settings of watermark to smu during boot up
dc to pplib interface is changed for navi1x, renoir. display_config_changed is not called by dc anymore. smu_write_watermarks_table is not executed for navi1x, renoir during boot up. solution: call smu_write_watermarks_table just after dc pass watermark clock settings to pplib Signed-off-by: Hersen Wu <[email protected]> Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent f1c2cd3 commit 1d2686d

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,8 +2006,11 @@ int smu_set_watermarks_for_clock_ranges(struct smu_context *smu,
20062006
smu_feature_is_enabled(smu, SMU_FEATURE_DPM_DCEFCLK_BIT) &&
20072007
smu_feature_is_enabled(smu, SMU_FEATURE_DPM_SOCCLK_BIT)) {
20082008
smu_set_watermarks_table(smu, table, clock_ranges);
2009-
smu->watermarks_bitmap |= WATERMARKS_EXIST;
2010-
smu->watermarks_bitmap &= ~WATERMARKS_LOADED;
2009+
2010+
if (!(smu->watermarks_bitmap & WATERMARKS_EXIST)) {
2011+
smu->watermarks_bitmap |= WATERMARKS_EXIST;
2012+
smu->watermarks_bitmap &= ~WATERMARKS_LOADED;
2013+
}
20112014
}
20122015

20132016
mutex_unlock(&smu->mutex);

drivers/gpu/drm/amd/powerplay/navi10_ppt.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,15 +1062,6 @@ static int navi10_display_config_changed(struct smu_context *smu)
10621062
{
10631063
int ret = 0;
10641064

1065-
if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&
1066-
!(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
1067-
ret = smu_write_watermarks_table(smu);
1068-
if (ret)
1069-
return ret;
1070-
1071-
smu->watermarks_bitmap |= WATERMARKS_LOADED;
1072-
}
1073-
10741065
if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&
10751066
smu_feature_is_supported(smu, SMU_FEATURE_DPM_DCEFCLK_BIT) &&
10761067
smu_feature_is_supported(smu, SMU_FEATURE_DPM_SOCCLK_BIT)) {
@@ -1493,6 +1484,7 @@ static int navi10_set_watermarks_table(struct smu_context *smu,
14931484
*clock_ranges)
14941485
{
14951486
int i;
1487+
int ret = 0;
14961488
Watermarks_t *table = watermarks;
14971489

14981490
if (!table || !clock_ranges)
@@ -1544,6 +1536,18 @@ static int navi10_set_watermarks_table(struct smu_context *smu,
15441536
clock_ranges->wm_mcif_clocks_ranges[i].wm_set_id;
15451537
}
15461538

1539+
smu->watermarks_bitmap |= WATERMARKS_EXIST;
1540+
1541+
/* pass data to smu controller */
1542+
if (!(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
1543+
ret = smu_write_watermarks_table(smu);
1544+
if (ret) {
1545+
pr_err("Failed to update WMTABLE!");
1546+
return ret;
1547+
}
1548+
smu->watermarks_bitmap |= WATERMARKS_LOADED;
1549+
}
1550+
15471551
return 0;
15481552
}
15491553

drivers/gpu/drm/amd/powerplay/renoir_ppt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,10 @@ static int renoir_set_watermarks_table(
806806
clock_ranges->wm_mcif_clocks_ranges[i].wm_set_id;
807807
}
808808

809+
smu->watermarks_bitmap |= WATERMARKS_EXIST;
810+
809811
/* pass data to smu controller */
810-
if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&
811-
!(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
812+
if (!(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
812813
ret = smu_write_watermarks_table(smu);
813814
if (ret) {
814815
pr_err("Failed to update WMTABLE!");

0 commit comments

Comments
 (0)