|
@@ -37,27 +37,12 @@
|
|
|
#include <linux/agp_backend.h>
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
-/*
|
|
|
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
|
|
-#include <linux/XGIfb.h>
|
|
|
-#else
|
|
|
-#include <video/XGIfb.h>
|
|
|
-#endif
|
|
|
-*/
|
|
|
#include <asm/io.h>
|
|
|
|
|
|
#ifdef CONFIG_MTRR
|
|
|
#include <asm/mtrr.h>
|
|
|
#endif
|
|
|
|
|
|
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
|
|
-#include <video/fbcon.h>
|
|
|
-#include <video/fbcon-cfb8.h>
|
|
|
-#include <video/fbcon-cfb16.h>
|
|
|
-#include <video/fbcon-cfb24.h>
|
|
|
-#include <video/fbcon-cfb32.h>
|
|
|
-#endif
|
|
|
-
|
|
|
#include "osdef.h"
|
|
|
#include "vgatypes.h"
|
|
|
#include "vb_struct.h"
|
|
@@ -108,11 +93,9 @@ static const int XGIPatALUConv[] =
|
|
|
0xFF, /* dest = 0xFF; 1, GXset, 0xF */
|
|
|
};
|
|
|
|
|
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34)
|
|
|
static const unsigned char myrops[] = {
|
|
|
3, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
|
|
|
};
|
|
|
-#endif
|
|
|
|
|
|
/* 300 series */
|
|
|
#if 0
|
|
@@ -326,8 +309,6 @@ void XGIfb_syncaccel(void)
|
|
|
|
|
|
}
|
|
|
|
|
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34) /* --- KERNEL 2.5.34 and later --- */
|
|
|
-
|
|
|
int fbcon_XGI_sync(struct fb_info *info)
|
|
|
{
|
|
|
if(!XGIfb_accel) return 0;
|
|
@@ -399,198 +380,5 @@ void fbcon_XGI_copyarea(struct fb_info *info, const struct fb_copyarea *area)
|
|
|
|
|
|
}
|
|
|
|
|
|
-#endif
|
|
|
-
|
|
|
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,33) /* ------ KERNEL <2.5.34 ------ */
|
|
|
-
|
|
|
-void fbcon_XGI_bmove(struct display *p, int srcy, int srcx,
|
|
|
- int dsty, int dstx, int height, int width)
|
|
|
-{
|
|
|
- int xdir, ydir;
|
|
|
- CRITFLAGS
|
|
|
-
|
|
|
- if(!xgi_video_info.accel) {
|
|
|
- switch(xgi_video_info.video_bpp) {
|
|
|
- case 8:
|
|
|
-#ifdef FBCON_HAS_CFB8
|
|
|
- fbcon_cfb8_bmove(p, srcy, srcx, dsty, dstx, height, width);
|
|
|
-#endif
|
|
|
- break;
|
|
|
- case 16:
|
|
|
-#ifdef FBCON_HAS_CFB16
|
|
|
- fbcon_cfb16_bmove(p, srcy, srcx, dsty, dstx, height, width);
|
|
|
-#endif
|
|
|
- break;
|
|
|
- case 32:
|
|
|
-#ifdef FBCON_HAS_CFB32
|
|
|
- fbcon_cfb32_bmove(p, srcy, srcx, dsty, dstx, height, width);
|
|
|
-#endif
|
|
|
- break;
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- srcx *= fontwidth(p);
|
|
|
- srcy *= fontheight(p);
|
|
|
- dstx *= fontwidth(p);
|
|
|
- dsty *= fontheight(p);
|
|
|
- width *= fontwidth(p);
|
|
|
- height *= fontheight(p);
|
|
|
-
|
|
|
- if(srcx < dstx) xdir = 0;
|
|
|
- else xdir = 1;
|
|
|
- if(srcy < dsty) ydir = 0;
|
|
|
- else ydir = 1;
|
|
|
-
|
|
|
-
|
|
|
- CRITBEGIN
|
|
|
- XGI310SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
|
|
|
- XGI310SubsequentScreenToScreenCopy(srcx, srcy, dstx, dsty, width, height);
|
|
|
- CRITEND
|
|
|
- XGI310Sync();
|
|
|
-#if 0
|
|
|
- printk(KERN_INFO "XGI_bmove sx %d sy %d dx %d dy %d w %d h %d\n",
|
|
|
- srcx, srcy, dstx, dsty, width, height);
|
|
|
-#endif
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-static void fbcon_XGI_clear(struct vc_data *conp, struct display *p,
|
|
|
- int srcy, int srcx, int height, int width, int color)
|
|
|
-{
|
|
|
- CRITFLAGS
|
|
|
-
|
|
|
- srcx *= fontwidth(p);
|
|
|
- srcy *= fontheight(p);
|
|
|
- width *= fontwidth(p);
|
|
|
- height *= fontheight(p);
|
|
|
-
|
|
|
-
|
|
|
- CRITBEGIN
|
|
|
- XGI310SetupForSolidFill(color, 3, 0);
|
|
|
- XGI310SubsequentSolidFillRect(srcx, srcy, width, height);
|
|
|
- CRITEND
|
|
|
- XGI310Sync();
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-void fbcon_XGI_clear8(struct vc_data *conp, struct display *p,
|
|
|
- int srcy, int srcx, int height, int width)
|
|
|
-{
|
|
|
- u32 bgx;
|
|
|
-
|
|
|
- if(!xgi_video_info.accel) {
|
|
|
-#ifdef FBCON_HAS_CFB8
|
|
|
- fbcon_cfb8_clear(conp, p, srcy, srcx, height, width);
|
|
|
-#endif
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- bgx = attr_bgcol_ec(p, conp);
|
|
|
- fbcon_XGI_clear(conp, p, srcy, srcx, height, width, bgx);
|
|
|
-}
|
|
|
-
|
|
|
-void fbcon_XGI_clear16(struct vc_data *conp, struct display *p,
|
|
|
- int srcy, int srcx, int height, int width)
|
|
|
-{
|
|
|
- u32 bgx;
|
|
|
- if(!xgi_video_info.accel) {
|
|
|
-#ifdef FBCON_HAS_CFB16
|
|
|
- fbcon_cfb16_clear(conp, p, srcy, srcx, height, width);
|
|
|
-#endif
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- bgx = ((u_int16_t*)p->dispsw_data)[attr_bgcol_ec(p, conp)];
|
|
|
- fbcon_XGI_clear(conp, p, srcy, srcx, height, width, bgx);
|
|
|
-}
|
|
|
-
|
|
|
-void fbcon_XGI_clear32(struct vc_data *conp, struct display *p,
|
|
|
- int srcy, int srcx, int height, int width)
|
|
|
-{
|
|
|
- u32 bgx;
|
|
|
-
|
|
|
- if(!xgi_video_info.accel) {
|
|
|
-#ifdef FBCON_HAS_CFB32
|
|
|
- fbcon_cfb32_clear(conp, p, srcy, srcx, height, width);
|
|
|
-#endif
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- bgx = ((u_int32_t*)p->dispsw_data)[attr_bgcol_ec(p, conp)];
|
|
|
- fbcon_XGI_clear(conp, p, srcy, srcx, height, width, bgx);
|
|
|
-}
|
|
|
-
|
|
|
-void fbcon_XGI_revc(struct display *p, int srcx, int srcy)
|
|
|
-{
|
|
|
- CRITFLAGS
|
|
|
-
|
|
|
- if(!xgi_video_info.accel) {
|
|
|
- switch(xgi_video_info.video_bpp) {
|
|
|
- case 16:
|
|
|
-#ifdef FBCON_HAS_CFB16
|
|
|
- fbcon_cfb16_revc(p, srcx, srcy);
|
|
|
-#endif
|
|
|
- break;
|
|
|
- case 32:
|
|
|
-#ifdef FBCON_HAS_CFB32
|
|
|
- fbcon_cfb32_revc(p, srcx, srcy);
|
|
|
-#endif
|
|
|
- break;
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- srcx *= fontwidth(p);
|
|
|
- srcy *= fontheight(p);
|
|
|
-
|
|
|
-
|
|
|
- CRITBEGIN
|
|
|
- XGI310SetupForSolidFill(0, 0x0a, 0);
|
|
|
- XGI310SubsequentSolidFillRect(srcx, srcy, fontwidth(p), fontheight(p));
|
|
|
- CRITEND
|
|
|
- XGI310Sync();
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-#ifdef FBCON_HAS_CFB8
|
|
|
-struct display_switch fbcon_XGI8 = {
|
|
|
- setup: fbcon_cfb8_setup,
|
|
|
- bmove: fbcon_XGI_bmove,
|
|
|
- clear: fbcon_XGI_clear8,
|
|
|
- putc: fbcon_cfb8_putc,
|
|
|
- putcs: fbcon_cfb8_putcs,
|
|
|
- revc: fbcon_cfb8_revc,
|
|
|
- clear_margins: fbcon_cfb8_clear_margins,
|
|
|
- fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
|
|
|
-};
|
|
|
-#endif
|
|
|
-#ifdef FBCON_HAS_CFB16
|
|
|
-struct display_switch fbcon_XGI16 = {
|
|
|
- setup: fbcon_cfb16_setup,
|
|
|
- bmove: fbcon_XGI_bmove,
|
|
|
- clear: fbcon_XGI_clear16,
|
|
|
- putc: fbcon_cfb16_putc,
|
|
|
- putcs: fbcon_cfb16_putcs,
|
|
|
- revc: fbcon_XGI_revc,
|
|
|
- clear_margins: fbcon_cfb16_clear_margins,
|
|
|
- fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
|
|
|
-};
|
|
|
-#endif
|
|
|
-#ifdef FBCON_HAS_CFB32
|
|
|
-struct display_switch fbcon_XGI32 = {
|
|
|
- setup: fbcon_cfb32_setup,
|
|
|
- bmove: fbcon_XGI_bmove,
|
|
|
- clear: fbcon_XGI_clear32,
|
|
|
- putc: fbcon_cfb32_putc,
|
|
|
- putcs: fbcon_cfb32_putcs,
|
|
|
- revc: fbcon_XGI_revc,
|
|
|
- clear_margins: fbcon_cfb32_clear_margins,
|
|
|
- fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
|
|
|
-};
|
|
|
-#endif
|
|
|
-
|
|
|
-#endif /* KERNEL VERSION */
|
|
|
|
|
|
|