Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932305AbcKQJ2B (ORCPT ); Thu, 17 Nov 2016 04:28:01 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36266 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753335AbcKQJ1z (ORCPT ); Thu, 17 Nov 2016 04:27:55 -0500 From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Sean Paul , Thierry Reding , Emil Velikov , Daniel Vetter , Jani Nikula , Tomeu Vizoso , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, David Airlie Subject: [PATCH v12 4/4] drm/i915: Put "cooked" vlank counters in frame CRC lines Date: Thu, 17 Nov 2016 10:27:07 +0100 Message-Id: <1479374827-10642-5-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479374827-10642-1-git-send-email-tomeu.vizoso@collabora.com> References: <1479374827-10642-1-git-send-email-tomeu.vizoso@collabora.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1308 Lines: 37 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 Reviewed-by: Emil Velikov --- 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 7870a86d7209..c522a8b611b8 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1557,7 +1557,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) { @@ -1612,8 +1611,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->base, true, frame, crcs); + ret = drm_crtc_add_crc_entry(&crtc->base, true, + drm_accurate_vblank_count(&crtc->base), + crcs); if (!ret) wake_up_interruptible(&crtc->base.crc.wq); } -- 2.7.4