On Wednesday, January 23, 2008 8:28 am Jesse Barnes wrote: > On Wednesday, January 23, 2008 4:29 am Michel Dänzer wrote: > > On Tue, 2008-01-22 at 15:17 -0800, Jesse Barnes wrote: > > > @@ -378,6 +380,15 @@ u32 i915_get_vblank_counter(struct drm_device > > > *dev, int plane) > > > > > > count = (high1 << 8) | low; > > > > > > + /* > > > + * If we're in the middle of the vblank period, the > > > + * above regs won't have been updated yet, so return > > > + * an incremented count to stay accurate > > > + */ > > > + if ((I915_READ(pipedsl) >= (I915_READ(vblank) & VBLANK_START_MASK)) > > > || + (I915_READ(pipedsl) < (I915_READ(htotal) & HACTIVE_MASK))) > > > + count++; > > > > Shouldn't this check vtotal instead of htotal? > > Of course you're right... funny that it worked so well with this code.
One caveat with the currently merged bits on i915: since I disabled the i915_in_vblank checking, the counter will currently guarantee that you hit every active frame rather than every vblank period, so you'll probably see tearing until I fix that. However, it shouldn't hang and it should properly disable interrupts when not in use, so if you see those or any other problems please send me a mail or file a bug. Thanks, Jesse ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel