From: <boyuan.zhang@amd.com>
To: <amd-gfx@lists.freedesktop.org>, <leo.liu@amd.com>,
<christian.koenig@amd.com>, <alexander.deucher@amd.com>,
<sunil.khatri@amd.com>
Cc: Boyuan Zhang <boyuan.zhang@amd.com>
Subject: [PATCH 18/18] drm/amdgpu: set powergating state by vcn instance
Date: Fri, 4 Oct 2024 14:44:44 -0400 [thread overview]
Message-ID: <20241004184444.435356-19-boyuan.zhang@amd.com> (raw)
In-Reply-To: <20241004184444.435356-1-boyuan.zhang@amd.com>
From: Boyuan Zhang <boyuan.zhang@amd.com>
Set powergating state by vcn instance in idle_work_handler() and
ring_begin_use() functions for vcn with multiple instances.
Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 28c5e15d166d..9a8e8f88e1ad 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -410,8 +410,12 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
fence += amdgpu_fence_count_emitted(&adev->vcn.inst[inst].ring_dec);
if (!fence && !atomic_read(&adev->vcn.total_submission_cnt)) {
- amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
- AMD_PG_STATE_GATE);
+ if (adev->vcn.num_vcn_inst > 1)
+ amdgpu_device_ip_set_powergating_state_instance(adev,
+ AMD_IP_BLOCK_TYPE_VCN, AMD_PG_STATE_GATE, inst);
+ else
+ amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
+ AMD_PG_STATE_GATE);
r = amdgpu_dpm_switch_power_profile(adev, PP_SMC_POWER_PROFILE_VIDEO,
false);
if (r)
@@ -436,8 +440,12 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
}
mutex_lock(&adev->vcn.vcn_pg_lock);
- amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
- AMD_PG_STATE_UNGATE);
+ if (adev->vcn.num_vcn_inst > 1)
+ amdgpu_device_ip_set_powergating_state_instance(adev,
+ AMD_IP_BLOCK_TYPE_VCN, AMD_PG_STATE_UNGATE, ring->me);
+ else
+ amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
+ AMD_PG_STATE_UNGATE);
/* Only set DPG pause for VCN3 or below, VCN4 and above will be handled by FW */
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG &&
--
2.34.1
next prev parent reply other threads:[~2024-10-04 18:45 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 18:44 [PATCH 00/18] Separating vcn power management by instance boyuan.zhang
2024-10-04 18:44 ` [PATCH 01/18] drm/amd/pm: add inst to dpm_set_vcn_enable boyuan.zhang
2024-10-04 18:44 ` [PATCH 02/18] drm/amd/pm: power up or down vcn by instance boyuan.zhang
2024-10-04 18:44 ` [PATCH 03/18] drm/amd/pm: add inst to smu_dpm_set_vcn_enable boyuan.zhang
2024-10-04 18:44 ` [PATCH 04/18] drm/amd/pm: add inst to set_powergating_by_smu boyuan.zhang
2024-10-04 19:14 ` Alex Deucher
2024-10-08 22:06 ` Boyuan Zhang
2024-10-04 18:44 ` [PATCH 05/18] drm/amd/pm: add inst to amdgpu_dpm_set_powergating_by_smu boyuan.zhang
2024-10-04 18:44 ` [PATCH 06/18] add inst to amdgpu_dpm_enable_vcn boyuan.zhang
2024-10-04 18:44 ` [PATCH 07/18] drm/amdgpu: pass ip_block in set_powergating_state boyuan.zhang
2024-10-04 18:44 ` [PATCH 08/18] drm/amdgpu: track instances of the same IP block boyuan.zhang
2024-10-04 18:44 ` [PATCH 09/18] drm/amdgpu: add set_powergating_state_instance boyuan.zhang
2024-10-04 19:40 ` Alex Deucher
2024-10-08 22:07 ` Boyuan Zhang
2024-10-04 18:44 ` [PATCH 10/18] drm/amdgpu/vcn: separate gating state by instance boyuan.zhang
2024-10-04 18:44 ` [PATCH 11/18] drm/amdgpu: power vcn 2_5 " boyuan.zhang
2024-10-04 19:52 ` Alex Deucher
2024-10-08 22:10 ` Boyuan Zhang
2024-10-07 5:22 ` Lazar, Lijo
2024-10-07 13:33 ` Boyuan Zhang
2024-10-07 13:50 ` Lazar, Lijo
2024-10-07 14:17 ` Alex Deucher
2024-10-07 14:29 ` Christian König
2024-10-07 14:32 ` Lazar, Lijo
2024-10-07 15:24 ` Alex Deucher
2024-10-08 7:03 ` Lazar, Lijo
2024-10-08 22:04 ` Boyuan Zhang
2024-10-09 3:43 ` Lazar, Lijo
2024-10-09 13:36 ` Boyuan Zhang
2024-10-09 14:07 ` Lazar, Lijo
2024-10-04 18:44 ` [PATCH 12/18] drm/amdgpu: power vcn 3_0 " boyuan.zhang
2024-10-04 18:44 ` [PATCH 13/18] drm/amdgpu: power vcn 4_0 " boyuan.zhang
2024-10-04 18:44 ` [PATCH 14/18] drm/amdgpu: power vcn 4_0_3 " boyuan.zhang
2024-10-04 18:44 ` [PATCH 15/18] drm/amdgpu: power vcn 4_0_5 " boyuan.zhang
2024-10-04 18:44 ` [PATCH 16/18] drm/amdgpu: power vcn 5_0_0 " boyuan.zhang
2024-10-04 18:44 ` [PATCH 17/18] drm/amdgpu/vcn: separate idle work " boyuan.zhang
2024-10-04 18:44 ` boyuan.zhang [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-10-02 4:36 [PATCH 00/18] Separating vcn power management " boyuan.zhang
2024-10-02 4:36 ` [PATCH 18/18] drm/amdgpu: set powergating state by vcn instance boyuan.zhang
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=20241004184444.435356-19-boyuan.zhang@amd.com \
--to=boyuan.zhang@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=leo.liu@amd.com \
--cc=sunil.khatri@amd.com \
/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