From patchwork Thu Oct 6 08:56:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9364151 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 AAB65608A6 for ; Thu, 6 Oct 2016 08:57:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B31128E4C for ; Thu, 6 Oct 2016 08:57:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A8D228E79; Thu, 6 Oct 2016 08:57:16 +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 5012728E75 for ; Thu, 6 Oct 2016 08:57:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7F046E7CB; Thu, 6 Oct 2016 08:57:06 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0FE5A6E511; Thu, 6 Oct 2016 08:57:04 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id p138so2423156wmb.0; Thu, 06 Oct 2016 01:57:03 -0700 (PDT) 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=2O2IOY5HAIT2Uwf72L1S6BLUBKvmiTPaZ16OVFXbbCY=; b=bJZxIPKI0Vm8GAf68ehbicz6ggdUNjTCXEt1T5sUYfcnOwC5GMJfbNjaWQHhIowz/D abkVxyi/US/zlyX5xoQYAXnf+jhma0HaL4ngEOL/J2dPkgskYR7CLe8+TlNzd5io6yeo 4ASFAunkWJzw48Pm75+elnV2jmWLNZUJjErG2XWvA8OhAM7GVCRm+U1/GSIM7yIp8wN2 6i2sbKC4PlXFhute0efx1/0g2Ljxk9TjwSYL6bsRYqunQ7W9Cld2MLxN8jcUmWV7iA4y 5bjnTQ3UKI6LTwd4C7lec/MlE7hzVh/hfURv3hm4jgQoa9qr4C+INgF85OGFDGbyxOBE l6dg== 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=2O2IOY5HAIT2Uwf72L1S6BLUBKvmiTPaZ16OVFXbbCY=; b=aQtfXoR+FcahKOF8ugybdK3Xl2j4qDpjqqopGmP5CNfiu8yNSH1ObA0xaUFrfj1AIo ZSfITbcdpaymWsxNNu9xMT01FsRhQW1MZdsyw+BF/ZH9RN4kTeZEooV3bE/uD3GQ377z SOw1p3GoImuEgVPSn20MJnpzjswAq/svziyGRRGfbG6Zg2hqgH+qmw10NYHI11SrKdVB IvC5RzHPxLHFle4JsEr7ss79yeKUA45Ctgc2HlUcciCH2RtwrGh+NP1BAhO0AfkWrAUB e+K6ZtJeZmteuOlwISx5De4W3+Lnxqlqxl9/NsJb9mU4JMsuJEE3RQBCPmYGga5I6F/a 7uhA== X-Gm-Message-State: AA6/9RmddqnHryoFL/5iB3KwJX0qVSIENc7KHccGa65bHtV9Ybgq6i6Gf03j/WilzvsePA== X-Received: by 10.28.151.141 with SMTP id z135mr7614031wmd.81.1475744222475; Thu, 06 Oct 2016 01:57:02 -0700 (PDT) Received: from cizrna.lan ([109.72.12.69]) by smtp.gmail.com with ESMTPSA id o196sm33111039wmg.8.2016.10.06.01.57.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Oct 2016 01:57:01 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org 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> Cc: Tomeu Vizoso , David Airlie , intel-gfx@lists.freedesktop.org, Thierry Reding , dri-devel@lists.freedesktop.org, Daniel Vetter Subject: [Intel-gfx] [PATCH v9 4/4] 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 --- 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);