Skip to contentSkip to conversation

drm/amdgpu: Take VCN jpeg ring into account in idle work handler

PATCH In review Leo Liu 3 participants 5 messages Jul 9, 2018 – Jul 10, 2018 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Leo Liu

author
#0 lore raw

PATCH 1/3 drm/amdgpu: Take VCN jpeg ring into account in idle work handler

VCN won't get power off when only jpeg active

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +2 -0
index a66cd521a875..4a3457236e85 100644
@@ -211,6 +211,8 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
 		fences += amdgpu_fence_count_emitted(&adev->vcn.ring_enc[i]);
 	}
 
+	fences += amdgpu_fence_count_emitted(&adev->vcn.ring_jpeg);
+
 	if (fences == 0) {
 		if (adev->pm.dpm_enabled)
 			amdgpu_dpm_enable_uvd(adev, false);
Signature · 6 lines
2.17.1

_______________________________________________
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): [email protected]

author
#2 lore raw

PATCH 2/3 drm/amdgpu: get VCN start to process in the dpm disabled case

Fixes 22cc6c5e19 (drm/amdgpu: Add runtime VCN PG support)
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1 -1
index 4a3457236e85..769c6723c9ca 100644
@@ -229,7 +229,7 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
 	struct amdgpu_device *adev = ring->adev;
 	bool set_clocks = !cancel_delayed_work_sync(&adev->vcn.idle_work);
 
-	if (set_clocks && adev->pm.dpm_enabled) {
+	if (set_clocks) {
 		if (adev->pm.dpm_enabled)
 			amdgpu_dpm_enable_uvd(adev, true);
 		else
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#3 lore raw

PATCH 3/3 drm/amdgpu: move cache window setup after power and clock resume

In reply to a message not in the archive

To make register read/write reliable. Along with the previous patch, VCN will work with dpm disabled case.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2 -2
index b82c92084b6f..ca4265bc10b9 100644
@@ -600,12 +600,12 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
 	/* disable byte swapping */
 	lmi_swap_cntl = 0;
 
-	vcn_v1_0_mc_resume(adev);
-
 	vcn_1_0_disable_static_power_gating(adev);
 	/* disable clock gating */
 	vcn_v1_0_disable_clock_gating(adev);
 
+	vcn_v1_0_mc_resume(adev);
+
 	/* disable interupt */
 	WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_MASTINT_EN), 0,
 			~UVD_MASTINT_EN__VCPU_EN_MASK);
Signature · 6 lines
2.17.1

_______________________________________________
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): [email protected]

Reviewed-by
#5 lore raw

Re: [PATCH 3/3] drm/amdgpu: move cache window setup after power and clock resume

Series is:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Leo Liu <[email protected]>
Sent: Monday, July 9, 2018 12:11:38 PM
To: [email protected]
Cc: Liu, Leo
Subject: [PATCH 3/3] drm/amdgpu: move cache window setup after power and clock resume

To make register read/write reliable. Along with the previous patch, VCN will work with dpm disabled case.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2 -2
index b82c92084b6f..ca4265bc10b9 100644
@@ -600,12 +600,12 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
         /* disable byte swapping */
         lmi_swap_cntl = 0;
 
-       vcn_v1_0_mc_resume(adev);
-
         vcn_1_0_disable_static_power_gating(adev);
         /* disable clock gating */
         vcn_v1_0_disable_clock_gating(adev);
 
+       vcn_v1_0_mc_resume(adev);
+
         /* disable interupt */
         WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_MASTINT_EN), 0,
                         ~UVD_MASTINT_EN__VCPU_EN_MASK);

--
2.17.1

_______________________________________________
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): BN6PR12MB18099B0BE2002A60EDEC16FBF7440-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#7 lore raw

Re: [PATCH 3/3] drm/amdgpu: move cache window setup after power and clock resume

Looks like the patches should be reordered, e.g. patch #2 should be the last.

Apart from that Reviewed-by: Christian König <[email protected]>.

Regards,
Christian.

Am 09.07.2018 um 18:54 schrieb Deucher, Alexander:

Quoted 38 lines

Series is:

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Leo Liu <[email protected]> *Sent:* Monday, July 9, 2018 12:11:38 PM
*To:* [email protected]
*Cc:* Liu, Leo
*Subject:* [PATCH 3/3] drm/amdgpu: move cache window setup after power and clock resume
To make register read/write reliable. Along with the previous patch,
VCN will work with dpm disabled case.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2 -2
index b82c92084b6f..ca4265bc10b9 100644
@@ -600,12 +600,12 @@ static int vcn_v1_0_start(struct amdgpu_device 
 *adev)
          /* disable byte swapping */
          lmi_swap_cntl = 0;
 
-       vcn_v1_0_mc_resume(adev);
-
          vcn_1_0_disable_static_power_gating(adev);
          /* disable clock gating */
          vcn_v1_0_disable_clock_gating(adev);
 
+       vcn_v1_0_mc_resume(adev);
+
          /* disable interupt */
          WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_MASTINT_EN), 0,
Quoted 14 lines

                         ~UVD_MASTINT_EN__VCPU_EN_MASK);

Signature · 12 lines
2.17.1

_______________________________________________
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