From patchwork Fri Aug 5 10:45:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9265197 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 BA8EC6089F for ; Fri, 5 Aug 2016 10:45:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC7592843A for ; Fri, 5 Aug 2016 10:45:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A121B2843B; Fri, 5 Aug 2016 10:45:43 +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 683BF28440 for ; Fri, 5 Aug 2016 10:45:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 378FC6EB67; Fri, 5 Aug 2016 10:45:42 +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 903CF6EB63; Fri, 5 Aug 2016 10:45:40 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id i5so3216876wmg.2; Fri, 05 Aug 2016 03:45:40 -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=bQWkkwK95aC+JeATkPfOp3GiS6w6xRTCQRZ4CJdYNV4=; b=h+iutZmmE7w6ntCR3l6VNLS+4mtASB7w7cYLaa5uBi5DNLMOo8wqcuvY5CIDUzxjSY BR4J5VsdF1KSIqK4OuvBtCMKNLdOrZpzmV2FVuXoGp9Ls3cAOdF+K7pYqFZolxX/qopO hpw+0RZxNO9mZxrzxxoXr0A5UPjH8l6Ir6X/ep43vAL8UzOEpXdaULYIFgOnLEgedrF4 pAvWXd/T0N+cK4GbLk8QxpF2XZYNOtC6q7IIsyn4FAszrl0CtKwtFeSJYbVgX8dJJwE/ uGJVGwObxYMgyYy3aq7PTA2r6fZJuCwl1cIWKdWVOegjiFHTAP2hphN9eq+ow/ZseLq/ sW8g== 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=bQWkkwK95aC+JeATkPfOp3GiS6w6xRTCQRZ4CJdYNV4=; b=Tw9izPV6cA7Jdzvo6sXy70LaBy0/uJ/UmZDI0jfTp/iKQJ2mZLTutols3D4hsYsOJi QzUwDfIc7nFkWrD2vhK5PRq0XYRvIdY+eitFBnMclwFY3FycExr91sOWERRzWXBhgdaC RxWouL/yJt+gqSFyv9IXgTfK55/Au8503u2w/i+4KjuNPEXtjf3ZnxOj/JTNlE+vv+XN tUDMIxZJsek1E3BwwE5ShSSMcY/Vos7RdWMST5x5+jIN2JZ4CtxJw1kulOenM3dsOT2t x7DHe6bqBb5V48aDA3ZjfAPWS+NzBwFc+ObjXJHpW86TWPNWIRFDgkqbfP3UpGsjuwfN vAiQ== X-Gm-Message-State: AEkooutSPcxw21ZFaGkmHMwAMAXp67oTgrNuVxOTkWfYlIR8kTU9ksFhZ+RD6GBLJYFdTg== X-Received: by 10.194.82.164 with SMTP id j4mr21256257wjy.157.1470393939235; Fri, 05 Aug 2016 03:45:39 -0700 (PDT) Received: from cizrna.lan ([109.72.12.111]) by smtp.gmail.com with ESMTPSA id xa2sm17252629wjc.0.2016.08.05.03.45.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Aug 2016 03:45:38 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Date: Fri, 5 Aug 2016 12:45:05 +0200 Message-Id: <1470393905-6640-5-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470393905-6640-1-git-send-email-tomeu.vizoso@collabora.com> References: <1470393905-6640-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 , Emil Velikov Subject: [Intel-gfx] [PATCH v4 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 --- 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 e5fb9fa86358..0a834303004e 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1496,7 +1496,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) { @@ -1538,8 +1537,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);