amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Leo Liu <leo.liu@amd.com>
To: amd-gfx@lists.freedesktop.org
Cc: Leo Liu <leo.liu@amd.com>
Subject: [PATCH 13/21] drm/amd/powerplay: add Powergate JPEG for Renoir
Date: Tue, 12 Nov 2019 13:03:21 -0500	[thread overview]
Message-ID: <20191112180329.3927-14-leo.liu@amd.com> (raw)
Message-ID: <20191112180321.BKLYdtDnz4xLv-ssX66qua43YESaqCs1ZqPJcktSndk@z> (raw)
In-Reply-To: <20191112180329.3927-1-leo.liu@amd.com>

Similar to SDMA, VCN etc.

Signed-off-by: Leo Liu <leo.liu@amd.com>
---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c    |  2 ++
 drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h |  2 ++
 drivers/gpu/drm/amd/powerplay/renoir_ppt.c    |  1 +
 drivers/gpu/drm/amd/powerplay/smu_internal.h  |  2 ++
 drivers/gpu/drm/amd/powerplay/smu_v12_0.c     | 11 +++++++++++
 5 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index 69243a858dd5..211934521d37 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -1229,6 +1229,7 @@ static int smu_hw_init(void *handle)
 	if (adev->flags & AMD_IS_APU) {
 		smu_powergate_sdma(&adev->smu, false);
 		smu_powergate_vcn(&adev->smu, false);
+		smu_powergate_jpeg(&adev->smu, false);
 		smu_set_gfx_cgpg(&adev->smu, true);
 	}
 
@@ -1287,6 +1288,7 @@ static int smu_hw_fini(void *handle)
 	if (adev->flags & AMD_IS_APU) {
 		smu_powergate_sdma(&adev->smu, true);
 		smu_powergate_vcn(&adev->smu, true);
+		smu_powergate_jpeg(&adev->smu, true);
 	}
 
 	ret = smu_stop_thermal_control(smu);
diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h b/drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h
index 9b9f5df0911c..1745e0146fba 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/smu_v12_0.h
@@ -58,6 +58,8 @@ int smu_v12_0_powergate_sdma(struct smu_context *smu, bool gate);
 
 int smu_v12_0_powergate_vcn(struct smu_context *smu, bool gate);
 
+int smu_v12_0_powergate_jpeg(struct smu_context *smu, bool gate);
+
 int smu_v12_0_set_gfx_cgpg(struct smu_context *smu, bool enable);
 
 uint32_t smu_v12_0_get_gfxoff_status(struct smu_context *smu);
diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
index 04daf7e9fe05..492a201554e8 100644
--- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
@@ -697,6 +697,7 @@ static const struct pptable_funcs renoir_ppt_funcs = {
 	.check_fw_version = smu_v12_0_check_fw_version,
 	.powergate_sdma = smu_v12_0_powergate_sdma,
 	.powergate_vcn = smu_v12_0_powergate_vcn,
+	.powergate_jpeg = smu_v12_0_powergate_jpeg,
 	.send_smc_msg = smu_v12_0_send_msg,
 	.send_smc_msg_with_param = smu_v12_0_send_msg_with_param,
 	.read_smc_arg = smu_v12_0_read_arg,
diff --git a/drivers/gpu/drm/amd/powerplay/smu_internal.h b/drivers/gpu/drm/amd/powerplay/smu_internal.h
index 8bcda7871309..70c4d66721cd 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_internal.h
+++ b/drivers/gpu/drm/amd/powerplay/smu_internal.h
@@ -42,6 +42,8 @@
 	((smu)->ppt_funcs->powergate_sdma ? (smu)->ppt_funcs->powergate_sdma((smu), (gate)) : 0)
 #define smu_powergate_vcn(smu, gate) \
 	((smu)->ppt_funcs->powergate_vcn ? (smu)->ppt_funcs->powergate_vcn((smu), (gate)) : 0)
+#define smu_powergate_jpeg(smu, gate) \
+	((smu)->ppt_funcs->powergate_jpeg ? (smu)->ppt_funcs->powergate_jpeg((smu), (gate)) : 0)
 
 #define smu_get_vbios_bootup_values(smu) \
 	((smu)->ppt_funcs->get_vbios_bootup_values ? (smu)->ppt_funcs->get_vbios_bootup_values((smu)) : 0)
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v12_0.c b/drivers/gpu/drm/amd/powerplay/smu_v12_0.c
index 139dd737eaa5..f5d87110ec34 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v12_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v12_0.c
@@ -203,6 +203,17 @@ int smu_v12_0_powergate_vcn(struct smu_context *smu, bool gate)
 		return smu_send_smc_msg(smu, SMU_MSG_PowerUpVcn);
 }
 
