All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] drm/amd/pp: Expose the smu support for SDMA PG cntl
@ 2018-09-26 12:50 Rex Zhu
       [not found] ` <1537966249-30259-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Rex Zhu @ 2018-09-26 12:50 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Rex Zhu

SDMA IP can be power up/down via smu message

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c     | 18 ++++++++++++++++++
 drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c |  8 ++++++++
 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h         |  1 +
 3 files changed, 27 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 53d3337..aff7c14 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -1214,6 +1214,21 @@ static void pp_dpm_powergate_acp(void *handle, bool gate)
 	hwmgr->hwmgr_func->powergate_acp(hwmgr, gate);
 }
 
+static void pp_dpm_powergate_sdma(void *handle, bool gate)
+{
+	struct pp_hwmgr *hwmgr = handle;
+
+	if (!hwmgr)
+		return;
+
+	if (hwmgr->hwmgr_func->powergate_sdma == NULL) {
+		pr_info("%s was not implemented.\n", __func__);
+		return;
+	}
+
+	hwmgr->hwmgr_func->powergate_sdma(hwmgr, gate);
+}
+
 static int pp_set_powergating_by_smu(void *handle,
 				uint32_t block_type, bool gate)
 {
@@ -1236,6 +1251,9 @@ static int pp_set_powergating_by_smu(void *handle,
 	case AMD_IP_BLOCK_TYPE_ACP:
 		pp_dpm_powergate_acp(handle, gate);
 		break;
+	case AMD_IP_BLOCK_TYPE_SDMA:
+		pp_dpm_powergate_sdma(handle, gate);
+		break;
 	default:
 		break;
 	}
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
index 5d1dae2..b7a9d0c 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
@@ -1153,6 +1153,14 @@ static int smu10_powergate_mmhub(struct pp_hwmgr *hwmgr)
 	return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PowerGateMmHub);
 }
 
+static int smu10_powergate_sdma(struct pp_hwmgr *hwmgr, bool gate)
+{
+	if (gate)
+		return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PowerDownSdma);
+	else
+		return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PowerUpSdma);
+}
+
 static void smu10_powergate_vcn(struct pp_hwmgr *hwmgr, bool bgate)
 {
 	if (bgate) {
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
index a6d9212..d1183b1 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
@@ -328,6 +328,7 @@ struct pp_hwmgr_func {
 	int (*set_power_limit)(struct pp_hwmgr *hwmgr, uint32_t n);
 	int (*powergate_mmhub)(struct pp_hwmgr *hwmgr);
 	int (*smus_notify_pwe)(struct pp_hwmgr *hwmgr);
+	int (*powergate_sdma)(struct pp_hwmgr *hwmgr, bool bgate);
 };
 
 struct pp_table_func {
-- 
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-09-26 15:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26 12:50 [PATCH 1/7] drm/amd/pp: Expose the smu support for SDMA PG cntl Rex Zhu
     [not found] ` <1537966249-30259-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-09-26 12:50   ` [PATCH 2/7] drm/amdgpu: Move out power up/down sdma out of smu Rex Zhu
     [not found]     ` <1537966249-30259-2-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-09-26 14:13       ` Alex Deucher
2018-09-26 12:50   ` [PATCH 3/7] drm/amd/pp: Remove uncessary extra vcn pg cntl in smu Rex Zhu
     [not found]     ` <1537966249-30259-3-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-09-26 14:13       ` Alex Deucher
2018-09-26 12:50   ` [PATCH 4/7] drm/amd/pp: Remove wrong code in fiji_start_smu Rex Zhu
     [not found]     ` <1537966249-30259-4-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-09-26 14:14       ` Alex Deucher
2018-09-26 12:50   ` [PATCH 5/7] drm/amd/pp: Remove useless code in smu Rex Zhu
     [not found]     ` <1537966249-30259-5-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-09-26 14:07       ` Alex Deucher
2018-09-26 12:50   ` [PATCH 6/7] drm/amd/pp: Export load_firmware interface Rex Zhu
     [not found]     ` <1537966249-30259-6-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-09-26 14:15       ` Alex Deucher
     [not found]         ` <CADnq5_PoCAk_k8EnFhWSvQER6ennOcDH6_N-uEe35xHTCnbNjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-26 15:21           ` Zhu, Rex
     [not found]             ` <BYAPR12MB2775099DFB71D6B0D40F4F69FB150-ZGDeBxoHBPmJeBUhB162ZQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-26 15:39               ` Alex Deucher
     [not found]                 ` <CADnq5_Obr9=qhsJqjKDpJccjpW24a5yjg34+fYLyA9qrBYDDfg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-26 15:55                   ` Zhu, Rex
2018-09-26 12:50   ` [PATCH 7/7] drm/amdgpu: Change the gfx/sdma init/fini sequence Rex Zhu
2018-09-26 14:13   ` [PATCH 1/7] drm/amd/pp: Expose the smu support for SDMA PG cntl Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.