31 #include <linux/module.h>
32 #include <linux/kernel.h>
35 #include <linux/types.h>
41 static const u8 sisALUConv[] =
61 static const u8 sisPatALUConv[] =
81 static const int myrops[] = {
82 3, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
86 #ifdef CONFIG_FB_SIS_300
94 SiS300SetupForScreenToScreenCopy(
struct sis_video_info *ivideo,
int xdir,
int ydir,
95 int rop,
int trans_color)
101 if(trans_color != -1) {
117 SiS300SubsequentScreenToScreenCopy(
struct sis_video_info *ivideo,
int src_x,
118 int src_y,
int dst_x,
int dst_y,
int width,
int height)
120 u32 srcbase = 0, dstbase = 0;
164 dstbase = ivideo->video_linelength *
y;
177 #ifdef CONFIG_FB_SIS_315
185 SiS310SetupForScreenToScreenCopy(
struct sis_video_info *ivideo,
int rop,
int trans_color)
190 if(trans_color != -1) {
204 SiS310SubsequentScreenToScreenCopy(
struct sis_video_info *ivideo,
int src_x,
int src_y,
205 int dst_x,
int dst_y,
int width,
int height)
207 u32 srcbase = 0, dstbase = 0;
208 int mymin =
min(src_y, dst_y);
209 int mymax =
max(src_y, dst_y);
221 if((mymax - mymin) < height) {
222 if((src_y >= 2048) || (dst_y >= 2048)) {
266 dstbase = ivideo->video_linelength *
y;
269 dstbase += ivideo->video_offset;
284 #ifdef SISFB_USE_SPINLOCKS
293 #ifdef CONFIG_FB_SIS_300
297 #ifdef CONFIG_FB_SIS_315
322 u32 vxres = info->
var.xres_virtual;
323 u32 vyres = info->
var.yres_virtual;
335 if(!rect->
width || !rect->
height || rect->
dx >= vxres || rect->
dy >= vyres)
339 width = ((rect->
dx + rect->
width) > vxres) ? (vxres - rect->
dx) : rect->
width;
340 height = ((rect->
dy + rect->
height) > vyres) ? (vyres - rect->
dy) : rect->
height;
342 switch(info->
var.bits_per_pixel) {
343 case 8: col = rect->
color;
351 #ifdef CONFIG_FB_SIS_300
353 SiS300SetupForSolidFill(ivideo, col, myrops[rect->
rop]);
354 SiS300SubsequentSolidFillRect(ivideo, rect->
dx, rect->
dy, width, height);
358 #ifdef CONFIG_FB_SIS_315
360 SiS310SetupForSolidFill(ivideo, col, myrops[rect->
rop]);
361 SiS310SubsequentSolidFillRect(ivideo, rect->
dx, rect->
dy, width, height);
372 u32 vxres = info->
var.xres_virtual;
373 u32 vyres = info->
var.yres_virtual;
374 int width = area->
width;
375 int height = area->
height;
386 if(!width || !height ||
387 area->
sx >= vxres || area->
sy >= vyres ||
388 area->
dx >= vxres || area->
dy >= vyres)
392 if((area->
sx + width) > vxres) width = vxres - area->
sx;
393 if((area->
dx + width) > vxres) width = vxres - area->
dx;
394 if((area->
sy + height) > vyres) height = vyres - area->
sy;
395 if((area->
dy + height) > vyres) height = vyres - area->
dy;
398 #ifdef CONFIG_FB_SIS_300
401 if(area->
sx < area->
dx) xdir = 0;
403 if(area->
sy < area->
dy) ydir = 0;
407 SiS300SetupForScreenToScreenCopy(ivideo, xdir, ydir, 3, -1);
408 SiS300SubsequentScreenToScreenCopy(ivideo, area->
sx, area->
sy,
409 area->
dx, area->
dy, width, height);
413 #ifdef CONFIG_FB_SIS_315
415 SiS310SetupForScreenToScreenCopy(ivideo, 3, -1);
416 SiS310SubsequentScreenToScreenCopy(ivideo, area->
sx, area->
sy,
417 area->
dx, area->
dy, width, height);