+int smu_v12_0_powergate_jpeg(struct smu_context *smu, bool gate)
+{
+	if (!(smu->adev->flags & AMD_IS_APU))
+		return 0;
+
+	if (gate)
+		return smu_send_smc_msg(smu, SMU_MSG_PowerDownJpeg);
+	else
+		return smu_send_smc_msg(smu, SMU_MSG_PowerUpJpeg);
+}
+
 int smu_v12_0_set_gfx_cgpg(struct smu_context *smu, bool enable)
 {
 	if (!(smu->adev->pg_flags & AMD_PG_SUPPORT_GFX_PG))
-- 
2.17.1

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

  parent reply	other threads:[~2019-11-12 18:04 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 18:03 [PATCH 00/21] Separate JPEG from VCN Leo Liu
2019-11-12 18:03 ` Leo Liu
     [not found] ` <20191112180329.3927-1-leo.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-12 18:03   ` [PATCH 01/21] drm/amdgpu: add JPEG HW IP and SW structures Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 02/21] drm/amdgpu: add amdgpu_jpeg and JPEG tests Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 03/21] drm/amdgpu: separate JPEG1.0 code out from VCN1.0 Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 04/21] drm/amdgpu: use the JPEG structure for general driver support Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 05/21] drm/amdgpu: add JPEG IP block type Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 06/21] drm/amdgpu: add JPEG common functions to amdgpu_jpeg Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 07/21] drm/amdgpu: add JPEG v2.0 function supports Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 08/21] drm/amdgpu: remove unnecessary JPEG2.0 code from VCN2.0 Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 09/21] drm/amdgpu: add JPEG PG and CG interface Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 10/21] drm/amdgpu: add PG and CG for JPEG2.0 Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 11/21] drm/amd/powerplay: add JPEG Powerplay interface Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 12/21] drm/amd/powerplay: add JPEG power control for Navi1x Leo Liu
2019-11-12 18:03     ` Leo Liu
     [not found]     ` <20191112180329.3927-13-leo.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-13  3:50       ` Quan, Evan
2019-11-13  3:50         ` Quan, Evan
     [not found]         ` <MN2PR12MB334438FF2957ED7C7C8E226FE4760-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-11-13 13:50           ` Leo Liu
2019-11-13 13:50             ` Leo Liu
2019-11-13 14:11       ` Leo Liu
2019-11-13 14:11         ` Leo Liu
2019-11-12 18:03   ` Leo Liu [this message]
2019-11-12 18:03     ` [PATCH 13/21] drm/amd/powerplay: add Powergate JPEG for Renoir Leo Liu
     [not found]     ` <20191112180329.3927-14-leo.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-13  3:52       ` Quan, Evan
2019-11-13  3:52         ` Quan, Evan
2019-11-13 14:12       ` Leo Liu
2019-11-13 14:12         ` Leo Liu
2019-11-12 18:03   ` [PATCH 14/21] drm/amd/powerplay: add JPEG power control " Leo Liu
2019-11-12 18:03     ` Leo Liu
     [not found]     ` <20191112180329.3927-15-leo.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-13  3:52       ` Quan, Evan
2019-11-13  3:52         ` Quan, Evan
2019-11-13 14:13       ` Leo Liu
2019-11-13 14:13         ` Leo Liu
2019-11-12 18:03   ` [PATCH 15/21] drm/amd/powerplay: set JPEG to SMU dpm Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 16/21] drm/amdgpu: enable JPEG2.0 dpm Leo Liu
2019-11-12 18:03     ` Leo Liu
     [not found]     ` <20191112180329.3927-17-leo.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-14 16:03       ` Alex Deucher
2019-11-14 16:03         ` Alex Deucher
     [not found]         ` <CADnq5_PTs-1fU3o3rpQ1hhAdbiicwixWMHuOxSbZ7bshMSBVxA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-11-14 16:14           ` Leo Liu
2019-11-14 16:14             ` Leo Liu
2019-11-12 18:03   ` [PATCH 17/21] drm/amdgpu: add driver support for JPEG2.0 and above Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 18/21] drm/amdgpu: enable JPEG2.0 for Navi1x and Renoir Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 19/21] drm/amdgpu: move JPEG2.5 out from VCN2.5 Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 20/21] drm/amdgpu: enable Arcturus CG for VCN and JPEG blocks Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:03   ` [PATCH 21/21] drm/amdgpu: enable Arcturus JPEG2.5 block Leo Liu
2019-11-12 18:03     ` Leo Liu
2019-11-12 18:59   ` [PATCH 00/21] Separate JPEG from VCN Leo Liu
2019-11-12 18:59     ` Leo Liu
2019-11-12 19:49   ` Alex Deucher
2019-11-12 19:49     ` Alex Deucher
     [not found]     ` <CADnq5_NVBemrfE5OB=NBeb5XM5HPWdnhjaWM0KjdDyb6+pm9zA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-11-12 19:57       ` Leo Liu
2019-11-12 19:57         ` Leo Liu
     [not found]         ` <171a5818-a2b5-6e91-ac35-050b43963988-5C7GfCeVMHo@public.gmane.org>
2019-11-12 20:12           ` Alex Deucher
2019-11-12 20:12             ` Alex Deucher
     [not found]             ` <CADnq5_MRfvfE1D5SPOWTyWZFnLZezZ3N61QXvrwnLFssM++LrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-11-12 20:16               ` Leo Liu
2019-11-12 20:16                 ` Leo Liu
     [not found]                 ` <bf523547-408a-536d-5f61-226691058a7b-5C7GfCeVMHo@public.gmane.org>
2019-11-12 20:34                   ` Alex Deucher
2019-11-12 20:34                     ` Alex Deucher
     [not found]                     ` <CADnq5_NjNPZC=2xt5Qft6_jiZnbdtR+LqogTWdfty_N_zWR_uA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-11-12 20:37                       ` Leo Liu
2019-11-12 20:37                         ` Leo Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191112180329.3927-14-leo.liu@amd.com \
    --to=leo.liu@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).