Here's a patch to support the second head of Matrox cards. There is one
outstanding problem: the BES. Maybe dfb_gfxcard_get_accelerator() should
return some private value for CRTC2 and the BES layer could be disabled?
Dualhead operation isn't exactly possible. With the single application
core it draws to both heads but takes turns in doing so, and with the
multi application core it waits for one application to finish before the
other one starts. Actullay when I tested with the multi application core I
had my AGP patch applied as well so it might do something different
without it.

-- 
Ville Syrj�l�
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/
Index: DirectFB/gfxdrivers/matrox/matrox_state.c
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/matrox/matrox_state.c,v
retrieving revision 1.32
diff -u -d -r1.32 matrox_state.c
--- DirectFB/gfxdrivers/matrox/matrox_state.c   30 Jun 2002 22:06:19 -0000      1.32
+++ DirectFB/gfxdrivers/matrox/matrox_state.c   15 Jul 2002 15:18:22 -0000
@@ -60,7 +60,8 @@
      if (mdev->old_matrox)
           mga_out32( mmio, mdev->dst_pixeloffset, YDSTORG );
      else
-          mga_out32( mmio, buffer->video.offset, DSTORG );
+          mga_out32( mmio, dfb_gfxcard_memory_physical( buffer->video.offset) &
+                     0x1FFFFFF, DSTORG );
 
      mga_out32( mmio, mdev->dst_pixelpitch, PITCH );
 
@@ -380,7 +381,8 @@
                       ((8-mdev->matrox_w2)&63)<<9 | mdev->matrox_w2, TEXWIDTH );
      mga_out32( mmio, ((surface->height-1)<<18) |
                       ((8-mdev->matrox_h2)&63)<<9 | mdev->matrox_h2, TEXHEIGHT );
-     mga_out32( mmio, buffer->video.offset, TEXORG );
+     mga_out32( mmio, dfb_gfxcard_memory_physical( buffer->video.offset ) &
+                0x1FFFFFF, TEXORG );
 
      MGA_VALIDATE( m_Source );
 }
@@ -403,7 +405,8 @@
           mdev->src_pixeloffset = buffer->video.offset / bytes_per_pixel;
      else {
           mga_waitfifo( mdrv, mdev, 1);
-          mga_out32( mmio, buffer->video.offset, SRCORG );
+          mga_out32( mmio, dfb_gfxcard_memory_physical( buffer->video.offset) &
+                     0x1FFFFFF, SRCORG );
      }
 
      MGA_VALIDATE( m_source );
Index: DirectFB/src/core/gfxcard.c
===================================================================
RCS file: /cvs/directfb/DirectFB/src/core/gfxcard.c,v
retrieving revision 1.70
diff -u -d -r1.70 gfxcard.c
--- DirectFB/src/core/gfxcard.c 19 Jun 2002 20:26:44 -0000      1.70
+++ DirectFB/src/core/gfxcard.c 15 Jul 2002 15:18:24 -0000
@@ -1153,6 +1153,10 @@
 
 int dfb_gfxcard_get_accelerator( GraphicsDevice *device )
 {
+#ifdef FB_ACCEL_MATROX_MGAG400
+     if (!strcmp( device->shared->fix.id, "MATROX DH" ))
+          return FB_ACCEL_MATROX_MGAG400;
+#endif
      return device->shared->fix.accel;
 }
 

Reply via email to