Fix SYNC_ALWAYS (debugging) code to use mach64WaitIdle instead of

KdCheckSync -- the boolean used in the latter won't be set yet.
Oops. == instead of =.
Must sync hardware before rasterizing trapezoids in case the mask is in
    off-screen memory and has just been erased. Yes, it is silly to place
    masks in off-screen memory. That's a separate issue.
This commit is contained in:
Keith Packard 2004-05-20 05:27:03 +00:00
parent 94648799c8
commit b9d920f3dc
4 changed files with 30 additions and 18 deletions

View File

@ -65,9 +65,6 @@ CARD8 mach64Rop[16] = {
#define MACH64_DRAW_COMBO_COPY 0x8
#define SYNC_ALWAYS 0
#if SYNC_ALWAYS
static ScreenPtr mach64Screen;
#endif
static Reg *reg;
static CARD32 avail;
static CARD32 triple;
@ -114,7 +111,7 @@ static const Mach64AccelReg mach64AccelReg[] = {
{ 1, 1,
/* DP_PIX_WIDTH */
((PIX_FORMAT_MONO << 0) | /* DP_DST_PIX_WIDTH */
(PIX_FORMAT_TRUE_8888 << 4) | /* COMPOSITE_PIX_WIDTH */
(PIX_FORMAT_MONO << 4) | /* COMPOSITE_PIX_WIDTH */
(PIX_FORMAT_MONO << 8) | /* DP_SRC_PIX_WIDTH */
(0 << 13) | /* DP_HOST_TRIPLE_EN */
(0 << 14) | /* DP_PALETTE_TYPE */
@ -124,7 +121,7 @@ static const Mach64AccelReg mach64AccelReg[] = {
(0 << 25) | /* DP_CONVERSION_TEMP */
(0 << 26) | /* DP_C14_RGB_LOW_NIBBLE */
(0 << 27) | /* DP_C14_RGB_HIGH_NIBBLE */
(PIX_FORMAT_TRUE_8888 << 28) | /* DP_SCALE_PIX_WIDTH */
(PIX_FORMAT_MONO << 28) | /* DP_SCALE_PIX_WIDTH */
0),
/* DP_SET_GUI_ENGINE */
((PIX_FORMAT_MONO << 3) |
@ -146,7 +143,7 @@ static const Mach64AccelReg mach64AccelReg[] = {
{ 8, 8,
/* DP_PIX_WIDTH */
((PIX_FORMAT_PSEUDO_8 << 0) | /* DP_DST_PIX_WIDTH */
(PIX_FORMAT_TRUE_8888 << 4) | /* COMPOSITE_PIX_WIDTH */
(PIX_FORMAT_PSEUDO_8 << 4) | /* COMPOSITE_PIX_WIDTH */
(PIX_FORMAT_PSEUDO_8 << 8) | /* DP_SRC_PIX_WIDTH */
(0 << 13) | /* DP_HOST_TRIPLE_EN */
(0 << 14) | /* DP_PALETTE_TYPE */
@ -156,7 +153,7 @@ static const Mach64AccelReg mach64AccelReg[] = {
(0 << 25) | /* DP_CONVERSION_TEMP */
(0 << 26) | /* DP_C14_RGB_LOW_NIBBLE */
(0 << 27) | /* DP_C14_RGB_HIGH_NIBBLE */
(PIX_FORMAT_TRUE_8888 << 28) | /* DP_SCALE_PIX_WIDTH */
(PIX_FORMAT_PSEUDO_8 << 28) | /* DP_SCALE_PIX_WIDTH */
0),
/* DP_SET_GUI_ENGINE */
((PIX_FORMAT_PSEUDO_8 << 3) |
@ -178,7 +175,7 @@ static const Mach64AccelReg mach64AccelReg[] = {
{ 15, 16,
/* DP_PIX_WIDTH */
((PIX_FORMAT_TRUE_1555 << 0) | /* DP_DST_PIX_WIDTH */
(PIX_FORMAT_TRUE_8888 << 4) | /* COMPOSITE_PIX_WIDTH */
(PIX_FORMAT_TRUE_1555 << 4) | /* COMPOSITE_PIX_WIDTH */
(PIX_FORMAT_TRUE_1555 << 8) | /* DP_SRC_PIX_WIDTH */
(0 << 13) | /* DP_HOST_TRIPLE_EN */
(0 << 14) | /* DP_PALETTE_TYPE */
@ -188,7 +185,7 @@ static const Mach64AccelReg mach64AccelReg[] = {
(0 << 25) | /* DP_CONVERSION_TEMP */
(0 << 26) | /* DP_C14_RGB_LOW_NIBBLE */
(0 << 27) | /* DP_C14_RGB_HIGH_NIBBLE */
(PIX_FORMAT_TRUE_8888 << 28) | /* DP_SCALE_PIX_WIDTH */
(PIX_FORMAT_TRUE_1555 << 28) | /* DP_SCALE_PIX_WIDTH */
0),
/* DP_SET_GUI_ENGINE */
((PIX_FORMAT_TRUE_1555 << 3) |
@ -210,7 +207,7 @@ static const Mach64AccelReg mach64AccelReg[] = {
{ 16, 16,
/* DP_PIX_WIDTH */
((PIX_FORMAT_TRUE_565 << 0) | /* DP_DST_PIX_WIDTH */
(PIX_FORMAT_TRUE_8888 << 4) | /* COMPOSITE_PIX_WIDTH */
(PIX_FORMAT_TRUE_565 << 4) | /* COMPOSITE_PIX_WIDTH */
(PIX_FORMAT_TRUE_565 << 8) | /* DP_SRC_PIX_WIDTH */
(0 << 13) | /* DP_HOST_TRIPLE_EN */
(0 << 14) | /* DP_PALETTE_TYPE */
@ -220,7 +217,7 @@ static const Mach64AccelReg mach64AccelReg[] = {
(0 << 25) | /* DP_CONVERSION_TEMP */
(0 << 26) | /* DP_C14_RGB_LOW_NIBBLE */
(0 << 27) | /* DP_C14_RGB_HIGH_NIBBLE */
(PIX_FORMAT_TRUE_8888 << 28) | /* DP_SCALE_PIX_WIDTH */
(PIX_FORMAT_TRUE_565 << 28) | /* DP_SCALE_PIX_WIDTH */
0),
/* DP_SET_GUI_ENGINE */
((PIX_FORMAT_TRUE_565 << 3) |
@ -252,7 +249,7 @@ static const Mach64AccelReg mach64AccelReg[] = {
(0 << 25) | /* DP_CONVERSION_TEMP */
(0 << 26) | /* DP_C14_RGB_LOW_NIBBLE */
(0 << 27) | /* DP_C14_RGB_HIGH_NIBBLE */
(PIX_FORMAT_TRUE_8888 << 28) | /* DP_SCALE_PIX_WIDTH */
(PIX_FORMAT_PSEUDO_8 << 28) | /* DP_SCALE_PIX_WIDTH */
0),
/* DP_SET_GUI_ENGINE */
((PIX_FORMAT_PSEUDO_8 << 3) |
@ -353,6 +350,7 @@ mach64Setup (PixmapPtr pDst, PixmapPtr pSrc, CARD32 combo, int wait)
CARD32 DP_SET_GUI_ENGINE;
int i;
KdCheckSync (pScreen);
for (i = 0; i < NACCELREG; i++)
if (mach64AccelReg[i].depth == pDst->drawable.depth &&
mach64AccelReg[i].bitsPerPixel == pDst->drawable.bitsPerPixel)
@ -364,9 +362,6 @@ mach64Setup (PixmapPtr pDst, PixmapPtr pSrc, CARD32 combo, int wait)
reg = mach64c->reg;
triple = (pDst->drawable.bitsPerPixel == 24);
#if SYNC_ALWAYS
mach64Screen = pScreen;
#endif
if (!reg)
return FALSE;
@ -439,7 +434,7 @@ static void
mach64DoneSolid (void)
{
#if SYNC_ALWAYS
KdCheckSync (mach64Screen);
mach64WaitIdle (reg);
#endif
}
@ -526,7 +521,7 @@ static void
mach64DoneCopy (void)
{
#if SYNC_ALWAYS
KdCheckSync (mach64Screen);
mach64WaitIdle (reg);
#endif
}

View File

@ -291,7 +291,7 @@ kaaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
return NULL;
pKaaPixmap = KaaGetPixmapPriv(pPixmap);
if (!w || !h)
pKaaPixmap->score == KAA_PIXMAP_SCORE_PINNED;
pKaaPixmap->score = KAA_PIXMAP_SCORE_PINNED;
else
pKaaPixmap->score = KAA_PIXMAP_SCORE_INIT;

View File

@ -849,6 +849,12 @@ KdCheckComposite (CARD8 op,
INT16 yDst,
CARD16 width,
CARD16 height);
void
KdCheckRasterizeTrapezoid(PicturePtr pMask,
xTrapezoid *trap,
int x_off,
int y_off);
#endif
/* kshadow.c */

View File

@ -59,6 +59,16 @@ KdCheckComposite (CARD8 op,
height);
}
void
KdCheckRasterizeTrapezoid(PicturePtr pMask,
xTrapezoid *trap,
int x_off,
int y_off)
{
KdCheckSync (pMask->pDrawable->pScreen);
fbRasterizeTrapezoid (pMask, trap, x_off, y_off);
}
void
KdPictureInitAsync (ScreenPtr pScreen)
{
@ -66,4 +76,5 @@ KdPictureInitAsync (ScreenPtr pScreen)
ps = GetPictureScreen(pScreen);
ps->Composite = KdCheckComposite;
ps->RasterizeTrapezoid = KdCheckRasterizeTrapezoid;
}