xserver/hw/kdrive/smi smi.c, 1.8, 1.9 smi.h, 1.7, 1.8 smidraw.c, 1.7, 1.8

Eric Anholt <xserver-commit-u7BhqnqprCWvj1b/[email protected]> Thu, 9 Jun 2005 03:44:47 -0700 (PDT)
Newsgroups gmane.comp.freedesktop.xserver.cvs
Message-ID <[email protected]>
Committed by: anholt

Update of /cvs/xserver/xserver/hw/kdrive/smi
In directory gabe:/tmp/cvs-serv30863/hw/kdrive/smi

Modified Files:
	smi.c smi.h smidraw.c 
Log Message:
- Replace the syncAccel hook in the kdrive structure with a pair of
  hooks in the kaa structure: markSync and waitMarker.  The first, if
  set, returns a hardware-dependent marker number which can then be
  waited for with waitMarker.  If markSync is absent (which is the case
  on all drivers currently), waitMarker must wait for idle on any given
  marker number.  The intention is to allow for more parallelism when
  we get downloading from framebuffer, or more fine-grained idling.
- Replace the KdMarkSync/KdCheckSync functions with kaaMarkSync and
  kaaWaitSync.  These will need to be refined when KAA starts being
  smart about using them.  Merge kpict.c into kasync.c since kasyn.c has
  all the rest of these fallback funcs.
- Restructure all drivers to initialize a KaaInfo structure by hand
  rather than statically in dubious order.
- Whack the i810 driver into shape in hopes that it'll work after this
  change (it certainly wouldn't have before this).  Doesn't support my
  i845 though.
- Make a new KXV helper to avoid duplicated code to fill the region
  with the necessary color key.  Use it in i810 and mach64 (tested).


Index: smi.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/smi/smi.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- smi.c	7 Nov 2003 23:29:29 -0000	1.8
+++ smi.c	9 Jun 2005 10:44:45 -0000	1.9
@@ -108,7 +108,7 @@
     Bool    ret;
     
     ENTER ();
-    KdCheckSync (pScreen);
+    kaaWaitSync (pScreen);
 
     ret = subRandRSetConfig (pScreen, randr, rate, pSize);
     LEAVE();
@@ -335,7 +335,6 @@
     
     smiDrawInit,	    /* initAccel */
     smiDrawEnable,	    /* enableAccel */
-    smiDrawSync,	    /* syncAccel */
     smiDrawDisable,	    /* disableAccel */
     smiDrawFini,	    /* finiAccel */
     

Index: smi.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/smi/smi.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- smi.h	18 Nov 2003 04:53:16 -0000	1.7
+++ smi.h	9 Jun 2005 10:44:45 -0000	1.8
@@ -186,6 +186,7 @@
     CARD32		stride;
     CARD32		data_format;
     CARD8		dpr_vpr_enable;
+    KaaScreenInfoRec kaa;
 } SmiScreenInfo;
 
 #define getSmiScreenInfo(kd) ((SmiScreenInfo *) ((kd)->screen->driver))
@@ -243,9 +244,6 @@
 smiDrawEnable (ScreenPtr pScreen);
 
 void
-smiDrawSync (ScreenPtr pScreen);
-
-void
 smiDrawDisable (ScreenPtr pScreen);
 
 void

Index: smidraw.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/smi/smidraw.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- smidraw.c	2 Nov 2003 19:56:10 -0000	1.7
+++ smidraw.c	9 Jun 2005 10:44:45 -0000	1.8
@@ -41,6 +41,7 @@
 #include	"migc.h"
 #include	"miline.h"
 #include	"picturestr.h"
+#include	"kaa.h"
 
 CARD8 smiBltRop[16] = {
     /* GXclear      */      0x00,         /* 0 */
@@ -143,6 +144,15 @@
     return TRUE;
 }
 
+static void
+smiWaitMarker (ScreenPtr pScreen, int marker)
+{
+    KdScreenPriv(pScreen);
+    smic = getSmiCardInfo(pScreenPriv);
+    
+    smiWaitIdle (smic);
+}
+
 static Bool
 smiPrepareSolid (PixmapPtr    pPixmap,
 		 int		alu,
@@ -229,15 +239,6 @@
 {
 }
 
-KaaScreenInfoRec    smiKaa = {
-    smiPrepareSolid,
-    smiSolid,
-    smiDoneSolid,
-
-    smiPrepareCopy,
-    smiCopy,
-    smiDoneCopy,
-};
 
 Bool
 smiDrawInit (ScreenPtr pScreen)
@@ -258,7 +259,16 @@
 	return FALSE;
     }
 
-    if (!kaaDrawInit (pScreen, &smiKaa))
+    memset(&smis->kaa, 0, sizeof(KaaScreenInfoRec));
+    smis->kaa.PrepareSolid	= smiPrepareSolid;
+    smis->kaa.Solid		= smiSolid;
+    smis->kaa.DoneSolid		= smiDoneSolid;
+    smis->kaa.PrepareCopy	= smiPrepareCopy;
+    smis->kaa.Copy		= smiCopy;
+    smis->kaa.DoneCopy		= smiDoneCopy;
+    smis->kaa.waitMarker	= smiWaitMarker;
+
+    if (!kaaDrawInit (pScreen, &smis->kaa))
     {
 	LEAVE ();
 	return FALSE;
@@ -311,7 +321,7 @@
     }
     
     smiSetup (pScreen, 0);
-    KdMarkSync (pScreen);
+    kaaMarkSync (pScreen);
     LEAVE ();
 }
 
@@ -332,12 +342,3 @@
     ENTER ();
     LEAVE ();
 }
-
-void
-smiDrawSync (ScreenPtr pScreen)
-{
-    KdScreenPriv(pScreen);
-    smic = getSmiCardInfo(pScreenPriv);
-    
-    smiWaitIdle (smic);
-}