summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2017-09-25 18:51:50 +0800
committerAlex Deucher <alexander.deucher@amd.com>2017-09-28 16:03:33 -0400
commit6d07fe7bcae57ee73d87766b6cd1e026d3fee85d (patch)
treed5610d5a4bd1ee4c8bd8e69f668864fbd8ca3cc2 /drivers/gpu/drm/amd/powerplay/amd_powerplay.c
parent790d84fdc9826500c88abfca0f3f86e96153bd4e (diff)
drm/amdgpu: delete pp_enable in adev
amdgpu not care powerplay or dpm is enabled. just check ip functions and pp functions Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/amd_powerplay.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/amd_powerplay.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 9f3f3b8cf64f..5c7415e8fd0e 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -30,6 +30,9 @@
#include "pp_instance.h"
#include "power_state.h"
+static int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_task task_id,
+ void *input, void *output);
+
static inline int pp_check(struct pp_instance *handle)
{
if (handle == NULL || handle->pp_valid != PP_VALID)
@@ -146,6 +149,19 @@ static int pp_hw_fini(void *handle)
return 0;
}
+static int pp_late_init(void *handle)
+{
+ struct pp_instance *pp_handle = (struct pp_instance *)handle;
+ int ret = 0;
+
+ ret = pp_check(pp_handle);
+ if (ret == 0)
+ pp_dpm_dispatch_tasks(pp_handle,
+ AMD_PP_TASK_COMPLETE_INIT, NULL, NULL);
+
+ return 0;
+}
+
static bool pp_is_idle(void *handle)
{
return false;
@@ -254,7 +270,7 @@ static int pp_resume(void *handle)
const struct amd_ip_funcs pp_ip_funcs = {
.name = "powerplay",
.early_init = pp_early_init,
- .late_init = NULL,
+ .late_init = pp_late_init,
.sw_init = pp_sw_init,
.sw_fini = pp_sw_fini,
.hw_init = pp_hw_init,