From patchwork Thu Oct 6 15:04:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9364917 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 302A6607D3 for ; Thu, 6 Oct 2016 15:05:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 229AF2906D for ; Thu, 6 Oct 2016 15:05:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1761029077; Thu, 6 Oct 2016 15:05:20 +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 3EB452906D for ; Thu, 6 Oct 2016 15:05:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5B68A6E9DE; Thu, 6 Oct 2016 15:05:10 +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 096396E9E3; Thu, 6 Oct 2016 15:05:09 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id i130so642162wmg.0; Thu, 06 Oct 2016 08:05:08 -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=n662D8bJb+Nsh1PwinhQq8u2fluGNXdnTQUqxXArgpnpzS3nEH8aSipFGQHzPpYRTU 7VnxQsmpD1u4RGqrmFPqegiiBNToNIWl5fDJAQrc5us3MINqw1JtrL54ctHjL4DxTHBG 1L7QkcC4MaIKIpSkb1k0WyQsY19TCz5kOnSzzjgTwMEMA7JVvGJvvKVEDvHT7wPir3d+ 5n58F4re68SLCcRA4OVrNFLNwSI/Vi/Bfoz30W/WOb/kQI1Jd6S7Bhoi75Z9dDVEo5b0 P55m4mz2vHQuQP9r7Zz4Hma6ggFdvr/0fb/lJaZ8D/KA+089E+ce44G9NyEYV6dp9kpF xWDg== 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=JmIw0jtpIvkdNOYth6huuEYlFAkfDdt4qRMu/eXCGobJXxJcQxpqikkIVWtJlpKt4E dCs11JMaJO37Oxs9C0gwXhw5AGb0+njnEX3tVH5lyq9cP3ydPMGnoj6SRHYb/ma8dhbS DPQUyKK/rdJrWkqQD8vQfxADCNVFgtIOU8f8bC6VRun2zHB4yYYSzsO9ux4BnS7sN/Hw LecI7ryalUlntJuW8U/BvxR0r9Mz/7WIwocdcKlkHJ+v2mrnTYGcy+idRP13VO9q5ft+ oBIrynlJPuf66V0iSrb3h/NucZ4IwQOxyQc+cM8uYhEmesmqPEmCGYL6oJKjzSh5eBHh YsuQ== X-Gm-Message-State: AA6/9RljZVPXpTwWfJzUgaE2SafwXM6gCdqfD3VX9OiGKzzVRM31L7nXYJMi4ou5fluSKw== X-Received: by 10.194.115.135 with SMTP id jo7mr12703418wjb.225.1475766307432; Thu, 06 Oct 2016 08:05:07 -0700 (PDT) Received: from cizrna.lan ([109.72.12.69]) by smtp.gmail.com with ESMTPSA id y2sm4437474wjx.20.2016.10.06.08.05.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Oct 2016 08:05:06 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Subject: [PATCH v10 4/4] drm/i915: Put "cooked" vlank counters in frame CRC lines Date: Thu, 6 Oct 2016 17:04:33 +0200 Message-Id: <1475766273-1105-5-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475766273-1105-1-git-send-email-tomeu.vizoso@collabora.com> References: <1475766273-1105-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 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);