From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933685AbdAJQb5 (ORCPT ); Tue, 10 Jan 2017 11:31:57 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35134 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933208AbdAJQbx (ORCPT ); Tue, 10 Jan 2017 11:31:53 -0500 Date: Tue, 10 Jan 2017 17:31:49 +0100 From: Daniel Vetter To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: Tomeu Vizoso , David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thierry Reding , dri-devel@lists.freedesktop.org, Daniel Vetter Subject: Re: [Intel-gfx] [RESEND PATCH v14 2/2] drm/i915: Put "cooked" vlank counters in frame CRC lines Message-ID: <20170110163149.xb7ysmfs5knvzxeu@phenom.ffwll.local> Mail-Followup-To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Tomeu Vizoso , David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thierry Reding , dri-devel@lists.freedesktop.org, Daniel Vetter References: <20170110134305.26326-1-tomeu.vizoso@collabora.com> <20170110134305.26326-3-tomeu.vizoso@collabora.com> <20170110155457.GE31595@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170110155457.GE31595@intel.com> X-Operating-System: Linux phenom 4.8.0-1-amd64 User-Agent: NeoMutt/20161126 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 10, 2017 at 05:54:57PM +0200, Ville Syrjälä wrote: > On Tue, Jan 10, 2017 at 02:43:05PM +0100, Tomeu Vizoso wrote: > > 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 > > Reviewed-by: Robert Foss > > --- > > > > 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 b9beb5955dae..75fb1f66cc0c 100644 > > --- a/drivers/gpu/drm/i915/i915_irq.c > > +++ b/drivers/gpu/drm/i915/i915_irq.c > > @@ -1557,7 +1557,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; > > - u32 frame; > > > > spin_lock(&pipe_crc->lock); > > if (pipe_crc->source) { > > @@ -1612,8 +1611,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); > > - drm_crtc_add_crc_entry(&crtc->base, true, frame, crcs); > > + drm_crtc_add_crc_entry(&crtc->base, true, > > + drm_accurate_vblank_count(&crtc->base), > > My assumption would be that this gets called after the vblank irq > handler, so using the _accurate version seems a bit overkill. Since we're at like v15 of this I figured I'll pull this in, and we can polish this a bit more later. Tomeu, can you pls do that follow-up patch and get Ville to review+merge it. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch