AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang-5C7GfCeVMHo@public.gmane.org>
To: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Huang Rui <ray.huang-5C7GfCeVMHo@public.gmane.org>,
	Hawking Zhang <hawking.zhang-5C7GfCeVMHo@public.gmane.org>,
	Rex Zhu <rex.zhu-5C7GfCeVMHo@public.gmane.org>,
	Ping Fu <ping.fu-5C7GfCeVMHo@public.gmane.org>,
	David Mao <david.mao-5C7GfCeVMHo@public.gmane.org>
Subject: [PART1 PATCH 7/8] drm/amdgpu: add clockgating_state method for uvd v5&v6
Date: Thu, 5 Jan 2017 21:49:52 +0800	[thread overview]
Message-ID: <1483624193-20897-8-git-send-email-ray.huang@amd.com> (raw)
In-Reply-To: <1483624193-20897-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 12 ++++++++++++
 drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 12 ++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
index 03a35d9..9f1d8f6 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
@@ -793,6 +793,17 @@ static int uvd_v5_0_set_powergating_state(void *handle,
 	}
 }
 
+static void uvd_v5_0_clockgating_state(void *handle, u32 *flags)
+{
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+	int data;
+
+	/* AMD_CG_SUPPORT_UVD_MGCG */
+	data = RREG32(mmUVD_CGC_CTRL);
+	if (data & UVD_CGC_CTRL__DYN_CLOCK_MODE_MASK)
+		*flags |= AMD_CG_SUPPORT_UVD_MGCG;
+}
+
 static const struct amd_ip_funcs uvd_v5_0_ip_funcs = {
 	.name = "uvd_v5_0",
 	.early_init = uvd_v5_0_early_init,
@@ -808,6 +819,7 @@ static const struct amd_ip_funcs uvd_v5_0_ip_funcs = {
 	.soft_reset = uvd_v5_0_soft_reset,
 	.set_clockgating_state = uvd_v5_0_set_clockgating_state,
 	.set_powergating_state = uvd_v5_0_set_powergating_state,
+	.clockgating_state = uvd_v5_0_clockgating_state,
 };
 
 static const struct amdgpu_ring_funcs uvd_v5_0_ring_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
index 8779d4b..bccf2b9 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
@@ -1001,6 +1001,17 @@ static int uvd_v6_0_set_powergating_state(void *handle,
 	}
 }
 
+static void uvd_v6_0_clockgating_state(void *handle, u32 *flags)
+{
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+	int data;
+
+	/* AMD_CG_SUPPORT_UVD_MGCG */
+	data = RREG32(mmUVD_CGC_CTRL);
+	if (data & UVD_CGC_CTRL__DYN_CLOCK_MODE_MASK)
+		*flags |= AMD_CG_SUPPORT_UVD_MGCG;
+}
+
 static const struct amd_ip_funcs uvd_v6_0_ip_funcs = {
 	.name = "uvd_v6_0",
 	.early_init = uvd_v6_0_early_init,
@@ -1019,6 +1030,7 @@ static const struct amd_ip_funcs uvd_v6_0_ip_funcs = {
 	.post_soft_reset = uvd_v6_0_post_soft_reset,
 	.set_clockgating_state = uvd_v6_0_set_clockgating_state,
 	.set_powergating_state = uvd_v6_0_set_powergating_state,
+	.clockgating_state = uvd_v6_0_clockgating_state,
 };
 
 static const struct amdgpu_ring_funcs uvd_v6_0_ring_phys_funcs = {
-- 
2.7.4

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

  parent reply	other threads:[~2017-01-05 13:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05 13:49 [PART1 PATCH 0/8] Introduce a method to get clock gating status dynamically Huang Rui
     [not found] ` <1483624193-20897-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2017-01-05 13:49   ` [PART1 PATCH 1/8] drm/amdgpu: introduce an interface " Huang Rui
2017-01-05 13:49   ` [PART1 PATCH 2/8] drm/amdgpu: add parse clock gating state Huang Rui
     [not found]     ` <1483624193-20897-3-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2017-01-05 16:33       ` Felix Kuehling
     [not found]         ` <b407dd74-16e2-8df3-0adb-2afa17bf8f13-5C7GfCeVMHo@public.gmane.org>
2017-01-06  6:19           ` Huang Rui
2017-01-05 16:34       ` William Lewis
     [not found]         ` <BN6PR17MB0913FDE2AC51D02FD9730FD1C8600-jOV4XOBZ6Mu/5fi7T5v52H+GY4YGzQ7gvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-01-06  6:21           ` Huang Rui
2017-01-05 13:49   ` [PART1 PATCH 3/8] drm/amdgpu: add clockgating_state method for gfx v8 Huang Rui
2017-01-05 13:49   ` [PART1 PATCH 4/8] drm/amdgpu: add clockgating_state method for gmc v8 Huang Rui
2017-01-05 13:49   ` [PART1 PATCH 5/8] drm/amdgpu: add clockgating_state method for sdma v3 Huang Rui
2017-01-05 13:49   ` [PART1 PATCH 6/8] drm/amdgpu: add clockgating_state method for vi common Huang Rui
2017-01-05 13:49   ` Huang Rui [this message]
2017-01-05 13:49   ` [PART1 PATCH 8/8] drm/amdgpu: add clockgating_state method for vce v3 Huang Rui
2017-01-05 15:40   ` [PART1 PATCH 0/8] Introduce a method to get clock gating status dynamically Deucher, Alexander
     [not found]     ` <BN6PR12MB1652B0E3AD8F9252CE089FA0F7600-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-01-05 15:51       ` StDenis, Tom
2017-01-06  6:12       ` Huang Rui

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=1483624193-20897-8-git-send-email-ray.huang@amd.com \
    --to=ray.huang-5c7gfcevmho@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=david.mao-5C7GfCeVMHo@public.gmane.org \
    --cc=hawking.zhang-5C7GfCeVMHo@public.gmane.org \
    --cc=ping.fu-5C7GfCeVMHo@public.gmane.org \
    --cc=rex.zhu-5C7GfCeVMHo@public.gmane.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