Skip to contentSkip to conversation

drm/amdgpu/vcn: fix gfxoff issue

PATCH In review James Zhu 7 participants 11 messages Apr 14, 2020 – Apr 15, 2020

Subsystems (2)
lore
Share & tools
lore

James Zhu

author
#0 lore raw

PATCH 1/1 drm/amdgpu/vcn: fix gfxoff issue

Turn off gfxoff control when vcn is gated.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +5 -3
index dab34f6..aa9a7a5 100644
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
 	cancel_delayed_work_sync(&adev->vcn.idle_work);
 
 	mutex_lock(&adev->vcn.vcn_pg_lock);
-	amdgpu_gfx_off_ctrl(adev, false);
-	amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
-	       AMD_PG_STATE_UNGATE);
+	if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+		amdgpu_gfx_off_ctrl(adev, false);
+		amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
+		       AMD_PG_STATE_UNGATE);
+	}
 
 	if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)	{
 		struct dpg_pause_state new_state;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Tested-by on v1 1/1
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

BR,
Changfeng.

-----Original Message-----
From: Zhu, James <[email protected]>
Sent: Tuesday, April 14, 2020 8:05 PM
To: [email protected]
Cc: Zhu, James <[email protected]>; Zhu, Changfeng <[email protected]>
Subject: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

Turn off gfxoff control when vcn is gated.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +5 -3
index dab34f6..aa9a7a5 100644
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
 	cancel_delayed_work_sync(&adev->vcn.idle_work);
 
 	mutex_lock(&adev->vcn.vcn_pg_lock);
-	amdgpu_gfx_off_ctrl(adev, false);
-	amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
-	       AMD_PG_STATE_UNGATE);
+	if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+		amdgpu_gfx_off_ctrl(adev, false);
+		amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
+		       AMD_PG_STATE_UNGATE);
+	}
 
 	if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)	{
 		struct dpg_pause_state new_state;
Signature · 5 lines
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw
In reply to James Zhu
Quoted 15 lines · James Zhu

Turn off gfxoff control when vcn is gated.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -0
index dab34f6..aa9a7a5 100644
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
        cancel_delayed_work_sync(&adev->vcn.idle_work);
 

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring) · line 377

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +5 -3
        mutex_lock(&adev->vcn.vcn_pg_lock);
-       amdgpu_gfx_off_ctrl(adev, false);
-       amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
-              AMD_PG_STATE_UNGATE);
+       if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+               amdgpu_gfx_off_ctrl(adev, false);
+               amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
+                      AMD_PG_STATE_UNGATE);
+       }
 

Why are we touching gfxoff with VCN? Was this a leftover from bring up? Can we just drop all of this gfxoff stuff from VCN handling? I don't see why there would be a dependency.

Alex

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -1
        if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)    {
                struct dpg_pause_state new_state;
--

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

Reviewed-by Hawking Zhang
#3 lore raw

+Rex

This is introduce by below patch.

commit 3fded222f4bf7f4c56ef4854872a39a4de08f7a8
Author: Rex Zhu <[email protected]>
Date:   Fri Jul 27 17:00:02 2018 +0800

    drm/amdgpu: Disable gfx off if VCN is busy

    this patch is a workaround for the gpu hang at video begin/end time if gfx off is enabled.

Quoted 29 lines · Alex Deucher
Quoted 14 lines · James Zhu

Turn off gfxoff control when vcn is gated.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -0
index dab34f6..aa9a7a5 100644
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
         cancel_delayed_work_sync(&adev->vcn.idle_work);
 

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring) · line 377

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +5 -3
         mutex_lock(&adev->vcn.vcn_pg_lock);
-       amdgpu_gfx_off_ctrl(adev, false);
-       amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
-              AMD_PG_STATE_UNGATE);
+       if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+               amdgpu_gfx_off_ctrl(adev, false);
+               amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
+                      AMD_PG_STATE_UNGATE);
+       }
 

Why are we touching gfxoff with VCN? Was this a leftover from bring up? Can we just drop all of this gfxoff stuff from VCN handling? I don't see why there would be a dependency.

Quoted 11 lines

