linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,
	Gustavo Padovan <gustavo@padovan.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>,
	Alexey Brodkin <alexey.brodkin@synopsys.com>,
	stable@vger.kernel.org,
	Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Subject: [PATCH] DRM: VBLANK: provide valid timestamp for EVENT_FLIP
Date: Wed, 26 Sep 2018 17:25:35 +0300	[thread overview]
Message-ID: <20180926142535.17997-1-Eugeniy.Paltsev@synopsys.com> (raw)

If driver/HW doesn't support vblank functionality (for example
UDL driver, ARCPGU driver, ...) we always have vblank->time == 0.
In result we always provide zero timestamp for
DRM_EVENT_FLIP_COMPLETE. This breaks userspace apps (for example
weston) which relies on timestamp value.

Setup time to provide valid timestamp for DRM_EVENT_FLIP_COMPLETE
event.

Cc: stable@vger.kernel.org
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 drivers/gpu/drm/drm_vblank.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 28cdcf76b6f9..0d19aca48782 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -911,6 +911,15 @@ void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
 
 	if (dev->num_crtcs > 0) {
 		seq = drm_vblank_count_and_time(dev, pipe, &now);
+
+		/*
+		 * If driver/HW doesn't support vblank functionality we
+		 * always have vblank->time == 0. Setup time to provide valid
+		 * timestamp for DRM_EVENT_FLIP_COMPLETE event.
+		 */
+		if (!now && e->event.base.type == DRM_EVENT_FLIP_COMPLETE)
+			now = ktime_get();
+
 	} else {
 		seq = 0;
 
-- 
2.14.4


             reply	other threads:[~2018-09-26 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 14:25 Eugeniy Paltsev [this message]
2018-09-26 16:37 ` [PATCH] DRM: VBLANK: provide valid timestamp for EVENT_FLIP Ville Syrjälä
2018-09-28 14:32   ` Eugeniy Paltsev

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=20180926142535.17997-1-Eugeniy.Paltsev@synopsys.com \
    --to=eugeniy.paltsev@synopsys.com \
    --cc=airlied@linux.ie \
    --cc=alexey.brodkin@synopsys.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=sean@poorly.run \
    --cc=stable@vger.kernel.org \
    /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).