From patchwork Tue Jan 10 13:43:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9507305 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 5B1B6601E9 for ; Tue, 10 Jan 2017 13:43:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E3DE2833C for ; Tue, 10 Jan 2017 13:43:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 422F9284E6; Tue, 10 Jan 2017 13:43:52 +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=ham 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 D0C5B2833C for ; Tue, 10 Jan 2017 13:43:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E5686E2DC; Tue, 10 Jan 2017 13:43:42 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wj0-x243.google.com (mail-wj0-x243.google.com [IPv6:2a00:1450:400c:c01::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF8D86E6A2; Tue, 10 Jan 2017 13:43:39 +0000 (UTC) Received: by mail-wj0-x243.google.com with SMTP id kp2so87586662wjc.0; Tue, 10 Jan 2017 05:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=gZJUiVIpC+h0zhvccZsTy9fJSqPGgN0QoNrSG78njNs=; b=ANcMHJ3i5iyG5IuYqchJYozfjEO11MYDUEtXrdBbArIccEI3p6caqL/HtXi7jXeTjf hg+wXvlAJG81qIX0IDvHinUerG/MCEY+vq2vLLQyDd0BVBIffFD/B84NUC/XFytAIzuY eteUyADd104rZUn6cOwWY+vqh1NeAkCjZHCRwZs2xvm+hEPFOyN6k7E3ib0lvkHaWV2t R3InHCzISm32XmsNWK2fcNpOyVv8iUrfkiNa7hmA2A+CbIZCOjo2w9UW7Q79pqiCfN0N 06MrygA67+L+sEhrvXuLTZlkM31N5YED3KCWWaVOhIyB/5C6FTDGLbAtxbsOwNDY8rvK llEw== 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=gZJUiVIpC+h0zhvccZsTy9fJSqPGgN0QoNrSG78njNs=; b=QipqOF8fcrt7ZwMwQMyXqxF16H9t9kqwaG8c/1zRlJ9Vd8Fg2b8Yzwo2idfo2mWmNT 6HqBmG8mHSoRg5+0QPQLVaEq0zsZ/Ty5ioHUxzkU7BlDSwsmhPLT+sOVK6t1iZfi+aBG sxgk4y1cu6sP/Ha++nU7aloDNjeLUGUjBOl9juz4pfnkfgvOIKJDcuMYNUHhJEEoYlJ0 E6NuXQMW4F/YwSVlVH+ddb9p0jL5gA+AdrIfWf0qIG3JSuBIvikZvfQ59Ef+5A3if0B8 4T731+81lScwC6KQxeNuZlv7h+OHBiFAOwNuDMJ8mQvkZDCArI487gZwgOY0jipJgCRu p9oA== X-Gm-Message-State: AIkVDXLZV56TwgAHqozDABrEKgMU+qpEeDGuS9YpV2CSPpXlTapihNMWo+ckab4ozaKhTw== X-Received: by 10.194.221.131 with SMTP id qe3mr2158506wjc.133.1484055817827; Tue, 10 Jan 2017 05:43:37 -0800 (PST) Received: from cizrna.lan ([109.72.12.251]) by smtp.gmail.com with ESMTPSA id jn10sm825853wjb.11.2017.01.10.05.43.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jan 2017 05:43:36 -0800 (PST) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Date: Tue, 10 Jan 2017 14:43:05 +0100 Message-Id: <20170110134305.26326-3-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170110134305.26326-1-tomeu.vizoso@collabora.com> References: <20170110134305.26326-1-tomeu.vizoso@collabora.com> Cc: Tomeu Vizoso , David Airlie , intel-gfx@lists.freedesktop.org, Thierry Reding , dri-devel@lists.freedesktop.org, Daniel Vetter Subject: [Intel-gfx] [RESEND PATCH v14 2/2] drm/i915: Put "cooked" vlank counters in frame CRC lines X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 Reviewed-by: Robert Foss --- 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 b9beb5955dae..75fb1f66cc0c 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; - 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); - drm_crtc_add_crc_entry(&crtc->base, true, frame, crcs); + drm_crtc_add_crc_entry(&crtc->base, true, + drm_accurate_vblank_count(&crtc->base), + crcs); } } #else