Alex

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -1
         if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)    {
                 struct dpg_pause_state new_state;
--

2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CJames.Zhu%40amd.com%7C3dd9135c717a4b3011e308d7e07f52b6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637224709763391845&amp;sdata=Y%2BtsJQNB1TXCQ9v86DW%2F0FC63gOSHsfzzZFu0MDvCHw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw

+Hawking

Hi Hawking,

can we drop this WA?

Thanks!

James

Quoted 13 lines · James Zhu

+Rex

This is introduce by below patch.

commit 3fded222f4bf7f4c56ef4854872a39a4de08f7a8
Author: Rex Zhu <[email protected]>
Date:   Fri Jul 27 17:00:02 2018 +0800

    drm/amdgpu: Disable gfx off if VCN is busy

    this patch is a workaround for the gpu hang at video begin/end time if gfx off is enabled.

Quoted 50 lines
Quoted 44 lines · Alex Deucher
Quoted 17 lines · James Zhu

Turn off gfxoff control when vcn is gated.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---

  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -0
index dab34f6..aa9a7a5 100644
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct 
 amdgpu_ring *ring)
 cancel_delayed_work_sync(&adev->vcn.idle_work);
 
          mutex_lock(&adev->vcn.vcn_pg_lock);

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c void amdgpu_vcn_ring_begin_use(struct · line 379

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +5 -3
-       amdgpu_gfx_off_ctrl(adev, false);
-       amdgpu_device_ip_set_powergating_state(adev, 
 AMD_IP_BLOCK_TYPE_VCN,
-              AMD_PG_STATE_UNGATE);
+       if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+               amdgpu_gfx_off_ctrl(adev, false);
+               amdgpu_device_ip_set_powergating_state(adev, 
 AMD_IP_BLOCK_TYPE_VCN,
+                      AMD_PG_STATE_UNGATE);
+       }

Why are we touching gfxoff with VCN?  Was this a leftover from bring up?  Can we just drop all of this gfxoff stuff from VCN handling?  I don't see why there would be a dependency.

Alex

Quoted 10 lines

         if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)    { struct dpg_pause_state new_state;

Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CJames.Zhu%40amd.com%7C3dd9135c717a4b3011e308d7e07f52b6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637224709763391845&amp;sdata=Y%2BtsJQNB1TXCQ9v86DW%2F0FC63gOSHsfzzZFu0MDvCHw%3D&amp;reserved=0 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#5 lore raw

[AMD Official Use Only - Internal Distribution Only]

+Ray

BR,
Changfeng.

-----Original Message-----
From: Zhu, James <[email protected]>
Sent: Tuesday, April 14, 2020 11:00 PM
To: Alex Deucher <[email protected]>; Zhu, James <[email protected]>; Zhang, Hawking <[email protected]>
Cc: amd-gfx list <[email protected]>; Zhu, Changfeng <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

+Hawking

Hi Hawking,

can we drop this WA?

Thanks!

James

Quoted 13 lines · James Zhu

+Rex

This is introduce by below patch.

commit 3fded222f4bf7f4c56ef4854872a39a4de08f7a8
Author: Rex Zhu <[email protected]>
Date:   Fri Jul 27 17:00:02 2018 +0800

    drm/amdgpu: Disable gfx off if VCN is busy

    this patch is a workaround for the gpu hang at video begin/end time if gfx off is enabled.

Quoted 54 lines
Quoted 48 lines · Alex Deucher
Quoted 17 lines · James Zhu

Turn off gfxoff control when vcn is gated.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---

  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -1
index dab34f6..aa9a7a5 100644
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct 
 amdgpu_ring *ring) cancel_delayed_work_sync(&adev->vcn.idle_work);
 
          mutex_lock(&adev->vcn.vcn_pg_lock);
-       amdgpu_gfx_off_ctrl(adev, false);

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c void amdgpu_vcn_ring_begin_use(struct · line 379

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +5 -2
-       amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
-              AMD_PG_STATE_UNGATE);
+       if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+               amdgpu_gfx_off_ctrl(adev, false);
+               amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
+                      AMD_PG_STATE_UNGATE);
+       }
 

Why are we touching gfxoff with VCN?  Was this a leftover from bring up?  Can we just drop all of this gfxoff stuff from VCN handling?  I don't see why there would be a dependency.

Alex

