drm/amdgpu:No action needs when VCN PG state is unchanged
Subsystems (2)
PATCH 1/1 drm/amdgpu:No action needs when VCN PG state is unchanged
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(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +11 -2
@@ -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 = {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1536598142-19689-1-git-send-email-James.Zhu-5C7GfCeVMHo@public.gmane.org
Quoted 5 lines · James Zhu
Signed-off-by James Zhu <[email protected]>When VCN PG state is unchanged, it is unnecessary to reset power gate state again.
Don't you need to initialize and store the PG state somewhere? You are just using a local variable here.
Alex
Quoted 35 lines
--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +11
-3@@ -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
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CADnq5_P5Oj_Fdxhv2n8ZxDTm1mV_NQo6M1kmgGzLV0fHhhR8sA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 10 lines · Alex Deucher
Quoted 4 lines · James Zhu
Signed-off-by James Zhu <[email protected]>When VCN PG state is unchanged, it is unnecessary to reset power gate state again.
Don't you need to initialize and store the PG state somewhere? You are just using a local variable here.
Alex
Hi Alex,
I used */static/* for this local state variable(*cur_state*) with initialization state AMD_PG_STATE_GATE. this variable's scope is only inside this function, but it's initialization is done
once at compile time and it's lifetime will last until the driver exit.
Since it is only used inside this function, I didn't put it into struct amdgpu_vcn.
Best Regards!
James Zhu
Quoted 31 lines
Quoted 31 lines
--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +11
-2@@ -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; }
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0
-1static const struct amd_ip_funcs vcn_v1_0_ip_funcs = { --2.7.4
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): d358b2be-26d1-627a-7105-5d90685d0f3b-5C7GfCeVMHo@public.gmane.org
Am 11.09.2018 um 17:06 schrieb James Zhu:
Quoted 9 lines · Alex Deucher
Quoted 5 lines · James Zhu
Quoted 4 lines
Signed-off-by James Zhu<[email protected]>When VCN PG state is unchanged, it is unnecessary to reset power gate state again.
Quoted 8 lines
Quoted 5 lines
Don't you need to initialize and store the PG state somewhere? You are just using a local variable here.
Alex
Hi Alex,
I used */static/* for this local state
variable(*cur_state*)with initialization stateAMD_PG_STATE_GATE.
That won't work correctly. A "static" variable is global, but the power state is per device.
Regards,
Christian.
Quoted 42 lines
this variable's scope is only inside this function, but it's initialization is done once at compile time and it's lifetime will last until the driver exit.
Since it is only used inside this function, I didn't put it into struct
amdgpu_vcn.Best Regards!
James ZhuQuoted 35 lines
Quoted 35 lines
--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +11
-3@@ -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
Quoted 11 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 68b30f71-86eb-89a0-0f8d-fcfb18e89cc2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Quoted 15 lines · Christian König
Am 11.09.2018 um 17:06 schrieb James Zhu:
Quoted 14 lines · Alex Deucher
Quoted 10 lines · James Zhu
Quoted 4 lines
Signed-off-by James Zhu<[email protected]>When VCN PG state is unchanged, it is unnecessary to reset power gate state again.
Don't you need to initialize and store the PG state somewhere? You are just using a local variable here.
Alex
Quoted 9 lines
Quoted 3 lines
Hi Alex,
I used */static/* for this local state
variable(*cur_state*)with initialization stateAMD_PG_STATE_GATE.That won't work correctly. A "static" variable is global, but the power state is per device.
Regards,
Christian.
This "static" variable under local scope is mainly for VCN used only. It only tracks VCN's PG state. (currently VCN only have one hardware instance)
Best Regards!
James Zhu
Quoted 42 lines
Quoted 42 lines
this variable's scope is only inside this function, but it's initialization is done once at compile time and it's lifetime will last until the driver exit.
Since it is only used inside this function, I didn't put it into struct
amdgpu_vcn.Best Regards!
James ZhuQuoted 35 lines
Quoted 35 lines
--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +11
-3@@ -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
Quoted 12 lines
Quoted 11 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 62baa235-e113-3635-6060-f5ffcc14e967-5C7GfCeVMHo@public.gmane.org
Am 11.09.2018 um 17:29 schrieb James Zhu:
Quoted 23 lines · Christian König
Quoted 19 lines
Am 11.09.2018 um 17:06 schrieb James Zhu:
Quoted 17 lines · Alex Deucher
Quoted 10 lines · James Zhu
Quoted 4 lines
Signed-off-by James Zhu<[email protected]>When VCN PG state is unchanged, it is unnecessary to reset power gate state again.
Don't you need to initialize and store the PG state somewhere? You are just using a local variable here.
Alex
Hi Alex,
I used */static/* for this local state
variable(*cur_state*)with initialization stateAMD_PG_STATE_GATE.
Quoted 7 lines
Quoted 5 lines
That won't work correctly. A "static" variable is global, but the power state is per device.
Regards,
Christian.This "static" variable under local scope is mainly for VCN used only. It only tracks VCN's PG state. (currently VCN only have one hardware instance)
Still an absolute no-go for kernel coding. VCN will soon be used for dGPUs as well.
Please fix and reiterate,
Christian.
Quoted 60 lines
Best Regards!
James ZhuQuoted 42 lines
Quoted 42 lines
this variable's scope is only inside this function, but it's initialization is done once at compile time and it's lifetime will last until the driver exit.
Since it is only used inside this function, I didn't put it into struct
amdgpu_vcn.Best Regards!
James ZhuQuoted 35 lines
Quoted 35 lines
--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +11
-3@@ -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
Quoted 12 lines
Quoted 11 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): cbd39fc8-bd5e-cd11-b9f2-4b91185429f7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Quoted 29 lines · Christian König
Am 11.09.2018 um 17:29 schrieb James Zhu:
Quoted 28 lines · Christian König
Quoted 24 lines
Am 11.09.2018 um 17:06 schrieb James Zhu:
Quoted 9 lines · Alex Deucher
Quoted 5 lines · James Zhu
Quoted 4 lines
Signed-off-by James Zhu<[email protected]>When VCN PG state is unchanged, it is unnecessary to reset power gate state again.
Quoted 8 lines
Quoted 5 lines
Don't you need to initialize and store the PG state somewhere? You are just using a local variable here.
Alex
Hi Alex,
I used */static/* for this local state
variable(*cur_state*)with initialization stateAMD_PG_STATE_GATE.That won't work correctly. A "static" variable is global, but the power state is per device.
Regards,
Christian.
Quoted 7 lines
Quoted 2 lines
This "static" variable under local scope is mainly for VCN used only. It only tracks VCN's PG state. (currently VCN only have one hardware instance)
Still an absolute no-go for kernel coding. VCN will soon be used for dGPUs as well.
Please fix and reiterate,
Christian.
I see, then I will put this current state track into struct amdgpu_vcn.
By the way, under multiple dPGU situation, I though per dPGU will create it's own driver instance. this static variable won't be shared cross driver instance. Am I right?
Thanks!
James Zhu
Quoted 60 lines
Quoted 60 lines
Best Regards!
James ZhuQuoted 54 lines
Quoted 53 lines
this variable's scope is only inside this function, but it's initialization is done once at compile time and it's lifetime will last until the driver exit.
Since it is only used inside this function, I didn't put it into struct
amdgpu_vcn.Best Regards!
James ZhuQuoted 31 lines
Quoted 31 lines
--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +11
-2@@ -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; }Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0
-1static const struct amd_ip_funcs vcn_v1_0_ip_funcs = { --2.7.4
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 5 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v2 1/1 drm/amdgpu:No action when VCN PG state is unchanged
In reply to a message not in the archiveWhen VCN PG state is unchanged, it is unnecessary to reset power gate state
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1 -0
@@ -69,6 +69,7 @@ struct amdgpu_vcn {struct amdgpu_ring ring_jpeg;struct amdgpu_irq_src irq;unsigned num_enc_rings; +enum amd_powergating_state cur_state; };int amdgpu_vcn_sw_init (struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +10 -2
@@ -1633,12 +1633,20 @@ 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;struct amdgpu_device *adev = (struct amdgpu_device *)handle; +if (state == adev->vcn.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) + adev->vcn.cur_state = state; +return ret; }static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1536872144-18347-1-git-send-email-James.Zhu-5C7GfCeVMHo@public.gmane.org
Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Ping
Alex and Christian,
Could you give a review on this updated patch?
Thanks & Best Regards!
James Zhu
________________________________
From: James Zhu <[email protected]>
Sent: Thursday, September 13, 2018 4:55 PM
To: [email protected]
Cc: Zhu, James
Subject: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
When VCN PG state is unchanged, it is unnecessary to reset power gate state
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1 -0
@@ -69,6 +69,7 @@ struct amdgpu_vcn {struct amdgpu_ring ring_jpeg;struct amdgpu_irq_src irq;unsigned num_enc_rings; +enum amd_powergating_state cur_state; };int amdgpu_vcn_sw_init (struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +10 -2
@@ -1633,12 +1633,20 @@ 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;struct amdgpu_device *adev = (struct amdgpu_device *)handle; +if (state == adev->vcn.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) + adev->vcn.cur_state = state; +return ret; }static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher
Acked-byRe: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
In reply to a message not in the archiveQuoted 15 lines · James Zhu
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn {struct amdgpu_ring ring_jpeg;struct amdgpu_irq_src irq;unsigned num_enc_rings; +enum amd_powergating_state cur_state;
Does the default value (0) at init time properly reflect the default powergating state? If so,
Quoted 33 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0};int amdgpu_vcn_sw_init (struct amdgpu_device *adev);drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +10
-3@@ -1633,12 +1633,20 @@ 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;struct amdgpu_device *adev = (struct amdgpu_device *)handle; +if (state == adev->vcn.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) + adev->vcn.cur_state = state; +return ret; }static const struct amd_ip_funcs vcn_v1_0_ip_funcs = { --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CADnq5_Nb-QPFox25ggaaOVO12P2_BUN7gmVWoJYpim1mYS9r3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Quoted 21 lines · Alex Deucher
Quoted 14 lines · James Zhu
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn {struct amdgpu_ring ring_jpeg;struct amdgpu_irq_src irq;unsigned num_enc_rings; +enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Quoted 1 line
Acked-by Alex Deucher <[email protected]>
Yes, the below code shows it will be set to 0 during driver load stage.
int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
....
adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);
struct amdgpu_device {
....
struct amdgpu_vcn vcn;
Best Regards!
James zhu
Quoted 29 lines
Quoted 29 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0};int amdgpu_vcn_sw_init (struct amdgpu_device *adev);drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +10
-2@@ -1633,12 +1633,20 @@ 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;struct amdgpu_device *adev = (struct amdgpu_device *)handle; +if (state == adev->vcn.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) + adev->vcn.cur_state = state; +return ret; }
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0
-1static const struct amd_ip_funcs vcn_v1_0_ip_funcs = { --2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): f7433b95-909a-8a6b-6659-2f9d04c108e5-5C7GfCeVMHo@public.gmane.org
Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Quoted 26 lines · James Zhu
Quoted 21 lines · Alex Deucher
Quoted 14 lines · James Zhu
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn {struct amdgpu_ring ring_jpeg;struct amdgpu_irq_src irq;unsigned num_enc_rings; +enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Quoted 1 line
Acked-by Alex Deucher <[email protected]>
Quoted 1 line
Yes, the below code shows it will be set to 0 during driver load stage.
Yes, I understand that. Is 0 (AMD_PG_STATE_GATE) what we want as the default though? The first time the code runs are we going to do the right thing or is the code going to return early? IIRC, the hw default is ungated.
Alex
Quoted 40 lines
int
amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
....adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);struct
amdgpu_device{
....struct amdgpu_vcn vcn;Best Regards!
James zhuQuoted 29 lines
Quoted 29 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0};int amdgpu_vcn_sw_init (struct amdgpu_device *adev);drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +10
-2@@ -1633,12 +1633,20 @@ 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;struct amdgpu_device *adev = (struct amdgpu_device *)handle; +if (state == adev->vcn.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) + adev->vcn.cur_state = state; +return ret; }
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0
-1static const struct amd_ip_funcs vcn_v1_0_ip_funcs = { --2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CADnq5_P2T2R+AyDquvEDWPN09iE1ZUMfMxoMSiJtuUWTKxkarQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Quoted 26 lines · Alex Deucher
Quoted 25 lines · James Zhu
Quoted 22 lines · Alex Deucher
Quoted 14 lines · James Zhu
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn {struct amdgpu_ring ring_jpeg;struct amdgpu_irq_src irq;unsigned num_enc_rings; +enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Acked-by Alex Deucher <[email protected]>
Quoted 5 lines
Quoted 1 line
Yes, the below code shows it will be set to 0 during driver load stage.
Yes, I understand that. Is 0 (
AMD_PG_STATE_GATE) what we want as the default though? The first time the code runs are we going to do the right thing or is the code going to return early? IIRC, the hw default is ungated.
cur_state is used for tracking driver SW PG state, not HW PG state.
I though no matter what HW PG state is after device powers up, when first vcn ring is scheduled to run, begin_use->set_powergating_state->vcn_v1_0_start->ungate power/clock->Boot_VCPU will be tried.
For DPG mode, the ungate power/clock , boot VCPU will not actually be activated during start setup stage, and only be activated during ring run stage.
James
Quoted 40 lines
Alex
Quoted 39 lines
int
amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
....adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);struct
amdgpu_device{
....struct amdgpu_vcn vcn;Best Regards!
James zhuQuoted 29 lines
Quoted 29 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0};int amdgpu_vcn_sw_init (struct amdgpu_device *adev);drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +10
-2@@ -1633,12 +1633,20 @@ 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;struct amdgpu_device *adev = (struct amdgpu_device *)handle; +if (state == adev->vcn.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) + adev->vcn.cur_state = state; +return ret; }
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0
-1static const struct amd_ip_funcs vcn_v1_0_ip_funcs = { --2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): f0c2d5b3-a273-406f-16c8-8e419ae26dd8-5C7GfCeVMHo@public.gmane.org
Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Am 20.09.2018 um 18:24 schrieb James Zhu:
Quoted 34 lines · Alex Deucher
Quoted 26 lines · James Zhu
Quoted 25 lines · Alex Deucher
Quoted 22 lines · James Zhu
Quoted 14 lines
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h| 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++--2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn { struct amdgpu_ring ring_jpeg; struct amdgpu_irq_src irq; unsigned num_enc_rings; + enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Acked-by Alex Deucher <[email protected]>Quoted 5 lines
Quoted 1 line
Yes, the below code shows it will be set to 0 during driver load stage.
Yes, I understand that. Is 0 (
AMD_PG_STATE_GATE) what we want as the default though? The first time the code runs are we going to do the right thing or is the code going to return early? IIRC, the hw default is ungated.
Quoted 6 lines
cur_stateis used for tracking driver SW PG state, not HW PG state.
I though no matter what HW PG state is after device powers up, when first vcn ring is scheduled to run,begin_use->set_powergating_state->vcn_v1_0_start->ungatepower/clock->Boot_VCPU will be tried.For DPG mode, the ungate power/clock , boot VCPU will not actually be activated during start setup stage, and only be activated during ring run stage.
Mhm, I wonder if it wouldn't be better to have that functionality one layer up.
E.g. in amdgpu_device_ip_set_powergating_state so that it applies to all IP blocks in the same way.
But on the other hand the correct solution looks good to me as well, so feel free to add my Acked-by as well.
Christian.
Quoted 47 lines
James
Quoted 45 lines
Alex
Quoted 44 lines
int
amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
....
adev =kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);struct
amdgpu_device{
....
struct amdgpu_vcn vcn;Best Regards!
James zhuQuoted 34 lines
Quoted 34 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0}; int amdgpu_vcn_sw_init(struct amdgpu_device *adev);drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5
-1@@ -1633,12 +1633,20 @@ static intvcn_v1_0_set_powergating_state(void *handle, * revisit this when there is a cleaner line between * the smc and the hw blocks */ + int ret; struct amdgpu_device *adev = (struct amdgpu_device *)handle; + if(state == adev->vcn.cur_state) + return 0; + if (state == AMD_PG_STATE_GATE) - return vcn_v1_0_stop(adev); + ret = vcn_v1_0_stop(adev);else
- returnvcn_v1_0_start(adev);
+ ret =vcn_v1_0_start(adev);
+
+ if(!ret)
+adev->vcn.cur_state= state;
+ return ret;
}static const struct
amd_ip_funcsvcn_v1_0_ip_funcs= {Signature · 1 line
2.7.4
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1d95a0b3-3b35-53f3-4ef3-0a0bbcc0456e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Quoted 39 lines · Christian König
Am 20.09.2018 um 18:24 schrieb James Zhu:
Quoted 38 lines · Alex Deucher
Quoted 26 lines · James Zhu
Quoted 25 lines · Alex Deucher
Quoted 22 lines · James Zhu
Quoted 14 lines
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h| 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++--2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn { struct amdgpu_ring ring_jpeg; struct amdgpu_irq_src irq; unsigned num_enc_rings; + enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Acked-by Alex Deucher <[email protected]>Quoted 5 lines
Quoted 1 line
Yes, the below code shows it will be set to 0 during driver load stage.
Yes, I understand that. Is 0 (
AMD_PG_STATE_GATE) what we want as the default though? The first time the code runs are we going to do the right thing or is the code going to return early? IIRC, the hw default is ungated.
cur_stateis used for tracking driver SW PG state, not HW PG state.
I though no matter what HW PG state is after device powers up, when first vcn ring is scheduled to run,begin_use->set_powergating_state->vcn_v1_0_start->ungatepower/clock->Boot_VCPU will be tried.
Quoted 6 lines
Quoted 2 lines
For DPG mode, the ungate power/clock , boot VCPU will not actually be activated during start setup stage, and only be activated during ring run stage.
Mhm, I wonder if it wouldn't be better to have that functionality one layer up.
E.g. in
amdgpu_device_ip_set_powergating_stateso that it applies to all IP blocks in the same way.
If necessary, I can add support for IP blocks later. James
Quoted 62 lines
But on the other hand the correct solution looks good to me as well, so feel free to add my Acked-by as well.
Christian.
Quoted 56 lines
James
Quoted 41 lines
Alex
Quoted 40 lines
int
amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
....
adev =kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);struct
amdgpu_device{
....
struct amdgpu_vcn vcn;Best Regards!
James zhuQuoted 30 lines
Quoted 30 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0}; int amdgpu_vcn_sw_init(struct amdgpu_device *adev);drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5
-1@@ -1633,12 +1633,20 @@ static intvcn_v1_0_set_powergating_state(void *handle, * revisit this when there is a cleaner line between * the smc and the hw blocks */ + int ret; struct amdgpu_device *adev = (struct amdgpu_device *)handle; + if(state == adev->vcn.cur_state) + return 0; + if (state == AMD_PG_STATE_GATE) - return vcn_v1_0_stop(adev); + ret = vcn_v1_0_stop(adev);else
- returnvcn_v1_0_start(adev);
+ ret =vcn_v1_0_start(adev);
+
+ if(!ret)
+adev->vcn.cur_state= state;
+ return ret;
}Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
static const struct
amd_ip_funcsvcn_v1_0_ip_funcs= {Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 89710c26-e399-5f1f-d27c-d038bf275a23-5C7GfCeVMHo@public.gmane.org
Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Am 21.09.2018 um 14:28 schrieb James Zhu:
Quoted 42 lines · Christian König
Quoted 39 lines
Am 20.09.2018 um 18:24 schrieb James Zhu:
Quoted 38 lines · Alex Deucher
Quoted 26 lines · James Zhu
Quoted 25 lines · Alex Deucher
Quoted 22 lines · James Zhu
Quoted 14 lines
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h| 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++--2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn { struct amdgpu_ring ring_jpeg; struct amdgpu_irq_src irq; unsigned num_enc_rings; + enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Acked-by Alex Deucher <[email protected]>Quoted 5 lines
Quoted 1 line
Yes, the below code shows it will be set to 0 during driver load stage.
Yes, I understand that. Is 0 (
AMD_PG_STATE_GATE) what we want as the default though? The first time the code runs are we going to do the right thing or is the code going to return early? IIRC, the hw default is ungated.
cur_stateis used for tracking driver SW PG state, not HW PG state.
I though no matter what HW PG state is after device powers up, when first vcn ring is scheduled to run,begin_use->set_powergating_state->vcn_v1_0_start->ungatepower/clock->Boot_VCPU will be tried.
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
For DPG mode, the ungate power/clock , boot VCPU will not actually be activated during start setup stage, and only be activated during ring run stage.
Mhm, I wonder if it wouldn't be better to have that functionality one layer up.
E.g. in
amdgpu_device_ip_set_powergating_stateso that it applies to all IP blocks in the same way.If necessary, I can add support for IP blocks later.
Yeah, agree. In general I'm not doing much with power management, so can't judge if that is a good idea or not.
Anyway feel free to add my Acked-by to the patch.
Regards,
Christian.
Quoted 64 lines
James
Quoted 62 lines
But on the other hand the correct solution looks good to me as well, so feel free to add my Acked-by as well.
Christian.
Quoted 56 lines
James
Quoted 41 lines
Alex
Quoted 40 lines
int
amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
....
adev =kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);struct
amdgpu_device{
....
struct amdgpu_vcn vcn;Best Regards!
James zhuQuoted 30 lines
Quoted 30 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0}; int amdgpu_vcn_sw_init(struct amdgpu_device *adev);drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5
-1@@ -1633,12 +1633,20 @@ static intvcn_v1_0_set_powergating_state(void *handle, * revisit this when there is a cleaner line between * the smc and the hw blocks */ + int ret; struct amdgpu_device *adev = (struct amdgpu_device *)handle; + if(state == adev->vcn.cur_state) + return 0; + if (state == AMD_PG_STATE_GATE) - return vcn_v1_0_stop(adev); + ret = vcn_v1_0_stop(adev);else
- returnvcn_v1_0_start(adev);
+ ret =vcn_v1_0_start(adev);
+
+ if(!ret)
+adev->vcn.cur_state= state;
+ return ret;
}Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
static const struct
amd_ip_funcsvcn_v1_0_ip_funcs= {Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1faf5014-572d-0260-0f50-ab63aedc274e-5C7GfCeVMHo@public.gmane.org
RE: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
In my understand, when dpg mode enabled, we don't need to power up/down VCN via SMU and Also don't need to set vcn power gate/ungate state.
Just need to enable the dpg mode.
If not true, please correct me.
Best Regards
Rex
Quoted 148 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Friday, September 21, 2018 8:53 PM
To: Zhu, James <[email protected]>; Alex Deucher <[email protected]>
Cc: James Zhu <[email protected]>; Zhu, James <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchangedAm 21.09.2018 um 14:28 schrieb James Zhu:
Quoted 8 lines · Christian König
Quoted 5 lines
Am 20.09.2018 um 18:24 schrieb James Zhu:
Quoted 4 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 20, 2018 at 11:27 AM James Zhu <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 13, 2018 at 4:56 PM James Zhu <[email protected]>
Quoted 38 lines · wrote:
Quoted 38 lines
Quoted 37 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 15 lines
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h| 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++--2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn { struct amdgpu_ring ring_jpeg; struct amdgpu_irq_src irq; unsigned num_enc_rings; + enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Acked-by Alex Deucher <[email protected]>Quoted 6 lines
Quoted 2 lines
Yes, the below code shows it will be set to 0 during driver load stage.
Yes, I understand that. Is 0 (
AMD_PG_STATE_GATE) what we want as the default though? The first time the code runs are we going to do the right thing or is the code going to return early? IIRC, the hw default is ungated.
cur_stateis used for tracking driver SW PG state, not HW PG state. I though no matter what HW PG state is after device powers up, when first vcn ring is scheduled to run,begin_use->set_powergating_state->vcn_v1_0_start->ungatepower/clock->Boot_VCPU will be tried.For DPG mode, the ungate power/clock , boot VCPU will not actually be activated during start setup stage, and only be activated during ring run stage.
Quoted 6 lines
Quoted 5 lines
Mhm, I wonder if it wouldn't be better to have that functionality one layer up.
E.g. in
amdgpu_device_ip_set_powergating_stateso that it applies to all IP blocks in the same way.If necessary, I can add support for IP blocks later.
Yeah, agree. In general I'm not doing much with power management, so can't judge if that is a good idea or not.
Anyway feel free to add my Acked-by to the patch.
Regards,
Christian.Quoted 68 lines
James
Quoted 66 lines
But on the other hand the correct solution looks good to me as well, so feel free to add my Acked-by as well.
Christian.
Quoted 59 lines
James
Quoted 44 lines
Alex
Quoted 43 lines
int
amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
....
adev =kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);struct
amdgpu_device{
....
struct amdgpu_vcn vcn;Best Regards!
James zhuQuoted 32 lines
Quoted 32 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0};int
amdgpu_vcn_sw_init(struct amdgpu_device *adev); diff --gita/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.cb/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 2664bb2..2cde0b4 100644drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1
-0@@ -1633,12 +1633,20 @@ static intvcn_v1_0_set_powergating_state(void *handle, * revisit this when there is a cleaner line between * the smc and the hw blocks */ + int ret;struct
amdgpu_device*adev = (structamdgpu_device*)handle;+
if(state == adev->vcn.cur_state)
+ return 0;
+
if (state ==AMD_PG_STATE_GATE)
- returnvcn_v1_0_stop(adev);
+ ret =vcn_v1_0_stop(adev);
else
- returnvcn_v1_0_start(adev);
+ ret =vcn_v1_0_start(adev);
+
+ if(!ret)
+adev->vcn.cur_state= state;
+ return ret;
}Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
static const struct
amd_ip_funcsvcn_v1_0_ip_funcs= { --
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BYAPR12MB277586C5BB434DF23EC5B3C0FB120-ZGDeBxoHBPmJeBUhB162ZQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Quoted 6 lines · Rex
In my understand, when dpg mode enabled, we don't need to power up/down VCN via SMU and Also don't need to set vcn power gate/ungate state.
Just need to enable the dpg mode.
If not true, please correct me.
You are right. Under DPG mode, vcn_v1_0_start is used to setup DPG mode instead of ungating power. For code reuse purpose, the function/variable name may have different connotation under different mode.
James
Quoted 149 lines
Best Regards
RexQuoted 141 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Friday, September 21, 2018 8:53 PM
To: Zhu, James <[email protected]>; Alex Deucher <[email protected]>
Cc: James Zhu <[email protected]>; Zhu, James <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchangedAm 21.09.2018 um 14:28 schrieb James Zhu:
Quoted 6 lines · Christian König
Quoted 4 lines
Am 20.09.2018 um 18:24 schrieb James Zhu:
Quoted 3 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 20, 2018 at 11:27 AM James Zhu <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 13, 2018 at 4:56 PM James Zhu <[email protected]>
Quoted 37 lines · wrote:
Quoted 37 lines
Quoted 37 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 15 lines
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn { struct amdgpu_ring ring_jpeg; struct amdgpu_irq_src irq; unsigned num_enc_rings; + enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Acked-by Alex Deucher <[email protected]>Quoted 6 lines
Quoted 2 lines
Yes, the below code shows it will be set to 0 during driver load stage.
Yes, I understand that. Is 0 (
AMD_PG_STATE_GATE) what we want as the default though? The first time the code runs are we going to do the right thing or is the code going to return early? IIRC, the hw default is ungated.
cur_stateis used for tracking driver SW PG state, not HW PG state. I though no matter what HW PG state is after device powers up, when first vcn ring is scheduled to run,begin_use->set_powergating_state->vcn_v1_0_start->ungatepower/clock->Boot_VCPU will be tried.For DPG mode, the ungate power/clock , boot VCPU will not actually be activated during start setup stage, and only be activated during ring run stage.
Quoted 6 lines
Quoted 5 lines
Mhm, I wonder if it wouldn't be better to have that functionality one layer up.
E.g. in
amdgpu_device_ip_set_powergating_stateso that it applies to all IP blocks in the same way.If necessary, I can add support for IP blocks later.
Yeah, agree. In general I'm not doing much with power management, so can't judge if that is a good idea or not.
Anyway feel free to add my Acked-by to the patch.
Regards,
Christian.Quoted 63 lines
James
Quoted 62 lines
But on the other hand the correct solution looks good to me as well, so feel free to add my Acked-by as well.
Christian.
Quoted 57 lines
James
Quoted 44 lines
Alex
Quoted 43 lines
int
amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
....
adev =kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);struct
amdgpu_device{
....
struct amdgpu_vcn vcn;Best Regards!
James zhuQuoted 32 lines
Quoted 32 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-1}; int amdgpu_vcn_sw_init(struct amdgpu_device *adev); diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 2664bb2..2cde0b4 100644drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +10
-2@@ -1633,12 +1633,20 @@ static intvcn_v1_0_set_powergating_state(void *handle, * revisit this when there is a cleaner line between * the smc and the hw blocks */ + int ret; struct amdgpu_device *adev = (struct amdgpu_device *)handle; + if(state == adev->vcn.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) + adev->vcn.cur_state = state; + return ret; }Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
static const struct
amd_ip_funcsvcn_v1_0_ip_funcs= {
--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): d690bf76-e1d0-6edb-c11b-3db58eddd512-5C7GfCeVMHo@public.gmane.org
RE: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Quoted 21 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of James Zhu
Sent: Friday, September 21, 2018 10:22 PM
To: Zhu, Rex <[email protected]>; Koenig, Christian <[email protected]>; Zhu, James <[email protected]>; Alex Deucher <[email protected]>
Cc: James Zhu <[email protected]>; amd-gfx list <amd- [email protected]>
Subject: Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchangedQuoted 2 lines · Rex
In my understand, when dpg mode enabled, we don't need to power up/down VCN via SMU and Also don't need to set vcn power gate/ungate
state.
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Just need to enable the dpg mode.
If not true, please correct me.
You are right. Under DPG mode,
vcn_v1_0_startis used to setup DPG mode instead of ungating power.
For code reuse purpose, the function/variable name may have different connotation under different mode.
Did your patch base on tip drm-next code?
Rex
Quoted 154 lines
James
Quoted 56 lines
Best Regards
RexQuoted 48 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Friday, September 21, 2018 8:53 PM
To: Zhu, James <[email protected]>; Alex Deucher <[email protected]>
Cc: James Zhu <[email protected]>; Zhu, James <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchangedAm 21.09.2018 um 14:28 schrieb James Zhu:
Quoted 6 lines · Christian König
Quoted 4 lines
Am 20.09.2018 um 18:24 schrieb James Zhu:
Quoted 3 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 20, 2018 at 11:27 AM James Zhu <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 13, 2018 at 4:56 PM James Zhu <[email protected]>
Quoted 25 lines · wrote:
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 22 lines
Quoted 21 lines
Quoted 15 lines
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn { struct amdgpu_ring ring_jpeg; struct amdgpu_irq_src irq; unsigned num_enc_rings; + enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Quoted 1 line
Acked-by Alex Deucher <[email protected]>Quoted 2 lines
Yes, the below code shows it will be set to 0 during driver load stage.
Yes, I understand that. Is 0 (
AMD_PG_STATE_GATE) what we wantas
Quoted 27 lines
Quoted 27 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 3 lines
the default though? The first time the code runs are we going to do the right thing or is the code going to return early? IIRC, the hw default is ungated.
cur_stateis used for tracking driver SW PG state, not HW PG state. I though no matter what HW PG state is after device powers up, when first vcn ring is scheduled to run,begin_use->set_powergating_state->vcn_v1_0_start->ungatepower/clock->Boot_VCPU will be tried.For DPG mode, the ungate power/clock , boot VCPU will not actually be activated during start setup stage, and only be activated during ring run stage.
Quoted 6 lines
Quoted 5 lines
Mhm, I wonder if it wouldn't be better to have that functionality one layer up.
E.g. in
amdgpu_device_ip_set_powergating_stateso that it applies to all IP blocks in the same way.If necessary, I can add support for IP blocks later.
Yeah, agree. In general I'm not doing much with power management, so can't judge if that is a good idea or not.
Anyway feel free to add my Acked-by to the patch.
Regards,
Christian.Quoted 1 line
James
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
But on the other hand the correct solution looks good to me as well, so feel free to add my Acked-by as well.
Christian.
Quoted 3 lines
James
Quoted 2 lines
Alex
Quoted 1 line
int amdgpu_driver_load_kms(struct
drm_device*dev, unsignedlong
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 43 lines
Quoted 43 lines
flags)
....
adev =kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);struct
amdgpu_device{
....
struct amdgpu_vcn vcn;Best Regards!
James zhuQuoted 33 lines
Quoted 33 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-1}; int amdgpu_vcn_sw_init(struct amdgpu_device *adev); diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 2664bb2..2cde0b4 100644drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0
-0@@ -1633,12 +1633,20 @@ static intvcn_v1_0_set_powergating_state (void *handle, * revisit this when there is a cleaner linebetween
* the smc and the hw blocks
*/
+ int ret;
structamdgpu_device*adev = (structamdgpu_device
*)handle;+
if(state == adev->vcn.cur_state)
+ return 0;drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +7
-2+ 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) + adev->vcn.cur_state = state; + return ret; }Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
static const struct
amd_ip_funcsvcn_v1_0_ip_funcs= {
--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfxQuoted 4 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BYAPR12MB27752338D93DA89D250C53BAFB120-ZGDeBxoHBPmJeBUhB162ZQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Quoted 19 lines · Rex
Quoted 19 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of James Zhu
Sent: Friday, September 21, 2018 10:22 PM
To: Zhu, Rex <[email protected]>; Koenig, Christian <[email protected]>; Zhu, James <[email protected]>; Alex Deucher <[email protected]>
Cc: James Zhu <[email protected]>; amd-gfx list <amd- [email protected]>
Subject: Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchangedQuoted 2 lines · Rex
In my understand, when dpg mode enabled, we don't need to power up/down VCN via SMU and Also don't need to set vcn power gate/ungate
state.
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
Just need to enable the dpg mode.
If not true, please correct me.
You are right. Under DPG mode,
vcn_v1_0_startis used to setup DPG mode instead of ungating power.
For code reuse purpose, the function/variable name may have different connotation under different mode.Did your patch base on tip drm-next code?
No based on amd-temp-pco. Since DPG mode is enabled only on PCO at this moment. James
Quoted 156 lines
Rex
Quoted 153 lines
James
Quoted 52 lines
Best Regards
RexQuoted 45 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Friday, September 21, 2018 8:53 PM
To: Zhu, James <[email protected]>; Alex Deucher <[email protected]>
Cc: James Zhu <[email protected]>; Zhu, James <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchangedAm 21.09.2018 um 14:28 schrieb James Zhu:
Quoted 4 lines · Christian König
Quoted 3 lines
Am 20.09.2018 um 18:24 schrieb James Zhu:
Quoted 2 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 20, 2018 at 11:27 AM James Zhu <[email protected]>
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 13, 2018 at 4:56 PM James Zhu <[email protected]>
Quoted 25 lines · wrote:
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 22 lines
Quoted 21 lines
Quoted 15 lines
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn { struct amdgpu_ring ring_jpeg; struct amdgpu_irq_src irq; unsigned num_enc_rings; + enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Quoted 1 line
Acked-by Alex Deucher <[email protected]>Quoted 2 lines
Yes, the below code shows it will be set to 0 during driver load stage.
Yes, I understand that. Is 0 (
AMD_PG_STATE_GATE) what we wantas
Quoted 27 lines
Quoted 27 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 3 lines
the default though? The first time the code runs are we going to do the right thing or is the code going to return early? IIRC, the hw default is ungated.
cur_stateis used for tracking driver SW PG state, not HW PG state. I though no matter what HW PG state is after device powers up, when first vcn ring is scheduled to run,begin_use->set_powergating_state->vcn_v1_0_start->ungatepower/clock->Boot_VCPU will be tried.For DPG mode, the ungate power/clock , boot VCPU will not actually be activated during start setup stage, and only be activated during ring run stage.
Quoted 6 lines
Quoted 5 lines
Mhm, I wonder if it wouldn't be better to have that functionality one layer up.
E.g. in
amdgpu_device_ip_set_powergating_stateso that it applies to all IP blocks in the same way.If necessary, I can add support for IP blocks later.
Yeah, agree. In general I'm not doing much with power management, so can't judge if that is a good idea or not.
Anyway feel free to add my Acked-by to the patch.
Regards,
Christian.Quoted 1 line
James
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
But on the other hand the correct solution looks good to me as well, so feel free to add my Acked-by as well.
Christian.
Quoted 3 lines
James
Quoted 2 lines
Alex
Quoted 1 line
int amdgpu_driver_load_kms(struct
drm_device*dev, unsignedlong
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 43 lines
Quoted 43 lines
flags)
....
adev =kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);struct
amdgpu_device{
....
struct amdgpu_vcn vcn;Best Regards!
James zhuQuoted 33 lines
Quoted 33 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-1}; int amdgpu_vcn_sw_init(struct amdgpu_device *adev); diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 2664bb2..2cde0b4 100644drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0
-0@@ -1633,12 +1633,20 @@ static intvcn_v1_0_set_powergating_state (void *handle, * revisit this when there is a cleaner linebetween
* the smc and the hw blocks
*/
+ int ret;
structamdgpu_device*adev = (structamdgpu_device
*)handle;+
if(state == adev->vcn.cur_state)
+ return 0;drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +7
-2+ 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) + adev->vcn.cur_state = state; + return ret; }Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
static const struct
amd_ip_funcsvcn_v1_0_ip_funcs= {
--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfxQuoted 4 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): de330d77-efb3-935d-7c7f-8ac99b86bf62-5C7GfCeVMHo@public.gmane.org
Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Quoted 25 lines · James Zhu
Quoted 21 lines · Rex
Quoted 21 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of James Zhu
Sent: Friday, September 21, 2018 10:22 PM
To: Zhu, Rex <[email protected]>; Koenig, Christian <[email protected]>; Zhu, James <[email protected]>; Alex Deucher <[email protected]>
Cc: James Zhu <[email protected]>; amd-gfx list <amd- [email protected]>
Subject: Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchangedQuoted 2 lines · Rex
In my understand, when dpg mode enabled, we don't need to power up/down VCN via SMU and Also don't need to set vcn power gate/ungate
state.
Quoted 2 lines
Just need to enable the dpg mode.
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line
If not true, please correct me.
You are right. Under DPG mode,
vcn_v1_0_startis used to setup DPG mode instead of ungating power.
For code reuse purpose, the function/variable name may have different connotation under different mode.Did your patch base on tip drm-next code?
No based on amd-temp-pco. Since DPG mode is enabled only on PCO at this moment.
Picasso support has been merged into drm-next as of last week.
Alex
Quoted 158 lines
James
Quoted 156 lines
Rex
Quoted 153 lines
James
Quoted 52 lines
Best Regards
RexQuoted 45 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Friday, September 21, 2018 8:53 PM
To: Zhu, James <[email protected]>; Alex Deucher <[email protected]>
Cc: James Zhu <[email protected]>; Zhu, James <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchangedAm 21.09.2018 um 14:28 schrieb James Zhu:
Quoted 4 lines · Christian König
Quoted 3 lines
Am 20.09.2018 um 18:24 schrieb James Zhu:
Quoted 2 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 20, 2018 at 11:27 AM James Zhu <[email protected]>
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 13, 2018 at 4:56 PM James Zhu <[email protected]>
Quoted 25 lines · wrote:
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 22 lines
Quoted 21 lines
Quoted 15 lines
When VCN PG state is unchanged, it is unnecessary to reset power gate state
Signed-off-by James Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h struct amdgpu_vcn { · line 72
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1
-0@@ -69,6 +69,7 @@ struct amdgpu_vcn {struct amdgpu_ring ring_jpeg;struct amdgpu_irq_src irq;unsigned num_enc_rings; +enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Quoted 1 line
Acked-by Alex Deucher <[email protected]>Quoted 2 lines
Yes, the below code shows it will be set to 0 during driver load stage.
Yes, I understand that. Is 0 (
AMD_PG_STATE_GATE) what we wantas
Quoted 27 lines
Quoted 27 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 3 lines
the default though? The first time the code runs are we going to do the right thing or is the code going to return early? IIRC, the hw default is ungated.
cur_stateis used for tracking driver SW PG state, not HW PG state. I though no matter what HW PG state is after device powers up, when first vcn ring is scheduled to run,begin_use->set_powergating_state->vcn_v1_0_start->ungatepower/clock->Boot_VCPU will be tried.For DPG mode, the ungate power/clock , boot VCPU will not actually be activated during start setup stage, and only be activated during ring run stage.
Quoted 6 lines
Quoted 5 lines
Mhm, I wonder if it wouldn't be better to have that functionality one layer up.
E.g. in
amdgpu_device_ip_set_powergating_stateso that it applies to all IP blocks in the same way.If necessary, I can add support for IP blocks later.
Yeah, agree. In general I'm not doing much with power management, so can't judge if that is a good idea or not.
Anyway feel free to add my Acked-by to the patch.
Regards,
Christian.Quoted 1 line
James
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
But on the other hand the correct solution looks good to me as well, so feel free to add my Acked-by as well.
Christian.
Quoted 3 lines
James
Quoted 2 lines
Alex
Quoted 1 line
int amdgpu_driver_load_kms(struct
drm_device*dev, unsignedlong
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 43 lines
Quoted 43 lines
flags)
....adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);struct
amdgpu_device{
....struct amdgpu_vcn vcn;Best Regards!
James zhuQuoted 33 lines
Quoted 33 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +0
-1};int amdgpu_vcn_sw_init (struct amdgpu_device *adev); diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 2664bb2..2cde0b4 100644drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0
-0@@ -1633,12 +1633,20 @@ static int vcn_v1_0_set_powergating_state(void *handle, * revisit this when there is a cleaner linebetween
* the smc and the hw blocks
*/
+ int ret;
structamdgpu_device*adev = (structamdgpu_device
*)handle;drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +9
-2+if (state == adev->vcn.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) + adev->vcn.cur_state = state; +return ret; }Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfxQuoted 4 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CADnq5_Ouq4_9BngfKEYH42anGL3oGKgf0791JQynGo_GA=8qaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchanged
Quoted 25 lines · Alex Deucher
Quoted 24 lines · James Zhu
Quoted 21 lines · Rex
Quoted 21 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of James Zhu
Sent: Friday, September 21, 2018 10:22 PM
To: Zhu, Rex <[email protected]>; Koenig, Christian <[email protected]>; Zhu, James <[email protected]>; Alex Deucher <[email protected]>
Cc: James Zhu <[email protected]>; amd-gfx list <amd- [email protected]>
Subject: Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchangedQuoted 2 lines · Rex
In my understand, when dpg mode enabled, we don't need to power up/down VCN via SMU and Also don't need to set vcn power gate/ungate
state.
Quoted 3 lines
Just need to enable the dpg mode.
If not true, please correct me.
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
You are right. Under DPG mode,
vcn_v1_0_startis used to setup DPG mode instead of ungating power.
For code reuse purpose, the function/variable name may have different connotation under different mode.Did your patch base on tip drm-next code?
No based on amd-temp-pco. Since DPG mode is enabled only on PCO at this moment.
Picasso support has been merged into drm-next as of last week.
I see, then I will rebase it to drm-next also.
James.
Quoted 159 lines
Alex
Quoted 156 lines
James
Quoted 155 lines
Rex
Quoted 153 lines
James
Quoted 52 lines
Best Regards
RexQuoted 45 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Friday, September 21, 2018 8:53 PM
To: Zhu, James <[email protected]>; Alex Deucher <[email protected]>
Cc: James Zhu <[email protected]>; Zhu, James <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH v2] drm/amdgpu:No action when VCN PG state is unchangedAm 21.09.2018 um 14:28 schrieb James Zhu:
Quoted 4 lines · Christian König
Quoted 3 lines
Am 20.09.2018 um 18:24 schrieb James Zhu:
Quoted 2 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 20, 2018 at 11:27 AM James Zhu <[email protected]>
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Alex Deucher
Quoted 1 line
On Thu, Sep 13, 2018 at 4:56 PM James Zhu <[email protected]>
Quoted 25 lines · wrote:
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 22 lines
Quoted 21 lines
Quoted 19 lines
When VCN PG state is unchanged, it is unnecessary to reset
power gate stateSigned-off-by: James Zhu <[email protected]>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 +
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 12 ++++++++++--
2 files changed, 11 insertions(+), 2 deletions(-)diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
index 0b0b863..d2219ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
@@ -69,6 +69,7 @@ struct amdgpu_vcn {
struct amdgpu_ring ring_jpeg;
struct amdgpu_irq_src irq;
unsigned num_enc_rings;
+ enum amd_powergating_state cur_state;Does the default value (0) at init time properly reflect the default powergating state? If so,
Quoted 1 line
Acked-by Alex Deucher <[email protected]>Quoted 2 lines
Yes, the below code shows it will be set to 0 during driver load stage.
Yes, I understand that. Is 0 (
AMD_PG_STATE_GATE) what we wantas
Quoted 27 lines
Quoted 27 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 3 lines
the default though? The first time the code runs are we going to do the right thing or is the code going to return early? IIRC, the hw default is ungated.
cur_stateis used for tracking driver SW PG state, not HW PG state. I though no matter what HW PG state is after device powers up, when first vcn ring is scheduled to run,begin_use->set_powergating_state->vcn_v1_0_start->ungatepower/clock->Boot_VCPU will be tried.For DPG mode, the ungate power/clock , boot VCPU will not actually be activated during start setup stage, and only be activated during ring run stage.
Quoted 6 lines
Quoted 5 lines
Mhm, I wonder if it wouldn't be better to have that functionality one layer up.
E.g. in
amdgpu_device_ip_set_powergating_stateso that it applies to all IP blocks in the same way.If necessary, I can add support for IP blocks later.
Yeah, agree. In general I'm not doing much with power management, so can't judge if that is a good idea or not.
Anyway feel free to add my Acked-by to the patch.
Regards,
Christian.Quoted 1 line
James
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
But on the other hand the correct solution looks good to me as well, so feel free to add my Acked-by as well.
Christian.
Quoted 3 lines
James
Quoted 2 lines
Alex
Quoted 1 line
int amdgpu_driver_load_kms(struct
drm_device*dev, unsignedlong
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
Quoted 43 lines
Quoted 43 lines
flags)
....adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);struct
amdgpu_device{
....struct amdgpu_vcn vcn;Best Regards!
James zhuQuoted 33 lines
Quoted 33 lines
};
int amdgpu_vcn_sw_init(struct amdgpu_device *adev); diff
--git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 2664bb2..2cde0b4 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
@@ -1633,12 +1633,20 @@ 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;
struct amdgpu_device *adev = (struct amdgpu_device
*)handle;+ if(state == adev->vcn.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)
+ adev->vcn.cur_state = state;
+ return ret;
}Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfxQuoted 4 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx