summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-06-05 11:56:42 -0700
committerZhenyu Wang <zhenyu.z.wang@intel.com>2008-06-12 13:49:55 +0800
commita4e8b188d469c8092d4314be96a697fb4f780276 (patch)
tree9a251d16067ed5809a81601eca01d0344072f5fa /src
parent7d267e27c152a4935ec5301d9fbbfd6eff8816d4 (diff)
Replace a couple of wait-for-ring-idles with a single function to do so.
(cherry picked from commit 7e51384c973a96366b02ea646392c43574674111)
Diffstat (limited to 'src')
-rw-r--r--src/i830.h8
-rw-r--r--src/i830_accel.c2
-rw-r--r--src/i830_driver.c6
-rw-r--r--src/i830_ring.h17
4 files changed, 13 insertions, 20 deletions
diff --git a/src/i830.h b/src/i830.h
index db930a06..a7cdb8c7 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -853,6 +853,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 a237374e..16092dd9 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);
@@ -3358,10 +3358,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; \