diff options
author | Eric Anholt <anholt@freebsd.org> | 2005-06-09 10:44:45 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2005-06-09 10:44:45 +0000 |
commit | 545c082cf9c86f2a809ea6b4dca33643afb0c3d3 (patch) | |
tree | 5bf8f4861202fe3a120826e9c8d170cf27de1508 /hw/kdrive/r128 | |
parent | 72ca8e1b5432db57401e66af8a07fcd8cbbbb9f1 (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/r128')
-rw-r--r-- | hw/kdrive/r128/r128.c | 1 | ||||
-rw-r--r-- | hw/kdrive/r128/r128.h | 5 | ||||
-rw-r--r-- | hw/kdrive/r128/r128draw.c | 50 |
3 files changed, 29 insertions, 27 deletions
diff --git a/hw/kdrive/r128/r128.c b/hw/kdrive/r128/r128.c index 2be8b26d2..62d96fab0 100644 --- a/hw/kdrive/r128/r128.c +++ b/hw/kdrive/r128/r128.c @@ -244,7 +244,6 @@ KdCardFuncs r128Funcs = { r128DrawInit, /* initAccel */ r128DrawEnable, /* enableAccel */ - r128DrawSync, /* syncAccel */ r128DrawDisable, /* disableAccel */ r128DrawFini, /* finiAccel */ diff --git a/hw/kdrive/r128/r128.h b/hw/kdrive/r128/r128.h index 8cf2bd4e2..02e3c10d5 100644 --- a/hw/kdrive/r128/r128.h +++ b/hw/kdrive/r128/r128.h @@ -83,6 +83,8 @@ typedef struct _r128ScreenInfo { CARD8 *off_screen; int off_screen_size; + KaaScreenInfoRec kaa; + int pitch; int datatype; @@ -114,9 +116,6 @@ void r128DrawEnable (ScreenPtr pScreen); void -r128DrawSync (ScreenPtr pScreen); - -void r128DrawDisable (ScreenPtr pScreen); void diff --git a/hw/kdrive/r128/r128draw.c b/hw/kdrive/r128/r128draw.c index be4dc79ae..208d7ef5f 100644 --- a/hw/kdrive/r128/r128draw.c +++ b/hw/kdrive/r128/r128draw.c @@ -26,6 +26,7 @@ #include <config.h> #endif #include "r128.h" +#include "kaa.h" CARD8 r128SolidRop[16] = { /* GXclear */ 0x00, /* 0 */ @@ -107,6 +108,17 @@ r128WaitIdle (void) } +static void +r128WaitMarker (ScreenPtr pScreen, int marker) +{ + KdScreenPriv (pScreen); + r128CardInfo (pScreenPriv); + + mmio = r128c->reg_base; + + r128WaitIdle (); +} + static Bool r128Setup (ScreenPtr pScreen, int wait) { @@ -219,20 +231,23 @@ r128DoneCopy (void) { } -KaaScreenInfoRec r128Kaa = { - r128PrepareSolid, - r128Solid, - r128DoneSolid, - - r128PrepareCopy, - r128Copy, - r128DoneCopy, -}; Bool r128DrawInit (ScreenPtr pScreen) { - if (!kaaDrawInit (pScreen, &r128Kaa)) + KdScreenPriv (pScreen); + r128ScreenInfo (pScreenPriv); + + memset(&r128s->kaa, 0, sizeof(KaaScreenInfoRec)); + r128s->kaa.waitMarker = r128WaitMarker; + r128s->kaa.PrepareSolid = r128PrepareSolid; + r128s->kaa.Solid = r128Solid; + r128s->kaa.DoneSolid = r128DoneSolid; + r128s->kaa.PrepareCopy = r128PrepareCopy; + r128s->kaa.Copy = r128Copy; + r128s->kaa.DoneCopy = r128DoneCopy; + + if (!kaaDrawInit (pScreen, &r128s->kaa)) return FALSE; return TRUE; @@ -245,7 +260,7 @@ r128DrawEnable (ScreenPtr pScreen) r128ScreenInfo (pScreenPriv); r128s->pitch = pScreenPriv->screen->width >> 3; - + switch (pScreenPriv->screen->fb[0].depth) { case 8: r128s->datatype = 2; @@ -270,7 +285,7 @@ r128DrawEnable (ScreenPtr pScreen) | R128_GMC_CLR_CMP_CNTL_DIS | R128_GMC_AUX_CLIP_DIS); - KdMarkSync (pScreen); + kaaMarkSync (pScreen); } void @@ -282,14 +297,3 @@ void r128DrawFini (ScreenPtr pScreen) { } - -void -r128DrawSync (ScreenPtr pScreen) -{ - KdScreenPriv (pScreen); - r128CardInfo (pScreenPriv); - - mmio = r128c->reg_base; - - r128WaitIdle (); -} |