OSDN Git Service

drm/amd/powerplay: add interface to notify smu enable pme restore register
authorHuang Rui <ray.huang@amd.com>
Wed, 16 Jan 2019 10:55:33 +0000 (18:55 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Mar 2019 20:03:59 +0000 (15:03 -0500)
This patch adds interface to notify smu enable pme restore register for display
and in smu v11 didn't have this implementation.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Kevin Wang <Kevin1.Wang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h

index 4fa3fa5..93830d7 100644 (file)
@@ -593,10 +593,10 @@ void pp_rv_set_pme_wa_enable(struct pp_smu *pp)
        void *pp_handle = adev->powerplay.pp_handle;
        const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
 
-       if (!pp_funcs || !pp_funcs->notify_smu_enable_pwe)
-               return;
-
-       pp_funcs->notify_smu_enable_pwe(pp_handle);
+       if (pp_funcs && pp_funcs->notify_smu_enable_pwe)
+               pp_funcs->notify_smu_enable_pwe(pp_handle);
+       else if (adev->smu.funcs)
+               smu_notify_smu_enable_pwe(&adev->smu);
 }
 
 void pp_rv_set_active_display_count(struct pp_smu *pp, int count)
index a7e62cd..53bdc1c 100644 (file)
@@ -319,6 +319,7 @@ struct smu_funcs
                              struct smu_performance_level *level);
        int (*get_current_shallow_sleep_clocks)(struct smu_context *smu,
                                                struct smu_clock_info *clocks);
+       int (*notify_smu_enable_pwe)(struct smu_context *smu);
 };
 
 #define smu_init_microcode(smu) \
@@ -436,6 +437,8 @@ struct smu_funcs
        ((smu)->funcs->get_perf_level ? (smu)->funcs->get_perf_level((smu), (designation), (level)) : 0)
 #define smu_get_current_shallow_sleep_clocks(smu, clocks) \
        ((smu)->funcs->get_current_shallow_sleep_clocks ? (smu)->funcs->get_current_shallow_sleep_clocks((smu), (clocks)) : 0)
+#define smu_notify_smu_enable_pwe(smu) \
+       ((smu)->funcs->notify_smu_enable_pwe ? (smu)->funcs->notify_smu_enable_pwe((smu)) : 0)
 
 
 extern int smu_get_atom_data_table(struct smu_context *smu, uint32_t table,