Commit 2d64d23e authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/pm: unify the interface for gfx state setting

No need to have special handling for swSMU supported ASICs.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d2b0b483
...@@ -842,14 +842,10 @@ int amdgpu_gfx_get_num_kcq(struct amdgpu_device *adev) ...@@ -842,14 +842,10 @@ int amdgpu_gfx_get_num_kcq(struct amdgpu_device *adev)
void amdgpu_gfx_state_change_set(struct amdgpu_device *adev, enum gfx_change_state state) void amdgpu_gfx_state_change_set(struct amdgpu_device *adev, enum gfx_change_state state)
{ {
if (is_support_sw_smu(adev)) {
smu_gfx_state_change_set(&adev->smu, state);
} else {
mutex_lock(&adev->pm.mutex); mutex_lock(&adev->pm.mutex);
if (adev->powerplay.pp_funcs && if (adev->powerplay.pp_funcs &&
adev->powerplay.pp_funcs->gfx_state_change_set) adev->powerplay.pp_funcs->gfx_state_change_set)
((adev)->powerplay.pp_funcs->gfx_state_change_set( ((adev)->powerplay.pp_funcs->gfx_state_change_set(
(adev)->powerplay.pp_handle, state)); (adev)->powerplay.pp_handle, state));
mutex_unlock(&adev->pm.mutex); mutex_unlock(&adev->pm.mutex);
}
} }
...@@ -1282,8 +1282,6 @@ int smu_allow_xgmi_power_down(struct smu_context *smu, bool en); ...@@ -1282,8 +1282,6 @@ int smu_allow_xgmi_power_down(struct smu_context *smu, bool en);
int smu_get_status_gfxoff(struct amdgpu_device *adev, uint32_t *value); int smu_get_status_gfxoff(struct amdgpu_device *adev, uint32_t *value);
int smu_gfx_state_change_set(struct smu_context *smu, uint32_t state);
int smu_set_light_sbr(struct smu_context *smu, bool enable); int smu_set_light_sbr(struct smu_context *smu, bool enable);
int smu_wait_for_event(struct amdgpu_device *adev, enum smu_event_type event, int smu_wait_for_event(struct amdgpu_device *adev, enum smu_event_type event,
......
...@@ -2906,8 +2906,10 @@ static int smu_enable_mgpu_fan_boost(void *handle) ...@@ -2906,8 +2906,10 @@ static int smu_enable_mgpu_fan_boost(void *handle)
return ret; return ret;
} }
int smu_gfx_state_change_set(struct smu_context *smu, uint32_t state) static int smu_gfx_state_change_set(void *handle,
uint32_t state)
{ {
struct smu_context *smu = handle;
int ret = 0; int ret = 0;
mutex_lock(&smu->mutex); mutex_lock(&smu->mutex);
...@@ -2980,6 +2982,7 @@ static const struct amd_pm_funcs swsmu_pm_funcs = { ...@@ -2980,6 +2982,7 @@ static const struct amd_pm_funcs swsmu_pm_funcs = {
.display_disable_memory_clock_switch = smu_display_disable_memory_clock_switch, .display_disable_memory_clock_switch = smu_display_disable_memory_clock_switch,
.get_max_sustainable_clocks_by_dc = smu_get_max_sustainable_clocks_by_dc, .get_max_sustainable_clocks_by_dc = smu_get_max_sustainable_clocks_by_dc,
.load_firmware = smu_load_microcode, .load_firmware = smu_load_microcode,
.gfx_state_change_set = smu_gfx_state_change_set,
}; };
int smu_wait_for_event(struct amdgpu_device *adev, enum smu_event_type event, int smu_wait_for_event(struct amdgpu_device *adev, enum smu_event_type event,
......
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