From patchwork Mon Dec 5 07:40:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9460515 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 1EBCA60231 for ; Mon, 5 Dec 2016 07:42:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1068B22BF1 for ; Mon, 5 Dec 2016 07:42:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0535B23B3D; Mon, 5 Dec 2016 07:42:03 +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 CBFC222BF1 for ; Mon, 5 Dec 2016 07:42:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9896B6E0E2; Mon, 5 Dec 2016 07:41:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 25F296E096; Mon, 5 Dec 2016 07:41:41 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id g23so14071750wme.1; Sun, 04 Dec 2016 23:41:41 -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=ZIJeNhhGEcgOrhVkhpRJ4e3w4lMKr6Zpmakg52JzZSU=; b=DtFIc2s1BdUC7GuQ5ngkzpznMQnlpiWKaV8sTQheWL7MlwqMTOwhRfakJ4NRszzhMt e/DFn6X7iJRK8GsAKosjZ3OsrOaCZQat92zvDjjwryRa8Bw46+BZa9FI8twp4ZvqyhHv Y7nuh4qmdNHYoaGezvCFMHAhkhvd5AsZVwEztthjIHJcaEon5FD7r6ocOKeamwbraaO1 YzSqlgNnkbhyCZhQEERseWcsjm0HVpLGWlfRa9f26TX1n1xt12mzfJii67fWcJ/wP0tF /sWtuP623a+6p/CtkJwgF7u68NaIy6rmWHCpUDMfQY61FH50fK1fvY7OthRVFPoBJBjM P/TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ZIJeNhhGEcgOrhVkhpRJ4e3w4lMKr6Zpmakg52JzZSU=; b=Z5BN4x9tgUbw47EpwVedj/VYevwSRmKKbVO6XMDODGkFB/PFsGUpAi6qD1/qvEcZxv v4OdeyfQFl3XA6PtN6esEikQ7LUe+XuF7wbdlb/OhVn9e+XbxSSt+kiwUCN+jLV94Mxw EjlUYvVNl8IJgMjUZAxFOOA2T9Vdc+A0tw92/QT9U3Pf4SBoPv7Zw44QvTqHTr2b3UHE bbKKyMb3CFWFsd65dw3e+RL7ijQ11U2Hml+3IbzBKoZojDTCMDCqbsLVWba7aPtaGcYg vyDRRatlYWP11AVnzRQLO80FAnpcxZScMShna66fKLecbGY0rTKpzRPmsZ2hX7A0ITuS kGnQ== X-Gm-Message-State: AKaTC02c8j3Nv0qLlRjcVcLsApcBABuVGM/HkiuN+Eo/nXHi39Uf+B984byABaoVMr3Hug== X-Received: by 10.28.151.136 with SMTP id z130mr8514574wmd.126.1480923699471; Sun, 04 Dec 2016 23:41:39 -0800 (PST) Received: from cizrna.lan ([109.72.12.105]) by smtp.gmail.com with ESMTPSA id c81sm16508859wmf.22.2016.12.04.23.41.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Dec 2016 23:41:38 -0800 (PST) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Subject: [RESEND PATCH v12 4/4] drm/i915: Put "cooked" vlank counters in frame CRC lines Date: Mon, 5 Dec 2016 08:40:57 +0100 Message-Id: <1480923657-7908-5-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480923657-7908-1-git-send-email-tomeu.vizoso@collabora.com> References: <1480923657-7908-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 2eac6ed0f653..a395fe0fb4f3 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); }