summaryrefslogtreecommitdiff
path: root/src/radeon_exa.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-02-10 17:08:37 -0500
committerAlex Deucher <alexdeucher@gmail.com>2009-02-10 17:08:37 -0500
commit0c4694c58f2ec152b19023626bc7ced891d9da65 (patch)
treeb228880177fddc61ebb80c14cffaa7f11ebc1473 /src/radeon_exa.c
parent13ab61d90bb58112bef4ce7267ef127935315f80 (diff)
Radeon EXA: wait for the engine to be idle before sw access
Really we need proper fencing with timestamps but this should help in the short term. This should help with minor corruption issues and possibly lockups.
Diffstat (limited to 'src/radeon_exa.c')
-rw-r--r--src/radeon_exa.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index c4bc1bb1..ebe65d1d 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -220,17 +220,22 @@ int RADEONBiggerCrtcArea(PixmapPtr pPix)
}
#if X_BYTE_ORDER == X_BIG_ENDIAN
-
static unsigned long swapper_surfaces[3];
+#endif /* X_BYTE_ORDER == X_BIG_ENDIAN */
static Bool RADEONPrepareAccess(PixmapPtr pPix, int index)
{
RINFO_FROM_SCREEN(pPix->drawable.pScreen);
+#if X_BYTE_ORDER == X_BIG_ENDIAN
unsigned char *RADEONMMIO = info->MMIO;
uint32_t offset = exaGetPixmapOffset(pPix);
int bpp, soff;
uint32_t size, flags;
+#endif /* X_BYTE_ORDER == X_BIG_ENDIAN */
+
+ RADEONWaitforIdlePoll(pScrn);
+#if X_BYTE_ORDER == X_BIG_ENDIAN
/* Front buffer is always set with proper swappers */
if (offset == 0)
return TRUE;
@@ -286,11 +291,13 @@ static Bool RADEONPrepareAccess(PixmapPtr pPix, int index)
OUTREG(RADEON_SURFACE0_LOWER_BOUND + soff, offset);
OUTREG(RADEON_SURFACE0_UPPER_BOUND + soff, offset + size - 1);
swapper_surfaces[index] = offset;
+#endif /* X_BYTE_ORDER == X_BIG_ENDIAN */
return TRUE;
}
static void RADEONFinishAccess(PixmapPtr pPix, int index)
{
+#if X_BYTE_ORDER == X_BIG_ENDIAN
RINFO_FROM_SCREEN(pPix->drawable.pScreen);
unsigned char *RADEONMMIO = info->MMIO;
uint32_t offset = exaGetPixmapOffset(pPix);
@@ -318,9 +325,9 @@ static void RADEONFinishAccess(PixmapPtr pPix, int index)
OUTREG(RADEON_SURFACE0_LOWER_BOUND + soff, 0);
OUTREG(RADEON_SURFACE0_UPPER_BOUND + soff, 0);
swapper_surfaces[index] = 0;
+#endif /* X_BYTE_ORDER == X_BIG_ENDIAN */
}
-#endif /* X_BYTE_ORDER == X_BIG_ENDIAN */
#define ENTER_DRAW(x) TRACE
#define LEAVE_DRAW(x) TRACE