All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/tilcdc: send vblank event when disabling crtc
@ 2021-01-29  5:58 ` quanyang.wang
  0 siblings, 0 replies; 10+ messages in thread
From: quanyang.wang @ 2021-01-29  5:58 UTC (permalink / raw)
  To: Jyri Sarha, David Airlie, Daniel Vetter, Tomi Valkeinen
  Cc: dri-devel, linux-kernel, quanyang.wang

From: Quanyang Wang <quanyang.wang@windriver.com>

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 completing

Just 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.

Fixes: cb345decb4d2 ("drm/tilcdc: Use standard drm_atomic_helper_commit")
Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index 30213708fc99..d99afd19ca08 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] drm/tilcdc: send vblank event when disabling crtc
@ 2021-01-29  5:58 ` quanyang.wang
  0 siblings, 0 replies; 10+ messages in thread
From: quanyang.wang @ 2021-01-29  5:58 UTC (permalink / raw)
  To: Jyri Sarha, David Airlie, Daniel Vetter, Tomi Valkeinen
  Cc: linux-kernel, dri-devel, quanyang.wang

From: Quanyang Wang <quanyang.wang@windriver.com>

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 completing

Just 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.

Fixes: cb345decb4d2 ("drm/tilcdc: Use standard drm_atomic_helper_commit")
Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index 30213708fc99..d99afd19ca08 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -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);
-- 
2.25.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/tilcdc: send vblank event when disabling crtc
  2021-01-29  5:58 ` quanyang.wang
@ 2021-01-29  7:58   ` Tomi Valkeinen
  -1 siblings, 0 replies; 10+ messages in thread
From: Tomi Valkeinen @ 2021-01-29  7:58 UTC (permalink / raw)
  To: quanyang.wang, David Airlie, Daniel Vetter, Jyri Sarha
  Cc: dri-devel, linux-kernel, Tomi Valkeinen

Dropped the @ti.com addresses and added the new ones.

 Tomi

On 29/01/2021 07:58, quanyang.wang@windriver.com wrote:
> From: Quanyang Wang <quanyang.wang@windriver.com>
> 
> 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 completing
> 
> Just 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.
> 
> Fixes: cb345decb4d2 ("drm/tilcdc: Use standard drm_atomic_helper_commit")
> Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
> ---
>  drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> index 30213708fc99..d99afd19ca08 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> @@ -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);
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/tilcdc: send vblank event when disabling crtc
@ 2021-01-29  7:58   ` Tomi Valkeinen
  0 siblings, 0 replies; 10+ messages in thread
From: Tomi Valkeinen @ 2021-01-29  7:58 UTC (permalink / raw)
  To: quanyang.wang, David Airlie, Daniel Vetter, Jyri Sarha
  Cc: Tomi Valkeinen, linux-kernel, dri-devel

Dropped the @ti.com addresses and added the new ones.

 Tomi

On 29/01/2021 07:58, quanyang.wang@windriver.com wrote:
> From: Quanyang Wang <quanyang.wang@windriver.com>
> 
> 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 completing
> 
> Just 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.
> 
> Fixes: cb345decb4d2 ("drm/tilcdc: Use standard drm_atomic_helper_commit")
> Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
> ---
>  drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> index 30213708fc99..d99afd19ca08 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> @@ -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);
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/tilcdc: send vblank event when disabling crtc
  2021-01-29  7:58   ` Tomi Valkeinen
@ 2021-02-09  3:09     ` quanyang.wang
  -1 siblings, 0 replies; 10+ messages in thread
From: quanyang.wang @ 2021-02-09  3:09 UTC (permalink / raw)
  To: Tomi Valkeinen, David Airlie, Daniel Vetter, Jyri Sarha
  Cc: dri-devel, linux-kernel

Ping.

On 1/29/21 3:58 PM, Tomi Valkeinen wrote:
> Dropped the @ti.com addresses and added the new ones.
>
>   Tomi
>
> On 29/01/2021 07:58, quanyang.wang@windriver.com wrote:
>> From: Quanyang Wang <quanyang.wang@windriver.com>
>>
>> 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 completing
>>
>> Just 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.
>>
>> Fixes: cb345decb4d2 ("drm/tilcdc: Use standard drm_atomic_helper_commit")
>> Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
>> ---
>>   drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>> index 30213708fc99..d99afd19ca08 100644
>> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>> @@ -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);
>>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/tilcdc: send vblank event when disabling crtc
@ 2021-02-09  3:09     ` quanyang.wang
  0 siblings, 0 replies; 10+ messages in thread
From: quanyang.wang @ 2021-02-09  3:09 UTC (permalink / raw)
  To: Tomi Valkeinen, David Airlie, Daniel Vetter, Jyri Sarha
  Cc: linux-kernel, dri-devel

Ping.

On 1/29/21 3:58 PM, Tomi Valkeinen wrote:
> Dropped the @ti.com addresses and added the new ones.
>
>   Tomi
>
> On 29/01/2021 07:58, quanyang.wang@windriver.com wrote:
>> From: Quanyang Wang <quanyang.wang@windriver.com>
>>
>> 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 completing
>>
>> Just 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.
>>
>> Fixes: cb345decb4d2 ("drm/tilcdc: Use standard drm_atomic_helper_commit")
>> Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
>> ---
>>   drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>> index 30213708fc99..d99afd19ca08 100644
>> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>> @@ -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);
>>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/tilcdc: send vblank event when disabling crtc
  2021-02-09  3:09     ` quanyang.wang
@ 2021-02-09  7:58       ` Jyri Sarha
  -1 siblings, 0 replies; 10+ messages in thread
From: Jyri Sarha @ 2021-02-09  7:58 UTC (permalink / raw)
  To: quanyang.wang
  Cc: Tomi Valkeinen, David Airlie, Daniel Vetter, dri-devel, linux-kernel

