aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0961-drm-amd-powerplay-Clean-up-reading-GPU-load.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0961-drm-amd-powerplay-Clean-up-reading-GPU-load.patch')
-rw-r--r--common/recipes-kernel/linux/files/0961-drm-amd-powerplay-Clean-up-reading-GPU-load.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0961-drm-amd-powerplay-Clean-up-reading-GPU-load.patch b/common/recipes-kernel/linux/files/0961-drm-amd-powerplay-Clean-up-reading-GPU-load.patch
new file mode 100644
index 00000000..1a4f6d67
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0961-drm-amd-powerplay-Clean-up-reading-GPU-load.patch
@@ -0,0 +1,41 @@
+From 9a3617cb545c8c7cfa15bc2c1cbb14cf4c2ffd8e Mon Sep 17 00:00:00 2001
+From: Tom St Denis <tom.stdenis@amd.com>
+Date: Fri, 18 Dec 2015 09:19:26 -0500
+Subject: [PATCH 0961/1050] drm/amd/powerplay: Clean up reading GPU load
+
+This patch cleans up the routine by not reading the register if the value
+is to be thrown away anyways. Also remove the redundant comparison of active_percent.
+
+Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
+index 9b5d529..248446b 100644
+--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
+@@ -1540,14 +1540,14 @@ cz_print_current_perforce_level(struct pp_hwmgr *hwmgr, struct seq_file *m)
+ }
+
+ result = smum_send_msg_to_smc(hwmgr->smumgr, PPSMC_MSG_GetAverageGraphicsActivity);
+- active_percent = cgs_read_register(hwmgr->device, mmSMU_MP1_SRBM2P_ARG_0);
+-
+- if (0 == result)
++ if (0 == result) {
++ active_percent = cgs_read_register(hwmgr->device, mmSMU_MP1_SRBM2P_ARG_0);
+ active_percent = active_percent > 100 ? 100 : active_percent;
+- else
++ } else {
+ active_percent = 50;
++ }
+
+- seq_printf(m, "\n [GPU load]: %u %%\n\n", active_percent > 100 ? 100 : active_percent);
++ seq_printf(m, "\n [GPU load]: %u %%\n\n", active_percent);
+ }
+
+ static void cz_hw_print_display_cfg(
+--
+1.9.1
+