From patchwork Fri Sep 9 09:56:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9322781 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 3C9B660752 for ; Fri, 9 Sep 2016 09:57:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EFF229D5B for ; Fri, 9 Sep 2016 09:57:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 236B229D5D; Fri, 9 Sep 2016 09:57:23 +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 E718E29D5B for ; Fri, 9 Sep 2016 09:57:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C8946E76B; Fri, 9 Sep 2016 09:57:19 +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 57DCE6E767; Fri, 9 Sep 2016 09:57:16 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id l65so1953510wmf.3; Fri, 09 Sep 2016 02:57:16 -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=JG9gZLfaj2uwYYXN1WNzINrpEiFy3Pivjf4wCacMYj0=; b=0QUrWqlhoCR7fSbebmS6LVK4ju/JqOIHx3bBSJ0XpYZnpIzfPe41pMLiGCG9mJbgwb oMvjJBG5f9ax+cjFo2qIexb74APAYSbbmZyhcxy3YEXUebo2oeENDpOJoHHN2nQDbnqI u9h33gFdo11spxlM5wwkbP0j6fFENmH1eoIykmx5yHoBC191r8jmkLEDrZYJEEqPhJB1 RzIoVO8m/5ORV1umW6NHn7Jb86Bp1UbU4V4w2UV3SZdDX1H3KwaK6Au6Z4h8gT37XAIj pco2gOxfXPBGYSaVq4lThLkrhPdAh/uxlA1dGGGQ7i9T05xFe67DOkqP/RYrMLSBpia3 qOZQ== 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=JG9gZLfaj2uwYYXN1WNzINrpEiFy3Pivjf4wCacMYj0=; b=EkUaFe+gRRtG6+O8g5xeYbh+Rgo5tfLydtBAk++/W/f7+ROKPzJ/T8kYBVbKsOC2oL dKlSyDk4u3FgzZaZ0Bnj26wW9Yn5JMqknA8RPUQqh4rJqdA0psEIEYGMAyFI9AHvu72I rIGKI9FMQZlbq1HUVviTZgXkH3oqaM34xRsEqjh5x2kEA6vAotK9SLrycTYObbBLJhCn b2rE/nHVGuF5B/Ye6iY/fr5Iae1DCQfnBxlmH3IKvwWEUnK9cQRXjO14JfWJDUDPAaR2 hvIr2VB/aoBoRrYnwgYdbdhSf7nhfOulj81aBcAmU6yGCpNv2gAbgS2O5eDqmBE3405T DLgw== X-Gm-Message-State: AE9vXwNxM18lnzuuz3zrQaOfQHdiMrbm7AGfZj/OQdUkTM7mFW+/mbG9gQjrCM4s3VRY3w== X-Received: by 10.194.58.178 with SMTP id s18mr2626692wjq.0.1473415035018; Fri, 09 Sep 2016 02:57:15 -0700 (PDT) Received: from cizrna.lan ([109.72.12.101]) by smtp.gmail.com with ESMTPSA id bw9sm2541130wjc.33.2016.09.09.02.57.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Sep 2016 02:57:14 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Subject: [PATCH v8 4/4] drm/i915: Put "cooked" vlank counters in frame CRC lines Date: Fri, 9 Sep 2016 11:56:50 +0200 Message-Id: <1473415010-1389-5-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473415010-1389-1-git-send-email-tomeu.vizoso@collabora.com> References: <1473415010-1389-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 e56c7f627093..6d3d4ad62498 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1489,7 +1489,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) { @@ -1545,8 +1544,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);