From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [RFC 4/4] drm: add support for raw monotonic vblank timestamps Date: Sun, 7 Oct 2012 22:33:46 +0200 Message-ID: <20121007203346.GB7352@phenom.ffwll.local> References: <1349444222-22274-1-git-send-email-imre.deak@intel.com> <1349444222-22274-5-git-send-email-imre.deak@intel.com> <1349480477.21982.12.camel@ideak-mobl> <1349484556.23130.15.camel@ideak-mobl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1349484556.23130.15.camel@ideak-mobl> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Imre Deak Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rob Clark List-Id: intel-gfx@lists.freedesktop.org On Sat, Oct 06, 2012 at 03:49:16AM +0300, Imre Deak wrote: > On Fri, 2012-10-05 at 18:09 -0600, Rob Clark wrote: > > > > /* Called before vblank count and timestamps have > > * been updated for the vblank interval of flip > > * completion? Need to increment vblank count and > > * add one videorefresh duration to returned timestamp > > * to account for this. We assume this happened if we > > * get called over 0.9 frame durations after the last > > * timestamped vblank. > > * > > * This calculation can not be used with vrefresh rates > > * below 5Hz (10Hz to be on the safe side) without > > * promoting to 64 integers. > > */ > > if (10 * (timeval_to_ns(&tnow) - timeval_to_ns(&tvbl)) > > > 9 * crtc->framedur_ns) { > > event->event.sequence++; > > tvbl = ns_to_timeval(timeval_to_ns(&tvbl) + > > crtc->framedur_ns); > > } > > This has been recently removed by danvet's "drm/i915: don't frob the > vblank ts in finish_page_flip", though not yet committed, so we can do > away with it here too. Yeah, I'd prefer if the common code doesn't have such hackes - this bit here papered over some bugs in our driver code, but only partially successfully ... -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch