Skip to contentSkip to conversation

drm/amd/powerplay: add vclk/dclkSoftMin support for raven

PATCH In review Junwei Zhang 2 participants 2 messages Jul 28, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/powerplay: add vclk/dclkSoftMin support for raven

---
 drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 9 +++++++++
 drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.h | 2 ++
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h      | 2 ++
 drivers/gpu/drm/amd/powerplay/inc/rv_ppsmc.h   | 7 ++++++-
 4 files changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c +9 -0
index f61da66..14e0321 100644
@@ -279,6 +279,15 @@ static int rv_tf_set_clock_limit(struct pp_hwmgr *hwmgr, void *input,
 		}
 	} */
 
+	if (((hwmgr->uvd_arbiter.vclk_soft_min / 100) != rv_data->vclk_soft_min) ||
+	    ((hwmgr->uvd_arbiter.dclk_soft_min / 100) != rv_data->dclk_soft_min)) {
+		rv_data->vclk_soft_min = hwmgr->uvd_arbiter.vclk_soft_min / 100;
+		rv_data->dclk_soft_min = hwmgr->uvd_arbiter.dclk_soft_min / 100;
+		smum_send_msg_to_smc_with_parameter(hwmgr->smumgr,
+			PPSMC_MSG_SetSoftMinVcn,
+			(rv_data->vclk_soft_min << 16) | rv_data->vclk_soft_min);
+	}
+
 	if((hwmgr->gfx_arbiter.sclk_hard_min != 0) &&
 		((hwmgr->gfx_arbiter.sclk_hard_min / 100) != rv_data->soc_actual_hard_min_freq)) {
 		smum_send_msg_to_smc_with_parameter(hwmgr->smumgr,
drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.h +2 -0
index afb8522..2472b50 100644
@@ -280,6 +280,8 @@ struct rv_hwmgr {
 
 	uint32_t                        f_actual_hard_min_freq;
 	uint32_t                        fabric_actual_soft_min_freq;
+	uint32_t                        vclk_soft_min;
+	uint32_t                        dclk_soft_min;
 	uint32_t                        gfx_actual_soft_min_freq;
 
 	bool                           vcn_power_gated;
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
index 3a0e6b1..f539d55 100644
@@ -128,6 +128,8 @@ struct phm_uvd_arbiter {
 	uint32_t dclk;
 	uint32_t vclk_ceiling;
 	uint32_t dclk_ceiling;
+	uint32_t vclk_soft_min;
+	uint32_t dclk_soft_min;
 };
 
 struct phm_vce_arbiter {
drivers/gpu/drm/amd/powerplay/inc/rv_ppsmc.h +6 -1
index e0e106f..901c960c 100644
@@ -66,7 +66,12 @@
 #define PPSMC_MSG_SetMinVddcrSocVoltage         0x22
 #define PPSMC_MSG_SetMinVideoFclkFreq           0x23
 #define PPSMC_MSG_SetMinDeepSleepDcefclk        0x24
-#define PPSMC_Message_Count                     0x25
+#define PPSMC_MSG_ForcePowerDownGfx             0x25
+#define PPSMC_MSG_SetPhyclkVoltageByFreq        0x26
+#define PPSMC_MSG_SetDppclkVoltageByFreq        0x27
+#define PPSMC_MSG_SetSoftMinVcn                 0x28
+#define PPSMC_Message_Count                     0x29
+
 
 typedef uint16_t PPSMC_Result;
 typedef int      PPSMC_Msg;
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): 1501234125-24584-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 1 line · Junwei Zhang
Quoted 74 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 9 +++++++++
 drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.h | 2 ++
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h      | 2 ++
 drivers/gpu/drm/amd/powerplay/inc/rv_ppsmc.h   | 7 ++++++-
 4 files changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c +9 -0
index f61da66..14e0321 100644
@@ -279,6 +279,15 @@ static int rv_tf_set_clock_limit(struct pp_hwmgr *hwmgr, void *input,
                }
        } */
 
+       if (((hwmgr->uvd_arbiter.vclk_soft_min / 100) != rv_data->vclk_soft_min) ||
+           ((hwmgr->uvd_arbiter.dclk_soft_min / 100) != rv_data->dclk_soft_min)) {
+               rv_data->vclk_soft_min = hwmgr->uvd_arbiter.vclk_soft_min / 100;
+               rv_data->dclk_soft_min = hwmgr->uvd_arbiter.dclk_soft_min / 100;
+               smum_send_msg_to_smc_with_parameter(hwmgr->smumgr,
+                       PPSMC_MSG_SetSoftMinVcn,
+                       (rv_data->vclk_soft_min << 16) | rv_data->vclk_soft_min);
+       }
+
        if((hwmgr->gfx_arbiter.sclk_hard_min != 0) &&
                ((hwmgr->gfx_arbiter.sclk_hard_min / 100) != rv_data->soc_actual_hard_min_freq)) {
                smum_send_msg_to_smc_with_parameter(hwmgr->smumgr,
drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.h +2 -0
index afb8522..2472b50 100644
@@ -280,6 +280,8 @@ struct rv_hwmgr {
 
        uint32_t                        f_actual_hard_min_freq;
        uint32_t                        fabric_actual_soft_min_freq;
+       uint32_t                        vclk_soft_min;
+       uint32_t                        dclk_soft_min;
        uint32_t                        gfx_actual_soft_min_freq;
 
        bool                           vcn_power_gated;
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
index 3a0e6b1..f539d55 100644
@@ -128,6 +128,8 @@ struct phm_uvd_arbiter {
        uint32_t dclk;
        uint32_t vclk_ceiling;
        uint32_t dclk_ceiling;
+       uint32_t vclk_soft_min;
+       uint32_t dclk_soft_min;
 };
 
 struct phm_vce_arbiter {
drivers/gpu/drm/amd/powerplay/inc/rv_ppsmc.h +6 -2
index e0e106f..901c960c 100644
@@ -66,7 +66,12 @@
 #define PPSMC_MSG_SetMinVddcrSocVoltage         0x22
 #define PPSMC_MSG_SetMinVideoFclkFreq           0x23
 #define PPSMC_MSG_SetMinDeepSleepDcefclk        0x24
-#define PPSMC_Message_Count                     0x25
+#define PPSMC_MSG_ForcePowerDownGfx             0x25
+#define PPSMC_MSG_SetPhyclkVoltageByFreq        0x26
+#define PPSMC_MSG_SetDppclkVoltageByFreq        0x27
+#define PPSMC_MSG_SetSoftMinVcn                 0x28
+#define PPSMC_Message_Count                     0x29
+
 
 typedef uint16_t PPSMC_Result;
 typedef int      PPSMC_Msg;
--

1.9.1

Quoted 4 lines

_______________________________________________
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