diff options
author | Egbert Eich <eich@freedesktop.org> | 2009-11-06 13:16:10 +0100 |
---|---|---|
committer | Egbert Eich <eich@freedesktop.org> | 2009-11-06 13:16:10 +0100 |
commit | f3df2394eba2926467eea98c7568544f6a821fbe (patch) | |
tree | 583303dd50bc1b348e0499381c06970ae7754393 | |
parent | af5f1e1abc11a2182705527421c30ad99b7dc60e (diff) |
Accel: Insert proper waits for 2D/3D engine idles when switching between the two contexts.
-rw-r--r-- | src/r5xx_exa.c | 8 | ||||
-rw-r--r-- | src/radeon_3d.c | 12 | ||||
-rw-r--r-- | src/radeon_textured_videofuncs.c | 3 | ||||
-rw-r--r-- | src/rhd_video.c | 4 |
4 files changed, 21 insertions, 6 deletions
diff --git a/src/r5xx_exa.c b/src/r5xx_exa.c index 36e91ad..1570ed2 100644 --- a/src/r5xx_exa.c +++ b/src/r5xx_exa.c @@ -205,7 +205,8 @@ R5xxEXASolid(PixmapPtr pPix, int x1, int y1, int x2, int y2) static void R5xxEXADoneSolid(PixmapPtr pPix) { - ; + struct RhdCS *CS = RHDPTRE(pPix->drawable.pScreen)->CS; + R5xxEngineWaitIdle2D(CS); } /* @@ -315,7 +316,8 @@ R5xxEXACopy(PixmapPtr pDst, int srcX, int srcY, int dstX, int dstY, int w, int h static void R5xxEXADoneCopy(PixmapPtr pDst) { - ; + struct RhdCS *CS = RHDPTRE(pDst->drawable.pScreen)->CS; + R5xxEngineWaitIdle2D(CS); } /* @@ -481,6 +483,7 @@ R5xxEXAUploadToScreenCP(PixmapPtr pDst, int x, int y, int w, int h, } exaMarkSync(pDst->drawable.pScreen); + R5xxEngineWaitIdle2D(CS); return TRUE; } @@ -676,6 +679,7 @@ R5xxEXADownloadFromScreenCP(PixmapPtr pSrc, int x, int y, int w, int h, /* since we had a full idle every time, we make sure we don't do yet another system call here */ ExaPrivate->exaMarkerSynced = ExaPrivate->exaSyncMarker; + R5xxEngineWaitIdle2D(CS); return TRUE; } diff --git a/src/radeon_3d.c b/src/radeon_3d.c index d70052a..4fe0790 100644 --- a/src/radeon_3d.c +++ b/src/radeon_3d.c @@ -136,16 +136,17 @@ R5xxPVSFPUCount(ScrnInfoPtr pScrn) /* * Map the macros. */ -#define ACCEL_PREAMBLE() struct RhdCS *CS = rhdPtr->CS +#define ACCEL_PREAMBLE() struct RhdCS *CS = rhdPtr->CS; \ + if (pScrn->pScreen) \ + RHDDRIContextClaim(pScrn) + #define BEGIN_ACCEL(Count) RHDCSGrab(CS, 2 * (Count)) #define OUT_ACCEL_REG(Reg, Value) RHDCSRegWrite(CS, (Reg), (Value)) #define FINISH_ACCEL() #ifdef USE_DRI -#define END_ACCEL() RHDCSAdvance(CS); \ - if (pScrn->pScreen) \ - RHDDRIContextClaim(pScrn) +#define END_ACCEL() RHDCSAdvance(CS); #else #define END_ACCEL() RHDCSAdvance(CS) #endif @@ -239,6 +240,9 @@ R5xx3DSetup(int scrnIndex) accel_state->texW[1] = 1; accel_state->texH[1] = 1; + RHDDRIContextClaim(pScrn); + + #ifdef IS_RADEON_DRIVER if (IS_R300_3D || IS_R500_3D) { #endif diff --git a/src/radeon_textured_videofuncs.c b/src/radeon_textured_videofuncs.c index b51e145..06458ea 100644 --- a/src/radeon_textured_videofuncs.c +++ b/src/radeon_textured_videofuncs.c @@ -125,6 +125,7 @@ do { \ # define ADVANCE_RING() RHDCSAdvance(CS) # define OUT_VIDEO_RING_F(x) OUT_RING(F_TO_DW(x)) +# define RADEON_SWITCH_TO_3D() R5xxEngineWaitIdle2D(rhdPtr->CS) #define VTX_DWORD_COUNT 4 @@ -244,6 +245,8 @@ FUNC_NAME(RADEONDisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv if (!accel_state->XHas3DEngineState) RADEONInit3DEngine(pScrn); + RADEON_SWITCH_TO_3D(); + /* we can probably improve this */ BEGIN_VIDEO(2); #ifdef IS_RADEON_DRIVER diff --git a/src/rhd_video.c b/src/rhd_video.c index 383f926..76ccb39 100644 --- a/src/rhd_video.c +++ b/src/rhd_video.c @@ -347,6 +347,8 @@ R5xxXvCopyPackedDMA(RHDPtr rhdPtr, CARD8 *src, CARD8 *dst, CARD16 y = 0, dwords; CARD16 hpass = ((CS->Size - 10) * 4) / srcPitch; + R5xxEngineWaitIdle3D(rhdPtr->CS); + while (h) { if (h < hpass) hpass = h; @@ -478,6 +480,8 @@ R5xxXvCopyPlanarDMA(RHDPtr rhdPtr, CARD8 *src1, CARD8 *src2, CARD8 *src3, R5XX_GMC_CLR_CMP_CNTL_DIS | R5XX_GMC_WR_MSK_DIS; CARD16 y = 0, dwords; + R5xxEngineWaitIdle3D(rhdPtr->CS); + while (h) { if (h < hpass) hpass = h; |