From: Mihail Atanassov <Mihail.Atanassov@arm.com>
To: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>
Cc: Mihail Atanassov <Mihail.Atanassov@arm.com>, nd <nd@arm.com>,
Daniel Vetter <daniel@ffwll.ch>,
Liviu Dudau <Liviu.Dudau@arm.com>,
"james qian wang (Arm Technology China)"
<james.qian.wang@arm.com>, Liviu Dudau <Liviu.Dudau@arm.com>,
Brian Starkey <Brian.Starkey@arm.com>,
David Airlie <airlied@linux.ie>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] drm/komeda: Fix FLIP_COMPLETE timestamp on CRTC enable
Date: Thu, 19 Sep 2019 13:30:02 +0000 [thread overview]
Message-ID: <20190919132759.18358-1-mihail.atanassov@arm.com> (raw)
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
drm_crtc_handle_vblank.
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@ffwll.ch>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Mihail Atanassov <mihail.atanassov@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,
{
komeda_crtc_prepare(to_kcrtc(crtc));
drm_crtc_vblank_on(crtc);
+ WARN_ON(drm_crtc_vblank_get(crtc));
komeda_crtc_do_flush(crtc, old);
+ drm_crtc_vblank_put(crtc);
}
static void
--
2.23.0
next reply other threads:[~2019-09-19 13:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-19 13:30 Mihail Atanassov [this message]
2019-09-19 14:43 ` [PATCH] drm/komeda: Fix FLIP_COMPLETE timestamp on CRTC enable Mihail Atanassov
2019-09-23 10:10 ` [PATCH v2] drm/komeda: Workaround for broken FLIP_COMPLETE timestamps Mihail Atanassov
2019-09-29 6:18 ` [v2] " james qian wang (Arm Technology China)
2019-10-01 14:21 ` [PATCH v2 RESEND] " Mihail Atanassov
2019-10-01 14:42 ` Ayan Halder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190919132759.18358-1-mihail.atanassov@arm.com \
--to=mihail.atanassov@arm.com \
--cc=Brian.Starkey@arm.com \
--cc=Liviu.Dudau@arm.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=james.qian.wang@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nd@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).