Quoted 14 lines

         if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)    { struct dpg_pause_state new_state; --
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
sts.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01% 7CJames.Zhu%40amd.com%7C3dd9135c717a4b3011e308d7e07f52b6%7C3dd8961fe 4884e608e11a82d994e183d%7C0%7C0%7C637224709763391845&amp;sdata=Y%2Bt sJQNB1TXCQ9v86DW%2F0FC63gOSHsfzzZFu0MDvCHw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#6 lore raw

[AMD Official Use Only - Internal Distribution Only]

This workaround is to fix the s3 issue with video playback on raven1 before.

Changfeng, can you have a quick test whether we don't need it right now?

Thanks,
Ray

-----Original Message-----
From: Zhu, Changfeng <[email protected]>
Sent: Wednesday, April 15, 2020 10:12 AM
To: Zhu, James <[email protected]>; Alex Deucher <[email protected]>; Zhang, Hawking <[email protected]>; Huang, Ray <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: RE: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

[AMD Official Use Only - Internal Distribution Only]

+Ray

BR,
Changfeng.

-----Original Message-----
From: Zhu, James <[email protected]>
Sent: Tuesday, April 14, 2020 11:00 PM
To: Alex Deucher <[email protected]>; Zhu, James <[email protected]>; Zhang, Hawking <[email protected]>
Cc: amd-gfx list <[email protected]>; Zhu, Changfeng <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

+Hawking

Hi Hawking,

can we drop this WA?

Thanks!

James

Quoted 13 lines · James Zhu

+Rex

This is introduce by below patch.

commit 3fded222f4bf7f4c56ef4854872a39a4de08f7a8
Author: Rex Zhu <[email protected]>
Date:   Fri Jul 27 17:00:02 2018 +0800

    drm/amdgpu: Disable gfx off if VCN is busy

    this patch is a workaround for the gpu hang at video begin/end time if gfx off is enabled.

Quoted 54 lines
Quoted 48 lines · Alex Deucher
Quoted 17 lines · James Zhu

Turn off gfxoff control when vcn is gated.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---

  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -1
index dab34f6..aa9a7a5 100644
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct 
 amdgpu_ring *ring) cancel_delayed_work_sync(&adev->vcn.idle_work);
 
          mutex_lock(&adev->vcn.vcn_pg_lock);
-       amdgpu_gfx_off_ctrl(adev, false);

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c void amdgpu_vcn_ring_begin_use(struct · line 379

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +5 -2
-       amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
-              AMD_PG_STATE_UNGATE);
+       if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+               amdgpu_gfx_off_ctrl(adev, false);
+               amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
+                      AMD_PG_STATE_UNGATE);
+       }
 

Why are we touching gfxoff with VCN?  Was this a leftover from bring up?  Can we just drop all of this gfxoff stuff from VCN handling?  I don't see why there would be a dependency.

Alex

Quoted 14 lines

         if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)    { struct dpg_pause_state new_state; --
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
sts.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01% 7CJames.Zhu%40amd.com%7C3dd9135c717a4b3011e308d7e07f52b6%7C3dd8961fe 4884e608e11a82d994e183d%7C0%7C0%7C637224709763391845&amp;sdata=Y%2Bt sJQNB1TXCQ9v86DW%2F0FC63gOSHsfzzZFu0MDvCHw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#7 lore raw
In reply to James Zhu

[AMD Official Use Only - Internal Distribution Only]

This actually introduced at very early stage we enabled GFXOFF for the first time on Raven platform. At that time gfxoff can't work with Video play back (this is general issue across all OSes). So we disabled gfxoff when there is workload on VCN.

For most ASICs, it shall be removed. The only concern is some old Raven platform where the rlc fw fixes are not available.

I had a quick chat with @Zhu, Changfeng who will have a quick validation on his old Raven platform so that we can safely remove this workaround finally.

Regards,
Hawking
-----Original Message-----
From: Zhu, James <[email protected]>
Sent: Tuesday, April 14, 2020 23:00
To: Alex Deucher <[email protected]>; Zhu, James <[email protected]>; Zhang, Hawking <[email protected]>
Cc: amd-gfx list <[email protected]>; Zhu, Changfeng <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

+Hawking

Hi Hawking,

can we drop this WA?

Thanks!

James

Quoted 13 lines · James Zhu

+Rex

This is introduce by below patch.

commit 3fded222f4bf7f4c56ef4854872a39a4de08f7a8
Author: Rex Zhu <[email protected]>
Date:   Fri Jul 27 17:00:02 2018 +0800

    drm/amdgpu: Disable gfx off if VCN is busy

    this patch is a workaround for the gpu hang at video begin/end time if gfx off is enabled.

Quoted 54 lines
Quoted 48 lines · Alex Deucher
Quoted 17 lines · James Zhu

Turn off gfxoff control when vcn is gated.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---

  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -1
index dab34f6..aa9a7a5 100644
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct 
 amdgpu_ring *ring) cancel_delayed_work_sync(&adev->vcn.idle_work);
 
          mutex_lock(&adev->vcn.vcn_pg_lock);
