All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu:No action needs when VCN PG state is unchanged
@ 2018-09-10 16:49 James Zhu
       [not found] ` <1536598142-19689-1-git-send-email-James.Zhu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: James Zhu @ 2018-09-10 16:49 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: james.zhu-5C7GfCeVMHo

Signed-off-by: James Zhu <James.Zhu@amd.com>

When VCN PG state is unchanged, it is unnecessary to reset
power gate state again.
---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 2664bb2..86d98d2 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
@@ -1633,12 +1633,21 @@ static int vcn_v1_0_set_powergating_state(void *handle,
 	 * revisit this when there is a cleaner line between
 	 * the smc and the hw blocks
 	 */
+	int ret;
+	static enum amd_powergating_state cur_state = AMD_PG_STATE_GATE;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	if (state == cur_state)
+		return 0;
+
 	if (state == AMD_PG_STATE_GATE)
-		return vcn_v1_0_stop(adev);
+		ret = vcn_v1_0_stop(adev);
 	else
-		return vcn_v1_0_start(adev);
+		ret = vcn_v1_0_start(adev);
+
+	if (!ret)
+		cur_state = state;
+	return ret;
 }
 
 static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
-- 
2.7.4

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

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

end of thread, other threads:[~2018-09-21 14:56 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-10 16:49 [PATCH] drm/amdgpu:No action needs when VCN PG state is unchanged James Zhu
     [not found] ` <1536598142-19689-1-git-send-email-James.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-09-11 14:44   ` Alex Deucher
     [not found]     ` <CADnq5_P5Oj_Fdxhv2n8ZxDTm1mV_NQo6M1kmgGzLV0fHhhR8sA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-11 15:06       ` James Zhu
     [not found]         ` <d358b2be-26d1-627a-7105-5d90685d0f3b-5C7GfCeVMHo@public.gmane.org>
2018-09-11 15:17           ` Christian König
     [not found]             ` <68b30f71-86eb-89a0-0f8d-fcfb18e89cc2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-11 15:29               ` James Zhu
     [not found]                 ` <62baa235-e113-3635-6060-f5ffcc14e967-5C7GfCeVMHo@public.gmane.org>
2018-09-11 15:36                   ` Christian König
     [not found]                     ` <cbd39fc8-bd5e-cd11-b9f2-4b91185429f7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-11 15:44                       ` James Zhu
2018-09-13 20:55   ` [PATCH v2] drm/amdgpu:No action " James Zhu
     [not found]     ` <1536872144-18347-1-git-send-email-James.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-09-20 14:19       ` Zhu, James
2018-09-20 15:14       ` Alex Deucher
     [not found]         ` <CADnq5_Nb-QPFox25ggaaOVO12P2_BUN7gmVWoJYpim1mYS9r3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-20 15:27           ` James Zhu
     [not found]             ` <f7433b95-909a-8a6b-6659-2f9d04c108e5-5C7GfCeVMHo@public.gmane.org>
2018-09-20 15:49               ` Alex Deucher
     [not found]                 ` <CADnq5_P2T2R+AyDquvEDWPN09iE1ZUMfMxoMSiJtuUWTKxkarQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-20 16:24                   ` James Zhu
     [not found]                     ` <f0c2d5b3-a273-406f-16c8-8e419ae26dd8-5C7GfCeVMHo@public.gmane.org>
2018-09-20 17:54                       ` Christian König
     [not found]                         ` <1d95a0b3-3b35-53f3-4ef3-0a0bbcc0456e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-21 12:28                           ` James Zhu
     [not found]                             ` <89710c26-e399-5f1f-d27c-d038bf275a23-5C7GfCeVMHo@public.gmane.org>
2018-09-21 12:52                               ` Christian König
     [not found]                                 ` <1faf5014-572d-0260-0f50-ab63aedc274e-5C7GfCeVMHo@public.gmane.org>
2018-09-21 14:05                                   ` Zhu, Rex
     [not found]                                     ` <BYAPR12MB277586C5BB434DF23EC5B3C0FB120-ZGDeBxoHBPmJeBUhB162ZQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-21 14:22                                       ` James Zhu
     [not found]                                         ` <d690bf76-e1d0-6edb-c11b-3db58eddd512-5C7GfCeVMHo@public.gmane.org>
2018-09-21 14:48                                           ` Zhu, Rex
     [not found]                                             ` <BYAPR12MB27752338D93DA89D250C53BAFB120-ZGDeBxoHBPmJeBUhB162ZQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-21 14:51                                               ` James Zhu
     [not found]                                                 ` <de330d77-efb3-935d-7c7f-8ac99b86bf62-5C7GfCeVMHo@public.gmane.org>
2018-09-21 14:52                                                   ` Alex Deucher
     [not found]                                                     ` <CADnq5_Ouq4_9BngfKEYH42anGL3oGKgf0791JQynGo_GA=8qaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-21 14:56                                                       ` James Zhu

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.