diff options
author | Xiaomeng Hou <Xiaomeng.Hou@amd.com> | 2021-03-09 02:19:39 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-06-04 23:03:21 +0300 |
commit | 0b8b1c4d1a422b6f89918a15d9586de8d5795f46 (patch) | |
tree | d9c5074b04b584e07a4aa227532b81c903f42369 /drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | |
parent | 2f6888afded8a96cf558067cd5366b0dce8812a3 (diff) | |
download | linux-0b8b1c4d1a422b6f89918a15d9586de8d5795f46.tar.xz |
drm/amd/pm: initialize feature_enabled/feature_support bitmap for yellow carp
Initialize the feature_enabled and feature_supported bitmap for yellow
carp.
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c')
-rw-r--r-- | drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c index 935754e0de95..feef77c31d56 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c @@ -177,6 +177,30 @@ err0_out: return -ENOMEM; } +static int yellow_carp_system_features_control(struct smu_context *smu, bool en) +{ + struct smu_feature *feature = &smu->smu_feature; + uint32_t feature_mask[2]; + int ret = 0; + + bitmap_zero(feature->enabled, feature->feature_num); + bitmap_zero(feature->supported, feature->feature_num); + + if (!en) + return ret; + + ret = smu_cmn_get_enabled_32_bits_mask(smu, feature_mask, 2); + if (ret) + return ret; + + bitmap_copy(feature->enabled, (unsigned long *)&feature_mask, + feature->feature_num); + bitmap_copy(feature->supported, (unsigned long *)&feature_mask, + feature->feature_num); + + return 0; +} + static int yellow_carp_dpm_set_vcn_enable(struct smu_context *smu, bool enable) { int ret = 0; @@ -679,6 +703,7 @@ static const struct pptable_funcs yellow_carp_ppt_funcs = { .check_fw_version = smu_v13_0_1_check_fw_version, .init_smc_tables = yellow_carp_init_smc_tables, .fini_smc_tables = smu_v13_0_1_fini_smc_tables, + .system_features_control = yellow_carp_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 = yellow_carp_dpm_set_vcn_enable, |