Commit 0fe6e2d2 authored by Al Viro's avatar Al Viro Committed by Dave Airlie

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent d384ea69
...@@ -237,7 +237,7 @@ struct intelfb_info { ...@@ -237,7 +237,7 @@ struct intelfb_info {
u32 fb_start; u32 fb_start;
/* ring buffer */ /* ring buffer */
u8 __iomem *ring_head; u32 ring_head;
u32 ring_tail; u32 ring_tail;
u32 ring_tail_mask; u32 ring_tail_mask;
u32 ring_space; u32 ring_space;
......
...@@ -707,7 +707,7 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -707,7 +707,7 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
+ (dinfo->ring.offset << 12); + (dinfo->ring.offset << 12);
dinfo->ring.virtual = dinfo->aperture.virtual dinfo->ring.virtual = dinfo->aperture.virtual
+ (dinfo->ring.offset << 12); + (dinfo->ring.offset << 12);
dinfo->ring_head = dinfo->ring.virtual; dinfo->ring_head = 0;
} }
if (dinfo->hwcursor) { if (dinfo->hwcursor) {
agp_memtype = dinfo->mobile ? AGP_PHYSICAL_MEMORY 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,18 +766,18 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
if (mtrr) if (mtrr)
set_mtrr(dinfo); set_mtrr(dinfo);
DBG_MSG("fb: 0x%x(+ 0x%x)/0x%x (0x%x)\n", DBG_MSG("fb: 0x%x(+ 0x%x)/0x%x (0x%p)\n",
dinfo->fb.physical, dinfo->fb.offset, dinfo->fb.size, dinfo->fb.physical, dinfo->fb.offset, dinfo->fb.size,
(u32 __iomem ) dinfo->fb.virtual); dinfo->fb.virtual);
DBG_MSG("MMIO: 0x%x/0x%x (0x%x)\n", DBG_MSG("MMIO: 0x%x/0x%x (0x%p)\n",
dinfo->mmio_base_phys, INTEL_REG_SIZE, dinfo->mmio_base_phys, INTEL_REG_SIZE,
(u32 __iomem) dinfo->mmio_base); dinfo->mmio_base);
DBG_MSG("ring buffer: 0x%x/0x%x (0x%x)\n", DBG_MSG("ring buffer: 0x%x/0x%x (0x%p)\n",
dinfo->ring.physical, dinfo->ring.size, dinfo->ring.physical, dinfo->ring.size,
(u32 __iomem ) dinfo->ring.virtual); dinfo->ring.virtual);
DBG_MSG("HW cursor: 0x%x/0x%x (0x%x) (offset 0x%x) (phys 0x%x)\n", DBG_MSG("HW cursor: 0x%x/0x%x (0x%p) (offset 0x%x) (phys 0x%x)\n",
dinfo->cursor.physical, dinfo->cursor.size, dinfo->cursor.physical, dinfo->cursor.size,
(u32 __iomem ) dinfo->cursor.virtual, dinfo->cursor.offset, dinfo->cursor.virtual, dinfo->cursor.offset,
dinfo->cursor.physical); dinfo->cursor.physical);
DBG_MSG("options: vram = %d, accel = %d, hwcursor = %d, fixed = %d, " DBG_MSG("options: vram = %d, accel = %d, hwcursor = %d, fixed = %d, "
......
...@@ -1423,19 +1423,17 @@ wait_ring(struct intelfb_info *dinfo, int n) ...@@ -1423,19 +1423,17 @@ wait_ring(struct intelfb_info *dinfo, int n)
end = jiffies + (HZ * 3); end = jiffies + (HZ * 3);
while (dinfo->ring_space < n) { while (dinfo->ring_space < n) {
dinfo->ring_head = (u8 __iomem *)(INREG(PRI_RING_HEAD) & dinfo->ring_head = INREG(PRI_RING_HEAD) & RING_HEAD_MASK;
RING_HEAD_MASK); if (dinfo->ring_tail + RING_MIN_FREE < dinfo->ring_head)
if (dinfo->ring_tail + RING_MIN_FREE < dinfo->ring_space = dinfo->ring_head
(u32 __iomem) dinfo->ring_head)
dinfo->ring_space = (u32 __iomem) dinfo->ring_head
- (dinfo->ring_tail + RING_MIN_FREE); - (dinfo->ring_tail + RING_MIN_FREE);
else else
dinfo->ring_space = (dinfo->ring.size + dinfo->ring_space = (dinfo->ring.size +
(u32 __iomem) dinfo->ring_head) dinfo->ring_head)
- (dinfo->ring_tail + RING_MIN_FREE); - (dinfo->ring_tail + RING_MIN_FREE);
if ((u32 __iomem) dinfo->ring_head != last_head) { if (dinfo->ring_head != last_head) {
end = jiffies + (HZ * 3); end = jiffies + (HZ * 3);
last_head = (u32 __iomem) dinfo->ring_head; last_head = dinfo->ring_head;
} }
i++; i++;
if (time_before(end, jiffies)) { if (time_before(end, jiffies)) {
...@@ -1495,15 +1493,13 @@ refresh_ring(struct intelfb_info *dinfo) ...@@ -1495,15 +1493,13 @@ refresh_ring(struct intelfb_info *dinfo)
DBG_MSG("refresh_ring\n"); DBG_MSG("refresh_ring\n");
#endif #endif
dinfo->ring_head = (u8 __iomem *) (INREG(PRI_RING_HEAD) & dinfo->ring_head = INREG(PRI_RING_HEAD) & RING_HEAD_MASK;
RING_HEAD_MASK);
dinfo->ring_tail = INREG(PRI_RING_TAIL) & RING_TAIL_MASK; dinfo->ring_tail = INREG(PRI_RING_TAIL) & RING_TAIL_MASK;
if (dinfo->ring_tail + RING_MIN_FREE < (u32 __iomem)dinfo->ring_head) if (dinfo->ring_tail + RING_MIN_FREE < dinfo->ring_head)
dinfo->ring_space = (u32 __iomem) dinfo->ring_head dinfo->ring_space = dinfo->ring_head
- (dinfo->ring_tail + RING_MIN_FREE); - (dinfo->ring_tail + RING_MIN_FREE);
else else
dinfo->ring_space = (dinfo->ring.size + dinfo->ring_space = (dinfo->ring.size + dinfo->ring_head)
(u32 __iomem) dinfo->ring_head)
- (dinfo->ring_tail + RING_MIN_FREE); - (dinfo->ring_tail + RING_MIN_FREE);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment