diff options
Diffstat (limited to 'src/radeon_exa_funcs.c')
-rw-r--r-- | src/radeon_exa_funcs.c | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c index 460824dd..11dde5a4 100644 --- a/src/radeon_exa_funcs.c +++ b/src/radeon_exa_funcs.c @@ -131,6 +131,22 @@ static void FUNC_NAME(Emit2DState)(ScrnInfoPtr pScrn, int op) info->reemit_current2d = FUNC_NAME(Emit2DState); } +static void +FUNC_NAME(RADEONDone2D)(PixmapPtr pPix) +{ + RINFO_FROM_SCREEN(pPix->drawable.pScreen); + ACCEL_PREAMBLE(); + + TRACE; + + info->state_2d.op = 0; + BEGIN_ACCEL(2); + OUT_ACCEL_REG(RADEON_DSTCACHE_CTLSTAT, RADEON_RB2D_DC_FLUSH_ALL); + OUT_ACCEL_REG(RADEON_WAIT_UNTIL, + RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_DMA_GUI_IDLE); + FINISH_ACCEL(); +} + static Bool FUNC_NAME(RADEONPrepareSolid)(PixmapPtr pPix, int alu, Pixel pm, Pixel fg) { @@ -185,6 +201,8 @@ FUNC_NAME(RADEONPrepareSolid)(PixmapPtr pPix, int alu, Pixel pm, Pixel fg) if (driver_priv) info->state_2d.dst_bo = driver_priv->bo; + info->accel_state->dst_pix = pPix; + FUNC_NAME(Emit2DState)(pScrn, RADEON_2D_EXA_SOLID); return TRUE; @@ -199,6 +217,14 @@ FUNC_NAME(RADEONSolid)(PixmapPtr pPix, int x1, int y1, int x2, int y2) TRACE; +#ifdef ACCEL_CP + if (info->cs && info->cs->cdw > 15 * 1024) { + FUNC_NAME(RADEONDone2D)(info->accel_state->dst_pix); + radeon_cs_flush_indirect(pScrn); + FUNC_NAME(Emit2DState)(pScrn, RADEON_2D_EXA_SOLID); + } +#endif + if (info->accel_state->vsync) FUNC_NAME(RADEONWaitForVLine)(pScrn, pPix, RADEONBiggerCrtcArea(pPix), y1, y2); @@ -208,22 +234,6 @@ FUNC_NAME(RADEONSolid)(PixmapPtr pPix, int x1, int y1, int x2, int y2) FINISH_ACCEL(); } -static void -FUNC_NAME(RADEONDone2D)(PixmapPtr pPix) -{ - RINFO_FROM_SCREEN(pPix->drawable.pScreen); - ACCEL_PREAMBLE(); - - TRACE; - - info->state_2d.op = 0; - BEGIN_ACCEL(2); - OUT_ACCEL_REG(RADEON_DSTCACHE_CTLSTAT, RADEON_RB2D_DC_FLUSH_ALL); - OUT_ACCEL_REG(RADEON_WAIT_UNTIL, - RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_DMA_GUI_IDLE); - FINISH_ACCEL(); -} - void FUNC_NAME(RADEONDoPrepareCopy)(ScrnInfoPtr pScrn, uint32_t src_pitch_offset, uint32_t dst_pitch_offset, uint32_t datatype, int rop, @@ -288,6 +298,7 @@ FUNC_NAME(RADEONPrepareCopy)(PixmapPtr pSrc, PixmapPtr pDst, info->accel_state->xdir = xdir; info->accel_state->ydir = ydir; + info->accel_state->dst_pix = pDst; if (pDst->drawable.bitsPerPixel == 24) RADEON_FALLBACK(("24bpp unsupported")); @@ -315,6 +326,14 @@ FUNC_NAME(RADEONCopy)(PixmapPtr pDst, TRACE; +#ifdef ACCEL_CP + if (info->cs && info->cs->cdw > 15 * 1024) { + FUNC_NAME(RADEONDone2D)(info->accel_state->dst_pix); + radeon_cs_flush_indirect(pScrn); + FUNC_NAME(Emit2DState)(pScrn, RADEON_2D_EXA_COPY); + } +#endif + if (info->accel_state->xdir < 0) { srcX += w - 1; dstX += w - 1; |