Commit 85f8433f authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu/powerplay: properly set PP_GFXOFF_MASK (v2)

So that the setting reflects what the hw supports. This will
be used in a subsequent patch so needs to be correct.

v2: squash in fix from Colin Ian King

Bug: https://bugzilla.kernel.org/show_bug.cgi?id=205497Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4a113278
...@@ -730,6 +730,7 @@ static int smu_set_funcs(struct amdgpu_device *adev) ...@@ -730,6 +730,7 @@ static int smu_set_funcs(struct amdgpu_device *adev)
switch (adev->asic_type) { switch (adev->asic_type) {
case CHIP_VEGA20: case CHIP_VEGA20:
adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
vega20_set_ppt_funcs(smu); vega20_set_ppt_funcs(smu);
break; break;
case CHIP_NAVI10: case CHIP_NAVI10:
...@@ -738,6 +739,7 @@ static int smu_set_funcs(struct amdgpu_device *adev) ...@@ -738,6 +739,7 @@ static int smu_set_funcs(struct amdgpu_device *adev)
navi10_set_ppt_funcs(smu); navi10_set_ppt_funcs(smu);
break; break;
case CHIP_ARCTURUS: case CHIP_ARCTURUS:
adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
arcturus_set_ppt_funcs(smu); arcturus_set_ppt_funcs(smu);
/* OD is not supported on Arcturus */ /* OD is not supported on Arcturus */
smu->od_enabled =false; smu->od_enabled =false;
......
...@@ -81,6 +81,8 @@ static void hwmgr_init_workload_prority(struct pp_hwmgr *hwmgr) ...@@ -81,6 +81,8 @@ static void hwmgr_init_workload_prority(struct pp_hwmgr *hwmgr)
int hwmgr_early_init(struct pp_hwmgr *hwmgr) int hwmgr_early_init(struct pp_hwmgr *hwmgr)
{ {
struct amdgpu_device *adev;
if (!hwmgr) if (!hwmgr)
return -EINVAL; return -EINVAL;
...@@ -94,8 +96,11 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr) ...@@ -94,8 +96,11 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr)
hwmgr_init_workload_prority(hwmgr); hwmgr_init_workload_prority(hwmgr);
hwmgr->gfxoff_state_changed_by_workload = false; hwmgr->gfxoff_state_changed_by_workload = false;
adev = hwmgr->adev;
switch (hwmgr->chip_family) { switch (hwmgr->chip_family) {
case AMDGPU_FAMILY_CI: case AMDGPU_FAMILY_CI:
adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
hwmgr->smumgr_funcs = &ci_smu_funcs; hwmgr->smumgr_funcs = &ci_smu_funcs;
ci_set_asic_special_caps(hwmgr); ci_set_asic_special_caps(hwmgr);
hwmgr->feature_mask &= ~(PP_VBI_TIME_SUPPORT_MASK | hwmgr->feature_mask &= ~(PP_VBI_TIME_SUPPORT_MASK |
...@@ -106,12 +111,14 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr) ...@@ -106,12 +111,14 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr)
smu7_init_function_pointers(hwmgr); smu7_init_function_pointers(hwmgr);
break; break;
case AMDGPU_FAMILY_CZ: case AMDGPU_FAMILY_CZ:
adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
hwmgr->od_enabled = false; hwmgr->od_enabled = false;
hwmgr->smumgr_funcs = &smu8_smu_funcs; hwmgr->smumgr_funcs = &smu8_smu_funcs;
hwmgr->feature_mask &= ~PP_GFXOFF_MASK; hwmgr->feature_mask &= ~PP_GFXOFF_MASK;
smu8_init_function_pointers(hwmgr); smu8_init_function_pointers(hwmgr);
break; break;
case AMDGPU_FAMILY_VI: case AMDGPU_FAMILY_VI:
adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
hwmgr->feature_mask &= ~PP_GFXOFF_MASK; hwmgr->feature_mask &= ~PP_GFXOFF_MASK;
switch (hwmgr->chip_id) { switch (hwmgr->chip_id) {
case CHIP_TOPAZ: case CHIP_TOPAZ:
...@@ -153,6 +160,7 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr) ...@@ -153,6 +160,7 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr)
case AMDGPU_FAMILY_AI: case AMDGPU_FAMILY_AI:
switch (hwmgr->chip_id) { switch (hwmgr->chip_id) {
case CHIP_VEGA10: case CHIP_VEGA10:
adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
hwmgr->feature_mask &= ~PP_GFXOFF_MASK; hwmgr->feature_mask &= ~PP_GFXOFF_MASK;
hwmgr->smumgr_funcs = &vega10_smu_funcs; hwmgr->smumgr_funcs = &vega10_smu_funcs;
vega10_hwmgr_init(hwmgr); vega10_hwmgr_init(hwmgr);
...@@ -162,6 +170,7 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr) ...@@ -162,6 +170,7 @@ int hwmgr_early_init(struct pp_hwmgr *hwmgr)
vega12_hwmgr_init(hwmgr); vega12_hwmgr_init(hwmgr);
break; break;
case CHIP_VEGA20: case CHIP_VEGA20:
adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
hwmgr->feature_mask &= ~PP_GFXOFF_MASK; hwmgr->feature_mask &= ~PP_GFXOFF_MASK;
hwmgr->smumgr_funcs = &vega20_smu_funcs; hwmgr->smumgr_funcs = &vega20_smu_funcs;
vega20_hwmgr_init(hwmgr); vega20_hwmgr_init(hwmgr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment