[PATCH 083/138] drm/amd/powerplay: implement sensor of SCLK and MCLK for smu11

Huang Rui ray.huang at amd.com
Fri Jan 25 10:24:50 UTC 2019


From: Kevin Wang <Kevin1.Wang at amd.com>

add sensor interface of SCLK and MCKL for sys interface and hwmon.

Signed-off-by: Kevin Wang <Kevin1.Wang at amd.com>
Reviewed-by: Huang Rui <ray.huang at amd.com>
Reviewed-by: Evan Quan <evan.quan at amd.com>
---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 1aef6c6..7c16ece 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -1020,6 +1020,14 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,
 		ret = smu_v11_0_get_current_activity_percent(smu, data);
 		*size = 4;
 		break;
+	case AMDGPU_PP_SENSOR_GFX_MCLK:
+		ret = smu_get_current_clk_freq(smu, PPCLK_UCLK, (uint32_t *)data);
+		*size = 4;
+		break;
+	case AMDGPU_PP_SENSOR_GFX_SCLK:
+		ret = smu_get_current_clk_freq(smu, PPCLK_GFXCLK, (uint32_t *)data);
+		*size = 4;
+		break;
 	default:
 		ret = -EINVAL;
 		break;
-- 
2.7.4



More information about the amd-gfx mailing list