Skip to content

Commit d7d2688

Browse files
Kenneth Fengalexdeucher
authored andcommitted
drm/amd/pm: update workload mask after the setting
update workload mask after the setting. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3625 Signed-off-by: Kenneth Feng <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 34ad56a commit d7d2688

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2569,10 +2569,14 @@ static int smu_v13_0_0_set_power_profile_mode(struct smu_context *smu,
25692569
}
25702570
}
25712571

2572-
return smu_cmn_send_smc_msg_with_param(smu,
2572+
ret = smu_cmn_send_smc_msg_with_param(smu,
25732573
SMU_MSG_SetWorkloadMask,
25742574
workload_mask,
25752575
NULL);
2576+
if (!ret)
2577+
smu->workload_mask = workload_mask;
2578+
2579+
return ret;
25762580
}
25772581

25782582
static bool smu_v13_0_0_is_mode1_reset_supported(struct smu_context *smu)

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2501,8 +2501,11 @@ static int smu_v13_0_7_set_power_profile_mode(struct smu_context *smu, long *inp
25012501
return -EINVAL;
25022502
ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetWorkloadMask,
25032503
1 << workload_type, NULL);
2504+
25042505
if (ret)
25052506
dev_err(smu->adev->dev, "[%s] Failed to set work load mask!", __func__);
2507+
else
2508+
smu->workload_mask = (1 << workload_type);
25062509

25072510
return ret;
25082511
}

drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1861,10 +1861,14 @@ static int smu_v14_0_2_set_power_profile_mode(struct smu_context *smu,
18611861
if (workload_type < 0)
18621862
return -EINVAL;
18631863

1864-
return smu_cmn_send_smc_msg_with_param(smu,
1864+
ret = smu_cmn_send_smc_msg_with_param(smu,
18651865
SMU_MSG_SetWorkloadMask,
18661866
1 << workload_type,
18671867
NULL);
1868+
if (!ret)
1869+
smu->workload_mask = 1 << workload_type;
1870+
1871+
return ret;
18681872
}
18691873

18701874
static int smu_v14_0_2_baco_enter(struct smu_context *smu)

0 commit comments

Comments
 (0)