2 * linux/drivers/video/mfb.c -- Low level frame buffer operations for
5 * Created 5 Apr 1997 by Geert Uytterhoeven
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive for
12 #include <linux/string.h>
16 #include "atafb_utils.h"
23 void atafb_mfb_copyarea(struct fb_info *info, u_long next_line,
24 int sy, int sx, int dy, int dx,
25 int height, int width)
30 if (sx == 0 && dx == 0 && width == next_line) {
31 src = (u8 *)info->screen_base + sy * (width >> 3);
32 dest = (u8 *)info->screen_base + dy * (width >> 3);
33 fb_memmove(dest, src, height * (width >> 3));
34 } else if (dy <= sy) {
35 src = (u8 *)info->screen_base + sy * next_line + (sx >> 3);
36 dest = (u8 *)info->screen_base + dy * next_line + (dx >> 3);
37 for (rows = height; rows--;) {
38 fb_memmove(dest, src, width >> 3);
43 src = (u8 *)info->screen_base + (sy + height - 1) * next_line + (sx >> 3);
44 dest = (u8 *)info->screen_base + (dy + height - 1) * next_line + (dx >> 3);
45 for (rows = height; rows--;) {
46 fb_memmove(dest, src, width >> 3);
53 void atafb_mfb_fillrect(struct fb_info *info, u_long next_line, u32 color,
54 int sy, int sx, int height, int width)
59 dest = (u8 *)info->screen_base + sy * next_line + (sx >> 3);
61 if (sx == 0 && width == next_line) {
63 fb_memset255(dest, height * (width >> 3));
65 fb_memclear(dest, height * (width >> 3));
67 for (rows = height; rows--; dest += next_line) {
69 fb_memset255(dest, width >> 3);
71 fb_memclear_small(dest, width >> 3);
76 void atafb_mfb_linefill(struct fb_info *info, u_long next_line,
77 int dy, int dx, u32 width,
78 const u8 *data, u32 bgcolor, u32 fgcolor)
83 dest = (u8 *)info->screen_base + dy * next_line + (dx >> 3);
85 for (rows = width / 8; rows--; /* check margins */ ) {
86 // use fast_memmove or fb_memmove