All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Sean Paul" <seanpaul@chromium.org>,
	"Daniel Vetter" <daniel.vetter@intel.com>,
	"Emil Velikov" <emil.l.velikov@gmail.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Tomeu Vizoso" <tomeu.vizoso@collabora.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	"David Airlie" <airlied@linux.ie>
Subject: [PATCH v8 4/4] drm/i915: Put "cooked" vlank counters in frame CRC lines
Date: Fri,  9 Sep 2016 11:56:50 +0200	[thread overview]
Message-ID: <1473415010-1389-5-git-send-email-tomeu.vizoso@collabora.com> (raw)
In-Reply-To: <1473415010-1389-1-git-send-email-tomeu.vizoso@collabora.com>

Use drm_accurate_vblank_count so we have the full 32 bit to represent
the frame counter and userspace has a simpler way of knowing when the
counter wraps around.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
---

 drivers/gpu/drm/i915/i915_irq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index e56c7f627093..6d3d4ad62498 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1489,7 +1489,6 @@ static void display_pipe_crc_irq_handler(struct drm_i915_private *dev_priv,
 	struct drm_driver *driver = dev_priv->drm.driver;
 	uint32_t crcs[5];
 	int head, tail, ret;
-	u32 frame;
 
 	spin_lock(&pipe_crc->lock);
 	if (pipe_crc->source) {
@@ -1545,8 +1544,9 @@ static void display_pipe_crc_irq_handler(struct drm_i915_private *dev_priv,
 		crcs[2] = crc2;
 		crcs[3] = crc3;
 		crcs[4] = crc4;
-		frame = driver->get_vblank_counter(&dev_priv->drm, pipe);
-		ret = drm_crtc_add_crc_entry(crtc, true, frame, crcs);
+		ret = drm_crtc_add_crc_entry(crtc, true,
+					     drm_accurate_vblank_count(crtc),
+					     crcs);
 		spin_unlock(&crtc->crc.lock);
 		if (!ret)
 			wake_up_interruptible(&crtc->crc.wq);
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	David Airlie <airlied@linux.ie>,
	intel-gfx@lists.freedesktop.org,
	Thierry Reding <thierry.reding@gmail.com>,
	dri-devel@lists.freedesktop.org,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH v8 4/4] drm/i915: Put "cooked" vlank counters in frame CRC lines
Date: Fri,  9 Sep 2016 11:56:50 +0200	[thread overview]
Message-ID: <1473415010-1389-5-git-send-email-tomeu.vizoso@collabora.com> (raw)
In-Reply-To: <1473415010-1389-1-git-send-email-tomeu.vizoso@collabora.com>

Use drm_accurate_vblank_count so we have the full 32 bit to represent
the frame counter and userspace has a simpler way of knowing when the
counter wraps around.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
---

 drivers/gpu/drm/i915/i915_irq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index e56c7f627093..6d3d4ad62498 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1489,7 +1489,6 @@ static void display_pipe_crc_irq_handler(struct drm_i915_private *dev_priv,
 	struct drm_driver *driver = dev_priv->drm.driver;
 	uint32_t crcs[5];
 	int head, tail, ret;
-	u32 frame;
 
 	spin_lock(&pipe_crc->lock);
 	if (pipe_crc->source) {
@@ -1545,8 +1544,9 @@ static void display_pipe_crc_irq_handler(struct drm_i915_private *dev_priv,
 		crcs[2] = crc2;
 		crcs[3] = crc3;
 		crcs[4] = crc4;
-		frame = driver->get_vblank_counter(&dev_priv->drm, pipe);
-		ret = drm_crtc_add_crc_entry(crtc, true, frame, crcs);
+		ret = drm_crtc_add_crc_entry(crtc, true,
+					     drm_accurate_vblank_count(crtc),
+					     crcs);
 		spin_unlock(&crtc->crc.lock);
 		if (!ret)
 			wake_up_interruptible(&crtc->crc.wq);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-09-09  9:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09  9:56 [PATCH v8 0/4] New debugfs API for capturing CRC of frames Tomeu Vizoso
2016-09-09  9:56 ` [PATCH v8 1/4] drm/i915/debugfs: Move out pipe CRC code Tomeu Vizoso
2016-09-09  9:56   ` Tomeu Vizoso
2016-09-09  9:56 ` [PATCH v8 2/4] drm: Add API for capturing frame CRCs Tomeu Vizoso
2016-09-09  9:56   ` Tomeu Vizoso
2016-10-04 10:10   ` Jon Hunter
2016-10-04 10:10     ` Jon Hunter
2016-10-04 11:25     ` Daniel Vetter
2016-10-04 11:25       ` Daniel Vetter
2016-10-04 12:23       ` Lukas Wunner
2016-10-04 12:44         ` Lukas Wunner
     [not found]       ` <CAKMK7uGLhpDt3hWyDG++ey=QepSyi2a8Q4PrZ=8HhETvUbQBCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-04 12:38         ` Jon Hunter
2016-10-04 12:38           ` Jon Hunter
2016-09-09  9:56 ` [PATCH v8 3/4] drm/i915: Use new CRC debugfs API Tomeu Vizoso
2016-09-09  9:56   ` Tomeu Vizoso
2016-09-09  9:56 ` Tomeu Vizoso [this message]
2016-09-09  9:56   ` [PATCH v8 4/4] drm/i915: Put "cooked" vlank counters in frame CRC lines Tomeu Vizoso

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=1473415010-1389-5-git-send-email-tomeu.vizoso@collabora.com \
    --to=tomeu.vizoso@collabora.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanpaul@chromium.org \
    --cc=thierry.reding@gmail.com \
    --cc=ville.syrjala@linux.intel.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 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.