Skip to contentSkip to conversation

drm/amdgpu:cancel timer of virtual DCE(v2)

PATCH In review Monk Liu 2 participants 3 messages Nov 16, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Monk Liu

author
#0 lore raw

PATCH 1/1 drm/amdgpu:cancel timer of virtual DCE(v2)

virtual DCE Timer structure is already released after its sw_fini(), so we need to cancel the its Timer in hw_fini() otherwise the Timer canceling is missed.

v2:
use for loop and num_crtc to replace original code

Change-Id I03d6ca7aa07591d287da379ef4fe008f06edaff6
---
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +10 -0
index cd4895b4..943efc3 100644
@@ -44,6 +44,9 @@ static void dce_virtual_set_display_funcs(struct amdgpu_device *adev);
 static void dce_virtual_set_irq_funcs(struct amdgpu_device *adev);
 static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev,
 					      int index);
+static void dce_virtual_set_crtc_vblank_interrupt_state(struct amdgpu_device *adev,
+							int crtc,
+							enum amdgpu_interrupt_state state);
 
 /**
  * dce_virtual_vblank_wait - vblank wait asic callback.
@@ -550,6 +553,13 @@ static int dce_virtual_hw_init(void *handle)
 
 static int dce_virtual_hw_fini(void *handle)
 {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+	int i = 0;
+
+	for (i = 0; i<adev->mode_info.num_crtc; i++)
+		if (adev->mode_info.crtcs[i])
+			dce_virtual_set_crtc_vblank_interrupt_state(adev, i, AMDGPU_IRQ_STATE_DISABLE);
+
 	return 0;
 }
 
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): 1510812383-21908-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Hi Monk,

I’m not for sure what issue you are fixing. The timer should be cancelled while the IRQ is put to disable vblank . However there is a known rmmod issue fixed with “02d319e drm/amdgpu/virtual_dce: Remove the rmmod error message”.

Can you take a look at that patch or tell why or in which case the timer is not cancelled during IRQ put?

—
Sincerely Yours,
Pixel

Quoted 50 lines · amd-gfx on behalf of Monk Liu

virtual DCE Timer structure is already released after its sw_fini(), so we need to cancel the its Timer in hw_fini() otherwise the Timer canceling is missed.

v2:
use for loop and num_crtc to replace original code

Change-Id I03d6ca7aa07591d287da379ef4fe008f06edaff6

---
drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 10 ++++++++++

1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +10 -0
index cd4895b4..943efc3 100644
@@ -44,6 +44,9 @@ static void dce_virtual_set_display_funcs(struct amdgpu_device *adev);
 static void dce_virtual_set_irq_funcs(struct amdgpu_device *adev);
 static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev,
 					      int index);
+static void dce_virtual_set_crtc_vblank_interrupt_state(struct amdgpu_device *adev,
+							int crtc,
+							enum amdgpu_interrupt_state state);
 
 /**
 * dce_virtual_vblank_wait - vblank wait asic callback.
@@ -550,6 +553,13 @@ static int dce_virtual_hw_init(void *handle)
 
 static int dce_virtual_hw_fini(void *handle)
 {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+	int i = 0;
+
+	for (i = 0; i<adev->mode_info.num_crtc; i++)
+		if (adev->mode_info.crtcs[i])
+			dce_virtual_set_crtc_vblank_interrupt_state(adev, i, AMDGPU_IRQ_STATE_DISABLE);
+
 	return 0;
 }
 
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

A message that is not in the archive (sent off-list or not yet received): EA869283-1D32-45D6-9414-5503606D9607-5C7GfCeVMHo@public.gmane.org

#4 lore raw

I got it, the IH sw_fini is done later than DCE while your other patch cleans up timer in DCE sw_fini. Maybe you can call amdgpu_irq_put() here, anyway your patch is already in:)
—
Sincerely Yours,
Pixel

Quoted 61 lines · Pixel

Hi Monk,

I’m not for sure what issue you are fixing. The timer should be cancelled while the IRQ is put to disable vblank . However there is a known rmmod issue fixed with “02d319e drm/amdgpu/virtual_dce: Remove the rmmod error message”.

Can you take a look at that patch or tell why or in which case the timer is not cancelled during IRQ put?

—
Sincerely Yours,
Pixel

Quoted 43 lines · amd-gfx on behalf of Monk Liu

virtual DCE Timer structure is already released after its sw_fini(), so we need to cancel the its Timer in hw_fini() otherwise the Timer canceling is missed.

v2:
use for loop and num_crtc to replace original code

Change-Id I03d6ca7aa07591d287da379ef4fe008f06edaff6

---
drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 10 ++++++++++

1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +10 -0
index cd4895b4..943efc3 100644
@@ -44,6 +44,9 @@ static void dce_virtual_set_display_funcs(struct amdgpu_device *adev);
 static void dce_virtual_set_irq_funcs(struct amdgpu_device *adev);
 static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev,
 					      int index);
+static void dce_virtual_set_crtc_vblank_interrupt_state(struct amdgpu_device *adev,
+							int crtc,
+							enum amdgpu_interrupt_state state);
 
 /**
 * dce_virtual_vblank_wait - vblank wait asic callback.
@@ -550,6 +553,13 @@ static int dce_virtual_hw_init(void *handle)
 
 static int dce_virtual_hw_fini(void *handle)
 {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+	int i = 0;
+
+	for (i = 0; i<adev->mode_info.num_crtc; i++)
+		if (adev->mode_info.crtcs[i])
+			dce_virtual_set_crtc_vblank_interrupt_state(adev, i, AMDGPU_IRQ_STATE_DISABLE);
+
 	return 0;
 }
 
Quoted 7 lines
Quoted 7 lines
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