-       amdgpu_gfx_off_ctrl(adev, false);

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c void amdgpu_vcn_ring_begin_use(struct · line 379

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +5 -2
-       amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
-              AMD_PG_STATE_UNGATE);
+       if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+               amdgpu_gfx_off_ctrl(adev, false);
+               amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
+                      AMD_PG_STATE_UNGATE);
+       }
 

Why are we touching gfxoff with VCN?  Was this a leftover from bring up?  Can we just drop all of this gfxoff stuff from VCN handling?  I don't see why there would be a dependency.

Alex

Quoted 14 lines

         if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)    { struct dpg_pause_state new_state; --
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
sts.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01% 7CJames.Zhu%40amd.com%7C3dd9135c717a4b3011e308d7e07f52b6%7C3dd8961fe 4884e608e11a82d994e183d%7C0%7C0%7C637224709763391845&amp;sdata=Y%2Bt sJQNB1TXCQ9v86DW%2F0FC63gOSHsfzzZFu0MDvCHw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#8 lore raw

[AMD Official Use Only - Internal Distribution Only]

After drop this WA,
It can't enter GFXOFF on raven2.
And it can't run S3 successfully on Picasso and raven1.

I suggest that it can add chip type and drop this WA only on renoir.

BR,
Changfeng

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Wednesday, April 15, 2020 11:05 AM
To: Zhu, James <[email protected]>; Alex Deucher <[email protected]>; Zhu, Changfeng <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>
Subject: RE: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

[AMD Official Use Only - Internal Distribution Only]

This actually introduced at very early stage we enabled GFXOFF for the first time on Raven platform. At that time gfxoff can't work with Video play back (this is general issue across all OSes). So we disabled gfxoff when there is workload on VCN.

For most ASICs, it shall be removed. The only concern is some old Raven platform where the rlc fw fixes are not available.

I had a quick chat with @Zhu, Changfeng who will have a quick validation on his old Raven platform so that we can safely remove this workaround finally.

Regards,
Hawking
-----Original Message-----
From: Zhu, James <[email protected]>
Sent: Tuesday, April 14, 2020 23:00
To: Alex Deucher <[email protected]>; Zhu, James <[email protected]>; Zhang, Hawking <[email protected]>
Cc: amd-gfx list <[email protected]>; Zhu, Changfeng <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

+Hawking

Hi Hawking,

can we drop this WA?

Thanks!

James

Quoted 13 lines · James Zhu

+Rex

This is introduce by below patch.

commit 3fded222f4bf7f4c56ef4854872a39a4de08f7a8
Author: Rex Zhu <[email protected]>
Date:   Fri Jul 27 17:00:02 2018 +0800

    drm/amdgpu: Disable gfx off if VCN is busy

    this patch is a workaround for the gpu hang at video begin/end time if gfx off is enabled.

Quoted 54 lines
Quoted 48 lines · Alex Deucher
Quoted 17 lines · James Zhu

Turn off gfxoff control when vcn is gated.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---

  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -1
index dab34f6..aa9a7a5 100644
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct 
 amdgpu_ring *ring) cancel_delayed_work_sync(&adev->vcn.idle_work);
 
          mutex_lock(&adev->vcn.vcn_pg_lock);
-       amdgpu_gfx_off_ctrl(adev, false);

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c void amdgpu_vcn_ring_begin_use(struct · line 379

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +5 -2
-       amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
-              AMD_PG_STATE_UNGATE);
+       if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+               amdgpu_gfx_off_ctrl(adev, false);
+               amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
+                      AMD_PG_STATE_UNGATE);
+       }
 

