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/module.h>
 
  13 #include <linux/string.h>
 
  17 #include "atafb_utils.h"
 
  24 void atafb_mfb_copyarea(struct fb_info *info, u_long next_line,
 
  25                         int sy, int sx, int dy, int dx,
 
  26                         int height, int width)
 
  31         if (sx == 0 && dx == 0 && width == next_line) {
 
  32                 src = (u8 *)info->screen_base + sy * (width >> 3);
 
  33                 dest = (u8 *)info->screen_base + dy * (width >> 3);
 
  34                 fb_memmove(dest, src, height * (width >> 3));
 
  35         } else if (dy <= sy) {
 
  36                 src = (u8 *)info->screen_base + sy * next_line + (sx >> 3);
 
  37                 dest = (u8 *)info->screen_base + dy * next_line + (dx >> 3);
 
  38                 for (rows = height; rows--;) {
 
  39                         fb_memmove(dest, src, width >> 3);
 
  44                 src = (u8 *)info->screen_base + (sy + height - 1) * next_line + (sx >> 3);
 
  45                 dest = (u8 *)info->screen_base + (dy + height - 1) * next_line + (dx >> 3);
 
  46                 for (rows = height; rows--;) {
 
  47                         fb_memmove(dest, src, width >> 3);
 
  54 void atafb_mfb_fillrect(struct fb_info *info, u_long next_line, u32 color,
 
  55                         int sy, int sx, int height, int width)
 
  60         dest = (u8 *)info->screen_base + sy * next_line + (sx >> 3);
 
  62         if (sx == 0 && width == next_line) {
 
  64                         fb_memset255(dest, height * (width >> 3));
 
  66                         fb_memclear(dest, height * (width >> 3));
 
  68                 for (rows = height; rows--; dest += next_line) {
 
  70                                 fb_memset255(dest, width >> 3);
 
  72                                 fb_memclear_small(dest, width >> 3);
 
  77 void atafb_mfb_linefill(struct fb_info *info, u_long next_line,
 
  78                         int dy, int dx, u32 width,
 
  79                         const u8 *data, u32 bgcolor, u32 fgcolor)
 
  84         dest = (u8 *)info->screen_base + dy * next_line + (dx >> 3);
 
  86         for (rows = width / 8; rows--; /* check margins */ ) {
 
  87                 // use fast_memmove or fb_memmove
 
  93 MODULE_LICENSE("GPL");
 
 100 void cleanup_module(void)
 
 107      *  Visible symbols for modules
 
 110 EXPORT_SYMBOL(atafb_mfb_copyarea);
 
 111 EXPORT_SYMBOL(atafb_mfb_fillrect);
 
 112 EXPORT_SYMBOL(atafb_mfb_linefill);