Minimum timeslice fun (was semaphores and mutexes)

Not really. It’s been talked about on the X development list a bit, but
the problem is synchronizing graphics access for individual windows doesn’t
work very well with hard timing limitations of the vertical retrace. X runs
into all the same problems that people have noticed here with refresh rate
independence.

However, who knows what will happen in the future with extensions? :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment> On Thu, May 30, 2002 at 08:10:21PM +0200, David Olofson wrote:

(And of course, a proper video driver will “fix” the problem by blocking
on the retrace or “page available” event whenever you call
SDL_FlipSurface(). That is, depending on what platform you’re using, you
may never actually see this problem.)

Is this theoretically possible in windowed mode in X? My guess is “no”…

(And of course, a proper video driver will “fix” the problem by
blocking on the retrace or “page available” event whenever you call
SDL_FlipSurface(). That is, depending on what platform you’re
using, you may never actually see this problem.)

Is this theoretically possible in windowed mode in X? My guess is
"no"…

Not really. It’s been talked about on the X development list a bit,
but the problem is synchronizing graphics access for individual windows
doesn’t work very well with hard timing limitations of the vertical
retrace. X runs into all the same problems that people have noticed
here with refresh rate independence.

Actually, I think it’s worse than that: This adds a hard real time
scheduling requirement for individual blits, and also requires that
"huge" blits can be subdivided or interrupted in order to satisfy this
requirement. (Not much point in trying to sync with the retrace if the
blit is performed one and a half refresh too late anyway. :slight_smile:

However, who knows what will happen in the future with extensions? :slight_smile:

I don’t know what the XFree86 people have in mind for windows, but I
definitely think it’s possible to do in fullscreen modes. Should work
with any card that latches video data pointers/offsets during the
retrace, and provides any way whatsoever of answering one of these
questions:
* When is the next vertical retrace?
* Which page is being displayed?
* Is a vertical retrace in progress right now?
* Has there been a vertical retrace since last check?

That, and the ability to schedule a thread for wakeup within a specific
video frame (the RTC can handle that), should be enough for a clean and
efficient implementation.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Thursday 30 May 2002 20:21, Sam Lantinga wrote:

On Thu, May 30, 2002 at 08:10:21PM +0200, David Olofson wrote: