Commit 78494dd3 authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

fbdev: add sparse annotations in svgalib.c

Add sparse annotations and use fb_read/fb_write family to access the
framebuffer.
Signed-off-by: default avatarAntonino Daplas <adaplas@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 98a1153a
...@@ -194,7 +194,7 @@ void svga_dump_var(struct fb_var_screeninfo *var, int node) ...@@ -194,7 +194,7 @@ void svga_dump_var(struct fb_var_screeninfo *var, int node)
void svga_settile(struct fb_info *info, struct fb_tilemap *map) void svga_settile(struct fb_info *info, struct fb_tilemap *map)
{ {
const u8 *font = map->data; const u8 *font = map->data;
u8* fb = (u8 *) info->screen_base; u8 __iomem *fb = (u8 __iomem *)info->screen_base;
int i, c; int i, c;
if ((map->width != 8) || (map->height != 16) || if ((map->width != 8) || (map->height != 16) ||
...@@ -207,7 +207,8 @@ void svga_settile(struct fb_info *info, struct fb_tilemap *map) ...@@ -207,7 +207,8 @@ void svga_settile(struct fb_info *info, struct fb_tilemap *map)
fb += 2; fb += 2;
for (c = 0; c < map->length; c++) { for (c = 0; c < map->length; c++) {
for (i = 0; i < map->height; i++) { for (i = 0; i < map->height; i++) {
fb[i * 4] = font[i]; fb_writeb(font[i], fb + i * 4);
// fb[i * 4] = font[i];
} }
fb += 128; fb += 128;
font += map->height; font += map->height;
...@@ -221,8 +222,8 @@ void svga_tilecopy(struct fb_info *info, struct fb_tilearea *area) ...@@ -221,8 +222,8 @@ void svga_tilecopy(struct fb_info *info, struct fb_tilearea *area)
/* colstride is halved in this function because u16 are used */ /* colstride is halved in this function because u16 are used */
int colstride = 1 << (info->fix.type_aux & FB_AUX_TEXT_SVGA_MASK); int colstride = 1 << (info->fix.type_aux & FB_AUX_TEXT_SVGA_MASK);
int rowstride = colstride * (info->var.xres_virtual / 8); int rowstride = colstride * (info->var.xres_virtual / 8);
u16 *fb = (u16 *) info->screen_base; u16 __iomem *fb = (u16 __iomem *) info->screen_base;
u16 *src, *dst; u16 __iomem *src, *dst;
if ((area->sy > area->dy) || if ((area->sy > area->dy) ||
((area->sy == area->dy) && (area->sx > area->dx))) { ((area->sy == area->dy) && (area->sx > area->dx))) {
...@@ -239,10 +240,11 @@ void svga_tilecopy(struct fb_info *info, struct fb_tilearea *area) ...@@ -239,10 +240,11 @@ void svga_tilecopy(struct fb_info *info, struct fb_tilearea *area)
} }
for (dy = 0; dy < area->height; dy++) { for (dy = 0; dy < area->height; dy++) {
u16* src2 = src; u16 __iomem *src2 = src;
u16* dst2 = dst; u16 __iomem *dst2 = dst;
for (dx = 0; dx < area->width; dx++) { for (dx = 0; dx < area->width; dx++) {
*dst2 = *src2; fb_writew(fb_readw(src2), dst2);
// *dst2 = *src2;
src2 += colstride; src2 += colstride;
dst2 += colstride; dst2 += colstride;
} }
...@@ -258,14 +260,14 @@ void svga_tilefill(struct fb_info *info, struct fb_tilerect *rect) ...@@ -258,14 +260,14 @@ void svga_tilefill(struct fb_info *info, struct fb_tilerect *rect)
int colstride = 2 << (info->fix.type_aux & FB_AUX_TEXT_SVGA_MASK); int colstride = 2 << (info->fix.type_aux & FB_AUX_TEXT_SVGA_MASK);
int rowstride = colstride * (info->var.xres_virtual / 8); int rowstride = colstride * (info->var.xres_virtual / 8);
int attr = (0x0F & rect->bg) << 4 | (0x0F & rect->fg); int attr = (0x0F & rect->bg) << 4 | (0x0F & rect->fg);
u8 *fb = (u8 *) info->screen_base; u8 __iomem *fb = (u8 __iomem *)info->screen_base;
fb += rect->sx * colstride + rect->sy * rowstride; fb += rect->sx * colstride + rect->sy * rowstride;
for (dy = 0; dy < rect->height; dy++) { for (dy = 0; dy < rect->height; dy++) {
u8* fb2 = fb; u8 __iomem *fb2 = fb;
for (dx = 0; dx < rect->width; dx++) { for (dx = 0; dx < rect->width; dx++) {
fb2[0] = rect->index; fb_writeb(rect->index, fb2);
fb2[1] = attr; fb_writeb(attr, fb2 + 1);
fb2 += colstride; fb2 += colstride;
} }
fb += rowstride; fb += rowstride;
...@@ -279,15 +281,15 @@ void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit) ...@@ -279,15 +281,15 @@ void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit)
int colstride = 2 << (info->fix.type_aux & FB_AUX_TEXT_SVGA_MASK); int colstride = 2 << (info->fix.type_aux & FB_AUX_TEXT_SVGA_MASK);
int rowstride = colstride * (info->var.xres_virtual / 8); int rowstride = colstride * (info->var.xres_virtual / 8);
int attr = (0x0F & blit->bg) << 4 | (0x0F & blit->fg); int attr = (0x0F & blit->bg) << 4 | (0x0F & blit->fg);
u8* fb = (u8 *) info->screen_base; u8 __iomem *fb = (u8 __iomem *)info->screen_base;
fb += blit->sx * colstride + blit->sy * rowstride; fb += blit->sx * colstride + blit->sy * rowstride;
i=0; i=0;
for (dy=0; dy < blit->height; dy ++) { for (dy=0; dy < blit->height; dy ++) {
u8* fb2 = fb; u8 __iomem *fb2 = fb;
for (dx = 0; dx < blit->width; dx ++) { for (dx = 0; dx < blit->width; dx ++) {
fb2[0] = blit->indices[i]; fb_writeb(blit->indices[i], fb2);
fb2[1] = attr; fb_writeb(attr, fb2 + 1);
fb2 += colstride; fb2 += colstride;
i ++; i ++;
if (i == blit->length) return; if (i == blit->length) return;
......
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