]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
drm/amd/powerplay: disable cg pg task when pp uninitialize.
authorRex Zhu <Rex.Zhu@amd.com>
Tue, 29 Nov 2016 10:33:19 +0000 (18:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Dec 2016 23:08:32 +0000 (18:08 -0500)
fix bug on uvd pg enabled, when reboot vm in pass through case,
we need to notify smu power up uvd/vce if they were power down.
otherwise, the vbios post will fail.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h

index b6f45fd01fa61621d2f1e776f94e26a5dd938f82..ec36c0e28388105e75e294de99300c8dac5a6218 100644 (file)
@@ -154,7 +154,7 @@ int pem_task_powerdown_vce_tasks(struct pp_eventmgr *eventmgr, struct pem_event_
 
 int pem_task_disable_clock_power_gatings_tasks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data)
 {
-       /* TODO */
+       phm_disable_clock_power_gatings(eventmgr->hwmgr);
        return 0;
 }
 
index 0723758ed0650616ee111af60e9ac14287f73ae2..c355a0f51663bc04fc40949be24fddf634ddd7c9 100644 (file)
@@ -209,6 +209,19 @@ int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr)
        return 0;
 }
 
+int phm_disable_clock_power_gatings(struct pp_hwmgr *hwmgr)
+{
+       PHM_FUNC_CHECK(hwmgr);
+
+       if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
+               PHM_PlatformCaps_TablelessHardwareInterface)) {
+               if (NULL != hwmgr->hwmgr_func->disable_clock_power_gating)
+                       return hwmgr->hwmgr_func->disable_clock_power_gating(hwmgr);
+       }
+       return 0;
+}
+
+
 int phm_display_configuration_changed(struct pp_hwmgr *hwmgr)
 {
        PHM_FUNC_CHECK(hwmgr);
index d4495839c64ce9a9eaa7b6608ce1fb2d8b0b5545..26129972f68681c91bb6780768bc01d25174e30f 100644 (file)
@@ -334,6 +334,7 @@ struct phm_clocks {
        uint32_t clock[MAX_NUM_CLOCKS];
 };
 
+extern int phm_disable_clock_power_gatings(struct pp_hwmgr *hwmgr);
 extern int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr);
 extern int phm_powergate_uvd(struct pp_hwmgr *hwmgr, bool gate);
 extern int phm_powergate_vce(struct pp_hwmgr *hwmgr, bool gate);