On Sun, 2 Dec 2001, Billy Biggs wrote:

>   I recently purchased a Matrox G400 (to play with TV-out).
> 
>   I noticed nasty tearing when using my DVD player + XVideo.  This is in
> contrast to the i810 driver which will wait to blit if called during the
> retrace.  My code now spins on the VGA port, which fixed the tearing.

    No, that's not what happens.  The MGA driver doesn't double
buffer video so you get tearing.  The i810 driver does so you
don't.  I doubt spinning on the client side can do anything to
prevent tearing.

> 
>   Since I really badly want to see a well-supported API to query the
> vertical refresh, I'd hope that maybe this is a good chance to again
> request help and support.  (please!)
> 
>   That said, since I'm sure most simple video apps don't care about
> amortizing frame display time over refreshes and just want to avoid
> tearing, maybe doing the i810 trick in the mga driver would be useful.

   I think you misunderstand what the i810 driver is doing.  The
hardware automatically queues requests to display the next frame
and does so automatically at the next retrace.  Nearly all, if not
all, hardware works that way.  The i810 driver only has to spin to slow 
you down if you are sending stuff faster than the retrace, because
it can only queue one frame ahead.

> 
>   Do other drivers spin on a call to XvPut if the refresh is occuring?

    No.  If you send faster than the retrace on NVIDIA hardware
I just let it shear because I don't want the X-server eating CPU.
Below the refresh rate, it won't shear.

> 
> 
>   Also, I wait for the refresh using something like this code:
> 
>   void spin_until_refresh_complete( void ) {
>     for(;;) if( inb( 0x3da ) & 8 ) break;
>   }
> 
>   Does anyone know what VGA cards this could fail on?  So far it's
> worked great for my i815, G400, and TNT2.

   It won't necessarily work on those.  It depends whether or
not I/O access is enabled.  In the case of secondary cards, port
access to legacy VGA registers is typically disabled. 


                                Mark.

_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to