Why are we touching gfxoff with VCN?  Was this a leftover from bring up?  Can we just drop all of this gfxoff stuff from VCN handling?  I don't see why there would be a dependency.

Alex

Quoted 14 lines

         if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)    { struct dpg_pause_state new_state; --
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
sts.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01% 7CJames.Zhu%40amd.com%7C3dd9135c717a4b3011e308d7e07f52b6%7C3dd8961fe 4884e608e11a82d994e183d%7C0%7C0%7C637224709763391845&amp;sdata=Y%2Bt sJQNB1TXCQ9v86DW%2F0FC63gOSHsfzzZFu0MDvCHw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#9 lore raw

[AMD Official Use Only - Internal Distribution Only]

Do we know if whatever issue was actually fixed on renoir? If not, I'd say just leave it for now.

Alex

________________________________
From: amd-gfx <[email protected]> on behalf of Zhu, Changfeng <[email protected]>
Sent: Wednesday, April 15, 2020 7:27 AM
To: Zhang, Hawking <[email protected]>; Zhu, James <[email protected]>; Alex Deucher <[email protected]>; [email protected] <[email protected]>
Cc: Huang, Shimmer <[email protected]>; Huang, Ray <[email protected]>
Subject: RE: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

[AMD Official Use Only - Internal Distribution Only]

After drop this WA,
It can't enter GFXOFF on raven2.
And it can't run S3 successfully on Picasso and raven1.

I suggest that it can add chip type and drop this WA only on renoir.

BR,
Changfeng

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Wednesday, April 15, 2020 11:05 AM
To: Zhu, James <[email protected]>; Alex Deucher <[email protected]>; Zhu, Changfeng <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>
Subject: RE: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

[AMD Official Use Only - Internal Distribution Only]

This actually introduced at very early stage we enabled GFXOFF for the first time on Raven platform. At that time gfxoff can't work with Video play back (this is general issue across all OSes). So we disabled gfxoff when there is workload on VCN.

For most ASICs, it shall be removed. The only concern is some old Raven platform where the rlc fw fixes are not available.

I had a quick chat with @Zhu, Changfeng who will have a quick validation on his old Raven platform so that we can safely remove this workaround finally.

Regards,
Hawking
-----Original Message-----
From: Zhu, James <[email protected]>
Sent: Tuesday, April 14, 2020 23:00
To: Alex Deucher <[email protected]>; Zhu, James <[email protected]>; Zhang, Hawking <[email protected]>
Cc: amd-gfx list <[email protected]>; Zhu, Changfeng <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

+Hawking

Hi Hawking,

can we drop this WA?

Thanks!

James

Quoted 13 lines · James Zhu

+Rex

This is introduce by below patch.

commit 3fded222f4bf7f4c56ef4854872a39a4de08f7a8

Author: Rex Zhu <[email protected]>
Date:   Fri Jul 27 17:00:02 2018 +0800

drm/amdgpu: Disable gfx off if VCN is busy

this patch is a workaround for the gpu hang at video begin/end time if gfx off is enabled.

Quoted 54 lines
Quoted 48 lines · Alex Deucher
Quoted 17 lines · James Zhu

Turn off gfxoff control when vcn is gated.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -1
index dab34f6..aa9a7a5 100644
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct
 amdgpu_ring *ring) cancel_delayed_work_sync(&adev->vcn.idle_work);
 
         mutex_lock(&adev->vcn.vcn_pg_lock);
-       amdgpu_gfx_off_ctrl(adev, false);

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c void amdgpu_vcn_ring_begin_use(struct · line 379

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +5 -2
-       amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
-              AMD_PG_STATE_UNGATE);
+       if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+               amdgpu_gfx_off_ctrl(adev, false);
+               amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
+                      AMD_PG_STATE_UNGATE);
+       }
 

Why are we touching gfxoff with VCN? Was this a leftover from bring up? Can we just drop all of this gfxoff stuff from VCN handling? I don't see why there would be a dependency.

Alex

