Commit 9fb56675 authored by Antonino Daplas's avatar Antonino Daplas Committed by Linus Torvalds

[PATCH] fbdev: Add __iomem annotations to intelfb

- Add __iomem annotations to intelfb
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 64225ac4
...@@ -205,7 +205,7 @@ struct intelfb_hwstate { ...@@ -205,7 +205,7 @@ struct intelfb_hwstate {
struct intelfb_heap_data { struct intelfb_heap_data {
u32 physical; u32 physical;
u32 virtual; u32 __iomem *virtual;
u32 offset; // in GATT pages u32 offset; // in GATT pages
u32 size; // in bytes u32 size; // in bytes
}; };
...@@ -234,13 +234,13 @@ struct intelfb_info { ...@@ -234,13 +234,13 @@ struct intelfb_info {
/* mmio regs */ /* mmio regs */
u32 mmio_base_phys; u32 mmio_base_phys;
u32 mmio_base; u32 __iomem *mmio_base;
/* fb start offset (in bytes) */ /* fb start offset (in bytes) */
u32 fb_start; u32 fb_start;
/* ring buffer */ /* ring buffer */
u32 ring_head; u32 __iomem *ring_head;
u32 ring_tail; u32 ring_tail;
u32 ring_tail_mask; u32 ring_tail_mask;
u32 ring_space; u32 ring_space;
......
...@@ -410,9 +410,9 @@ cleanup(struct intelfb_info *dinfo) ...@@ -410,9 +410,9 @@ cleanup(struct intelfb_info *dinfo)
} }
if (dinfo->mmio_base) if (dinfo->mmio_base)
iounmap((void *)dinfo->mmio_base); iounmap((void __iomem *)dinfo->mmio_base);
if (dinfo->aperture.virtual) if (dinfo->aperture.virtual)
iounmap((void *)dinfo->aperture.virtual); iounmap((void __iomem *)dinfo->aperture.virtual);
if (dinfo->mmio_base_phys) if (dinfo->mmio_base_phys)
release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE); release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE);
...@@ -510,14 +510,15 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -510,14 +510,15 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
/* Map the fb and MMIO regions */ /* Map the fb and MMIO regions */
dinfo->aperture.virtual = (u32)ioremap_nocache dinfo->aperture.virtual = (u32 __iomem *)ioremap_nocache
(dinfo->aperture.physical, dinfo->aperture.size); (dinfo->aperture.physical, dinfo->aperture.size);
if (!dinfo->aperture.virtual) { if (!dinfo->aperture.virtual) {
ERR_MSG("Cannot remap FB region.\n"); ERR_MSG("Cannot remap FB region.\n");
cleanup(dinfo); cleanup(dinfo);
return -ENODEV; return -ENODEV;
} }
dinfo->mmio_base = (u32)ioremap_nocache(dinfo->mmio_base_phys, dinfo->mmio_base =
(u32 __iomem *)ioremap_nocache(dinfo->mmio_base_phys,
INTEL_REG_SIZE); INTEL_REG_SIZE);
if (!dinfo->mmio_base) { if (!dinfo->mmio_base) {
ERR_MSG("Cannot remap MMIO region.\n"); ERR_MSG("Cannot remap MMIO region.\n");
...@@ -656,14 +657,16 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -656,14 +657,16 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
DBG_MSG("fb: 0x%x(+ 0x%x)/0x%x (0x%x)\n", DBG_MSG("fb: 0x%x(+ 0x%x)/0x%x (0x%x)\n",
dinfo->fb.physical, dinfo->fb.offset, dinfo->fb.size, dinfo->fb.physical, dinfo->fb.offset, dinfo->fb.size,
dinfo->fb.virtual); (u32 __iomem ) dinfo->fb.virtual);
DBG_MSG("MMIO: 0x%x/0x%x (0x%x)\n", DBG_MSG("MMIO: 0x%x/0x%x (0x%x)\n",
dinfo->mmio_base_phys, INTEL_REG_SIZE, dinfo->mmio_base); dinfo->mmio_base_phys, INTEL_REG_SIZE,
(u32 __iomem) dinfo->mmio_base);
DBG_MSG("ring buffer: 0x%x/0x%x (0x%x)\n", DBG_MSG("ring buffer: 0x%x/0x%x (0x%x)\n",
dinfo->ring.physical, dinfo->ring.size, dinfo->ring.virtual); dinfo->ring.physical, dinfo->ring.size,
(u32 __iomem ) 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%x) (offset 0x%x) (phys 0x%x)\n",
dinfo->cursor.physical, dinfo->cursor.size, dinfo->cursor.physical, dinfo->cursor.size,
dinfo->cursor.virtual, dinfo->cursor.offset, (u32 __iomem ) dinfo->cursor.virtual, dinfo->cursor.offset,
dinfo->cursor.physical); dinfo->cursor.physical);
DBG_MSG("options: accel = %d, hwcursor = %d, fixed = %d, " DBG_MSG("options: accel = %d, hwcursor = %d, fixed = %d, "
...@@ -1159,7 +1162,7 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var) ...@@ -1159,7 +1162,7 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var)
if (FIXED_MODE(dinfo)) if (FIXED_MODE(dinfo))
dinfo->pitch = dinfo->initial_pitch; dinfo->pitch = dinfo->initial_pitch;
dinfo->info->screen_base = (char *)dinfo->fb.virtual; dinfo->info->screen_base = (char __iomem *)dinfo->fb.virtual;
dinfo->info->fix.line_length = dinfo->pitch; dinfo->info->fix.line_length = dinfo->pitch;
dinfo->info->fix.visual = dinfo->visual; dinfo->info->fix.visual = dinfo->visual;
} }
......
...@@ -1240,17 +1240,19 @@ wait_ring(struct intelfb_info *dinfo, int n) ...@@ -1240,17 +1240,19 @@ 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 = INREG(PRI_RING_HEAD) & RING_HEAD_MASK; dinfo->ring_head = (u32 __iomem *)(INREG(PRI_RING_HEAD) &
if (dinfo->ring_tail + RING_MIN_FREE < dinfo->ring_head) RING_HEAD_MASK);
dinfo->ring_space = dinfo->ring_head if (dinfo->ring_tail + RING_MIN_FREE <
(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 +
dinfo->ring_head) (u32 __iomem) dinfo->ring_head)
- (dinfo->ring_tail + RING_MIN_FREE); - (dinfo->ring_tail + RING_MIN_FREE);
if (dinfo->ring_head != last_head) { if ((u32 __iomem) dinfo->ring_head != last_head) {
end = jiffies + (HZ * 3); end = jiffies + (HZ * 3);
last_head = dinfo->ring_head; last_head = (u32 __iomem) dinfo->ring_head;
} }
i++; i++;
if (time_before(end, jiffies)) { if (time_before(end, jiffies)) {
...@@ -1310,13 +1312,15 @@ refresh_ring(struct intelfb_info *dinfo) ...@@ -1310,13 +1312,15 @@ refresh_ring(struct intelfb_info *dinfo)
DBG_MSG("refresh_ring\n"); DBG_MSG("refresh_ring\n");
#endif #endif
dinfo->ring_head = INREG(PRI_RING_HEAD) & RING_HEAD_MASK; dinfo->ring_head = (u32 __iomem *) (INREG(PRI_RING_HEAD) &
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 < dinfo->ring_head) if (dinfo->ring_tail + RING_MIN_FREE < (u32 __iomem)dinfo->ring_head)
dinfo->ring_space = 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_head) dinfo->ring_space = (dinfo->ring.size +
(u32 __iomem) dinfo->ring_head)
- (dinfo->ring_tail + RING_MIN_FREE); - (dinfo->ring_tail + RING_MIN_FREE);
} }
...@@ -1701,7 +1705,7 @@ void ...@@ -1701,7 +1705,7 @@ void
intelfbhw_cursor_load(struct intelfb_info *dinfo, int width, int height, intelfbhw_cursor_load(struct intelfb_info *dinfo, int width, int height,
u8 *data) u8 *data)
{ {
u8 *addr = (u8 *)dinfo->cursor.virtual; u8 __iomem *addr = (u8 __iomem *)dinfo->cursor.virtual;
int i, j, w = width / 8; int i, j, w = width / 8;
int mod = width % 8, t_mask, d_mask; int mod = width % 8, t_mask, d_mask;
...@@ -1729,7 +1733,7 @@ intelfbhw_cursor_load(struct intelfb_info *dinfo, int width, int height, ...@@ -1729,7 +1733,7 @@ intelfbhw_cursor_load(struct intelfb_info *dinfo, int width, int height,
void void
intelfbhw_cursor_reset(struct intelfb_info *dinfo) { intelfbhw_cursor_reset(struct intelfb_info *dinfo) {
u8 *addr = (u8 *)dinfo->cursor.virtual; u8 __iomem *addr = (u8 __iomem *)dinfo->cursor.virtual;
int i, j; int i, j;
#if VERBOSE > 0 #if VERBOSE > 0
......
...@@ -484,14 +484,16 @@ ...@@ -484,14 +484,16 @@
/*** Macros ***/ /*** Macros ***/
/* I/O macros */ /* I/O macros */
#define INREG8(addr) readb((u8 *)(dinfo->mmio_base + (addr))) #define INREG8(addr) readb((u8 __iomem *)(dinfo->mmio_base + (addr)))
#define INREG(addr) readl((u32 *)(dinfo->mmio_base + (addr))) #define INREG(addr) readl((u32 __iomem *)(dinfo->mmio_base + (addr)))
#define OUTREG8(addr, val) writeb((val), (u8 *)(dinfo->mmio_base + (addr))) #define OUTREG8(addr, val) writeb((val),(u8 __iomem *)(dinfo->mmio_base + \
#define OUTREG(addr, val) writel((val), (u32 *)(dinfo->mmio_base + (addr))) (addr)))
#define OUTREG(addr, val) writel((val),(u32 __iomem *)(dinfo->mmio_base + \
(addr)))
/* Ring buffer macros */ /* Ring buffer macros */
#define OUT_RING(n) do { \ #define OUT_RING(n) do { \
writel((n), (u32 *)(dinfo->ring.virtual + dinfo->ring_tail)); \ writel((n), (u32 __iomem *)(dinfo->ring.virtual + dinfo->ring_tail));\
dinfo->ring_tail += 4; \ dinfo->ring_tail += 4; \
dinfo->ring_tail &= dinfo->ring_tail_mask; \ dinfo->ring_tail &= dinfo->ring_tail_mask; \
} while (0) } while (0)
......
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