On Thu, Oct 27, 2005 at 07:30:09PM +0200, Denis Oliver Kropp wrote:
> Quoting Ville Syrjälä:
> > Attached are some patches that improve field parity and triple buffering 
> > in the matrox driver.
> 
> Impressive :)

Thanks :)

> 
> > I've moved the buffer flipping completely to the kernel which should make 
> > it less probable that the hardware flips the buffers when we're not 
> > looking.

I was a bit optimistic here. df_andi revealed some nasty tearing. But I 
fixed it! Just apply the following the patch and you should be enjoying 
absolutely tear-free df_andi @423fps on your TV! I know I am ;)

Index: matrox_crtc2.c
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/matrox/matrox_crtc2.c,v
retrieving revision 1.31
diff -u -r1.31 matrox_crtc2.c
--- matrox_crtc2.c      26 Oct 2005 07:26:16 -0000      1.31
+++ matrox_crtc2.c      28 Oct 2005 05:57:46 -0000
@@ -494,7 +534,7 @@

           mcrtc2->regs.c2MISC = 0;
           /* c2vlinecomp */
-          mcrtc2->regs.c2MISC |= (vdisplay + 1) << 16;
+          mcrtc2->regs.c2MISC |= vdisplay << 16;
      }

      /* c2bpp15halpha */


Now I just wish the embedded-2 mga drm would compile with recent kernels 
so I could really stress test this thing with df_gears @>1000fps...

> I'm sure there will be comparable ioctls in other drivers soon,
> or even a new standardized flip/wait ioctl that we've talked about.
> 
> This is a BIG step towards it :)

Right. It would be nice to hook in the vsync part next and make double 
buffering more useful with a new IDirectFBSurface::WaitForFlip() method.

> > +          FBDev                 *dfb_fbdev = dfb_system_data();
> > +          struct matrox_address  address;
> > +
> > +          bes_calc_regs( mdrv, mbes, &mbes->config, surface );
> > +
> > +          address.device    = MATROX_ADDRESS_DEVICE_BES;
> > +          address.field     = -1;
> > +          address.count     = mbes->last_count + 1;
> > +          address.offset[0] = mbes->regs.besA1ORG;
> > +          address.offset[1] = mbes->regs.besA2ORG;
> > +          address.offset[2] = mbes->regs.besA1CORG;
> > +          address.offset[3] = mbes->regs.besA2CORG;
> > +          address.offset[4] = mbes->regs.besA1C3ORG;
> > +          address.offset[5] = mbes->regs.besA2C3ORG;
> > +
> > +          if (ioctl( dfb_fbdev->fd, MATROXFB_ADDRESS, &address ))
> > +               D_ERROR( "DirectFB/Matrox/BES Address ioctl() failed!\n" );
> > +
> > +          dfb_surface_flip_buffers( surface, address.count == 
> > mbes->last_count );
> > +
> > +          mbes->last_count = address.count;
> 
> YES, you're using the second argument to dfb_surface_flip_buffers()!
> 
> I've never seen it in action after adding it :)

I played with it at one point but then I was doing the flipping in 
user-space and then going to the kernel to ask for the vsync count. 
Obviosly the user->kernel->user transition took too long and I could not 
get reliable results.

> Time to hook the primary layer and implement Flip() with that feature on 
> CRTC1 ;)

I hate VGA register. That's my excuse for not doing it :)

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

_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to