Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966732AbcJFI5Q (ORCPT ); Thu, 6 Oct 2016 04:57:16 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34563 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966225AbcJFI5E (ORCPT ); Thu, 6 Oct 2016 04:57:04 -0400 From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Sean Paul , Daniel Vetter , Emil Velikov , Thierry Reding , Tomeu Vizoso , Jani Nikula , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, David Airlie Subject: [PATCH v9 4/4] drm/i915: Put "cooked" vlank counters in frame CRC lines Date: Thu, 6 Oct 2016 10:56:37 +0200 Message-Id: <1475744197-3828-5-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475744197-3828-1-git-send-email-tomeu.vizoso@collabora.com> References: <1475744197-3828-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: 1311 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 1549cc4f88ec..238a353454e9 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1495,7 +1495,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) { @@ -1551,8 +1550,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