summaryrefslogtreecommitdiff
path: root/hw/kdrive/neomagic
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/neomagic
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/neomagic')
-rw-r--r--hw/kdrive/neomagic/ChangeLog24
-rw-r--r--hw/kdrive/neomagic/neo_draw.c38
-rw-r--r--hw/kdrive/neomagic/neomagic.c1
-rw-r--r--hw/kdrive/neomagic/neomagic.h4
4 files changed, 47 insertions, 20 deletions
diff --git a/hw/kdrive/neomagic/ChangeLog b/hw/kdrive/neomagic/ChangeLog
index 77d8839d8..c2c62dfe8 100644
--- a/hw/kdrive/neomagic/ChangeLog
+++ b/hw/kdrive/neomagic/ChangeLog
@@ -1,3 +1,27 @@
+2005-06-09 Eric Anholt <anholt@FreeBSD.org>
+
+ * neo_draw.c: (neoWaitMarker), (neoDrawInit):
+ * neomagic.c:
+ * neomagic.h:
+ - 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).
+
2005-02-08 Keith Packard <keithp@keithp.com>
reviewed by: <delete if not using a buddy>
diff --git a/hw/kdrive/neomagic/neo_draw.c b/hw/kdrive/neomagic/neo_draw.c
index b6419e73c..6c95f516a 100644
--- a/hw/kdrive/neomagic/neo_draw.c
+++ b/hw/kdrive/neomagic/neo_draw.c
@@ -71,6 +71,14 @@ static void neoWaitIdle(NeoCardInfo *neoc)
while ((mmio->bltStat & 1) && ++i<100000);
}
+static void neoWaitMarker (ScreenPtr pScreen, int marker)
+{
+ KdScreenPriv(pScreen);
+ neoCardInfo(pScreenPriv);
+
+ neoWaitIdle(neoc);
+}
+
static void neoWaitFifo(NeoCardInfo *neoc, int requested_fifo_space)
{
neoWaitIdle( neoc );
@@ -156,20 +164,24 @@ static void neoDoneCopy (void)
{
}
-KaaScreenInfoRec neoKaa = {
- neoPrepareSolid,
- neoSolid,
- neoDoneSolid,
-
- neoPrepareCopy,
- neoCopy,
- neoDoneCopy
-};
Bool neoDrawInit (ScreenPtr pScreen)
{
+ KdScreenPriv(pScreen);
+ neoScreenInfo(pScreenPriv);
+
ENTER();
- if (!kaaDrawInit (pScreen, &neoKaa)) {
+
+ memset(&neos->kaa, 0, sizeof(KaaScreenInfoRec));
+ neos->kaa.waitMarker = neoWaitMarker;
+ neos->kaa.PrepareSolid = neoPrepareSolid;
+ neos->kaa.Solid = neoSolid;
+ neos->kaa.DoneSolid = neoDoneSolid;
+ neos->kaa.PrepareCopy = neoPrepareCopy;
+ neos->kaa.Copy = neoCopy;
+ neos->kaa.DoneCopy = neoDoneCopy;
+
+ if (!kaaDrawInit (pScreen, &neos->kaa)) {
return FALSE;
}
LEAVE();
@@ -201,9 +213,3 @@ void neoDrawFini (ScreenPtr pScreen)
LEAVE();
}
-void neoDrawSync (ScreenPtr pScreen)
-{
- SetupNeo(pScreen);
-
- neoWaitIdle(neoc);
-}
diff --git a/hw/kdrive/neomagic/neomagic.c b/hw/kdrive/neomagic/neomagic.c
index 68dbb9172..b9c6f6f30 100644
--- a/hw/kdrive/neomagic/neomagic.c
+++ b/hw/kdrive/neomagic/neomagic.c
@@ -328,7 +328,6 @@ KdCardFuncs neoFuncs = {
neoDrawInit, // initAccel
neoDrawEnable, // enableAccel
- neoDrawSync, // syncAccel
neoDrawDisable, // disableAccel
neoDrawFini, // finiAccel
diff --git a/hw/kdrive/neomagic/neomagic.h b/hw/kdrive/neomagic/neomagic.h
index 590319652..b91e81e8a 100644
--- a/hw/kdrive/neomagic/neomagic.h
+++ b/hw/kdrive/neomagic/neomagic.h
@@ -166,6 +166,7 @@ typedef struct _neoScreenInfo {
int pitch;
int depth;
KdVideoAdaptorPtr pAdaptor;
+ KaaScreenInfoRec kaa;
} NeoScreenInfo;
#define getNeoScreenInfo(kd) ((NeoScreenInfo *) ((kd)->screen->driver))
@@ -208,9 +209,6 @@ neoDrawDisable (ScreenPtr pScreen);
void
neoDrawFini (ScreenPtr pScreen);
-void
-neoDrawSync (ScreenPtr pScreen);
-
extern KdCardFuncs neoFuncs;
#endif /* _NEOMAGIC_H_ */