aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/intelfb/intelfbhw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/intelfb/intelfbhw.c')
-rw-r--r--drivers/video/intelfb/intelfbhw.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index 426b7430b125..7533b3dd08ac 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -1423,19 +1423,17 @@ wait_ring(struct intelfb_info *dinfo, int n)
1423 1423
1424 end = jiffies + (HZ * 3); 1424 end = jiffies + (HZ * 3);
1425 while (dinfo->ring_space < n) { 1425 while (dinfo->ring_space < n) {
1426 dinfo->ring_head = (u8 __iomem *)(INREG(PRI_RING_HEAD) & 1426 dinfo->ring_head = INREG(PRI_RING_HEAD) & RING_HEAD_MASK;
1427 RING_HEAD_MASK); 1427 if (dinfo->ring_tail + RING_MIN_FREE < dinfo->ring_head)
1428 if (dinfo->ring_tail + RING_MIN_FREE < 1428 dinfo->ring_space = dinfo->ring_head
1429 (u32 __iomem) dinfo->ring_head)
1430 dinfo->ring_space = (u32 __iomem) dinfo->ring_head
1431 - (dinfo->ring_tail + RING_MIN_FREE); 1429 - (dinfo->ring_tail + RING_MIN_FREE);
1432 else 1430 else
1433 dinfo->ring_space = (dinfo->ring.size + 1431 dinfo->ring_space = (dinfo->ring.size +
1434 (u32 __iomem) dinfo->ring_head) 1432 dinfo->ring_head)
1435 - (dinfo->ring_tail + RING_MIN_FREE); 1433 - (dinfo->ring_tail + RING_MIN_FREE);
1436 if ((u32 __iomem) dinfo->ring_head != last_head) { 1434 if (dinfo->ring_head != last_head) {
1437 end = jiffies + (HZ * 3); 1435 end = jiffies + (HZ * 3);
1438 last_head = (u32 __iomem) dinfo->ring_head; 1436 last_head = dinfo->ring_head;
1439 } 1437 }
1440 i++; 1438 i++;
1441 if (time_before(end, jiffies)) { 1439 if (time_before(end, jiffies)) {
@@ -1495,15 +1493,13 @@ refresh_ring(struct intelfb_info *dinfo)
1495 DBG_MSG("refresh_ring\n"); 1493 DBG_MSG("refresh_ring\n");
1496#endif 1494#endif
1497 1495
1498 dinfo->ring_head = (u8 __iomem *) (INREG(PRI_RING_HEAD) & 1496 dinfo->ring_head = INREG(PRI_RING_HEAD) & RING_HEAD_MASK;
1499 RING_HEAD_MASK);
1500 dinfo->ring_tail = INREG(PRI_RING_TAIL) & RING_TAIL_MASK; 1497 dinfo->ring_tail = INREG(PRI_RING_TAIL) & RING_TAIL_MASK;
1501 if (dinfo->ring_tail + RING_MIN_FREE < (u32 __iomem)dinfo->ring_head) 1498 if (dinfo->ring_tail + RING_MIN_FREE < dinfo->ring_head)
1502 dinfo->ring_space = (u32 __iomem) dinfo->ring_head 1499 dinfo->ring_space = dinfo->ring_head
1503 - (dinfo->ring_tail + RING_MIN_FREE); 1500 - (dinfo->ring_tail + RING_MIN_FREE);
1504 else 1501 else
1505 dinfo->ring_space = (dinfo->ring.size + 1502 dinfo->ring_space = (dinfo->ring.size + dinfo->ring_head)
1506 (u32 __iomem) dinfo->ring_head)
1507 - (dinfo->ring_tail + RING_MIN_FREE); 1503 - (dinfo->ring_tail + RING_MIN_FREE);
1508} 1504}
1509 1505