xserver/hw/kdrive/chips chips.c, 1.4, 1.5 chips.h, 1.2, 1.3 chipsdraw.c, 1.4, 1.5
Eric Anholt <xserver-commit-u7BhqnqprCWvj1b/[email protected]> Thu, 9 Jun 2005 03:44:46 -0700 (PDT)
| Newsgroups | gmane.comp.freedesktop.xserver.cvs |
|---|---|
| Message-ID | <[email protected]> |
Committed by: anholt
Update of /cvs/xserver/xserver/hw/kdrive/chips
In directory gabe:/tmp/cvs-serv30863/hw/kdrive/chips
Modified Files:
chips.c chips.h chipsdraw.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: chips.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/chips/chips.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- chips.c 2 Dec 2003 01:59:38 -0000 1.4
+++ chips.c 9 Jun 2005 10:44:44 -0000 1.5
@@ -25,6 +25,7 @@
#include <config.h>
#endif
#include "chips.h"
+#include "kaa.h"
#include <sys/io.h>
#undef CHIPS_DEBUG
@@ -138,7 +139,7 @@
int rate,
RRScreenSizePtr pSize)
{
- KdCheckSync (pScreen);
+ kaaWaitSync (pScreen);
if (!vesaRandRSetConfig (pScreen, rotation, rate, pSize))
return FALSE;
@@ -332,7 +333,6 @@
chipsDrawInit, /* initAccel */
chipsDrawEnable, /* enableAccel */
- chipsDrawSync, /* syncAccel */
chipsDrawDisable, /* disableAccel */
chipsDrawFini, /* finiAccel */
Index: chips.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/chips/chips.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- chips.h 7 Jul 2003 19:12:58 -0000 1.2
+++ chips.h 9 Jun 2005 10:44:44 -0000 1.3
@@ -76,6 +76,7 @@
CARD8 *off_screen;
int off_screen_size;
ChipsCursor cursor;
+ KaaScreenInfoRec kaa;
} ChipsScreenInfo;
#define getChipsScreenInfo(kd) ((ChipsScreenInfo *) ((kd)->screen->driver))
@@ -88,9 +89,6 @@
chipsDrawEnable (ScreenPtr pScreen);
void
-chipsDrawSync (ScreenPtr pScreen);
-
-void
chipsDrawDisable (ScreenPtr pScreen);
void
Index: chipsdraw.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/chips/chipsdraw.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- chipsdraw.c 2 Dec 2003 01:59:38 -0000 1.4
+++ chipsdraw.c 9 Jun 2005 10:44:44 -0000 1.5
@@ -39,6 +39,7 @@
#include "fb.h"
#include "migc.h"
#include "miline.h"
+#include "kaa.h"
CARD8 chipsBltRop[16] = {
/* GXclear */ 0x00, /* 0 */
@@ -159,6 +160,13 @@
pixelStride = pScreenPriv->screen->fb[0].pixelStride;
}
+static void
+chipsWaitMarker (ScreenPtr pScreen, int marker)
+{
+ chipsSet (pScreen);
+ chipsWaitIdle ();
+}
+
#ifdef HIQV
#define CHIPS_BR0 0x00 /* offset */
#define CHIPS_BR1 0x04 /* bg */
@@ -424,23 +432,12 @@
{
}
-KaaScreenInfoRec chipsKaa = {
- chipsPrepareSolid,
- chipsSolid,
- chipsDoneSolid,
-
- chipsPrepareCopy,
- chipsCopy,
- chipsDoneCopy,
-
- 0, 0, 0
-};
-
Bool
chipsDrawInit (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
-
+ chipsScreenInfo(pScreenPriv);
+
switch (pScreenPriv->screen->fb[0].bitsPerPixel) {
case 8:
case 16:
@@ -449,7 +446,16 @@
return FALSE;
}
- if (!kaaDrawInit (pScreen, &chipsKaa))
+ memset(&chipss->kaa, 0, sizeof(KaaScreenInfoRec));
+ chipss->kaa.waitMarker = chipsWaitMarker;
+ chipss->kaa.PrepareSolid = chipsPrepareSolid;
+ chipss->kaa.Solid = chipsSolid;
+ chipss->kaa.DoneSolid = chipsDoneSolid;
+ chipss->kaa.PrepareCopy = chipsPrepareCopy;
+ chipss->kaa.Copy = chipsCopy;
+ chipss->kaa.DoneCopy = chipsDoneCopy;
+
+ if (!kaaDrawInit (pScreen, &chipss->kaa))
return FALSE;
return TRUE;
@@ -474,7 +480,7 @@
chipsWaitIdle ();
chipsWriteXR (chipss, 0x20, mode);
- KdMarkSync (pScreen);
+ kaaMarkSync (pScreen);
}
void
@@ -487,9 +493,3 @@
{
}
-void
-chipsDrawSync (ScreenPtr pScreen)
-{
- chipsSet (pScreen);
- chipsWaitIdle ();
-}