Skip to contentSkip to conversation

drm/amd/pp: implement dpm_get_sclk/mclk for RV

PATCH In review Rex Zhu 2 participants 2 messages Dec 12, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/1 drm/amd/pp: implement dpm_get_sclk/mclk for RV

Change-Id I3abf5bde8c64ccab8e842a7c22aee011fc34e69f
---
 drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c +23 -2
index 3e0b267..027fd63 100644
@@ -523,12 +523,33 @@ static int rv_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,
 
 static uint32_t rv_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low)
 {
-	return 0;
+	struct rv_hwmgr *data;
+
+	if (hwmgr == NULL)
+		return -EINVAL;
+
+	data = (struct rv_hwmgr *)(hwmgr->backend);
+
+	if (low)
+		return data->clock_vol_info.vdd_dep_on_fclk->entries[0].clk;
+	else
+		return data->clock_vol_info.vdd_dep_on_fclk->entries[
+			data->clock_vol_info.vdd_dep_on_fclk->count - 1].clk;
 }
 
 static uint32_t rv_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low)
 {
-	return 0;
+	struct rv_hwmgr *data;
+
+	if (hwmgr == NULL)
+		return -EINVAL;
+
+	data = (struct rv_hwmgr *)(hwmgr->backend);
+
+	if (low)
+		return data->gfx_min_freq_limit;
+	else
+		return data->gfx_max_freq_limit;
 }
 
 static int rv_dpm_patch_boot_state(struct pp_hwmgr *hwmgr,
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1513063453-21812-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

Reviewed-by Evan Quan Reviewed-by
#2 lore raw

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Rex Zhu <[email protected]>
Sent: Tuesday, December 12, 2017 2:24 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH] drm/amd/pp: implement dpm_get_sclk/mclk for RV

Change-Id I3abf5bde8c64ccab8e842a7c22aee011fc34e69f
---
 drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c +23 -2
index 3e0b267..027fd63 100644
@@ -523,12 +523,33 @@ static int rv_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,
 
 static uint32_t rv_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low)
 {
-       return 0;
+       struct rv_hwmgr *data;
+
+       if (hwmgr == NULL)
+               return -EINVAL;
+
+       data = (struct rv_hwmgr *)(hwmgr->backend);
+
+       if (low)
+               return data->clock_vol_info.vdd_dep_on_fclk->entries[0].clk;
+       else
+               return data->clock_vol_info.vdd_dep_on_fclk->entries[
+                       data->clock_vol_info.vdd_dep_on_fclk->count - 1].clk;
 }
 
 static uint32_t rv_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low)
 {
-       return 0;
+       struct rv_hwmgr *data;
+
+       if (hwmgr == NULL)
+               return -EINVAL;
+
+       data = (struct rv_hwmgr *)(hwmgr->backend);
+
+       if (low)
+               return data->gfx_min_freq_limit;
+       else
+               return data->gfx_max_freq_limit;
 }
 
 static int rv_dpm_patch_boot_state(struct pp_hwmgr *hwmgr,

--
1.9.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx