summaryrefslogtreecommitdiff
path: root/hw/kdrive/smi
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-06-09 10:44:45 +0000
committerEric Anholt <anholt@freebsd.org>2005-06-09 10:44:45 +0000
commit545c082cf9c86f2a809ea6b4dca33643afb0c3d3 (patch)
tree5bf8f4861202fe3a120826e9c8d170cf27de1508 /hw/kdrive/smi
parent72ca8e1b5432db57401e66af8a07fcd8cbbbb9f1 (diff)
- 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).
Diffstat (limited to 'hw/kdrive/smi')
-rw-r--r--hw/kdrive/smi/smi.c3
-rw-r--r--hw/kdrive/smi/smi.h4
-rw-r--r--hw/kdrive/smi/smidraw.c41
3 files changed, 23 insertions, 25 deletions
diff --git a/hw/kdrive/smi/smi.c b/hw/kdrive/smi/smi.c
index 635fca4da..05151aae9 100644
--- a/hw/kdrive/smi/smi.c
+++ b/hw/kdrive/smi/smi.c
@@ -108,7 +108,7 @@ smiRandRSetConfig (ScreenPtr pScreen,
Bool ret;
ENTER ();
- KdCheckSync (pScreen);
+ kaaWaitSync (pScreen);
ret = subRandRSetConfig (pScreen, randr, rate, pSize);
LEAVE();
@@ -335,7 +335,6 @@ KdCardFuncs smiFuncs = {
smiDrawInit, /* initAccel */
smiDrawEnable, /* enableAccel */
- smiDrawSync, /* syncAccel */
smiDrawDisable, /* disableAccel */
smiDrawFini, /* finiAccel */
diff --git a/hw/kdrive/smi/smi.h b/hw/kdrive/smi/smi.h
index d4733213f..93b856939 100644
--- a/hw/kdrive/smi/smi.h
+++ b/hw/kdrive/smi/smi.h
@@ -186,6 +186,7 @@ typedef struct _smiScreenInfo {
CARD32 stride;
CARD32 data_format;
CARD8 dpr_vpr_enable;
+ KaaScreenInfoRec kaa;
} SmiScreenInfo;
#define getSmiScreenInfo(kd) ((SmiScreenInfo *) ((kd)->screen->driver))
@@ -243,9 +244,6 @@ void
smiDrawEnable (ScreenPtr pScreen);
void
-smiDrawSync (ScreenPtr pScreen);
-
-void
smiDrawDisable (ScreenPtr pScreen);
void
diff --git a/hw/kdrive/smi/smidraw.c b/hw/kdrive/smi/smidraw.c
index d1691fce0..a85382816 100644
--- a/hw/kdrive/smi/smidraw.c
+++ b/hw/kdrive/smi/smidraw.c
@@ -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 @@ smiSetup (ScreenPtr pScreen, int wait)
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 @@ smiDoneCopy (void)
{
}
-KaaScreenInfoRec smiKaa = {
- smiPrepareSolid,
- smiSolid,
- smiDoneSolid,
-
- smiPrepareCopy,
- smiCopy,
- smiDoneCopy,
-};
Bool
smiDrawInit (ScreenPtr pScreen)
@@ -258,7 +259,16 @@ smiDrawInit (ScreenPtr pScreen)
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 @@ smiDrawEnable (ScreenPtr pScreen)
}
smiSetup (pScreen, 0);
- KdMarkSync (pScreen);
+ kaaMarkSync (pScreen);
LEAVE ();
}
@@ -332,12 +342,3 @@ smiDrawFini (ScreenPtr pScreen)
ENTER ();
LEAVE ();
}
-
-void
-smiDrawSync (ScreenPtr pScreen)
-{
- KdScreenPriv(pScreen);
- smic = getSmiCardInfo(pScreenPriv);
-
- smiWaitIdle (smic);
-}