mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 19:49:33 -04:00
drm/amd/pm: unified smu feature cap for link reset
unified link reset smu feature cap Signed-off-by: Yang Wang <kevinyang.wang@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -3536,15 +3536,10 @@ bool smu_mode1_reset_is_support(struct smu_context *smu)
|
||||
|
||||
bool smu_link_reset_is_support(struct smu_context *smu)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
if (!smu->pm_enabled)
|
||||
return false;
|
||||
|
||||
if (smu->ppt_funcs && smu->ppt_funcs->link_reset_is_support)
|
||||
ret = smu->ppt_funcs->link_reset_is_support(smu);
|
||||
|
||||
return ret;
|
||||
return smu_feature_cap_test(smu, SMU_FEATURE_CAP_ID__LINK_RESET);
|
||||
}
|
||||
|
||||
int smu_mode1_reset(struct smu_context *smu)
|
||||
|
||||
@@ -529,6 +529,7 @@ enum smu_fw_status {
|
||||
#define SMU_WBRF_EVENT_HANDLING_PACE 10
|
||||
|
||||
enum smu_feature_cap_id {
|
||||
SMU_FEATURE_CAP_ID__LINK_RESET = 0,
|
||||
SMU_FEATURE_CAP_ID__COUNT,
|
||||
};
|
||||
|
||||
@@ -1281,11 +1282,6 @@ struct pptable_funcs {
|
||||
*/
|
||||
bool (*mode1_reset_is_support)(struct smu_context *smu);
|
||||
|
||||
/**
|
||||
* @link_reset_is_support: Check if GPU supports link reset.
|
||||
*/
|
||||
bool (*link_reset_is_support)(struct smu_context *smu);
|
||||
|
||||
/**
|
||||
* @mode1_reset: Perform mode1 reset.
|
||||
*
|
||||
|
||||
@@ -3227,6 +3227,14 @@ static int smu_v13_0_6_reset_vcn(struct smu_context *smu, uint32_t inst_mask)
|
||||
}
|
||||
|
||||
|
||||
static int smu_v13_0_6_post_init(struct smu_context *smu)
|
||||
{
|
||||
if (smu_v13_0_6_is_link_reset_supported(smu))
|
||||
smu_feature_cap_set(smu, SMU_FEATURE_CAP_ID__LINK_RESET);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mca_smu_set_debug_mode(struct amdgpu_device *adev, bool enable)
|
||||
{
|
||||
struct smu_context *smu = adev->powerplay.pp_handle;
|
||||
@@ -3896,7 +3904,6 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {
|
||||
.get_xcp_metrics = smu_v13_0_6_get_xcp_metrics,
|
||||
.get_thermal_temperature_range = smu_v13_0_6_get_thermal_temperature_range,
|
||||
.mode1_reset_is_support = smu_v13_0_6_is_mode1_reset_supported,
|
||||
.link_reset_is_support = smu_v13_0_6_is_link_reset_supported,
|
||||
.mode1_reset = smu_v13_0_6_mode1_reset,
|
||||
.mode2_reset = smu_v13_0_6_mode2_reset,
|
||||
.link_reset = smu_v13_0_6_link_reset,
|
||||
@@ -3909,6 +3916,7 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {
|
||||
.reset_sdma_is_supported = smu_v13_0_6_reset_sdma_is_supported,
|
||||
.dpm_reset_vcn = smu_v13_0_6_reset_vcn,
|
||||
.reset_vcn_is_supported = smu_v13_0_6_reset_vcn_is_supported,
|
||||
.post_init = smu_v13_0_6_post_init,
|
||||
};
|
||||
|
||||
void smu_v13_0_6_set_ppt_funcs(struct smu_context *smu)
|
||||
|
||||
Reference in New Issue
Block a user