[lkml]   [2019]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 5.4 072/434] drm/komeda: Workaround for broken FLIP_COMPLETE timestamps
From: Mihail Atanassov <>

[ Upstream commit f59769c52cd7d158df53487ec2936f5592073340 ]

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

Additionally, if the user doesn't request vblanks but _does_ request
FLIP_COMPLETE events, we still don't have a good timestamp: it'll be the
same stamp as the last vblank one.

Work around the issue by always enabling vblanks when the CRTC is on.
Reducing the amount of time that PL0 has to be unmasked would be nice to
fix at a later time.

Changes since v1 []:
- moved drm_crtc_vblank_put call to the ->atomic_disable() hook

Cc: Daniel Vetter <>
Cc: Liviu Dudau <>
Signed-off-by: Mihail Atanassov <>
Reviewed-by: James Qian Wang (Arm Technology China) <>
Signed-off-by: Ayan kumar halder <>
Signed-off-by: Sasha Levin <>
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 624d257da20f..52c42569a111 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
@@ -250,6 +250,7 @@ komeda_crtc_atomic_enable(struct drm_crtc *crtc,
+ WARN_ON(drm_crtc_vblank_get(crtc));
komeda_crtc_do_flush(crtc, old);

@@ -319,6 +320,7 @@ komeda_crtc_atomic_disable(struct drm_crtc *crtc,

+ drm_crtc_vblank_put(crtc);

 \ /
  Last update: 2019-12-29 18:44    [W:1.134 / U:1.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site