Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752295AbdGFOIL (ORCPT ); Thu, 6 Jul 2017 10:08:11 -0400 Received: from mga05.intel.com ([192.55.52.43]:17151 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751943AbdGFOIK (ORCPT ); Thu, 6 Jul 2017 10:08:10 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,317,1496127600"; d="scan'208";a="1191484123" Date: Thu, 6 Jul 2017 17:08:05 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Daniel Vetter Cc: Keith Packard , Linux Kernel Mailing List , Dave Airlie , dri-devel Subject: Re: [PATCH 3/3] drm: Add CRTC_GET_SEQUENCE and CRTC_QUEUE_SEQUENCE ioctls Message-ID: <20170706140805.GZ12629@intel.com> References: <20170705221013.27940-1-keithp@keithp.com> <20170705221013.27940-4-keithp@keithp.com> <20170706075313.bn2exiklfabgc25t@phenom.ffwll.local> <20170706101604.GY12629@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1089 Lines: 30 On Thu, Jul 06, 2017 at 01:04:18PM +0200, Daniel Vetter wrote: > 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. Maybe, or maybe we want to turn the interrupt on in that case? That's what the old ioctl does. -- Ville Syrj?l? Intel OTC