From patchwork Wed Dec 14 13:34:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9474177 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 60DDE60823 for ; Wed, 14 Dec 2016 13:35:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55EED286B1 for ; Wed, 14 Dec 2016 13:35:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4ABF128728; Wed, 14 Dec 2016 13:35:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E891C286B1 for ; Wed, 14 Dec 2016 13:35:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C97816E091; Wed, 14 Dec 2016 13:35:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com [IPv6:2607:f8b0:400d:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id C60886E804; Wed, 14 Dec 2016 13:35:19 +0000 (UTC) Received: by mail-qk0-x244.google.com with SMTP id h201so2870587qke.3; Wed, 14 Dec 2016 05:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=y5gXJwK+lfL/JR4UqEC2hb1eE0SjUfi6Yxu8zgiKAfM=; b=QO3gr6nTKSMuslapiARrEwGBLp3aIe00GgRHew4v1X8JnNgR0V0KNahX1n6pwfRd7z T9fexHRgD/JDBYbtOwdMdHbfMRv/WvWOc6mYckxAsmwF9iT9Jf0QBn0uiO8ipeq7sdNA EdDK733T2h4tip5aprPHr1rdQ6RvWlvQdKgeDJCT3l0hx+Ml82An2qvVRv603rPAnV0o es2d3TACPStvGHO8qOTS94VoZSHrebotwgrDdwGAjIKuD5Bw4bhZMzsDUyQNfHG7ctM0 q+/zUY1Vi1KuEG1tM5I+PI11lHFIzcyOdOaBpJ9DaHKEK9jioITbGDcwpHeqonMT2NL+ s6tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=y5gXJwK+lfL/JR4UqEC2hb1eE0SjUfi6Yxu8zgiKAfM=; b=kjWgA/Tr4DPFsJQ1r70QAlD180q9jKE3ZPjmxRIJCM/3CtSQiwjbw30IkPSXl9apVy 1UPaxL7pr+3FG3jkNEBRxXj8LS+eLukokGdeDyVqPdb+hQnF0r2KQQ8uwOh67fxg3A5r n1DOguVisAN1z7GFmho6t5GaH/lVslVvUaRkB5r9S/41TV+F/lEGP82wnj0MUwav7A6k fRZgeoCRDaI82ZV/XW2aIxjcpltuMMMFeevvwTkvujp3vePoJ9jmbOzTL9M/gkWebdFN 4/7uaj5J36jDpl/99WRUKTHt4DBFScKO4mF5gV0w+0+Q250fLZxtmAOKJ7OgG4xw+8eV ZASQ== X-Gm-Message-State: AKaTC020x00obAhsANHMEhMbD9SFWr8F8jtF4IfhwkELPx7+Cp5zq+ypLn3gJY/sDRaIng== X-Received: by 10.28.225.138 with SMTP id y132mr7265454wmg.52.1481722518323; Wed, 14 Dec 2016 05:35:18 -0800 (PST) Received: from cizrna.lan ([109.72.12.226]) by smtp.gmail.com with ESMTPSA id 63sm7692000wmg.2.2016.12.14.05.35.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Dec 2016 05:35:17 -0800 (PST) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Subject: [PATCH v13 3/3] drm/i915: Put "cooked" vlank counters in frame CRC lines Date: Wed, 14 Dec 2016 14:34:36 +0100 Message-Id: <1481722476-29964-4-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481722476-29964-1-git-send-email-tomeu.vizoso@collabora.com> References: <1481722476-29964-1-git-send-email-tomeu.vizoso@collabora.com> Cc: Tomeu Vizoso , intel-gfx@lists.freedesktop.org, Emil Velikov , dri-devel@lists.freedesktop.org, Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 24b7620c1005..c0e3d1c1b4f0 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); }