From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754999AbdJKJ0l (ORCPT ); Wed, 11 Oct 2017 05:26:41 -0400 Received: from mail.netline.ch ([148.251.143.178]:54971 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbdJKJ0j (ORCPT ); Wed, 11 Oct 2017 05:26:39 -0400 X-Greylist: delayed 514 seconds by postgrey-1.27 at vger.kernel.org; Wed, 11 Oct 2017 05:26:39 EDT Subject: Re: [PATCH 3/3] drm: Add CRTC_GET_SEQUENCE and CRTC_QUEUE_SEQUENCE ioctls [v3] To: Keith Packard , Dave Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org References: <20171011004514.9500-1-keithp@keithp.com> <20171011004514.9500-4-keithp@keithp.com> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Message-ID: <447cce45-90bc-bc2c-c7cc-79270a940ae5@daenzer.net> Date: Wed, 11 Oct 2017 11:18:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171011004514.9500-4-keithp@keithp.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/10/17 02:45 AM, Keith Packard wrote: > These provide crtc-id based functions instead of pipe-number, while > also offering higher resolution time (ns) and wider frame count (64) > as required by the Vulkan API. > > v2: > > * Check for DRIVER_MODESET in new crtc-based vblank ioctls > > Failing to check this will oops the driver. > > * Ensure vblank interupt is running in crtc_get_sequence ioctl > > The sequence and timing values are not correct while the > interrupt is off, so make sure it's running before asking for > them. > > * Short-circuit get_sequence if the counter is enabled and accurate > > Steal the idea from the code in wait_vblank to avoid the > expense of drm_vblank_get/put > > * Return active state of crtc in crtc_get_sequence ioctl > > Might be useful for applications that aren't in charge of > modesetting? > > * Use drm_crtc_vblank_get/put in new crtc-based vblank sequence ioctls > > Daniel Vetter prefers these over the old drm_vblank_put/get > APIs. > > * Return s64 ns instead of u64 in new sequence event > > Suggested-by: Daniel Vetter > Suggested-by: Ville Syrjälä > > v3: > > * Removed FIRST_PIXEL_OUT_FLAG > * Document that the timestamp in the query and event are > that of the first pixel leaving the display engine for > the display (using the same wording as the Vulkan spec). > > Suggested-by: Michel Dänzer > Acked-by: Dave Airlie > > Signed-off-by: Keith Packard Just a nitpick: > +/* Queue event to be delivered at specified sequence. Time stamp marks > + * when the first pixel of the refresh cycle left the display engine > + * for the display > + */ [...] > @@ -903,6 +929,16 @@ struct drm_event_vblank { > __u32 crtc_id; /* 0 on older kernels that do not support this */ > }; > > +/* Event delivered at sequence. Time stamp marks when the first pixel > + * of the refresh cycle left the display engine for the display > + */ Might be better to use "leaves" instead of "left", since the event is usually delivered and processed before the first pixel leaves the display engine. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer