aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/1151-drm-amd-powerplay-correct-Vega20-gfxclk-readout-unde.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/1151-drm-amd-powerplay-correct-Vega20-gfxclk-readout-unde.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/1151-drm-amd-powerplay-correct-Vega20-gfxclk-readout-unde.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/1151-drm-amd-powerplay-correct-Vega20-gfxclk-readout-unde.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/1151-drm-amd-powerplay-correct-Vega20-gfxclk-readout-unde.patch
new file mode 100644
index 00000000..991ebaf6
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/1151-drm-amd-powerplay-correct-Vega20-gfxclk-readout-unde.patch
@@ -0,0 +1,48 @@
+From 06b6280744393007d65c921727d880b39a16dc44 Mon Sep 17 00:00:00 2001
+From: Evan Quan <evan.quan@amd.com>
+Date: Thu, 24 Jan 2019 17:50:39 +0800
+Subject: [PATCH 1151/2940] drm/amd/powerplay: correct Vega20 gfxclk readout
+ under DS
+
+Current implementation cannot report the correct gfxclk under DS.
+
+Signed-off-by: Evan Quan <evan.quan@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
+index 5085b3636f8e..13f124125f5a 100644
+--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
+@@ -2013,16 +2013,20 @@ static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx,
+ {
+ struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend);
+ struct amdgpu_device *adev = hwmgr->adev;
++ SmuMetrics_t metrics_table;
+ uint32_t val_vid;
+ int ret = 0;
+
+ switch (idx) {
+ case AMDGPU_PP_SENSOR_GFX_SCLK:
+- ret = vega20_get_current_clk_freq(hwmgr,
+- PPCLK_GFXCLK,
+- (uint32_t *)value);
+- if (!ret)
+- *size = 4;
++ ret = smum_smc_table_manager(hwmgr, (uint8_t *)&metrics_table,
++ TABLE_SMU_METRICS, true);
++ PP_ASSERT_WITH_CODE(!ret,
++ "Failed to export SMU METRICS table!",
++ return ret);
++
++ *((uint32_t *)value) = metrics_table.AverageGfxclkFrequency * 100;
++ *size = 4;
+ break;
+ case AMDGPU_PP_SENSOR_GFX_MCLK:
+ ret = vega20_get_current_clk_freq(hwmgr,
+--
+2.17.1
+