On Wed, 29 Oct 2003 17:07:50 +0100
Michel Dänzer <[EMAIL PROTECTED]> wrote:

> On Wed, 2003-10-29 at 01:04, Felix Kühling wrote: 
> > 
> > First a short summary of the problem. Currently the user space driver
> > waits for a vblank and then issues a buffer swap ioctl. That ioctl puts
> > the actual swap instructions on the command queue of the 3D hardware.
> > After that it may take an arbitrary time before the swap is actually
> > executed depending on how many rendering instructions were pending in
> > the queue when the swap was issued. Therefore you can observe tearing
> > even with vsyncing enabled.
> 
> Have you verified that this is actually what's going on, not e.g. that
> the flip is too late due to scheduling latency? In that case, doing
> everything in a single ioctl should help?

I have verified that doing a glFinish before waitForVBlank gets rid of
the tearing. Note that this is only really necessary if the user
requests unconditional sychronization with vblanks. With normal swap
intervals you don't have to do this. If you swap too early then
rendering just took to long and you wouldn't have wanted to wait for
another vblank anyway.

> 
> 
> > The 3D engine finishes rendering a frame. Then it generates an
> > interrupt. At this point the engine has to suspend _somehow_ until the
> > buffer swap has completed. The kernel waits for the software interrupt.
> > If the deadline for the frame has passed it executes a buffer swap
> > immediately. Otherwise it also waits for a specified vblank interrupt
> > and then executes the buffer swap. When the swap is completed it
> > _somehow_ makes the 3D engine resume executing rendering commands for
> > the next frame.
> 
> Why suspend the engine at all? Isn't it enough to know when it's
> finished rendering?

You don't want to overwrite the buffer that is still being displayed as
front buffer while the swap is delayed until the next vblank.

> 
> 
> -- 
> Earthling Michel Dänzer   \  Debian (powerpc), XFree86 and DRI developer
> Software libre enthusiast  \     http://svcs.affero.net/rm.php?r=daenzer

------------    __\|/__    ___     ___       -------------------------
 Felix       ___\_e -_/___/ __\___/ __\_____   You can do anything,
   Kühling  (_____\Ä/____/ /_____/ /________)  just not everything
 [EMAIL PROTECTED]       \___/   \___/   U        at the same time.


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to