On Fri, Nov 29, 2002 at 08:35:03AM -0500, 
[EMAIL PROTECTED] wrote:
> On Fri, Nov 29, 2002 at 06:34:06AM +0200, Ville Syrj�l� wrote:
> > Have you tried doing
> > 
> > if (vo_vsync) {
> >      int field;
> >      crtc2->GetCurrentOutputField( crtc2, &field );
> >      if (field)
> >           crtc2->WaitForSync( crtc2 );
> > }
> > 
> > just before Flip()?
> 
> In flip_page() or in before every call to Flip()?

flip_page()

> > It seems to fix things for me but I'd like to be sure
> > that it is the correct fix.
> 
> So we always wait for field 1 before Flip()ing?  Why?

To guarantee that we display both fields and always in the same order.
Otherwise we might display only one field for some frames and in a random
order. I'm not sure why this is a problem though. One would think that
with progressive data it shouldn't really matter how the fields are
displayed. And it really doesn't explain the tearing we sometimes see.
But it seems to work for me... or it just hides the error :(

> Does this not
> suggest an error somewhere in the logic DirectFB Flip()ping logic?
> Should it not be sufficient to just write a frame to the framebuffer
> and ask DirectFB to Flip() the buffers, and know that it will do it
> synced with the vsync?

That's what I thought. The CRTC2 address registers are double buffered and
flipped at vblank automatically by the hardware. So it should be
sufficient to write the registers and then wait for the interrupt which
should arrive two lines after vblank start. By the time the interrupt
arrives the hardware should have flipped the registers and we can continue
drawing to the back buffer. Something apparently fails on some occasions
and we see some nasty crap on the TV.

> > Obviously there's still a slim chance that the
> > field will change between the two function calls but I don't think there's
> > anything we can do about that.
> 
> Indeed.  But why do we need this in the first place?

Don't know really :( Anyone else have good ideas as to what the problem
actually is?

-- 
Ville Syrj�l�
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/


-- 
Info:  To unsubscribe send a mail to [EMAIL PROTECTED] with 
"unsubscribe directfb-dev" as subject.

Reply via email to