13 #include <linux/module.h>
14 #include <linux/string.h>
17 #include <asm/setup.h>
25 int sy,
int sx,
int dy,
int dx,
44 u_int upwards = (dy < sy) || (dy == sy && dx < sx);
47 if (!((sx ^ dx) & 15)) {
54 memmove32_col(dst, src, 0xff00ff, height, next_line -
BPL * 2);
64 l = next_line - w * 4;
65 for (j = height; j > 0; j--) {
66 for (i = w; i > 0; i--)
73 memmove32_col(dst + width / (8 /
BPL), src + width / (8 /
BPL),
74 0xff00ff00, height, next_line -
BPL * 2);
76 src = (
u8 *)info->
screen_base + (sy - 1) * next_line + ((sx + width + 8) & ~15) / (8 /
BPL);
77 dst = (
u8 *)info->
screen_base + (dy - 1) * next_line + ((dx + width + 8) & ~15) / (8 /
BPL);
79 if ((sx + width) & 15) {
82 memmove32_col(dst, src, 0xff00ff00, colsize, -next_line -
BPL * 2);
90 l = next_line - w * 4;
91 for (j = height; j > 0; j--) {
92 for (i = w; i > 0; i--)
99 memmove32_col(dst - (width - 16) / (8 /
BPL),
100 src - (width - 16) / (8 /
BPL),
101 0xff00ff, colsize, -next_line -
BPL * 2);
120 if ((sx + width) & 15)
123 for (i = height;
i; i--) {
128 pval[0] = (*src32++ << 8) & mask;
129 pval[1] = (*src32++ << 8) & mask;
131 pval[0] = dst32[0] &
mask;
132 pval[1] = dst32[1] &
mask;
135 for (j = w; j > 0; j--) {
138 *dst32++ = pval[0] | (v1 >> 8);
139 pval[0] = (v ^
v1) << 8;
142 *dst32++ = pval[1] | (v1 >> 8);
143 pval[1] = (v ^
v1) << 8;
147 dst32[0] = (dst32[0] &
mask) | pval[0];
148 dst32[1] = (dst32[1] &
mask) | pval[1];
159 src = (
u8 *)info->
screen_base + (sy - 1) * next_line + ((sx + width + 8) & ~15) / (8 /
BPL);
160 dst = (
u8 *)info->
screen_base + (dy - 1) * next_line + ((dx + width + 8) & ~15) / (8 /
BPL);
165 if ((dx + width) & 15)
172 for (i = height;
i; i--) {
177 pval[0] = dst32[-1] &
mask;
178 pval[1] = dst32[-2] &
mask;
180 pval[0] = (*--src32 >> 8) & mask;
181 pval[1] = (*--src32 >> 8) & mask;
184 for (j = w; j > 0; j--) {
187 *--dst32 = pval[0] | (v1 << 8);
188 pval[0] = (v ^
v1) >> 8;
191 *--dst32 = pval[1] | (v1 << 8);
192 pval[1] = (v ^
v1) >> 8;
196 dst32[-1] = (dst32[-1] &
mask) | pval[0];
197 dst32[-2] = (dst32[-2] &
mask) | pval[1];
216 u8 *dest8 = (
u8 *)dest + 1;
218 expand8_col2mask(color, cval);
220 for (i = height;
i; i--) {
221 fill8_col(dest8, cval);
228 expand16_col2mask(color, cval);
232 u32 off = next_line - rows *
BPL * 2;
233 for (i = height;
i; i--) {
234 d = fill16_col(d, rows, cval);
235 d = (
u32 *)((
long)d + off);
237 dest += rows * BPL / 2;
242 u8 *dest8 = (
u8 *)dest;
244 expand8_col2mask(color, cval);
246 for (i = height;
i; i--) {
247 fill8_col(dest8, cval);
260 u32 fgm[4], bgm[4],
m;
264 fill8_2col((
u8 *)dest + 1, fgcolor, bgcolor, *data++);
270 data16 = (
const u16 *)data;
271 expand16_2col2mask(fgcolor, bgcolor, fgm, bgm);
273 for (rows = width / 16;
rows; rows--) {
275 m = d | ((
u32)d << 16);
276 *dest++ = (m & fgm[0]) ^ bgm[0];
277 *dest++ = (m & fgm[1]) ^ bgm[1];
280 data = (
const u8 *)data16;
285 fill8_2col((
u8 *)dest, fgcolor, bgcolor, *data);