diff options
author | Eric Anholt <eric@anholt.net> | 2008-06-05 11:56:42 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-06-05 11:56:42 -0700 |
commit | 7e51384c973a96366b02ea646392c43574674111 (patch) | |
tree | 7ab205b605e35fa88902162431f16266f82dceae /src | |
parent | 65306cdd71dad71e4ca7229764f81a0880dd70bf (diff) |
Replace a couple of wait-for-ring-idles with a single function to do so.
Diffstat (limited to 'src')
-rw-r--r-- | src/i830.h | 8 | ||||
-rw-r--r-- | src/i830_accel.c | 2 | ||||
-rw-r--r-- | src/i830_driver.c | 6 | ||||
-rw-r--r-- | src/i830_ring.h | 17 |
4 files changed, 13 insertions, 20 deletions
@@ -859,6 +859,14 @@ i830_get_transformed_coordinates_3d(int x, int y, PictTransformPtr transform, void i830_enter_render(ScrnInfoPtr); +static inline void +i830_wait_ring_idle(ScrnInfoPtr pScrn) +{ + I830Ptr pI830 = I830PTR(pScrn); + + I830WaitLpRing(pScrn, pI830->LpRing->mem->size - 8, 0); +} + static inline int i830_fb_compression_supported(I830Ptr pI830) { if (!IS_MOBILE(pI830)) diff --git a/src/i830_accel.c b/src/i830_accel.c index 953a73bc..7784c62a 100644 --- a/src/i830_accel.c +++ b/src/i830_accel.c @@ -201,7 +201,7 @@ I830Sync(ScrnInfoPtr pScrn) ADVANCE_BATCH(); } - I830WaitLpRing(pScrn, pI830->LpRing->mem->size - 8, 0); + i830_wait_ring_idle(pScrn); pI830->LpRing->space = pI830->LpRing->mem->size - 8; pI830->nextColorExpandBuf = 0; diff --git a/src/i830_driver.c b/src/i830_driver.c index 49f8db9d..5af3153a 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -1851,7 +1851,7 @@ i830_stop_ring(ScrnInfoPtr pScrn, Bool flush) if (temp & RING_VALID) { i830_refresh_ring(pScrn); I830Sync(pScrn); - DO_RING_IDLE(); + i830_wait_ring_idle(pScrn); } OUTREG(LP_RING + RING_LEN, 0); @@ -3416,10 +3416,10 @@ I830EnterVT(int scrnIndex, int flags) int i; I830DRIResume(screenInfo.screens[scrnIndex]); - + i830_refresh_ring(pScrn); I830Sync(pScrn); - DO_RING_IDLE(); + i830_wait_ring_idle(pScrn); sarea->texAge++; for(i = 0; i < I830_NR_TEX_REGIONS+1 ; i++) diff --git a/src/i830_ring.h b/src/i830_ring.h index cf789eb6..c2078fb4 100644 --- a/src/i830_ring.h +++ b/src/i830_ring.h @@ -75,28 +75,13 @@ union intfloat { pI830->ring_emitting = 0; \ } while (0) -/* - * XXX Note: the head/tail masks are different for 810 and i830. - * If the i810 always sets the higher bits to 0, then this shouldn't be - * a problem. Check this! - */ -#define DO_RING_IDLE() do { \ - int _head; \ - int _tail; \ - do { \ - _head = INREG(LP_RING + RING_HEAD) & I830_HEAD_MASK; \ - _tail = INREG(LP_RING + RING_TAIL) & I830_TAIL_MASK; \ - DELAY(10); \ - } while (_head != _tail); \ -} while (0) - #define BEGIN_LP_RING(n) \ do { \ if (pI830->ring_emitting != 0) \ FatalError("%s: BEGIN_LP_RING called without closing " \ "ADVANCE_LP_RING\n", __FUNCTION__); \ if ((n) > 2 && (I810_DEBUG&DEBUG_ALWAYS_SYNC)) \ - DO_RING_IDLE(); \ + i830_wait_ring_idle(pScrn); \ pI830->ring_emitting = (n) * 4; \ if ((n) & 1) \ pI830->ring_emitting += 4; \ |