summaryrefslogtreecommitdiff
path: root/hw/kdrive/src
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/src
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/src')
-rw-r--r--hw/kdrive/src/Makefile.am1
-rw-r--r--hw/kdrive/src/kaa.c55
-rw-r--r--hw/kdrive/src/kaa.h8
-rw-r--r--hw/kdrive/src/kaapict.c8
-rw-r--r--hw/kdrive/src/kasync.c102
-rw-r--r--hw/kdrive/src/kdrive.c2
-rw-r--r--hw/kdrive/src/kdrive.h25
-rw-r--r--hw/kdrive/src/kpict.c83
-rw-r--r--hw/kdrive/src/kxv.c43
-rw-r--r--hw/kdrive/src/kxv.h3
10 files changed, 186 insertions, 144 deletions
diff --git a/hw/kdrive/src/Makefile.am b/hw/kdrive/src/Makefile.am
index 07c388d29..4758caea5 100644
--- a/hw/kdrive/src/Makefile.am
+++ b/hw/kdrive/src/Makefile.am
@@ -21,7 +21,6 @@ libkdrive_a_SOURCES = \
kmode.c \
knoop.c \
koffscreen.c \
- kpict.c \
kshadow.c \
ktest.c \
kxv.c \
diff --git a/hw/kdrive/src/kaa.c b/hw/kdrive/src/kaa.c
index 6fa1d7ed0..559f4f5b4 100644
--- a/hw/kdrive/src/kaa.c
+++ b/hw/kdrive/src/kaa.c
@@ -104,7 +104,7 @@ kaaPixmapSave (ScreenPtr pScreen, KdOffscreenArea *area)
return;
#endif
- KdCheckSync (pPixmap->drawable.pScreen);
+ kaaWaitSync (pPixmap->drawable.pScreen);
bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
@@ -142,13 +142,13 @@ kaaPixmapAllocArea (PixmapPtr pPixmap)
if (pKaaScr->info->flags & KAA_OFFSCREEN_ALIGN_POT && w != 1)
w = 1 << (kaaLog2(w - 1) + 1);
- pitch = (w * bpp / 8 + pKaaScr->info->offscreenPitch - 1) &
- ~(pKaaScr->info->offscreenPitch - 1);
+ pitch = (w * bpp / 8 + pKaaScr->info->pitchAlign - 1) &
+ ~(pKaaScr->info->pitchAlign - 1);
pKaaPixmap->devKind = pPixmap->devKind;
pKaaPixmap->devPrivate = pPixmap->devPrivate;
pKaaPixmap->area = KdOffscreenAlloc (pScreen, pitch * h,
- pKaaScr->info->offscreenByteAlign,
+ pKaaScr->info->offsetAlign,
FALSE,
kaaPixmapSave, (pointer) pPixmap);
if (!pKaaPixmap->area)
@@ -202,7 +202,7 @@ kaaMoveInPixmap (PixmapPtr pPixmap)
bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
- KdCheckSync (pPixmap->drawable.pScreen);
+ kaaWaitSync (pPixmap->drawable.pScreen);
i = pPixmap->drawable.height;
while (i--) {
@@ -513,7 +513,7 @@ kaaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
}
(*pKaaScr->info->DoneSolid) ();
kaaDrawableDirty (pDrawable);
- KdMarkSync(pDrawable->pScreen);
+ kaaMarkSync (pDrawable->pScreen);
}
void
@@ -563,11 +563,11 @@ kaaCopyNtoN (DrawablePtr pSrcDrawable,
pbox++;
}
(*pKaaScr->info->DoneCopy) ();
- KdMarkSync(pDstDrawable->pScreen);
+ kaaMarkSync (pDstDrawable->pScreen);
}
else
{
- KdCheckSync (pDstDrawable->pScreen);
+ kaaWaitSync (pDstDrawable->pScreen);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
pbox, nbox, dx, dy, reverse, upsidedown,
bitplane, closure);
@@ -683,7 +683,7 @@ kaaPolyFillRect(DrawablePtr pDrawable,
}
(*pKaaScr->info->DoneSolid) ();
kaaDrawableDirty (pDrawable);
- KdMarkSync(pDrawable->pScreen);
+ kaaMarkSync (pDrawable->pScreen);
}
static void
@@ -708,7 +708,7 @@ kaaSolidBoxClipped (DrawablePtr pDrawable,
!(pPixmap = kaaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
!(*pKaaScr->info->PrepareSolid) (pPixmap, GXcopy, pm, fg))
{
- KdCheckSync (pDrawable->pScreen);
+ kaaWaitSync (pDrawable->pScreen);
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
fbAnd (GXcopy, fg, pm),
@@ -747,7 +747,7 @@ kaaSolidBoxClipped (DrawablePtr pDrawable,
}
(*pKaaScr->info->DoneSolid) ();
kaaDrawableDirty (pDrawable);
- KdMarkSync(pDrawable->pScreen);
+ kaaMarkSync (pDrawable->pScreen);
}
static void
@@ -833,7 +833,7 @@ kaaImageGlyphBlt (DrawablePtr pDrawable,
opaque = FALSE;
}
- KdCheckSync (pDrawable->pScreen);
+ kaaWaitSync (pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
ppci = ppciInit;
@@ -992,11 +992,11 @@ kaaFillRegionSolid (DrawablePtr pDrawable,
pBox++;
}
(*pKaaScr->info->DoneSolid) ();
- KdMarkSync(pDrawable->pScreen);
+ kaaMarkSync (pDrawable->pScreen);
}
else
{
- KdCheckSync (pDrawable->pScreen);
+ kaaWaitSync (pDrawable->pScreen);
fbFillRegionSolid (pDrawable, pRegion, 0,
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
}
@@ -1011,7 +1011,7 @@ kaaFillRegionTiled (DrawablePtr pDrawable,
{
else
{
- KdCheckSync
+ kaaWaitSync
}
#endif
@@ -1134,3 +1134,28 @@ kaaDrawFini (ScreenPtr pScreen)
xfree (pKaaScr);
}
+
+void
+kaaMarkSync (ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ KaaScreenPriv(pScreen);
+
+ pScreenPriv->card->needSync = TRUE;
+ if (pKaaScr->info->markSync != NULL) {
+ pScreenPriv->card->lastMarker = (*pKaaScr->info->markSync) (pScreen);
+ }
+}
+
+void
+kaaWaitSync (ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ KaaScreenPriv(pScreen);
+ KdCardInfo *card = pScreenPriv->card;
+
+ if (card->needSync) {
+ (*pKaaScr->info->waitMarker) (pScreen, card->lastMarker);
+ card->needSync = FALSE;
+ }
+}
diff --git a/hw/kdrive/src/kaa.h b/hw/kdrive/src/kaa.h
index 27f991742..15f2faac2 100644
--- a/hw/kdrive/src/kaa.h
+++ b/hw/kdrive/src/kaa.h
@@ -27,6 +27,8 @@
#ifndef _KAA_H_
#define _KAA_H_
+#include "picturestr.h"
+
#define KaaGetScreenPriv(s) ((KaaScreenPrivPtr)(s)->devPrivates[kaaScreenPrivateIndex].ptr)
#define KaaScreenPriv(s) KaaScreenPrivPtr pKaaScr = KaaGetScreenPriv(s)
@@ -72,6 +74,12 @@ void
kaaMoveInPixmap (PixmapPtr pPixmap);
void
+kaaMarkSync (ScreenPtr pScreen);
+
+void
+kaaWaitSync (ScreenPtr pScreen);
+
+void
kaaCopyNtoN (DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
diff --git a/hw/kdrive/src/kaapict.c b/hw/kdrive/src/kaapict.c
index 1e4d2ef61..bbd1584ff 100644
--- a/hw/kdrive/src/kaapict.c
+++ b/hw/kdrive/src/kaapict.c
@@ -279,7 +279,7 @@ kaaTryDriverSolidFill(PicturePtr pSrc,
* before accessing it. We'd prefer for it to be in memory.
*/
if (kaaPixmapIsOffscreen(pSrcPix)) {
- KdCheckSync(pDst->pDrawable->pScreen);
+ kaaWaitSync(pDst->pDrawable->pScreen);
}
pixel = *(CARD32 *)(pSrcPix->devPrivate.ptr);
@@ -310,7 +310,7 @@ kaaTryDriverSolidFill(PicturePtr pSrc,
}
(*pKaaScr->info->DoneSolid) ();
- KdMarkSync(pDst->pDrawable->pScreen);
+ kaaMarkSync (pDst->pDrawable->pScreen);
kaaDrawableDirty (pDst->pDrawable);
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
@@ -397,7 +397,7 @@ kaaTryDriverBlend(CARD8 op,
}
(*pKaaScr->info->DoneBlend) ();
- KdMarkSync(pDst->pDrawable->pScreen);
+ kaaMarkSync (pDst->pDrawable->pScreen);
kaaDrawableDirty (pDst->pDrawable);
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
@@ -520,7 +520,7 @@ kaaTryDriverComposite(CARD8 op,
}
(*pKaaScr->info->DoneComposite) ();
- KdMarkSync(pDst->pDrawable->pScreen);
+ kaaMarkSync (pDst->pDrawable->pScreen);
kaaDrawableDirty (pDst->pDrawable);
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
diff --git a/hw/kdrive/src/kasync.c b/hw/kdrive/src/kasync.c
index 4cb1e3b6b..724d546dd 100644
--- a/hw/kdrive/src/kasync.c
+++ b/hw/kdrive/src/kasync.c
@@ -28,6 +28,9 @@
#endif
#include "kdrive.h"
#include "kaa.h"
+#include "picturestr.h"
+#include "mipict.h"
+#include "fbpict.h"
/*
* These functions wrap the low-level fb rendering functions and
@@ -39,7 +42,7 @@ void
KdCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
DDXPointPtr ppt, int *pwidth, int fSorted)
{
- KdCheckSync (pDrawable->pScreen);
+ kaaWaitSync (pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbFillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted);
}
@@ -48,7 +51,7 @@ void
KdCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
{
- KdCheckSync (pDrawable->pScreen);
+ kaaWaitSync (pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbSetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
}
@@ -58,7 +61,7 @@ KdCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
int x, int y, int w, int h, int leftPad, int format,
char *bits)
{
- KdCheckSync (pDrawable->pScreen);
+ kaaWaitSync (pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
}
@@ -67,7 +70,7 @@ RegionPtr
KdCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty)
{
- KdCheckSync (pSrc->pScreen);
+ kaaWaitSync (pSrc->pScreen);
kaaDrawableDirty (pDst);
return fbCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
}
@@ -77,7 +80,7 @@ KdCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane)
{
- KdCheckSync (pSrc->pScreen);
+ kaaWaitSync (pSrc->pScreen);
kaaDrawableDirty (pDst);
return fbCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty,
bitPlane);
@@ -87,7 +90,7 @@ void
KdCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
DDXPointPtr pptInit)
{
- KdCheckSync (pDrawable->pScreen);
+ kaaWaitSync (pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbPolyPoint (pDrawable, pGC, mode, npt, pptInit);
}
@@ -98,7 +101,7 @@ KdCheckPolylines (DrawablePtr pDrawable, GCPtr pGC,
{
if (pGC->lineWidth == 0) {
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
}
kaaDrawableDirty (pDrawable);
@@ -110,7 +113,7 @@ KdCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC,
int nsegInit, xSegment *pSegInit)
{
if (pGC->lineWidth == 0) {
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
}
kaaDrawableDirty (pDrawable);
@@ -122,7 +125,7 @@ KdCheckPolyRectangle (DrawablePtr pDrawable, GCPtr pGC,
int nrects, xRectangle *prect)
{
if (pGC->lineWidth == 0) {
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
}
fbPolyRectangle (pDrawable, pGC, nrects, prect);
@@ -134,7 +137,7 @@ KdCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC,
{
if (pGC->lineWidth == 0)
{
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbPolyArc (pDrawable, pGC, narcs, pArcs);
}
@@ -147,7 +150,7 @@ void
KdCheckFillPolygon (DrawablePtr pDrawable, GCPtr pGC,
int shape, int mode, int count, DDXPointPtr pPts)
{
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbFillPolygon (pDrawable, pGC, mode, count, pPts);
}
@@ -157,7 +160,7 @@ void
KdCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
int nrect, xRectangle *prect)
{
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbPolyFillRect (pDrawable, pGC, nrect, prect);
}
@@ -166,7 +169,7 @@ void
KdCheckPolyFillArc (DrawablePtr pDrawable, GCPtr pGC,
int narcs, xArc *pArcs)
{
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbPolyFillArc (pDrawable, pGC, narcs, pArcs);
}
@@ -176,7 +179,7 @@ KdCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, pointer pglyphBase)
{
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
}
@@ -186,7 +189,7 @@ KdCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, pointer pglyphBase)
{
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
}
@@ -196,7 +199,7 @@ KdCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
DrawablePtr pDrawable,
int w, int h, int x, int y)
{
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y);
}
@@ -207,7 +210,7 @@ KdCheckGetImage (DrawablePtr pDrawable,
unsigned int format, unsigned long planeMask,
char *d)
{
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
fbGetImage (pDrawable, x, y, w, h, format, planeMask, d);
}
@@ -219,7 +222,7 @@ KdCheckGetSpans (DrawablePtr pDrawable,
int nspans,
char *pdstStart)
{
- KdCheckSync(pDrawable->pScreen);
+ kaaWaitSync(pDrawable->pScreen);
fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
}
@@ -230,7 +233,7 @@ KdCheckSaveAreas (PixmapPtr pPixmap,
int yorg,
WindowPtr pWin)
{
- KdCheckSync(pWin->drawable.pScreen);
+ kaaWaitSync(pWin->drawable.pScreen);
kaaDrawableDirty (&pPixmap->drawable);
fbSaveAreas (pPixmap, prgnSave, xorg, yorg, pWin);
}
@@ -242,7 +245,7 @@ KdCheckRestoreAreas (PixmapPtr pPixmap,
int yorg,
WindowPtr pWin)
{
- KdCheckSync(pWin->drawable.pScreen);
+ kaaWaitSync(pWin->drawable.pScreen);
kaaDrawableDirty ((DrawablePtr)pWin);
fbRestoreAreas (pPixmap, prgnSave, xorg, yorg, pWin);
}
@@ -250,7 +253,7 @@ KdCheckRestoreAreas (PixmapPtr pPixmap,
void
KdCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what)
{
- KdCheckSync (pWin->drawable.pScreen);
+ kaaWaitSync (pWin->drawable.pScreen);
kaaDrawableDirty ((DrawablePtr)pWin);
fbPaintWindow (pWin, pRegion, what);
}
@@ -258,7 +261,7 @@ KdCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what)
void
KdCheckCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
- KdCheckSync (pWin->drawable.pScreen);
+ kaaWaitSync (pWin->drawable.pScreen);
kaaDrawableDirty ((DrawablePtr)pWin);
fbCopyWindow (pWin, ptOldOrg, prgnSrc);
}
@@ -270,7 +273,7 @@ KdCheckPaintKey(DrawablePtr pDrawable,
CARD32 pixel,
int layer)
{
- KdCheckSync (pDrawable->pScreen);
+ kaaWaitSync (pDrawable->pScreen);
kaaDrawableDirty (pDrawable);
fbOverlayPaintKey (pDrawable, pRegion, pixel, layer);
}
@@ -278,7 +281,7 @@ KdCheckPaintKey(DrawablePtr pDrawable,
void
KdCheckOverlayCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
- KdCheckSync (pWin->drawable.pScreen);
+ kaaWaitSync (pWin->drawable.pScreen);
kaaDrawableDirty ((DrawablePtr)pWin);
fbOverlayCopyWindow (pWin, ptOldOrg, prgnSrc);
}
@@ -305,6 +308,47 @@ KdScreenInitAsync (ScreenPtr pScreen)
#endif
}
+void
+KdCheckComposite (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height)
+{
+ kaaWaitSync (pDst->pDrawable->pScreen);
+ kaaDrawableDirty (pDst->pDrawable);
+ fbComposite (op,
+ pSrc,
+ pMask,
+ pDst,
+ xSrc,
+ ySrc,
+ xMask,
+ yMask,
+ xDst,
+ yDst,
+ width,
+ height);
+}
+
+void
+KdCheckRasterizeTrapezoid(PicturePtr pMask,
+ xTrapezoid *trap,
+ int x_off,
+ int y_off)
+{
+ kaaWaitSync (pMask->pDrawable->pScreen);
+ kaaDrawableDirty (pMask->pDrawable);
+ fbRasterizeTrapezoid (pMask, trap, x_off, y_off);
+}
+
/*
* Only need to stall for copyarea/copyplane
*/
@@ -333,3 +377,13 @@ const GCOps kdAsyncPixmapGCOps = {
,NULL
#endif
};
+
+void
+KdPictureInitAsync (ScreenPtr pScreen)
+{
+ PictureScreenPtr ps;
+
+ ps = GetPictureScreen(pScreen);
+ ps->Composite = KdCheckComposite;
+ ps->RasterizeTrapezoid = KdCheckRasterizeTrapezoid;
+}
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index b27a6403d..0271d4e34 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -224,7 +224,7 @@ KdDisableScreen (ScreenPtr pScreen)
if (!pScreenPriv->enabled)
return;
- KdCheckSync (pScreen);
+ kaaWaitSync (pScreen);
if (!pScreenPriv->closed)
KdSetRootClip (pScreen, FALSE);
KdDisableColormap (pScreen);
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index 5289ae0bd..c371263d3 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -89,7 +89,9 @@ typedef struct _KdCardInfo {
struct _KdScreenInfo *screenList;
int selected;
struct _KdCardInfo *next;
+
Bool needSync;
+ int lastMarker;
} KdCardInfo;
extern KdCardInfo *kdCardInfo;
@@ -180,7 +182,6 @@ typedef struct _KdCardFuncs {
Bool (*initAccel) (ScreenPtr);
void (*enableAccel) (ScreenPtr);
- void (*syncAccel) (ScreenPtr);
void (*disableAccel) (ScreenPtr);
void (*finiAccel) (ScreenPtr);
@@ -316,6 +317,13 @@ typedef struct _KaaTrapezoid {
} KaaTrapezoid;
typedef struct _KaaScreenInfo {
+ int offsetAlign;
+ int pitchAlign;
+ int flags;
+
+ int (*markSync) (ScreenPtr pScreen);
+ void (*waitMarker) (ScreenPtr pScreen, int marker);
+
Bool (*PrepareSolid) (PixmapPtr pPixmap,
int alu,
Pixel planemask,
@@ -337,10 +345,6 @@ typedef struct _KaaScreenInfo {
int height);
void (*DoneCopy) (void);
- int offscreenByteAlign;
- int offscreenPitch;
- int flags;
-
Bool (*PrepareBlend) (int op,
PicturePtr pSrcPicture,
PicturePtr pDstPicture,
@@ -421,17 +425,6 @@ extern KdOsFuncs *kdOsFuncs;
(pointer) v)
#define KdScreenPriv(pScreen) KdPrivScreenPtr pScreenPriv = KdGetScreenPriv(pScreen)
-#define KdCheckSync(s) { \
- KdScreenPriv(s); \
- KdCardInfo *card = pScreenPriv->card; \
- if (card->needSync) { \
- card->needSync = FALSE; \
- (*card->cfuncs->syncAccel) (s); \
- } \
-}
-
-#define KdMarkSync(s) (KdGetScreenPriv(s)->card->needSync = TRUE)
-
/* kaa.c */
Bool
kaaDrawInit (ScreenPtr pScreen,
diff --git a/hw/kdrive/src/kpict.c b/hw/kdrive/src/kpict.c
deleted file mode 100644
index e42ae427b..000000000
--- a/hw/kdrive/src/kpict.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * $RCSId: $
- *
- * Copyright © 1999 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "kdrive.h"
-#include <picturestr.h>
-#include <mipict.h>
-#include <fbpict.h>
-#include "kaa.h"
-
-void
-KdCheckComposite (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- KdCheckSync (pDst->pDrawable->pScreen);
- kaaDrawableDirty (pDst->pDrawable);
- fbComposite (op,
- pSrc,
- pMask,
- pDst,
- xSrc,
- ySrc,
- xMask,
- yMask,
- xDst,
- yDst,
- width,
- height);
-}
-
-void
-KdCheckRasterizeTrapezoid(PicturePtr pMask,
- xTrapezoid *trap,
- int x_off,
- int y_off)
-{
- KdCheckSync (pMask->pDrawable->pScreen);
- kaaDrawableDirty (pMask->pDrawable);
- fbRasterizeTrapezoid (pMask, trap, x_off, y_off);
-}
-
-void
-KdPictureInitAsync (ScreenPtr pScreen)
-{
- PictureScreenPtr ps;
-
- ps = GetPictureScreen(pScreen);
- ps->Composite = KdCheckComposite;
- ps->RasterizeTrapezoid = KdCheckRasterizeTrapezoid;
-}
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index c66bf589b..57ca0db30 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -1919,3 +1919,46 @@ KdXVCopyPlanarData(KdScreenInfo *screen, CARD8 *src, CARD8 *dst, int randr,
}
}
}
+
+void
+KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
+{
+ GCPtr pGC;
+ CARD32 val[2];
+ xRectangle *rects, *r;
+ BoxPtr pBox = REGION_RECTS (pRgn);
+ int nBox = REGION_NUM_RECTS (pRgn);
+
+ rects = ALLOCATE_LOCAL (nBox * sizeof (xRectangle));
+ if (!rects)
+ goto bail0;
+ r = rects;
+ while (nBox--)
+ {
+ r->x = pBox->x1 - pDraw->x;
+ r->y = pBox->y1 - pDraw->y;
+ r->width = pBox->x2 - pBox->x1;
+ r->height = pBox->y2 - pBox->y1;
+ r++;
+ pBox++;
+ }
+
+ pGC = GetScratchGC (pDraw->depth, pDraw->pScreen);
+ if (!pGC)
+ goto bail1;
+
+ val[0] = fg;
+ val[1] = IncludeInferiors;
+ ChangeGC (pGC, GCForeground|GCSubwindowMode, val);
+
+ ValidateGC (pDraw, pGC);
+
+ (*pGC->ops->PolyFillRect) (pDraw, pGC,
+ REGION_NUM_RECTS (pRgn), rects);
+
+ FreeScratchGC (pGC);
+bail1:
+ DEALLOCATE_LOCAL (rects);
+bail0:
+ ;
+}
diff --git a/hw/kdrive/src/kxv.h b/hw/kdrive/src/kxv.h
index 28fc3c4ed..b9eca8b8e 100644
--- a/hw/kdrive/src/kxv.h
+++ b/hw/kdrive/src/kxv.h
@@ -256,6 +256,9 @@ KdXVCopyPlanarData(KdScreenInfo *screen, CARD8 *src, CARD8 *dst, int randr,
int srcPitch, int srcPitch2, int dstPitch, int srcW, int srcH, int height,
int top, int left, int h, int w, int id);
+void
+KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg);
+
KdVideoAdaptorPtr KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen);
void KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr);