aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-06-23 01:05:39 -0400
committerDave Airlie <airlied@linux.ie>2006-06-24 03:22:17 -0400
commit0fe6e2d2928e089d16ec5ed7ba634c1d60916020 (patch)
tree00b045e1d693d2dfa5a8e89e7129592f176ae902
parentd384ea691fe4ea8c2dd5b9b8d9042eb181776f18 (diff)
intelfb delousing
ring_head is offset in card memory, not iomem pointer. Fixed, removed fuckloads of amazingly bogus casts somebody had sprinkled all over the place. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Dave Airlie <airlied@linux.ie>
-rw-r--r--drivers/video/intelfb/intelfb.h2
-rw-r--r--drivers/video/intelfb/intelfbdrv.c18
-rw-r--r--drivers/video/intelfb/intelfbhw.c24
3 files changed, 20 insertions, 24 deletions
diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h
index 469b06c29180..e290d7460e1b 100644
--- a/drivers/video/intelfb/intelfb.h
+++ b/drivers/video/intelfb/intelfb.h
@@ -237,7 +237,7 @@ struct intelfb_info {
237 u32 fb_start; 237 u32 fb_start;
238 238
239 /* ring buffer */ 239 /* ring buffer */
240 u8 __iomem *ring_head; 240 u32 ring_head;
241 u32 ring_tail; 241 u32 ring_tail;
242 u32 ring_tail_mask; 242 u32 ring_tail_mask;
243 u32 ring_space; 243 u32 ring_space;
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 076fa56be192..0a0a8b199ecc 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -707,7 +707,7 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
707 + (dinfo->ring.offset << 12); 707 + (dinfo->ring.offset << 12);
708 dinfo->ring.virtual = dinfo->aperture.virtual 708 dinfo->ring.virtual = dinfo->aperture.virtual
709 + (dinfo->ring.offset << 12); 709 + (dinfo->ring.offset << 12);
710 dinfo->ring_head = dinfo->ring.virtual; 710 dinfo->ring_head = 0;
711 } 711 }
712 if (dinfo->hwcursor) { 712 if (dinfo->hwcursor) {
713 agp_memtype = dinfo->mobile ? AGP_PHYSICAL_MEMORY 713 agp_memtype = dinfo->mobile ? AGP_PHYSICAL_MEMORY
@@ -766,18 +766,18 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
766 if (mtrr) 766 if (mtrr)
767 set_mtrr(dinfo); 767 set_mtrr(dinfo);
768 768
769 DBG_MSG("fb: 0x%x(+ 0x%x)/0x%x (0x%x)\n", 769 DBG_MSG("fb: 0x%x(+ 0x%x)/0x%x (0x%p)\n",
770 dinfo->fb.physical, dinfo->fb.offset, dinfo->fb.size, 770 dinfo->fb.physical, dinfo->fb.offset, dinfo->fb.size,
771 (u32 __iomem ) dinfo->fb.virtual); 771 dinfo->fb.virtual);
772 DBG_MSG("MMIO: 0x%x/0x%x (0x%x)\n", 772 DBG_MSG("MMIO: 0x%x/0x%x (0x%p)\n",
773 dinfo->mmio_base_phys, INTEL_REG_SIZE, 773 dinfo->mmio_base_phys, INTEL_REG_SIZE,
774 (u32 __iomem) dinfo->mmio_base); 774 dinfo->mmio_base);
775 DBG_MSG("ring buffer: 0x%x/0x%x (0x%x)\n", 775 DBG_MSG("ring buffer: 0x%x/0x%x (0x%p)\n",
776 dinfo->ring.physical, dinfo->ring.size, 776 dinfo->ring.physical, dinfo->ring.size,
777 (u32 __iomem ) dinfo->ring.virtual); 777 dinfo->ring.virtual);
778 DBG_MSG("HW cursor: 0x%x/0x%x (0x%x) (offset 0x%x) (phys 0x%x)\n", 778 DBG_MSG("HW cursor: 0x%x/0x%x (0x%p) (offset 0x%x) (phys 0x%x)\n",
779 dinfo->cursor.physical, dinfo->cursor.size, 779 dinfo->cursor.physical, dinfo->cursor.size,
780 (u32 __iomem ) dinfo->cursor.virtual, dinfo->cursor.offset, 780 dinfo->cursor.virtual, dinfo->cursor.offset,
781 dinfo->cursor.physical); 781 dinfo->cursor.physical);
782 782
783 DBG_MSG("options: vram = %d, accel = %d, hwcursor = %d, fixed = %d, " 783 DBG_MSG("options: vram = %d, accel = %d, hwcursor = %d, fixed = %d, "
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