On Thu, 2009-02-12 at 09:15 -0800, Jesse Barnes wrote:
> On Thursday, February 12, 2009 2:11 am Michel Dänzer wrote:
> > On Wed, 2009-02-11 at 14:29 -0800, Jesse Barnes wrote:
> 
> > > The current wait_vblank condition won't return if the wait sequence is
> > > more than 8M behind the current counter.  This causes problems in the
> > > wraparound case, which can happen if vblank interrupts have been
> > > disabled by the timer (after 5s of no waiters), but then re-enabled
> > > after a DPMS event.
> >
> > Sounds like maybe the display driver isn't calling the modeset ioctl
> > properly around DPMS events?
> 
> It does, but take a look at that code again.  If interrupts are disabled by 
> the timer, we'll capture the frame count.  If, sometime later, they're 
> re-enabled, we'll end up in drm_update_vblank_count.  And if, between those 
> two points, we've had a DPMS event, the frame counter will have been reset 
> and will now be a lower value, so our drm_update_vblank_count will detect a 
> wraparound.  I think any hardware that resets its frame count will be 
> susceptible to this problem unless we make wraparounds harmless.

The modeset ioctl makes wraparounds harmless if used correctly.

> > > (An alternative fix might be to not account for lost frames between
> > > off->on periods at all, removing the drm_update_vblank_count code
> > > entirely.)
> >
> > You can do with your driver whatever you please, but please leave the
> > drm_update_vblank_count code for drivers that don't have these problems.
> 
> Note I'm not suggesting dropping frames due to mode set activity, just frames 
> that happen while no client is listening (subject to the 5s timeout window of 
> course).

I understand that.

> Can you think of a case where those frames would matter?

E.g. the GLX_OML_sync_control spec says 'The graphics Media Stream
Counter (or graphics MSC) is a counter that is unique to the graphics
subsystem and increments for each vertical retrace that occurs.'
Vertical retraces that occur while nobody's listening may not matter in
simple cases, but that doesn't mean they're never relevant.

In general, I'm a little worried about the trend to just remove stuff
with problems (software engineering is hard, let's go shopping?), in
particular in a case like this where it's working fine for other
drivers.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to