|
@@ -1088,6 +1088,7 @@ static int pp_set_power_profile_mode(void *handle, long *input, uint32_t size)
|
|
{
|
|
{
|
|
struct pp_hwmgr *hwmgr;
|
|
struct pp_hwmgr *hwmgr;
|
|
struct pp_instance *pp_handle = (struct pp_instance *)handle;
|
|
struct pp_instance *pp_handle = (struct pp_instance *)handle;
|
|
|
|
+ int ret = -EINVAL;
|
|
|
|
|
|
if (pp_check(pp_handle))
|
|
if (pp_check(pp_handle))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
@@ -1098,8 +1099,11 @@ static int pp_set_power_profile_mode(void *handle, long *input, uint32_t size)
|
|
pr_info("%s was not implemented.\n", __func__);
|
|
pr_info("%s was not implemented.\n", __func__);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
-
|
|
|
|
- return hwmgr->hwmgr_func->set_power_profile_mode(hwmgr, input, size);
|
|
|
|
|
|
+ mutex_lock(&pp_handle->pp_lock);
|
|
|
|
+ if (hwmgr->dpm_level == AMD_DPM_FORCED_LEVEL_MANUAL)
|
|
|
|
+ ret = hwmgr->hwmgr_func->set_power_profile_mode(hwmgr, input, size);
|
|
|
|
+ mutex_unlock(&pp_handle->pp_lock);
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
static int pp_odn_edit_dpm_table(void *handle, uint32_t type, long *input, uint32_t size)
|
|
static int pp_odn_edit_dpm_table(void *handle, uint32_t type, long *input, uint32_t size)
|