Commit f74aa69d authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: initialize uvd/vce powergate status v4

On UVD/VCE dpm enabled/disabled, the powergate status will be
set as false/true. So that we will not try to ungate/gate them(
enable/disable their dpm) again.

v2: added check for uvd/vce powergate status before gating
v3: fix typo in description
v4: warning fix (Alex)
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8fd26361
...@@ -777,6 +777,21 @@ static int vega12_set_allowed_featuresmask(struct pp_hwmgr *hwmgr) ...@@ -777,6 +777,21 @@ static int vega12_set_allowed_featuresmask(struct pp_hwmgr *hwmgr)
return 0; return 0;
} }
static void vega12_init_powergate_state(struct pp_hwmgr *hwmgr)
{
struct vega12_hwmgr *data =
(struct vega12_hwmgr *)(hwmgr->backend);
data->uvd_power_gated = true;
data->vce_power_gated = true;
if (data->smu_features[GNLD_DPM_UVD].enabled)
data->uvd_power_gated = false;
if (data->smu_features[GNLD_DPM_VCE].enabled)
data->vce_power_gated = false;
}
static int vega12_enable_all_smu_features(struct pp_hwmgr *hwmgr) static int vega12_enable_all_smu_features(struct pp_hwmgr *hwmgr)
{ {
struct vega12_hwmgr *data = struct vega12_hwmgr *data =
...@@ -801,6 +816,8 @@ static int vega12_enable_all_smu_features(struct pp_hwmgr *hwmgr) ...@@ -801,6 +816,8 @@ static int vega12_enable_all_smu_features(struct pp_hwmgr *hwmgr)
} }
} }
vega12_init_powergate_state(hwmgr);
return 0; return 0;
} }
...@@ -1985,6 +2002,9 @@ static void vega12_power_gate_vce(struct pp_hwmgr *hwmgr, bool bgate) ...@@ -1985,6 +2002,9 @@ static void vega12_power_gate_vce(struct pp_hwmgr *hwmgr, bool bgate)
{ {
struct vega12_hwmgr *data = (struct vega12_hwmgr *)(hwmgr->backend); struct vega12_hwmgr *data = (struct vega12_hwmgr *)(hwmgr->backend);
if (data->vce_power_gated == bgate)
return;
data->vce_power_gated = bgate; data->vce_power_gated = bgate;
vega12_enable_disable_vce_dpm(hwmgr, !bgate); vega12_enable_disable_vce_dpm(hwmgr, !bgate);
} }
...@@ -1993,6 +2013,9 @@ static void vega12_power_gate_uvd(struct pp_hwmgr *hwmgr, bool bgate) ...@@ -1993,6 +2013,9 @@ static void vega12_power_gate_uvd(struct pp_hwmgr *hwmgr, bool bgate)
{ {
struct vega12_hwmgr *data = (struct vega12_hwmgr *)(hwmgr->backend); struct vega12_hwmgr *data = (struct vega12_hwmgr *)(hwmgr->backend);
if (data->uvd_power_gated == bgate)
return;
data->uvd_power_gated = bgate; data->uvd_power_gated = bgate;
vega12_enable_disable_uvd_dpm(hwmgr, !bgate); vega12_enable_disable_uvd_dpm(hwmgr, !bgate);
} }
......
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