drm/tilcdc: send vblank event when disabling crtc
Subsystems (3)
PATCH 1/1 drm/tilcdc: send vblank event when disabling crtc
From: Quanyang Wang <[email protected]>
When run xrandr to change resolution on Beaglebone Black board, it will print the error information:
root@beaglebone:~# xrandr -display :0 --output HDMI-1 --mode 720x400 [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:32:tilcdc crtc] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:34:HDMI-A-1] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:31:plane-0] commit wait timed out tilcdc 4830e000.lcdc: already pending page flip!
This is because there is operation sequence as below:
drm_atomic_connector_commit_dpms(mode is DRM_MODE_DPMS_OFF):
...
drm_atomic_helper_setup_commit <- init_completion(commit_A->flip_done)
drm_atomic_helper_commit_tail
tilcdc_crtc_atomic_disable
tilcdc_plane_atomic_update <- drm_crtc_send_vblank_event in tilcdc_crtc_irq
is skipped since tilcdc_crtc->enabled is 0
tilcdc_crtc_atomic_flush <- drm_crtc_send_vblank_event is skipped since
crtc->state->event is set to be NULL in
tilcdc_plane_atomic_update
drm_mode_setcrtc:
...
drm_atomic_helper_setup_commit <- init_completion(commit_B->flip_done)
drm_atomic_helper_wait_for_dependencies
drm_crtc_commit_wait <- wait for commit_A->flip_done completingJust as shown above, the steps which could complete commit_A->flip_done are all skipped and commit_A->flip_done will never be completed. This will result a time-out ERROR when drm_crtc_commit_wait check the commit_A->flip_done. So add drm_crtc_send_vblank_event in tilcdc_crtc_atomic_disable to complete commit_A->flip_done.
--- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +9 -0
@@ -515,6 +515,15 @@ static void tilcdc_crtc_off(struct drm_crtc *crtc, bool shutdown)drm_crtc_vblank_off (crtc); +spin_lock_irq (&crtc->dev->event_lock); + +if (crtc->state->event) { +drm_crtc_send_vblank_event (crtc, crtc->state->event); + crtc->state->event =NULL ; + } + +spin_unlock_irq (&crtc->dev->event_lock); +tilcdc_crtc_disable_irqs (dev);pm_runtime_put_sync (dev->dev);
Signature · 1 line
2.25.1
Tomi Valkeinen
maintainerDropped the @ti.com addresses and added the new ones.
Tomi
Quoted 55 lines · On 29/01/2021 07:58, [email protected] wrote:
From: Quanyang Wang <[email protected]>
When run xrandr to change resolution on Beaglebone Black board, it will print the error information:
root@beaglebone:~# xrandr -display :0 --output HDMI-1 --mode 720x400 [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:32:tilcdc crtc] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:34:HDMI-A-1] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:31:plane-0] commit wait timed out tilcdc 4830e000.lcdc: already pending page flip!This is because there is operation sequence as below:
drm_atomic_connector_commit_dpms(mode is DRM_MODE_DPMS_OFF):... drm_atomic_helper_setup_commit <- init_completion(commit_A->flip_done) drm_atomic_helper_commit_tail tilcdc_crtc_atomic_disable tilcdc_plane_atomic_update <- drm_crtc_send_vblank_event in tilcdc_crtc_irq is skipped since tilcdc_crtc->enabled is 0 tilcdc_crtc_atomic_flush <- drm_crtc_send_vblank_event is skipped since crtc->state->event is set to be NULL in tilcdc_plane_atomic_update drm_mode_setcrtc: ... drm_atomic_helper_setup_commit <- init_completion(commit_B->flip_done) drm_atomic_helper_wait_for_dependencies drm_crtc_commit_wait <- wait for commit_A->flip_done completingJust as shown above, the steps which could complete
commit_A->flip_doneare all skipped andcommit_A->flip_donewill never be completed. This will result a time-out ERROR whendrm_crtc_commit_waitcheck thecommit_A->flip_done. So adddrm_crtc_send_vblank_eventintilcdc_crtc_atomic_disableto completecommit_A->flip_done.Fixes cb345decb4d2 ("drm/tilcdc: Use standard drm_atomic_helper_commit")Signed-off-by Quanyang Wang <[email protected]>--- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/gpu/drm/tilcdc/tilcdc_crtc.c +2
-0@@ -515,6 +515,15 @@ static void tilcdc_crtc_off(struct drm_crtc *crtc, bool shutdown)drm_crtc_vblank_off (crtc); +spin_lock_irq (&crtc->dev->event_lock); +
drivers/gpu/drm/tilcdc/tilcdc_crtc.c static void tilcdc_crtc_off(struct drm_crtc *crtc, bool shutdown) · line 529
Quoted 10 lines
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +7
-0+if (crtc->state->event) { +drm_crtc_send_vblank_event (crtc, crtc->state->event); + crtc->state->event =NULL ; + } + +spin_unlock_irq (&crtc->dev->event_lock); +tilcdc_crtc_disable_irqs (dev);pm_runtime_put_sync (dev->dev);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Ping.
Quoted 70 lines · Tomi Valkeinen
Dropped the @ti.com addresses and added the new ones.
Tomi
Quoted 65 lines · On 29/01/2021 07:58, [email protected] wrote:
From: Quanyang Wang <[email protected]>
When run xrandr to change resolution on Beaglebone Black board, it will print the error information:
root@beaglebone:~# xrandr -display :0 --output HDMI-1 --mode 720x400 [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:32:tilcdc crtc] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:34:HDMI-A-1] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:31:plane-0] commit wait timed out tilcdc 4830e000.lcdc: already pending page flip!This is because there is operation sequence as below:
drm_atomic_connector_commit_dpms(mode is DRM_MODE_DPMS_OFF):... drm_atomic_helper_setup_commit <- init_completion(commit_A->flip_done) drm_atomic_helper_commit_tail tilcdc_crtc_atomic_disable tilcdc_plane_atomic_update <- drm_crtc_send_vblank_event in tilcdc_crtc_irq is skipped since tilcdc_crtc->enabled is 0 tilcdc_crtc_atomic_flush <- drm_crtc_send_vblank_event is skipped since crtc->state->event is set to be NULL in tilcdc_plane_atomic_update drm_mode_setcrtc: ... drm_atomic_helper_setup_commit <- init_completion(commit_B->flip_done) drm_atomic_helper_wait_for_dependencies drm_crtc_commit_wait <- wait for commit_A->flip_done completingJust as shown above, the steps which could complete
commit_A->flip_doneare all skipped andcommit_A->flip_donewill never be completed. This will result a time-out ERROR whendrm_crtc_commit_waitcheck thecommit_A->flip_done. So adddrm_crtc_send_vblank_eventintilcdc_crtc_atomic_disableto completecommit_A->flip_done.Fixes cb345decb4d2 ("drm/tilcdc: Use standard drm_atomic_helper_commit")Signed-off-by Quanyang Wang <[email protected]>--- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/gpu/drm/tilcdc/tilcdc_crtc.c +9
-0@@ -515,6 +515,15 @@ static void tilcdc_crtc_off(struct drm_crtc *crtc, bool shutdown)drm_crtc_vblank_off (crtc); +spin_lock_irq (&crtc->dev->event_lock); + +if (crtc->state->event) { +drm_crtc_send_vblank_event (crtc, crtc->state->event); + crtc->state->event =NULL ; + } + +spin_unlock_irq (&crtc->dev->event_lock); +tilcdc_crtc_disable_irqs (dev);pm_runtime_put_sync (dev->dev);
Jyri Sarha
maintainerQuoted 2 lines · quanyang.wang
Ping.
Could you resend the original patch (I have not received it) so I can easily test and merge it?
I'll find some time to do it soon.
Best regards,
Jyri
Quoted 76 lines · Tomi Valkeinen
Quoted 75 lines
Dropped the @ti.com addresses and added the new ones.
Tomi
Quoted 70 lines · On 29/01/2021 07:58, [email protected] wrote:
From: Quanyang Wang <[email protected]>
When run xrandr to change resolution on Beaglebone Black board, it will print the error information:
root@beaglebone:~# xrandr -display :0 --output HDMI-1 --mode 720x400 [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:32:tilcdc crtc] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:34:HDMI-A-1] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:31:plane-0] commit wait timed out tilcdc 4830e000.lcdc: already pending page flip!This is because there is operation sequence as below:
drm_atomic_connector_commit_dpms(mode is DRM_MODE_DPMS_OFF):... drm_atomic_helper_setup_commit <-
init_completion(commit_A->flip_done)
drm_atomic_helper_commit_tail
tilcdc_crtc_atomic_disabletilcdc_plane_atomic_update<-drm_crtc_send_vblank_eventintilcdc_crtc_irq
is skipped sincetilcdc_crtc->enabledis 0
tilcdc_crtc_atomic_flush<-drm_crtc_send_vblank_eventis
skipped sincecrtc->state->event is set to be NULL in tilcdc_plane_atomic_update drm_mode_setcrtc: ... drm_atomic_helper_setup_commit <- init_completion(commit_B->flip_done) drm_atomic_helper_wait_for_dependencies drm_crtc_commit_wait <- wait for commit_A->flip_donecompleting
Just as shown above, the steps which could complete
commit_A->flip_doneare all skipped andcommit_A->flip_donewill never be completed. This will result a time-out ERROR whendrm_crtc_commit_waitcheck thecommit_A->flip_done. So adddrm_crtc_send_vblank_eventintilcdc_crtc_atomic_disableto completecommit_A->flip_done.Fixes cb345decb4d2 ("drm/tilcdc: Use standard drm_atomic_helper_commit")Signed-off-by Quanyang Wang <[email protected]>--- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/gpu/drm/tilcdc/tilcdc_crtc.c +8
-0@@ -515,6 +515,15 @@ static void tilcdc_crtc_off(struct drm_crtc *crtc, bool shutdown)drm_crtc_vblank_off (crtc); +spin_lock_irq (&crtc->dev->event_lock); + +if (crtc->state->event) { +drm_crtc_send_vblank_event (crtc, crtc->state->event); + crtc->state->event =NULL ; + } + +spin_unlock_irq (&crtc->dev->event_lock); +tilcdc_crtc_disable_irqs (dev);pm_runtime_put_sync (dev->dev);
Hi Jyri,
Quoted 5 lines · Jyri Sarha
Quoted 2 lines · quanyang.wang
Ping.
Could you resend the original patch (I have not received it) so I can easily test and merge it?
OK, I will resend it.
Thanks,
Quanyang
Quoted 75 lines
I'll find some time to do it soon.
Best regards,
JyriQuoted 69 lines · Tomi Valkeinen
Quoted 68 lines
Dropped the @ti.com addresses and added the new ones.
Tomi
Quoted 63 lines · On 29/01/2021 07:58, [email protected] wrote:
From: Quanyang Wang <[email protected]>
When run xrandr to change resolution on Beaglebone Black board, it will print the error information:
root@beaglebone:~# xrandr -display :0 --output HDMI-1 --mode 720x400 [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:32:tilcdc crtc] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:34:HDMI-A-1] commit wait timed out [drm:drm_crtc_commit_wait] *ERROR* flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:31:plane-0] commit wait timed out tilcdc 4830e000.lcdc: already pending page flip!This is because there is operation sequence as below:
drm_atomic_connector_commit_dpms(mode is DRM_MODE_DPMS_OFF):
...
drm_atomic_helper_setup_commit<-init_completion(commit_A->flip_done)drm_atomic_helper_commit_tail
tilcdc_crtc_atomic_disable
tilcdc_plane_atomic_update<-drm_crtc_send_vblank_eventintilcdc_crtc_irqis skipped sincetilcdc_crtc->enabledis 0 tilcdc_crtc_atomic_flush <-drm_crtc_send_vblank_eventis skipped sincecrtc->state->eventis set to be NULL intilcdc_plane_atomic_updatedrm_mode_setcrtc:
...
drm_atomic_helper_setup_commit<-init_completion(commit_B->flip_done)drm_atomic_helper_wait_for_dependencies
drm_crtc_commit_wait <- wait forcommit_A->flip_donecompletingJust as shown above, the steps which could complete
commit_A->flip_doneare all skipped andcommit_A->flip_donewill never be completed. This will result a time-out ERROR whendrm_crtc_commit_waitcheck thecommit_A->flip_done. So adddrm_crtc_send_vblank_eventintilcdc_crtc_atomic_disableto completecommit_A->flip_done.Fixes cb345decb4d2 ("drm/tilcdc: Use standard drm_atomic_helper_commit")Signed-off-by Quanyang Wang <[email protected]>---
drivers/gpu/drm/tilcdc/tilcdc_crtc.c| 9 +++++++++1 file changed, 9 insertions(+)drivers/gpu/drm/tilcdc/tilcdc_crtc.c +8
-0@@ -515,6 +515,15 @@ static void tilcdc_crtc_off(struct drm_crtc *crtc, bool shutdown) drm_crtc_vblank_off(crtc); + spin_lock_irq(&crtc->dev->event_lock); + + if (crtc->state->event) { + drm_crtc_send_vblank_event(crtc, crtc->state->event); + crtc->state->event = NULL; + } + + spin_unlock_irq(&crtc->dev->event_lock); + tilcdc_crtc_disable_irqs(dev); pm_runtime_put_sync(dev->dev);