Quoted 14 lines
         if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)    {
                 struct dpg_pause_state new_state;

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
sts.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01% 7CJames.Zhu%40amd.com%7C3dd9135c717a4b3011e308d7e07f52b6%7C3dd8961fe 4884e608e11a82d994e183d%7C0%7C0%7C637224709763391845&amp;sdata=Y%2Bt sJQNB1TXCQ9v86DW%2F0FC63gOSHsfzzZFu0MDvCHw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Calexander.deucher%40amd.com%7C9c7d297e1bae4b559e2c08d7e12ff6b7%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637225469199881257&amp;sdata=l%2BQiZNOq%2F%2FazFg2wmPAt6ZmNSQfJsniMA4W%2BQUBzTxE%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#10 lore raw
In reply to Zhu, Changfeng

I think this code in amdgpu_vcn.c right now is only for vcn2.0 and above.

why it can affect raven?

we need rerun  Video play back test case on renoir, see if  it still needs this WA.

Thanks!

James

Quoted 39 lines · Changfeng

[AMD Official Use Only - Internal Distribution Only]

After drop this WA,
It can't enter GFXOFF on raven2.
And it can't run S3 successfully on Picasso and raven1.

I suggest that it can add chip type and drop this WA only on renoir.

BR,
Changfeng

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Wednesday, April 15, 2020 11:05 AM
To: Zhu, James <[email protected]>; Alex Deucher <[email protected]>; Zhu, Changfeng <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>
Subject: RE: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

[AMD Official Use Only - Internal Distribution Only]

This actually introduced at very early stage we enabled GFXOFF for the first time on Raven platform. At that time gfxoff can't work with Video play back (this is general issue across all OSes). So we disabled gfxoff when there is workload on VCN.

For most ASICs, it shall be removed. The only concern is some old Raven platform where the rlc fw fixes are not available.

I had a quick chat with @Zhu, Changfeng who will have a quick validation on his old Raven platform so that we can safely remove this workaround finally.

Regards,
Hawking
-----Original Message-----
From: Zhu, James <[email protected]>
Sent: Tuesday, April 14, 2020 23:00
To: Alex Deucher <[email protected]>; Zhu, James <[email protected]>; Zhang, Hawking <[email protected]>
Cc: amd-gfx list <[email protected]>; Zhu, Changfeng <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

+Hawking

Hi Hawking,

Quoted 74 lines

can we drop this WA?

Thanks!

James

Quoted 67 lines · James Zhu

+Rex

This is introduce by below patch.

commit 3fded222f4bf7f4c56ef4854872a39a4de08f7a8
Author: Rex Zhu <[email protected]>
Date:   Fri Jul 27 17:00:02 2018 +0800

    drm/amdgpu: Disable gfx off if VCN is busy

    this patch is a workaround for the gpu hang at video begin/end time if gfx off is enabled.

Quoted 48 lines · Alex Deucher
Quoted 17 lines · James Zhu

Turn off gfxoff control when vcn is gated.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---
   1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0 -1
index dab34f6..aa9a7a5 100644
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct
 amdgpu_ring *ring) cancel_delayed_work_sync(&adev->vcn.idle_work);
 
          mutex_lock(&adev->vcn.vcn_pg_lock);
-       amdgpu_gfx_off_ctrl(adev, false);

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c void amdgpu_vcn_ring_begin_use(struct · line 379

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +5 -2
-       amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
-              AMD_PG_STATE_UNGATE);
+       if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+               amdgpu_gfx_off_ctrl(adev, false);
+               amdgpu_device_ip_set_powergating_state(adev,
 AMD_IP_BLOCK_TYPE_VCN,
+                      AMD_PG_STATE_UNGATE);
+       }
 

Why are we touching gfxoff with VCN?  Was this a leftover from bring up?  Can we just drop all of this gfxoff stuff from VCN handling?  I don't see why there would be a dependency.

Alex

Quoted 14 lines

         if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)    { struct dpg_pause_state new_state;
--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
sts.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01% 7CJames.Zhu%40amd.com%7C3dd9135c717a4b3011e308d7e07f52b6%7C3dd8961fe 4884e608e11a82d994e183d%7C0%7C0%7C637224709763391845&amp;sdata=Y%2Bt sJQNB1TXCQ9v86DW%2F0FC63gOSHsfzzZFu0MDvCHw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx