diff options
Diffstat (limited to 'src/radeon_accel.c')
-rw-r--r-- | src/radeon_accel.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/radeon_accel.c b/src/radeon_accel.c index 96570e8c..d2ae2e69 100644 --- a/src/radeon_accel.c +++ b/src/radeon_accel.c @@ -472,6 +472,23 @@ void RADEONEngineInit(ScrnInfoPtr pScrn) RADEONEngineRestore(pScrn); } +/* really would be better to wait on a timestamp shadowed in memory, + * but this will do for now. + */ +Bool +RADEONWaitforIdlePoll(ScrnInfoPtr pScrn) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO = info->MMIO; + uint32_t i; + + for (i = 0; i < 1000000; i++) { + if ((INREG(RADEON_RBBM_STATUS) & RADEON_RBBM_ACTIVE) == 0) + return TRUE; + } + return FALSE; +} + #define ACCEL_MMIO #define ACCEL_PREAMBLE() unsigned char *RADEONMMIO = info->MMIO @@ -872,6 +889,8 @@ RADEONHostDataBlitCopyPass( /* RADEONHostDataBlitCopy can return NULL ! */ if( (dst==NULL) || (src==NULL)) return; + RADEONWaitforIdlePoll(pScrn); + if ( dstPitch == srcPitch ) { #if X_BYTE_ORDER == X_BIG_ENDIAN |