From: Boyuan Zhang <boyuan.zhang@xxxxxxx> For smu v13, set vcn enable or disable by the given instance instead of setting it for all vcn instances. Signed-off-by: Boyuan Zhang <boyuan.zhang@xxxxxxx> --- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 5 +++-- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 21 ++++++++----------- .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 2 +- .../drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c | 2 +- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 2 +- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h index e58220a7ee2f..7b4761ad1902 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h @@ -254,8 +254,9 @@ int smu_v13_0_gfx_ulv_control(struct smu_context *smu, int smu_v13_0_wait_for_event(struct smu_context *smu, enum smu_event_type event, uint64_t event_arg); -int smu_v13_0_set_vcn_enable(struct smu_context *smu, - bool enable); +int smu_v13_0_set_vcn_enable_instance(struct smu_context *smu, + bool enable, + int inst); int smu_v13_0_set_jpeg_enable(struct smu_context *smu, bool enable); diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c index e17466cc1952..d87a1e288b0a 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c @@ -2087,22 +2087,19 @@ int smu_v13_0_get_current_pcie_link_speed(struct smu_context *smu) return link_speed[speed_level]; } -int smu_v13_0_set_vcn_enable(struct smu_context *smu, - bool enable) +int smu_v13_0_set_vcn_enable_instance(struct smu_context *smu, + bool enable, + int inst) { struct amdgpu_device *adev = smu->adev; - int i, ret = 0; + int ret = 0; - for (i = 0; i < adev->vcn.num_vcn_inst; i++) { - if (adev->vcn.harvest_config & (1 << i)) - continue; + if (adev->vcn.harvest_config & (1 << inst)) + return ret; - ret = smu_cmn_send_smc_msg_with_param(smu, enable ? - SMU_MSG_PowerUpVcn : SMU_MSG_PowerDownVcn, - i << 16U, NULL); - if (ret) - return ret; - } + ret = smu_cmn_send_smc_msg_with_param(smu, enable ? + SMU_MSG_PowerUpVcn : SMU_MSG_PowerDownVcn, + inst << 16U, NULL); return ret; } diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c index 866dc77d1005..94a23b330d5e 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c @@ -3028,7 +3028,7 @@ static const struct pptable_funcs smu_v13_0_0_ppt_funcs = { .system_features_control = smu_v13_0_0_system_features_control, .set_allowed_mask = smu_v13_0_set_allowed_mask, .get_enabled_mask = smu_cmn_get_enabled_mask, - .dpm_set_vcn_enable = smu_v13_0_set_vcn_enable, + .dpm_set_vcn_enable_instance = smu_v13_0_set_vcn_enable_instance, .dpm_set_jpeg_enable = smu_v13_0_set_jpeg_enable, .get_dpm_ultimate_freq = smu_v13_0_0_get_dpm_ultimate_freq, .get_vbios_bootup_values = smu_v13_0_get_vbios_bootup_values, diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c index b081ae3e8f43..18d14f96b506 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c @@ -1099,7 +1099,7 @@ static const struct pptable_funcs smu_v13_0_4_ppt_funcs = { .system_features_control = smu_v13_0_4_system_features_control, .send_smc_msg_with_param = smu_cmn_send_smc_msg_with_param, .send_smc_msg = smu_cmn_send_smc_msg, - .dpm_set_vcn_enable = smu_v13_0_set_vcn_enable, + .dpm_set_vcn_enable_instance = smu_v13_0_set_vcn_enable_instance, .dpm_set_jpeg_enable = smu_v13_0_set_jpeg_enable, .set_default_dpm_table = smu_v13_0_set_default_dpm_tables, .read_sensor = smu_v13_0_4_read_sensor, diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c index f7d7cae16d9b..416ba5efbf1d 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c @@ -2607,7 +2607,7 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = { .system_features_control = smu_v13_0_system_features_control, .set_allowed_mask = smu_v13_0_set_allowed_mask, .get_enabled_mask = smu_cmn_get_enabled_mask, - .dpm_set_vcn_enable = smu_v13_0_set_vcn_enable, + .dpm_set_vcn_enable_instance = smu_v13_0_set_vcn_enable_instance, .dpm_set_jpeg_enable = smu_v13_0_set_jpeg_enable, .init_pptable_microcode = smu_v13_0_init_pptable_microcode, .populate_umd_state_clk = smu_v13_0_7_populate_umd_state_clk, -- 2.34.1