All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/imx: correct order of crtc disable
@ 2019-06-19 11:41 Robert Beckett
  2019-06-19 11:53 ` Philipp Zabel
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Beckett @ 2019-06-19 11:41 UTC (permalink / raw)
  To: dri-devel
  Cc: Robert Beckett, David Airlie, NXP Linux Team, Shawn Guo,
	Pengutronix Kernel Team

Notify drm core before sending pending events during crtc disable.
This fixes the first event after disable having an old stale timestamp
by having drm_crtc_vblank_off update the timestamp to now.

This was seen while debugging weston log message:
Warning: computed repaint delay is insane: -8212 msec

Also only send pending event if crtc is kept disabled, otherwise it will
be sent on next vlblank.

Fixes: a474478642d5 ("drm/imx: fix crtc vblank state regression")

Changes since v1:
Add details to commit message.

Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/gpu/drm/imx/ipuv3-crtc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index 9cc1d678674f..c436a28d50e4 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -91,14 +91,14 @@ static void ipu_crtc_atomic_disable(struct drm_crtc *crtc,
 	ipu_dc_disable(ipu);
 	ipu_prg_disable(ipu);
 
+	drm_crtc_vblank_off(crtc);
+
 	spin_lock_irq(&crtc->dev->event_lock);
-	if (crtc->state->event) {
+	if (crtc->state->event && !crtc->state->active) {
 		drm_crtc_send_vblank_event(crtc, crtc->state->event);
 		crtc->state->event = NULL;
 	}
 	spin_unlock_irq(&crtc->dev->event_lock);
-
-	drm_crtc_vblank_off(crtc);
 }
 
 static void imx_drm_crtc_reset(struct drm_crtc *crtc)
-- 
2.18.0

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

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

* Re: [PATCH v2] drm/imx: correct order of crtc disable
  2019-06-19 11:41 [PATCH v2] drm/imx: correct order of crtc disable Robert Beckett
@ 2019-06-19 11:53 ` Philipp Zabel
  0 siblings, 0 replies; 2+ messages in thread
From: Philipp Zabel @ 2019-06-19 11:53 UTC (permalink / raw)
  To: Robert Beckett, dri-devel
  Cc: Pengutronix Kernel Team, David Airlie, NXP Linux Team, Shawn Guo

On Wed, 2019-06-19 at 12:41 +0100, Robert Beckett wrote:
> Notify drm core before sending pending events during crtc disable.
> This fixes the first event after disable having an old stale timestamp
> by having drm_crtc_vblank_off update the timestamp to now.
> 
> This was seen while debugging weston log message:
> Warning: computed repaint delay is insane: -8212 msec
> 
> Also only send pending event if crtc is kept disabled, otherwise it will
> be sent on next vlblank.
>
> Fixes: a474478642d5 ("drm/imx: fix crtc vblank state regression")

Thank you, applied to imx-drm/fixes.

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

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

end of thread, other threads:[~2019-06-19 11:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19 11:41 [PATCH v2] drm/imx: correct order of crtc disable Robert Beckett
2019-06-19 11:53 ` Philipp Zabel

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.