On 2021-02-09 5:09, quanyang.wang wrote:
> 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

> On 1/29/21 3:58 PM, Tomi Valkeinen wrote:
>> Dropped the @ti.com addresses and added the new ones.
>> 
>>   Tomi
>> 
>> On 29/01/2021 07:58, quanyang.wang@windriver.com wrote:
>>> From: Quanyang Wang <quanyang.wang@windriver.com>
>>> 
>>> 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 
>>> completing
>>> 
>>> Just 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.
>>> 
>>> Fixes: cb345decb4d2 ("drm/tilcdc: Use standard 
>>> drm_atomic_helper_commit")
>>> Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
>>> ---
>>>   drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++
>>>   1 file changed, 9 insertions(+)
>>> 
>>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c 
>>> b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>> index 30213708fc99..d99afd19ca08 100644
>>> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>> @@ -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);
>>> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/tilcdc: send vblank event when disabling crtc
@ 2021-02-09  7:58       ` Jyri Sarha
  0 siblings, 0 replies; 10+ messages in thread
From: Jyri Sarha @ 2021-02-09  7:58 UTC (permalink / raw)
  To: quanyang.wang; +Cc: David Airlie, Tomi Valkeinen, dri-devel, linux-kernel

On 2021-02-09 5:09, quanyang.wang wrote:
> 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

> On 1/29/21 3:58 PM, Tomi Valkeinen wrote:
>> Dropped the @ti.com addresses and added the new ones.
>> 
>>   Tomi
>> 
>> On 29/01/2021 07:58, quanyang.wang@windriver.com wrote:
>>> From: Quanyang Wang <quanyang.wang@windriver.com>
>>> 
>>> 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 
>>> completing
>>> 
>>> Just 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.
>>> 
>>> Fixes: cb345decb4d2 ("drm/tilcdc: Use standard 
>>> drm_atomic_helper_commit")
>>> Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
>>> ---
>>>   drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++
>>>   1 file changed, 9 insertions(+)
>>> 
>>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c 
>>> b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>> index 30213708fc99..d99afd19ca08 100644
>>> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>> @@ -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);
>>> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/tilcdc: send vblank event when disabling crtc
  2021-02-09  7:58       ` Jyri Sarha
@ 2021-02-09  8:07         ` quanyang.wang
  -1 siblings, 0 replies; 10+ messages in thread
From: quanyang.wang @ 2021-02-09  8:07 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: Tomi Valkeinen, David Airlie, Daniel Vetter, dri-devel, linux-kernel

Hi Jyri,

On 2/9/21 3:58 PM, Jyri Sarha wrote:
> On 2021-02-09 5:09, quanyang.wang wrote:
>> 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

>
> I'll find some time to do it soon.
>
> Best regards,
> Jyri
>
>> On 1/29/21 3:58 PM, Tomi Valkeinen wrote:
>>> Dropped the @ti.com addresses and added the new ones.
>>>
>>>   Tomi
>>>
>>> On 29/01/2021 07:58, quanyang.wang@windriver.com wrote:
>>>> From: Quanyang Wang <quanyang.wang@windriver.com>
>>>>
>>>> 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 
>>>> completing
>>>>
>>>> Just 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.
>>>>
>>>> Fixes: cb345decb4d2 ("drm/tilcdc: Use standard 
>>>> drm_atomic_helper_commit")
>>>> Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
>>>> ---
>>>>   drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++
>>>>   1 file changed, 9 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c 
>>>> b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>>> index 30213708fc99..d99afd19ca08 100644
>>>> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>>> @@ -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);
>>>>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/tilcdc: send vblank event when disabling crtc
@ 2021-02-09  8:07         ` quanyang.wang
  0 siblings, 0 replies; 10+ messages in thread
From: quanyang.wang @ 2021-02-09  8:07 UTC (permalink / raw)
  To: Jyri Sarha; +Cc: David Airlie, Tomi Valkeinen, dri-devel, linux-kernel

Hi Jyri,

On 2/9/21 3:58 PM, Jyri Sarha wrote:
> On 2021-02-09 5:09, quanyang.wang wrote:
>> 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

>
> I'll find some time to do it soon.
>
> Best regards,
> Jyri
>
>> On 1/29/21 3:58 PM, Tomi Valkeinen wrote:
>>> Dropped the @ti.com addresses and added the new ones.
>>>
>>>   Tomi
>>>
>>> On 29/01/2021 07:58, quanyang.wang@windriver.com wrote:
>>>> From: Quanyang Wang <quanyang.wang@windriver.com>
>>>>
>>>> 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 
>>>> completing
>>>>
>>>> Just 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.
>>>>
>>>> Fixes: cb345decb4d2 ("drm/tilcdc: Use standard 
>>>> drm_atomic_helper_commit")
>>>> Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
>>>> ---
>>>>   drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +++++++++
>>>>   1 file changed, 9 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c 
>>>> b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>>> index 30213708fc99..d99afd19ca08 100644
>>>> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>>>> @@ -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);
>>>>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-02-09  9:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29  5:58 [PATCH] drm/tilcdc: send vblank event when disabling crtc quanyang.wang
2021-01-29  5:58 ` quanyang.wang
2021-01-29  7:58 ` Tomi Valkeinen
2021-01-29  7:58   ` Tomi Valkeinen
2021-02-09  3:09   ` quanyang.wang
2021-02-09  3:09     ` quanyang.wang
2021-02-09  7:58     ` Jyri Sarha
2021-02-09  7:58       ` Jyri Sarha
2021-02-09  8:07       ` quanyang.wang
2021-02-09  8:07         ` quanyang.wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.