diff options
-rw-r--r-- | src/i830_exa.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/i830_exa.c b/src/i830_exa.c index 88853a75..0e9cd5bd 100644 --- a/src/i830_exa.c +++ b/src/i830_exa.c @@ -98,9 +98,14 @@ const int I830PatternROP[16] = }; static Bool -exaPixmapInFrontbuffer(PixmapPtr p) +exaPixmapTiled(PixmapPtr p) { ScreenPtr pScreen = p->drawable.pScreen; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + I830Ptr pI830 = I830PTR(pScrn); + + if (!pI830->tiling) + return FALSE; if (p == pScreen->GetScreenPixmap(pScreen)) return TRUE; @@ -147,7 +152,7 @@ I830EXAPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) I830FALLBACK("pixmap offset not aligned"); if ( pitch % pI830->EXADriverPtr->pixmapPitchAlign != 0) I830FALLBACK("pixmap pitch not aligned"); - if ( pI830->tiling && offset > 4096) + if ( exaPixmapTiled(pPixmap) && offset > 4096) I830FALLBACK("offset limited to 4k for tiled targets"); pI830->BR[13] = (pitch & 0xffff); @@ -186,7 +191,7 @@ I830EXASolid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2) if (pPixmap->drawable.bitsPerPixel == 32) cmd |= XY_COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB; - if (pI830->tiling && exaPixmapInFrontbuffer(pPixmap)) { + if (exaPixmapTiled(pPixmap)) { /* Fixup pitch for destination if tiled */ pI830->BR[13] = (ROUND_TO(pI830->BR[13] & 0xffff, 512) >> 2) | (pI830->BR[13] & 0xffff0000); @@ -230,12 +235,11 @@ I830EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, pI830->copy_src_pitch = exaGetPixmapPitch(pSrcPixmap); pI830->copy_src_off = exaGetPixmapOffset(pSrcPixmap); - pI830->copy_src_tiled = (pI830->tiling && - exaPixmapInFrontbuffer(pSrcPixmap)); + pI830->copy_src_tiled = exaPixmapTiled(pSrcPixmap); if (pI830->copy_src_tiled && pI830->copy_src_off > 4096) I830FALLBACK("offset limited to 4k for tiled targets"); - if (pI830->tiling && exaPixmapInFrontbuffer(pDstPixmap) && + if (exaPixmapTiled(pDstPixmap) && exaGetPixmapOffset(pDstPixmap) > 4096) I830FALLBACK("offset limited to 4k for tiled targets"); @@ -278,7 +282,7 @@ I830EXACopy(PixmapPtr pDstPixmap, int src_x1, int src_y1, int dst_x1, if (pDstPixmap->drawable.bitsPerPixel == 32) cmd |= XY_SRC_COPY_BLT_WRITE_ALPHA | XY_SRC_COPY_BLT_WRITE_RGB; - if (pI830->tiling && exaPixmapInFrontbuffer(pDstPixmap)) { + if (exaPixmapTiled(pDstPixmap)) { /* Fixup pitch for destination if tiled */ pI830->BR[13] = (ROUND_TO(pI830->BR[13] & 0xffff, 512) >> 2) | (pI830->BR[13] & 0xffff0000); |