[PATCH] drm/komeda: Fix FLIP_COMPLETE timestamp on CRTC enable

Mihail Atanassov Mihail.Atanassov at arm.com
Thu Sep 19 13:30:02 UTC 2019

When initially turning a crtc on, drm_reset_vblank_timestamp will
set the vblank timestamp to 0 for any driver that doesn't provide
a ->get_vblank_timestamp() hook.

Unfortunately, the FLIP_COMPLETE event depends on that timestamp,
and the only way to regenerate a valid one is to have vblank
interrupts enabled and have a valid in-ISR call to

Wrap the call to komeda_crtc_do_flush in ->atomic_enable() with a
drm_crtc_vblank_{get,put} pair so we can have a vblank ISR prior to
the FLIP_COMPLETE ISR (or more likely, they'll get handled in the same
ISR, which is equally valid).

Cc: Daniel Vetter <daniel at ffwll.ch>
Cc: Liviu Dudau <Liviu.Dudau at arm.com>
Signed-off-by: Mihail Atanassov <mihail.atanassov at arm.com>
 drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
index f4400788ab94..87420a767bc4 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
@@ -258,7 +258,9 @@ komeda_crtc_atomic_enable(struct drm_crtc *crtc,
+	WARN_ON(drm_crtc_vblank_get(crtc));
 	komeda_crtc_do_flush(crtc, old);
+	drm_crtc_vblank_put(crtc);
 static void

More information about the dri-devel mailing list