From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752418AbdGFLEU (ORCPT ); Thu, 6 Jul 2017 07:04:20 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:34955 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751865AbdGFLET (ORCPT ); Thu, 6 Jul 2017 07:04:19 -0400 MIME-Version: 1.0 X-Originating-IP: [2a02:168:5640:0:960b:2678:e223:c1c6] In-Reply-To: <20170706101604.GY12629@intel.com> References: <20170705221013.27940-1-keithp@keithp.com> <20170705221013.27940-4-keithp@keithp.com> <20170706075313.bn2exiklfabgc25t@phenom.ffwll.local> <20170706101604.GY12629@intel.com> From: Daniel Vetter Date: Thu, 6 Jul 2017 13:04:18 +0200 X-Google-Sender-Auth: I2Gv9g2Pgbv01-ZIEu-CRXbK7No Message-ID: Subject: Re: [PATCH 3/3] drm: Add CRTC_GET_SEQUENCE and CRTC_QUEUE_SEQUENCE ioctls To: =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= Cc: Keith Packard , Linux Kernel Mailing List , Dave Airlie , dri-devel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v66B4UQw028071 On Thu, Jul 6, 2017 at 12:16 PM, Ville Syrjälä wrote: >> > + if (!dev->irq_enabled) >> > + return -EINVAL; >> > + >> > + crtc = drm_crtc_find(dev, get_seq->crtc_id); >> > + if (!crtc) >> > + return -ENOENT; >> > + >> > + pipe = drm_crtc_index(crtc); >> > + >> > + get_seq->sequence = drm_vblank_count_and_time(dev, pipe, &now); >> >> This can give you and old vblank if the vblank is off (i.e. sw state >> hasn't be regularly updated). I think we want a new >> drm_crtc_accurate_vblank_count_and_time variant. > > Or better yet just do what Chris did for the old ioctl in commit > b33b02707ba3 ("drm: Peek at the current counter/timestamp for vblank queries") Yeah the READ_ONCE(vblank->enabled) is a nice fastpath. But we still need the accurate one as slowpath in case the vblank irq is off. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch