mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
drm/amd/pm: implement dpm vcn reset function
Implement VCN engine reset by sending MSG_ResetVCN on smu 13.0.6. v2: fix format for code and message Reviewed-by: Sonny Jiang <sonny.jiang@amd.com> Reviewed-by: Leo Liu <leo.liu@amd.com> Signed-off-by: Ruili Ji <ruiliji2@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
dd035239c9
commit
9f7ce6a9ab
|
|
@ -789,6 +789,21 @@ int amdgpu_dpm_reset_sdma(struct amdgpu_device *adev, uint32_t inst_mask)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int amdgpu_dpm_reset_vcn(struct amdgpu_device *adev, uint32_t inst_mask)
|
||||
{
|
||||
struct smu_context *smu = adev->powerplay.pp_handle;
|
||||
int ret;
|
||||
|
||||
if (!is_support_sw_smu(adev))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
mutex_lock(&adev->pm.mutex);
|
||||
ret = smu_reset_vcn(smu, inst_mask);
|
||||
mutex_unlock(&adev->pm.mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int amdgpu_dpm_get_dpm_freq_range(struct amdgpu_device *adev,
|
||||
enum pp_clock_type type,
|
||||
uint32_t *min,
|
||||
|
|
|
|||
|
|
@ -607,5 +607,6 @@ ssize_t amdgpu_dpm_get_pm_policy_info(struct amdgpu_device *adev,
|
|||
enum pp_pm_policy p_type, char *buf);
|
||||
int amdgpu_dpm_reset_sdma(struct amdgpu_device *adev, uint32_t inst_mask);
|
||||
bool amdgpu_dpm_reset_sdma_is_supported(struct amdgpu_device *adev);
|
||||
int amdgpu_dpm_reset_vcn(struct amdgpu_device *adev, uint32_t inst_mask);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3967,3 +3967,11 @@ int smu_reset_sdma(struct smu_context *smu, uint32_t inst_mask)
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int smu_reset_vcn(struct smu_context *smu, uint32_t inst_mask)
|
||||
{
|
||||
if (smu->ppt_funcs && smu->ppt_funcs->dpm_reset_vcn)
|
||||
smu->ppt_funcs->dpm_reset_vcn(smu, inst_mask);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1396,6 +1396,11 @@ struct pptable_funcs {
|
|||
*/
|
||||
bool (*reset_sdma_is_supported)(struct smu_context *smu);
|
||||
|
||||
/**
|
||||
* @reset_vcn: message SMU to soft reset vcn instance.
|
||||
*/
|
||||
int (*dpm_reset_vcn)(struct smu_context *smu, uint32_t inst_mask);
|
||||
|
||||
/**
|
||||
* @get_ecc_table: message SMU to get ECC INFO table.
|
||||
*/
|
||||
|
|
@ -1659,6 +1664,7 @@ int smu_send_hbm_bad_channel_flag(struct smu_context *smu, uint32_t size);
|
|||
int smu_send_rma_reason(struct smu_context *smu);
|
||||
int smu_reset_sdma(struct smu_context *smu, uint32_t inst_mask);
|
||||
bool smu_reset_sdma_is_supported(struct smu_context *smu);
|
||||
int smu_reset_vcn(struct smu_context *smu, uint32_t inst_mask);
|
||||
int smu_set_pm_policy(struct smu_context *smu, enum pp_pm_policy p_type,
|
||||
int level);
|
||||
ssize_t smu_get_pm_policy_info(struct smu_context *smu,
|
||||
|
|
|
|||
|
|
@ -94,7 +94,8 @@
|
|||
#define PPSMC_MSG_RmaDueToBadPageThreshold 0x43
|
||||
#define PPSMC_MSG_SetThrottlingPolicy 0x44
|
||||
#define PPSMC_MSG_ResetSDMA 0x4D
|
||||
#define PPSMC_Message_Count 0x4E
|
||||
#define PPSMC_MSG_ResetVCN 0x4E
|
||||
#define PPSMC_Message_Count 0x4F
|
||||
|
||||
//PPSMC Reset Types for driver msg argument
|
||||
#define PPSMC_RESET_TYPE_DRIVER_MODE_1_RESET 0x1
|
||||
|
|
|
|||
|
|
@ -277,6 +277,7 @@
|
|||
__SMU_DUMMY_MAP(MALLPowerController), \
|
||||
__SMU_DUMMY_MAP(MALLPowerState), \
|
||||
__SMU_DUMMY_MAP(ResetSDMA), \
|
||||
__SMU_DUMMY_MAP(ResetVCN), \
|
||||
__SMU_DUMMY_MAP(GetStaticMetricsTable),
|
||||
|
||||
#undef __SMU_DUMMY_MAP
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@ static const struct cmn2asic_msg_mapping smu_v13_0_6_message_map[SMU_MSG_MAX_COU
|
|||
MSG_MAP(RmaDueToBadPageThreshold, PPSMC_MSG_RmaDueToBadPageThreshold, 0),
|
||||
MSG_MAP(SetThrottlingPolicy, PPSMC_MSG_SetThrottlingPolicy, 0),
|
||||
MSG_MAP(ResetSDMA, PPSMC_MSG_ResetSDMA, 0),
|
||||
MSG_MAP(ResetVCN, PPSMC_MSG_ResetVCN, 0),
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
|
@ -2941,6 +2942,19 @@ static int smu_v13_0_6_reset_sdma(struct smu_context *smu, uint32_t inst_mask)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int smu_v13_0_6_reset_vcn(struct smu_context *smu, uint32_t inst_mask)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_ResetVCN, inst_mask, NULL);
|
||||
if (ret)
|
||||
dev_err(smu->adev->dev,
|
||||
"failed to send ResetVCN event with mask 0x%x\n",
|
||||
inst_mask);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int mca_smu_set_debug_mode(struct amdgpu_device *adev, bool enable)
|
||||
{
|
||||
struct smu_context *smu = adev->powerplay.pp_handle;
|
||||
|
|
@ -3615,6 +3629,7 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {
|
|||
.send_rma_reason = smu_v13_0_6_send_rma_reason,
|
||||
.reset_sdma = smu_v13_0_6_reset_sdma,
|
||||
.reset_sdma_is_supported = smu_v13_0_6_reset_sdma_is_supported,
|
||||
.dpm_reset_vcn = smu_v13_0_6_reset_vcn,
|
||||
};
|
||||
|
||||
void smu_v13_0_6_set_ppt_funcs(struct smu_context *smu)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user