aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
diff options
context:
space:
mode:
authorEmily Deng <Emily.Deng@amd.com>2019-05-28 10:17:04 +0800
committerAlex Deucher <alexander.deucher@amd.com>2019-05-28 14:47:42 -0500
commit394e9a14c63d58e0f45323629a3f9ce1e5bf0215 (patch)
treef87083296c2c93abbc36053cbec3af1bbbab37af /drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
parentdrm/amdgpu/soc15: skip reset on init (diff)
downloadlinux-dev-394e9a14c63d58e0f45323629a3f9ce1e5bf0215.tar.xz
linux-dev-394e9a14c63d58e0f45323629a3f9ce1e5bf0215.zip
drm/amdgpu: Need to set the baco cap before baco reset
For passthrough, after rebooted the VM, driver will do a baco reset before doing other driver initialization during loading driver. For doing the baco reset, it will first check the baco reset capability. So first need to set the cap from the vbios information or baco reset won't be enabled. Signed-off-by: Emily Deng <Emily.Deng@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
index b6767d74dc85..83d22cdeaa29 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
@@ -1371,3 +1371,27 @@ int vega10_get_powerplay_table_entry(struct pp_hwmgr *hwmgr,
return result;
}
+
+int vega10_baco_set_cap(struct pp_hwmgr *hwmgr)
+{
+ int result = 0;
+
+ const ATOM_Vega10_POWERPLAYTABLE *powerplay_table;
+
+ powerplay_table = get_powerplay_table(hwmgr);
+
+ PP_ASSERT_WITH_CODE((powerplay_table != NULL),
+ "Missing PowerPlay Table!", return -1);
+
+ result = check_powerplay_tables(hwmgr, powerplay_table);
+
+ PP_ASSERT_WITH_CODE((result == 0),
+ "check_powerplay_tables failed", return result);
+
+ set_hw_cap(
+ hwmgr,
+ 0 != (le32_to_cpu(powerplay_table->ulPlatformCaps) & ATOM_VEGA10_PP_PLATFORM_CAP_BACO),
+ PHM_PlatformCaps_BACO);
+ return result;
+}
+