diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-08-19 12:48:09 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-08-19 12:48:09 +0200 |
commit | c8710ad38900153af7a3e6762e99c062cfa46443 (patch) | |
tree | a0c0632274c4eb72f51e99a5861f71cffe65ea60 /drivers/staging/xgifb | |
parent | perf, tracing: add missing __percpu markups (diff) | |
parent | tracing: Clean up seqfile code for format file (diff) | |
download | linux-dev-c8710ad38900153af7a3e6762e99c062cfa46443.tar.xz linux-dev-c8710ad38900153af7a3e6762e99c062cfa46443.zip |
Merge branch 'tip/perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/core
Diffstat (limited to 'drivers/staging/xgifb')
-rw-r--r-- | drivers/staging/xgifb/XGI.h | 10 | ||||
-rw-r--r-- | drivers/staging/xgifb/XGI_accel.c | 307 | ||||
-rw-r--r-- | drivers/staging/xgifb/XGI_accel.h | 14 | ||||
-rw-r--r-- | drivers/staging/xgifb/XGI_main.h | 182 | ||||
-rw-r--r-- | drivers/staging/xgifb/XGI_main_26.c | 255 | ||||
-rw-r--r-- | drivers/staging/xgifb/XGIfb.h | 31 | ||||
-rw-r--r-- | drivers/staging/xgifb/osdef.h | 153 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_def.h | 4 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_ext.c | 510 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_ext.h | 26 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_init.c | 895 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_init.h | 4 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_setmode.c | 2060 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_setmode.h | 66 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_struct.h | 951 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_table.h | 633 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_util.c | 137 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_util.h | 20 | ||||
-rw-r--r-- | drivers/staging/xgifb/vgatypes.h | 271 |
19 files changed, 2357 insertions, 4172 deletions
diff --git a/drivers/staging/xgifb/XGI.h b/drivers/staging/xgifb/XGI.h deleted file mode 100644 index 87803dd032de..000000000000 --- a/drivers/staging/xgifb/XGI.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _XGI_H -#define _XGI_H - -#if 1 -#define TWDEBUG(x) -#else -#define TWDEBUG(x) printk(KERN_INFO x "\n"); -#endif - -#endif diff --git a/drivers/staging/xgifb/XGI_accel.c b/drivers/staging/xgifb/XGI_accel.c index 86ec3421942f..79549742cff1 100644 --- a/drivers/staging/xgifb/XGI_accel.c +++ b/drivers/staging/xgifb/XGI_accel.c @@ -37,37 +37,17 @@ #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" #include "XGIfb.h" #include "XGI_accel.h" - -extern struct video_info xgi_video_info; -extern int XGIfb_accel; - static const int XGIALUConv[] = { 0x00, /* dest = 0; 0, GXclear, 0 */ @@ -108,109 +88,17 @@ 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 -static void -XGI300Sync(void) -{ - XGI300Idle -} -#endif static void XGI310Sync(void) { XGI310Idle } -#if 0 -static void -XGI300SetupForScreenToScreenCopy(int xdir, int ydir, int rop, - unsigned int planemask, int trans_color) -{ - XGI300SetupDSTColorDepth(xgi_video_info.DstColor); - XGI300SetupSRCPitch(xgi_video_info.video_linelength) - XGI300SetupDSTRect(xgi_video_info.video_linelength, 0xFFF) - - if(trans_color != -1) { - XGI300SetupROP(0x0A) - XGI300SetupSRCTrans(trans_color) - XGI300SetupCMDFlag(TRANSPARENT_BITBLT) - } else { - XGI300SetupROP(XGIALUConv[rop]) - } - if(xdir > 0) { - XGI300SetupCMDFlag(X_INC) - } - if(ydir > 0) { - XGI300SetupCMDFlag(Y_INC) - } -} - -static void -XGI300SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y, - int width, int height) -{ - long srcbase, dstbase; - - srcbase = dstbase = 0; - if (src_y >= 2048) { - srcbase = xgi_video_info.video_linelength * src_y; - src_y = 0; - } - if (dst_y >= 2048) { - dstbase = xgi_video_info.video_linelength * dst_y; - dst_y = 0; - } - - XGI300SetupSRCBase(srcbase); - XGI300SetupDSTBase(dstbase); - - if(!(xgi_video_info.CommandReg & X_INC)) { - src_x += width-1; - dst_x += width-1; - } - if(!(xgi_video_info.CommandReg & Y_INC)) { - src_y += height-1; - dst_y += height-1; - } - XGI300SetupRect(width, height) - XGI300SetupSRCXY(src_x, src_y) - XGI300SetupDSTXY(dst_x, dst_y) - XGI300DoCMD -} - -static void -XGI300SetupForSolidFill(int color, int rop, unsigned int planemask) -{ - XGI300SetupPATFG(color) - XGI300SetupDSTRect(xgi_video_info.video_linelength, 0xFFF) - XGI300SetupDSTColorDepth(xgi_video_info.DstColor); - XGI300SetupROP(XGIPatALUConv[rop]) - XGI300SetupCMDFlag(PATFG) -} -static void -XGI300SubsequentSolidFillRect(int x, int y, int w, int h) -{ - long dstbase; - - dstbase = 0; - if(y >= 2048) { - dstbase = xgi_video_info.video_linelength * y; - y = 0; - } - XGI300SetupDSTBase(dstbase) - XGI300SetupDSTXY(x,y) - XGI300SetupRect(w,h) - XGI300SetupCMDFlag(X_INC | Y_INC | BITBLT) - XGI300DoCMD -} -#endif /* 310/325 series ------------------------------------------------ */ static void @@ -326,8 +214,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 +285,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 */ diff --git a/drivers/staging/xgifb/XGI_accel.h b/drivers/staging/xgifb/XGI_accel.h index 04e126772bb8..28c057994b37 100644 --- a/drivers/staging/xgifb/XGI_accel.h +++ b/drivers/staging/xgifb/XGI_accel.h @@ -491,21 +491,9 @@ void XGIfb_syncaccel(void); extern struct video_info xgi_video_info; -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,33) -void fbcon_XGI_bmove(struct display *p, int srcy, int srcx, int dsty, - int dstx, int height, int width); -void fbcon_XGI_revc(struct display *p, int srcy, int srcx); -void fbcon_XGI_clear8(struct vc_data *conp, struct display *p, int srcy, - int srcx, int height, int width); -void fbcon_XGI_clear16(struct vc_data *conp, struct display *p, int srcy, - int srcx, int height, int width); -void fbcon_XGI_clear32(struct vc_data *conp, struct display *p, int srcy, - int srcx, int height, int width); -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34) extern int XGIfb_accel; void fbcon_XGI_fillrect(struct fb_info *info, const struct fb_fillrect *rect); void fbcon_XGI_copyarea(struct fb_info *info, const struct fb_copyarea *area); -#endif + #endif diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h index 4f4171e8a68a..fd1152eb2c92 100644 --- a/drivers/staging/xgifb/XGI_main.h +++ b/drivers/staging/xgifb/XGI_main.h @@ -42,17 +42,10 @@ -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8) #define XGI_IOTYPE1 void __iomem #define XGI_IOTYPE2 __iomem #define XGIINITSTATIC static -#else -#define XGI_IOTYPE1 unsigned char -#define XGI_IOTYPE2 -#define XGIINITSTATIC -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static struct pci_device_id __devinitdata xgifb_pci_table[] = { { PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, @@ -63,7 +56,7 @@ static struct pci_device_id __devinitdata xgifb_pci_table[] = { }; MODULE_DEVICE_TABLE(pci, xgifb_pci_table); -#endif + /* To be included in fb.h */ #ifndef FB_ACCEL_XGI_GLAMOUR_2 #define FB_ACCEL_XGI_GLAMOUR_2 40 /* XGI 315, 650, 740 */ @@ -255,9 +248,6 @@ MODULE_DEVICE_TABLE(pci, xgifb_pci_table); #define BRI_DRAM_SIZE_32MB 0x04 #define BRI_DRAM_SIZE_64MB 0x05 -#define HW_DEVICE_EXTENSION XGI_HW_DEVICE_INFO -#define PHW_DEVICE_EXTENSION PXGI_HW_DEVICE_INFO - #define SR_BUFFER_SIZE 5 #define CR_BUFFER_SIZE 5 @@ -300,11 +290,7 @@ MODULE_DEVICE_TABLE(pci, xgifb_pci_table); /* ------------------- Global Variables ----------------------------- */ /* Fbcon variables */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static struct fb_info* fb_info; -#else -static struct fb_info XGI_fb_info; -#endif static int video_type = FB_TYPE_PACKED_PIXELS; @@ -336,12 +322,8 @@ static struct fb_var_screeninfo default_var = { .vsync_len = 0, .sync = 0, .vmode = FB_VMODE_NONINTERLACED, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - .reserved = {0, 0, 0, 0, 0, 0} -#endif }; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static struct fb_fix_screeninfo XGIfb_fix = { .id = "XGI", .type = FB_TYPE_PACKED_PIXELS, @@ -350,28 +332,7 @@ static struct fb_fix_screeninfo XGIfb_fix = { }; static char myid[20]; static u32 pseudo_palette[17]; -#endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -static struct display XGI_disp; - -static struct display_switch XGIfb_sw; - -static struct { - u16 blue, green, red, pad; -} XGI_palette[256]; - -static union { -#ifdef FBCON_HAS_CFB16 - u16 cfb16[16]; -#endif -#ifdef FBCON_HAS_CFB32 - u32 cfb32[16]; -#endif -} XGI_fbcon_cmap; - -static int XGIfb_inverse = 0; -#endif /* display status */ static int XGIfb_off = 0; @@ -380,9 +341,6 @@ static int XGIfb_forcecrt1 = -1; static int XGIvga_enabled = 0; static int XGIfb_userom = 0; //static int XGIfb_useoem = -1; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -static int currcon = 0; -#endif /* global flags */ static int XGIfb_registered; @@ -415,10 +373,10 @@ unsigned char XGIfb_detectedlcda = 0xff; /* XGIfb_info XGIfbinfo; */ /* TW: Hardware extension; contains data on hardware */ -HW_DEVICE_EXTENSION XGIhw_ext; +struct xgi_hw_device_info XGIhw_ext; /* TW: XGI private structure */ -VB_DEVICE_INFO XGI_Pr; +struct vb_device_info XGI_Pr; /* card parameters */ static unsigned long XGIfb_mmio_size = 0; @@ -530,29 +488,21 @@ struct _XGIbios_mode { /* mode-related variables */ #ifdef MODULE -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int xgifb_mode_idx = 1; #else -static int XGIfb_mode_idx = MODE_INDEX_NONE; /* Don't use a mode by default if we are a module */ -#endif -#else -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int xgifb_mode_idx = -1; /* Use a default mode if we are inside the kernel */ -#else -static int XGIfb_mode_idx = -1; -#endif #endif u8 XGIfb_mode_no = 0; u8 XGIfb_rate_idx = 0; /* TW: CR36 evaluation */ -const USHORT XGI300paneltype[] = +const unsigned short XGI300paneltype[] = { LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, LCD_1280x960, LCD_640x480, LCD_1024x600, LCD_1152x768, LCD_1024x768, LCD_1024x768, LCD_1024x768, LCD_1024x768, LCD_1024x768, LCD_1024x768, LCD_1024x768 }; -const USHORT XGI310paneltype[] = +const unsigned short XGI310paneltype[] = { LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960, LCD_1152x768, LCD_1400x1050,LCD_1280x768, LCD_1600x1200, @@ -648,17 +598,6 @@ static const struct _chswtable { { 0, 0, "" , "" } }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -/* Offscreen layout */ -typedef struct _XGI_GLYINFO { - unsigned char ch; - int fontwidth; - int fontheight; - u8 gmask[72]; - int ngmask; -} XGI_GLYINFO; -#endif - typedef struct _XGI_OH { struct _XGI_OH *poh_next; struct _XGI_OH *poh_prev; @@ -852,50 +791,6 @@ XGIINITSTATIC int __init XGIfb_setup(char *options); /* fbdev routines */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - int XGIfb_init(void); -static int XGIfb_get_fix(struct fb_fix_screeninfo *fix, - int con, - struct fb_info *info); -static int XGIfb_get_var(struct fb_var_screeninfo *var, - int con, - struct fb_info *info); -static int XGIfb_set_var(struct fb_var_screeninfo *var, - int con, - struct fb_info *info); -static void XGIfb_crtc_to_var(struct fb_var_screeninfo *var); -static int XGIfb_get_cmap(struct fb_cmap *cmap, - int kspc, - int con, - struct fb_info *info); -static int XGIfb_set_cmap(struct fb_cmap *cmap, - int kspc, - int con, - struct fb_info *info); -static int XGIfb_update_var(int con, - struct fb_info *info); -static int XGIfb_switch(int con, - struct fb_info *info); -static void XGIfb_blank(int blank, - struct fb_info *info); -static void XGIfb_set_disp(int con, - struct fb_var_screeninfo *var, - struct fb_info *info); -static int XGI_getcolreg(unsigned regno, unsigned *red, unsigned *green, - unsigned *blue, unsigned *transp, - struct fb_info *fb_info); -static void XGIfb_do_install_cmap(int con, - struct fb_info *info); -static void XGI_get_glyph(struct fb_info *info, - XGI_GLYINFO *gly); -static int XGIfb_mmap(struct fb_info *info, struct file *file, - struct vm_area_struct *vma); -static int XGIfb_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, int con, - struct fb_info *info); -#endif - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) XGIINITSTATIC int __init xgifb_init(void); static int XGIfb_set_par(struct fb_info *info); static int XGIfb_blank(int blank, @@ -907,36 +802,25 @@ extern void fbcon_XGI_fillrect(struct fb_info *info, const struct fb_fillrect *rect); extern void fbcon_XGI_copyarea(struct fb_info *info, const struct fb_copyarea *area); -#if 0 -extern void cfb_imageblit(struct fb_info *info, - const struct fb_image *image); -#endif extern int fbcon_XGI_sync(struct fb_info *info); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) static int XGIfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg); -#else -static int XGIfb_ioctl(struct inode *inode, - struct file *file, - unsigned int cmd, - unsigned long arg, - struct fb_info *info); -#endif /* extern int XGIfb_mode_rate_to_dclock(VB_DEVICE_INFO *XGI_Pr, - PXGI_HW_DEVICE_INFO HwDeviceExtension, + struct xgi_hw_device_info *HwDeviceExtension, unsigned char modeno, unsigned char rateindex); -extern int XGIfb_mode_rate_to_ddata(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwDeviceExtension, +extern int XGIfb_mode_rate_to_ddata(VB_DEVICE_INFO *XGI_Pr, struct xgi_hw_device_info *HwDeviceExtension, unsigned char modeno, unsigned char rateindex, unsigned int *left_margin, unsigned int *right_margin, unsigned int *upper_margin, unsigned int *lower_margin, unsigned int *hsync_len, unsigned int *vsync_len, unsigned int *sync, unsigned int *vmode); */ -#endif - extern BOOLEAN XGI_SearchModeID( USHORT ModeNo,USHORT *ModeIdIndex, PVB_DEVICE_INFO ); +extern unsigned char XGI_SearchModeID(unsigned short ModeNo, + unsigned short *ModeIdIndex, + struct vb_device_info *); static int XGIfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info); @@ -956,10 +840,10 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive, static void XGIfb_pre_setmode(void); static void XGIfb_post_setmode(void); -static BOOLEAN XGIfb_CheckVBRetrace(void); -static BOOLEAN XGIfbcheckvretracecrt2(void); -static BOOLEAN XGIfbcheckvretracecrt1(void); -static BOOLEAN XGIfb_bridgeisslave(void); +static unsigned char XGIfb_CheckVBRetrace(void); +static unsigned char XGIfbcheckvretracecrt2(void); +static unsigned char XGIfbcheckvretracecrt1(void); +static unsigned char XGIfb_bridgeisslave(void); struct XGI_memreq { unsigned long offset; @@ -994,30 +878,40 @@ static XGI_OH *XGIfb_poh_free(unsigned long base); static void XGIfb_free_node(XGI_OH *poh); /* Internal routines to access PCI configuration space */ -BOOLEAN XGIfb_query_VGA_config_space(PXGI_HW_DEVICE_INFO pXGIhw_ext, - unsigned long offset, unsigned long set, unsigned long *value); +unsigned char XGIfb_query_VGA_config_space(struct xgi_hw_device_info *pXGIhw_ext, + unsigned long offset, + unsigned long set, + unsigned long *value); //BOOLEAN XGIfb_query_north_bridge_space(PXGI_HW_DEVICE_INFO pXGIhw_ext, // unsigned long offset, unsigned long set, unsigned long *value); /* Routines from init.c/init301.c */ -extern void InitTo330Pointer(UCHAR,PVB_DEVICE_INFO pVBInfo); -extern BOOLEAN XGIInitNew(PXGI_HW_DEVICE_INFO HwDeviceExtension); -extern BOOLEAN XGISetModeNew(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo); +extern void InitTo330Pointer(unsigned char, struct vb_device_info *pVBInfo); +extern unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension); +extern unsigned char XGISetModeNew(struct xgi_hw_device_info *HwDeviceExtension, + unsigned short ModeNo); //extern void XGI_SetEnableDstn(VB_DEVICE_INFO *XGI_Pr); -extern void XGI_LongWait(VB_DEVICE_INFO *XGI_Pr); -extern USHORT XGI_GetRatePtrCRT2( PXGI_HW_DEVICE_INFO pXGIHWDE, USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo ); +extern void XGI_LongWait(struct vb_device_info *XGI_Pr); +extern unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE, + unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo); /* TW: Chrontel TV functions */ -extern USHORT XGI_GetCH700x(VB_DEVICE_INFO *XGI_Pr, USHORT tempbx); -extern void XGI_SetCH700x(VB_DEVICE_INFO *XGI_Pr, USHORT tempbx); -extern USHORT XGI_GetCH701x(VB_DEVICE_INFO *XGI_Pr, USHORT tempbx); -extern void XGI_SetCH701x(VB_DEVICE_INFO *XGI_Pr, USHORT tempbx); -extern void XGI_SetCH70xxANDOR(VB_DEVICE_INFO *XGI_Pr, USHORT tempax,USHORT tempbh); -extern void XGI_DDC2Delay(VB_DEVICE_INFO *XGI_Pr, USHORT delaytime); +extern unsigned short XGI_GetCH700x(struct vb_device_info *XGI_Pr, + unsigned short tempbx); +extern void XGI_SetCH700x(struct vb_device_info *XGI_Pr, unsigned short tempbx); +extern unsigned short XGI_GetCH701x(struct vb_device_info *XGI_Pr, + unsigned short tempbx); +extern void XGI_SetCH701x(struct vb_device_info *XGI_Pr, unsigned short tempbx); +extern void XGI_SetCH70xxANDOR(struct vb_device_info *XGI_Pr, + unsigned short tempax, + unsigned short tempbh); +extern void XGI_DDC2Delay(struct vb_device_info *XGI_Pr, unsigned short delaytime); /* TW: Sensing routines */ void XGI_Sense30x(void); int XGIDoSense(int tempbl, int tempbh, int tempcl, int tempch); -extern XGI21_LVDSCapStruct XGI21_LCDCapList[13]; +extern struct XGI21_LVDSCapStruct XGI21_LCDCapList[13]; #endif diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c index 867012b48a01..976c39bb2866 100644 --- a/drivers/staging/xgifb/XGI_main_26.c +++ b/drivers/staging/xgifb/XGI_main_26.c @@ -28,9 +28,6 @@ #include <linux/fs.h> #include <linux/types.h> #include <linux/proc_fs.h> -#include <linux/kernel.h> - -#include "osdef.h" #ifndef XGIFB_PAN @@ -164,16 +161,15 @@ struct video_info xgi_video_info; /* --------------- Hardware Access Routines -------------------------- */ -#ifdef LINUX_KERNEL int -XGIfb_mode_rate_to_dclock(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwDeviceExtension, +XGIfb_mode_rate_to_dclock(struct vb_device_info *XGI_Pr, struct xgi_hw_device_info *HwDeviceExtension, unsigned char modeno, unsigned char rateindex) { - USHORT ModeNo = modeno; - USHORT ModeIdIndex = 0, ClockIndex = 0; - USHORT RefreshRateTableIndex = 0; + unsigned short ModeNo = modeno; + unsigned short ModeIdIndex = 0, ClockIndex = 0; + unsigned short RefreshRateTableIndex = 0; - /*ULONG temp = 0;*/ + /*unsigned long temp = 0;*/ int Clock; XGI_Pr->ROMAddr = HwDeviceExtension->pjVirtualRomBase; InitTo330Pointer( HwDeviceExtension->jChipType, XGI_Pr ) ; @@ -201,16 +197,16 @@ XGIfb_mode_rate_to_dclock(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwDeviceEx } int -XGIfb_mode_rate_to_ddata(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwDeviceExtension, +XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr, struct xgi_hw_device_info *HwDeviceExtension, unsigned char modeno, unsigned char rateindex, u32 *left_margin, u32 *right_margin, u32 *upper_margin, u32 *lower_margin, u32 *hsync_len, u32 *vsync_len, u32 *sync, u32 *vmode) { - USHORT ModeNo = modeno; - USHORT ModeIdIndex = 0, index = 0; - USHORT RefreshRateTableIndex = 0; + unsigned short ModeNo = modeno; + unsigned short ModeIdIndex = 0, index = 0; + unsigned short RefreshRateTableIndex = 0; unsigned short VRE, VBE, VRS, VBS, VDE, VT; unsigned short HRE, HBE, HRS, HBS, HDE, HT; @@ -375,26 +371,13 @@ XGIfb_mode_rate_to_ddata(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwDeviceExt } } -#if 0 /* That's bullshit, only the resolution needs to be shifted */ - if((*vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) { - *upper_margin <<= 1; - *lower_margin <<= 1; - *vsync_len <<= 1; - } else if((*vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) { - *upper_margin >>= 1; - *lower_margin >>= 1; - *vsync_len >>= 1; - } -#endif - return 1; } -#endif -void XGIRegInit(VB_DEVICE_INFO *XGI_Pr, ULONG BaseAddr) +void XGIRegInit(struct vb_device_info *XGI_Pr, unsigned long BaseAddr) { XGI_Pr->RelIO = BaseAddr; XGI_Pr->P3c4 = BaseAddr + 0x14; @@ -432,8 +415,8 @@ u32 XGIfb_get_reg3(u16 port) /* ------------ Interface for init & mode switching code ------------- */ -BOOLEAN -XGIfb_query_VGA_config_space(PXGI_HW_DEVICE_INFO pXGIhw_ext, +unsigned char +XGIfb_query_VGA_config_space(struct xgi_hw_device_info *pXGIhw_ext, unsigned long offset, unsigned long set, unsigned long *value) { static struct pci_dev *pdev = NULL; @@ -445,10 +428,10 @@ XGIfb_query_VGA_config_space(PXGI_HW_DEVICE_INFO pXGIhw_ext, DPRINTK("XGIfb: Set offset 0x%lx to 0x%lx\n", offset, *value); if (!init) { - init = TRUE; + init = 1; pdev = pci_get_device(PCI_VENDOR_ID_XG, xgi_video_info.chip_id, pdev); if (pdev) { - valid_pdev = TRUE; + valid_pdev = 1; pci_dev_put(pdev); } } @@ -456,7 +439,7 @@ XGIfb_query_VGA_config_space(PXGI_HW_DEVICE_INFO pXGIhw_ext, if (!valid_pdev) { printk(KERN_DEBUG "XGIfb: Can't find XGI %d VGA device.\n", xgi_video_info.chip_id); - return FALSE; + return 0; } if (set == 0) @@ -464,10 +447,10 @@ XGIfb_query_VGA_config_space(PXGI_HW_DEVICE_INFO pXGIhw_ext, else pci_write_config_dword(pdev, offset, (u32)(*value)); - return TRUE; + return 1; } -/*BOOLEAN XGIfb_query_north_bridge_space(PXGI_HW_DEVICE_INFO pXGIhw_ext, +/*unsigned char XGIfb_query_north_bridge_space(struct xgi_hw_device_info *pXGIhw_ext, unsigned long offset, unsigned long set, unsigned long *value) { static struct pci_dev *pdev = NULL; @@ -475,7 +458,7 @@ XGIfb_query_VGA_config_space(PXGI_HW_DEVICE_INFO pXGIhw_ext, u16 nbridge_id = 0; if (!init) { - init = TRUE; + init = 1; switch (xgi_video_info.chip) { case XGI_540: nbridge_id = PCI_DEVICE_ID_XG_540; @@ -502,13 +485,13 @@ XGIfb_query_VGA_config_space(PXGI_HW_DEVICE_INFO pXGIhw_ext, pdev = pci_find_device(PCI_VENDOR_ID_SI, nbridge_id, pdev); if (pdev) - valid_pdev = TRUE; + valid_pdev = 1; } if (!valid_pdev) { printk(KERN_DEBUG "XGIfb: Can't find XGI %d North Bridge device.\n", nbridge_id); - return FALSE; + return 0; } if (set == 0) @@ -516,7 +499,7 @@ XGIfb_query_VGA_config_space(PXGI_HW_DEVICE_INFO pXGIhw_ext, else pci_write_config_dword(pdev, offset, (u32)(*value)); - return TRUE; + return 1; } */ /* ------------------ Internal helper routines ----------------- */ @@ -627,7 +610,8 @@ int XGIfb_GetXG21LVDSData(void) i += 25; j--; k++; - } while ( (j>0) && ( k < (sizeof(XGI21_LCDCapList)/sizeof(XGI21_LVDSCapStruct)) ) ); + } while ((j > 0) && + (k < (sizeof(XGI21_LCDCapList)/sizeof(struct XGI21_LVDSCapStruct)))); return 1; } return 0; @@ -954,46 +938,52 @@ static void XGIfb_search_tvstd(const char *name) } } -static BOOLEAN XGIfb_bridgeisslave(void) +static unsigned char XGIfb_bridgeisslave(void) { unsigned char usScratchP1_00; - if(xgi_video_info.hasVB == HASVB_NONE) return FALSE; + if (xgi_video_info.hasVB == HASVB_NONE) + return 0; inXGIIDXREG(XGIPART1,0x00,usScratchP1_00); - if( (usScratchP1_00 & 0x50) == 0x10) { - return TRUE; - } else { - return FALSE; - } + if ((usScratchP1_00 & 0x50) == 0x10) + return 1; + else + return 0; } -static BOOLEAN XGIfbcheckvretracecrt1(void) +static unsigned char XGIfbcheckvretracecrt1(void) { unsigned char temp; inXGIIDXREG(XGICR,0x17,temp); - if(!(temp & 0x80)) return FALSE; + if (!(temp & 0x80)) + return 0; inXGIIDXREG(XGISR,0x1f,temp); - if(temp & 0xc0) return FALSE; + if (temp & 0xc0) + return 0; - - if(inXGIREG(XGIINPSTAT) & 0x08) return TRUE; - else return FALSE; + if (inXGIREG(XGIINPSTAT) & 0x08) + return 1; + else + return 0; } -static BOOLEAN XGIfbcheckvretracecrt2(void) +static unsigned char XGIfbcheckvretracecrt2(void) { unsigned char temp; - if(xgi_video_info.hasVB == HASVB_NONE) return FALSE; + if (xgi_video_info.hasVB == HASVB_NONE) + return 0; inXGIIDXREG(XGIPART1, 0x30, temp); - if(temp & 0x02) return FALSE; - else return TRUE; + if (temp & 0x02) + return 0; + else + return 1; } -static BOOLEAN XGIfb_CheckVBRetrace(void) +static unsigned char XGIfb_CheckVBRetrace(void) { if(xgi_video_info.disp_state & DISPTYPE_DISP2) { if(XGIfb_bridgeisslave()) { @@ -1350,11 +1340,7 @@ static int XGIfb_set_par(struct fb_info *info) // printk("XGIfb: inside set_par\n"); if((err = XGIfb_do_set_var(&info->var, 1, info))) return err; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) - XGIfb_get_fix(&info->fix, info->currcon, info); -#else XGIfb_get_fix(&info->fix, -1, info); -#endif // printk("XGIfb:end of set_par\n"); return 0; } @@ -1540,58 +1526,7 @@ static int XGIfb_pan_display( struct fb_var_screeninfo *var, } #endif -#if 0 -static int XGIfb_mmap(struct fb_info *info, struct file *file, - struct vm_area_struct *vma) -{ - unsigned long start; - unsigned long off; - u32 len, mmio_off; - - DEBUGPRN("inside mmap"); - if(vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) return -EINVAL; - - off = vma->vm_pgoff << PAGE_SHIFT; - - start = (unsigned long) xgi_video_info.video_base; - len = PAGE_ALIGN((start & ~PAGE_MASK) + xgi_video_info.video_size); - start &= PAGE_MASK; -#if 0 - if (off >= len) { - off -= len; -#endif - /* By Jake Page: Treat mmap request with offset beyond heapstart - * as request for mapping the mmio area - */ - #if 1 - mmio_off = PAGE_ALIGN((start & ~PAGE_MASK) + xgi_video_info.heapstart); - if(off >= mmio_off) { - off -= mmio_off; - if(info->var.accel_flags) return -EINVAL; - - start = (unsigned long) xgi_video_info.mmio_base; - len = PAGE_ALIGN((start & ~PAGE_MASK) + XGIfb_mmio_size); - } - start &= PAGE_MASK; - #endif - if((vma->vm_end - vma->vm_start + off) > len) return -EINVAL; - - off += start; - vma->vm_pgoff = off >> PAGE_SHIFT; - vma->vm_flags |= VM_IO; /* by Jake Page; is that really needed? */ - -#if defined(__i386__) || defined(__x86_64__) - if (boot_cpu_data.x86 > 3) - pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; -#endif - if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, vma->vm_end - vma->vm_start, - vma->vm_page_prot)) - return -EAGAIN; - DEBUGPRN("end of mmap"); - return 0; -} -#endif static int XGIfb_blank(int blank, struct fb_info *info) { u8 reg; @@ -1610,15 +1545,8 @@ static int XGIfb_blank(int blank, struct fb_info *info) } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) static int XGIfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) -#else -static int XGIfb_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, - struct fb_info *info) -#endif - { DEBUGPRN("inside ioctl"); switch (cmd) { @@ -1687,7 +1615,7 @@ static int XGIfb_ioctl(struct inode *inode, struct file *file, break; case XGIFB_GET_INFO: /* TW: New for communication with X driver */ { - XGIfb_info *x = (XGIfb_info *)arg; + struct XGIfb_info *x = (struct XGIfb_info *)arg; //x->XGIfb_id = XGIFB_ID; x->XGIfb_version = VER_MAJOR; @@ -1786,9 +1714,6 @@ static struct fb_ops XGIfb_ops = { .fb_fillrect = fbcon_XGI_fillrect, .fb_copyarea = fbcon_XGI_copyarea, .fb_imageblit = cfb_imageblit, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) - .fb_cursor = soft_cursor, -#endif .fb_sync = fbcon_XGI_sync, .fb_ioctl = XGIfb_ioctl, // .fb_mmap = XGIfb_mmap, @@ -2008,9 +1933,9 @@ static int XGIfb_has_VB(void) break; default: xgi_video_info.hasVB = HASVB_NONE; - return FALSE; + return 0; } - return TRUE; + return 1; } @@ -2664,13 +2589,7 @@ static void XGIfb_pre_setmode(void) static void XGIfb_post_setmode(void) { u8 reg; - BOOLEAN doit = TRUE; -#if 0 /* TW: Wrong: Is not in MMIO space, but in RAM */ - /* Backup mode number to MMIO space */ - if(xgi_video_info.mmio_vbase) { - *(volatile u8 *)(((u8*)xgi_video_info.mmio_vbase) + 0x449) = (unsigned char)XGIfb_mode_no; - } -#endif + unsigned char doit = 1; /* outXGIIDXREG(XGISR,IND_XGI_PASSWORD,XGI_PASSWORD); outXGIIDXREG(XGICR,0x13,0x00); setXGIIDXREG(XGISR,0x0E,0xF0,0x01); @@ -2678,11 +2597,11 @@ static void XGIfb_post_setmode(void) if (xgi_video_info.video_bpp == 8) { /* TW: We can't switch off CRT1 on LVDS/Chrontel in 8bpp Modes */ if ((xgi_video_info.hasVB == HASVB_LVDS) || (xgi_video_info.hasVB == HASVB_LVDS_CHRONTEL)) { - doit = FALSE; + doit = 0; } /* TW: We can't switch off CRT1 on 301B-DH in 8bpp Modes if using LCD */ if (xgi_video_info.disp_state & DISPTYPE_LCD) { - doit = FALSE; + doit = 0; } } @@ -2691,14 +2610,15 @@ static void XGIfb_post_setmode(void) inXGIIDXREG(XGIPART1, 0x00, reg); - if((reg & 0x50) == 0x10) { - doit = FALSE; - } + if ((reg & 0x50) == 0x10) + doit = 0; - } else XGIfb_crt1off = 0; + + } else + XGIfb_crt1off = 0; inXGIIDXREG(XGICR, 0x17, reg); - if((XGIfb_crt1off) && (doit)) + if ((XGIfb_crt1off) && (doit)) reg &= ~0x80; else reg |= 0x80; @@ -2907,7 +2827,7 @@ XGIINITSTATIC int __init XGIfb_setup(char *options) static unsigned char VBIOS_BUF[65535]; -unsigned char* attempt_map_rom(struct pci_dev *dev,void *copy_address) +unsigned char *attempt_map_rom(struct pci_dev *dev, void *copy_address) { u32 rom_size = 0; u32 rom_address = 0; @@ -2962,15 +2882,9 @@ int __devinit xgifb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) XGIfb_registered = 0; - memset(&XGIhw_ext, 0, sizeof(HW_DEVICE_EXTENSION)); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,3)) + memset(&XGIhw_ext, 0, sizeof(struct xgi_hw_device_info)); fb_info = framebuffer_alloc(sizeof(struct fb_info), &pdev->dev); if(!fb_info) return -ENOMEM; -#else - XGI_fb_info = kmalloc( sizeof(struct fb_info), GFP_KERNEL); - if(!XGI_fb_info) return -ENOMEM; - memset(XGI_fb_info, 0, sizeof(struct fb_info)); -#endif xgi_video_info.chip_id = pdev->device; pci_read_config_byte(pdev, PCI_REVISION_ID,&xgi_video_info.revision_id); @@ -2988,14 +2902,15 @@ int __devinit xgifb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) xgi_video_info.mmio_base = pci_resource_start(pdev, 1); XGIfb_mmio_size = pci_resource_len(pdev, 1); xgi_video_info.vga_base = pci_resource_start(pdev, 2) + 0x30; - XGIhw_ext.pjIOAddress = (PUCHAR)xgi_video_info.vga_base; + XGIhw_ext.pjIOAddress = (unsigned char *)xgi_video_info.vga_base; //XGI_Pr.RelIO = ioremap(pci_resource_start(pdev, 2), 128) + 0x30; - printk("XGIfb: Relocate IO address: %lx [%08lx] \n", (unsigned long)pci_resource_start(pdev, 2), XGI_Pr.RelIO); + printk("XGIfb: Relocate IO address: %lx [%08lx]\n", + (unsigned long)pci_resource_start(pdev, 2), XGI_Pr.RelIO); if (pci_enable_device(pdev)) return -EIO; - XGIRegInit(&XGI_Pr, (ULONG)XGIhw_ext.pjIOAddress); + XGIRegInit(&XGI_Pr, (unsigned long)XGIhw_ext.pjIOAddress); outXGIIDXREG(XGISR, IND_XGI_PASSWORD, XGI_PASSWORD); inXGIIDXREG(XGISR, IND_XGI_PASSWORD, reg1); @@ -3052,7 +2967,7 @@ int __devinit xgifb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) case XG20: case XG21: case XG27: - XGIhw_ext.bIntegratedMMEnabled = TRUE; + XGIhw_ext.bIntegratedMMEnabled = 1; break; default: @@ -3080,7 +2995,7 @@ int __devinit xgifb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) strcpy(XGIhw_ext.szVBIOSVer, "0.84"); - XGIhw_ext.pSR = vmalloc(sizeof(XGI_DSReg) * SR_BUFFER_SIZE); + XGIhw_ext.pSR = vmalloc(sizeof(struct XGI_DSReg) * SR_BUFFER_SIZE); if (XGIhw_ext.pSR == NULL) { printk(KERN_ERR "XGIfb: Fatal error: Allocating SRReg space failed.\n"); @@ -3088,7 +3003,7 @@ int __devinit xgifb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } XGIhw_ext.pSR[0].jIdx = XGIhw_ext.pSR[0].jVal = 0xFF; - XGIhw_ext.pCR = vmalloc(sizeof(XGI_DSReg) * CR_BUFFER_SIZE); + XGIhw_ext.pCR = vmalloc(sizeof(struct XGI_DSReg) * CR_BUFFER_SIZE); if (XGIhw_ext.pCR == NULL) { vfree(XGIhw_ext.pSR); @@ -3218,7 +3133,7 @@ int __devinit xgifb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) xgi_video_info.disp_state = DISPTYPE_LCD; if (!XGIfb_GetXG21LVDSData()) { int m; - for (m=0; m < sizeof(XGI21_LCDCapList)/sizeof(XGI21_LVDSCapStruct); m++) { + for (m = 0; m < sizeof(XGI21_LCDCapList)/sizeof(struct XGI21_LVDSCapStruct); m++) { if ((XGI21_LCDCapList[m].LVDSHDE == XGIbios_mode[xgifb_mode_idx].xres) && (XGI21_LCDCapList[m].LVDSVDE == XGIbios_mode[xgifb_mode_idx].yres)) { XGINew_SetReg1( XGI_Pr.P3d4 , 0x36, m) ; @@ -3341,14 +3256,14 @@ int __devinit xgifb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) inXGIIDXREG(XGICR,0x38,tmp); if((tmp & 0x03) == 0x03) { -// XGI_Pr.XGI_UseLCDA = TRUE; +/* XGI_Pr.XGI_UseLCDA = 1; */ }else { // Currently on LCDA? (Some newer BIOSes set D0 in CR35) inXGIIDXREG(XGICR,0x35,tmp); if(tmp & 0x01) { -// XGI_Pr.XGI_UseLCDA = TRUE; +/* XGI_Pr.XGI_UseLCDA = 1; */ }else { inXGIIDXREG(XGICR,0x30,tmp); @@ -3357,7 +3272,7 @@ int __devinit xgifb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) inXGIIDXREG(XGIPART1,0x13,tmp); if(tmp & 0x04) { -// XGI_Pr.XGI_UseLCDA = TRUE; +/* XGI_Pr.XGI_UseLCDA = 1; */ } } } @@ -3462,20 +3377,6 @@ int __devinit xgifb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } - -#if 0 -#ifdef XGIFB_PAN - if(XGIfb_ypan) { - default_var.yres_virtual = - xgi_video_info.heapstart / (default_var.xres * (default_var.bits_per_pixel >> 3)); - if(default_var.yres_virtual <= default_var.yres) { - default_var.yres_virtual = default_var.yres; - } - } -#endif -#endif - - xgi_video_info.accel = 0; if(XGIfb_accel) { xgi_video_info.accel = -1; @@ -3511,7 +3412,8 @@ int __devinit xgifb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) XGIfb_registered = 1; - printk(KERN_INFO "XGIfb: Installed XGIFB_GET_INFO ioctl (%x)\n", XGIFB_GET_INFO); + printk(KERN_INFO "XGIfb: Installed XGIFB_GET_INFO ioctl (%lx)\n", + XGIFB_GET_INFO); /* printk(KERN_INFO "XGIfb: 2D acceleration is %s, scrolling mode %s\n", XGIfb_accel ? "enabled" : "disabled", @@ -3538,11 +3440,7 @@ static void __devexit xgifb_remove(struct pci_dev *pdev) /* Unregister the framebuffer */ // if(xgi_video_info.registered) { unregister_framebuffer(fb_info); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,3)) framebuffer_release(fb_info); -#else - kfree(fb_info); -#endif // } pci_set_drvdata(pdev, NULL); @@ -3558,7 +3456,6 @@ static struct pci_driver xgifb_driver = { XGIINITSTATIC int __init xgifb_init(void) { -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8) #ifndef MODULE char *option = NULL; @@ -3566,15 +3463,13 @@ XGIINITSTATIC int __init xgifb_init(void) return -ENODEV; XGIfb_setup(option); #endif -#endif return(pci_register_driver(&xgifb_driver)); } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8) + #ifndef MODULE module_init(xgifb_init); #endif -#endif /*****************************************************/ /* MODULE */ diff --git a/drivers/staging/xgifb/XGIfb.h b/drivers/staging/xgifb/XGIfb.h index 41bf163d4e6b..ef86a64d6996 100644 --- a/drivers/staging/xgifb/XGIfb.h +++ b/drivers/staging/xgifb/XGIfb.h @@ -27,7 +27,7 @@ #define XGIFB_ID 0x53495346 /* Identify myself with 'XGIF' */ #endif -typedef enum _XGI_CHIP_TYPE { +enum XGI_CHIP_TYPE { XGI_VGALegacy = 0, XGI_300, XGI_630, @@ -53,9 +53,9 @@ typedef enum _XGI_CHIP_TYPE { XG21, XG27, MAX_XGI_CHIP -} XGI_CHIP_TYPE; +}; -typedef enum _TVTYPE { +enum xgi_tvtype { TVMODE_NTSC = 0, TVMODE_PAL, TVMODE_HIVISION, @@ -63,13 +63,11 @@ typedef enum _TVTYPE { TVTYPE_PALN, // vicki@030226 TVTYPE_NTSCJ, // vicki@030226 TVMODE_TOTAL -} XGI_TV_TYPE; - +}; -typedef struct _XGIFB_INFO XGIfb_info; -struct _XGIFB_INFO { -unsigned long XGIfb_id; +struct XGIfb_info { + unsigned long XGIfb_id; int chip_id; /* PCI ID of detected chip */ int memory; /* video memory in KB which XGIfb manages */ int heapstart; /* heap start (= XGIfb "mem" argument) in KB */ @@ -97,7 +95,7 @@ unsigned long XGIfb_id; -typedef enum _TVPLUGTYPE { // vicki@030226 +enum xgi_tv_plug { /* vicki@030226 */ // TVPLUG_Legacy = 0, // TVPLUG_COMPOSITE, // TVPLUG_SVIDEO, @@ -113,7 +111,7 @@ typedef enum _TVPLUGTYPE { // vicki@030226 TVPLUG_YPBPR_750P = 7, TVPLUG_YPBPR_1080i = 8, TVPLUG_TOTAL -} XGI_TV_PLUG; +}; struct mode_info { @@ -132,10 +130,10 @@ struct ap_data { unsigned long iobase; unsigned int mem_size; unsigned long disp_state; - XGI_CHIP_TYPE chip; + enum XGI_CHIP_TYPE chip; unsigned char hasVB; - XGI_TV_TYPE TV_type; - XGI_TV_PLUG TV_plug; + enum xgi_tvtype TV_type; + enum xgi_tv_plug TV_plug; unsigned long version; char reserved[256]; }; @@ -184,7 +182,7 @@ struct video_info{ unsigned char TV_type; unsigned char TV_plug; - XGI_CHIP_TYPE chip; + enum XGI_CHIP_TYPE chip; unsigned char revision_id; unsigned short DstColor; @@ -207,9 +205,4 @@ struct video_info{ extern struct video_info xgi_video_info; -#ifdef __KERNEL__ -//extern void xgi_malloc(struct xgi_memreq *req); -extern void xgi_free(unsigned long base); -extern void xgi_dispinfo(struct ap_data *rec); -#endif #endif diff --git a/drivers/staging/xgifb/osdef.h b/drivers/staging/xgifb/osdef.h deleted file mode 100644 index 4bc7d3a7440c..000000000000 --- a/drivers/staging/xgifb/osdef.h +++ /dev/null @@ -1,153 +0,0 @@ -#ifndef _OSDEF_H_ -#define _OSDEF_H_ - -/* #define WINCE_HEADER*/ -/*#define WIN2000*/ -/* #define TC */ -#define LINUX_KERNEL -/* #define LINUX_XF86 */ - -/**********************************************************************/ -#ifdef LINUX_KERNEL -//#include <linux/config.h> -#endif - - -/**********************************************************************/ -#ifdef TC -#endif -#ifdef WIN2000 -#endif -#ifdef WINCE_HEADER -#endif -#ifdef LINUX_XF86 -#define LINUX -#endif -#ifdef LINUX_KERNEL -#define LINUX -#endif - -/**********************************************************************/ -#ifdef TC -#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize); -#endif -#ifdef WIN2000 -#define XGI_SetMemory(MemoryAddress,MemorySize,value) MemFill((PVOID) MemoryAddress,(ULONG) MemorySize,(UCHAR) value); -#endif -#ifdef WINCE_HEADER -#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize); -#endif -#ifdef LINUX_XF86 -#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize) -#endif -#ifdef LINUX_KERNEL -#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize) -#endif -/**********************************************************************/ - -/**********************************************************************/ - -#ifdef TC -#define XGI_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length); -#endif -#ifdef WIN2000 -#define XGI_MemoryCopy(Destination,Soruce,Length) /*VideoPortMoveMemory((PUCHAR)Destination , Soruce,length);*/ -#endif -#ifdef WINCE_HEADER -#define XGI_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length); -#endif -#ifdef LINUX_XF86 -#define XGI_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length) -#endif -#ifdef LINUX_KERNEL -#define XGI_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length) -#endif - -/**********************************************************************/ - -#ifdef OutPortByte -#undef OutPortByte -#endif /* OutPortByte */ - -#ifdef OutPortWord -#undef OutPortWord -#endif /* OutPortWord */ - -#ifdef OutPortLong -#undef OutPortLong -#endif /* OutPortLong */ - -#ifdef InPortByte -#undef InPortByte -#endif /* InPortByte */ - -#ifdef InPortWord -#undef InPortWord -#endif /* InPortWord */ - -#ifdef InPortLong -#undef InPortLong -#endif /* InPortLong */ - -/**********************************************************************/ -/* TC */ -/**********************************************************************/ - -#ifdef TC -#define OutPortByte(p,v) outp((unsigned short)(p),(unsigned char)(v)) -#define OutPortWord(p,v) outp((unsigned short)(p),(unsigned short)(v)) -#define OutPortLong(p,v) outp((unsigned short)(p),(unsigned long)(v)) -#define InPortByte(p) inp((unsigned short)(p)) -#define InPortWord(p) inp((unsigned short)(p)) -#define InPortLong(p) ((inp((unsigned short)(p+2))<<16) | inp((unsigned short)(p))) -#endif - -/**********************************************************************/ -/* LINUX XF86 */ -/**********************************************************************/ - -#ifdef LINUX_XF86 -#define OutPortByte(p,v) outb((CARD16)(p),(CARD8)(v)) -#define OutPortWord(p,v) outw((CARD16)(p),(CARD16)(v)) -#define OutPortLong(p,v) outl((CARD16)(p),(CARD32)(v)) -#define InPortByte(p) inb((CARD16)(p)) -#define InPortWord(p) inw((CARD16)(p)) -#define InPortLong(p) inl((CARD16)(p)) -#endif - -#ifdef LINUX_KERNEL -#define OutPortByte(p,v) outb((u8)(v),(p)) -#define OutPortWord(p,v) outw((u16)(v),(p)) -#define OutPortLong(p,v) outl((u32)(v),(p)) -#define InPortByte(p) inb(p) -#define InPortWord(p) inw(p) -#define InPortLong(p) inl(p) -#endif - -/**********************************************************************/ -/* WIN 2000 */ -/**********************************************************************/ - -#ifdef WIN2000 -#define OutPortByte(p,v) VideoPortWritePortUchar ((PUCHAR) (p), (UCHAR) (v)) -#define OutPortWord(p,v) VideoPortWritePortUshort((PUSHORT) (p), (USHORT) (v)) -#define OutPortLong(p,v) VideoPortWritePortUlong ((PULONG) (p), (ULONG) (v)) -#define InPortByte(p) VideoPortReadPortUchar ((PUCHAR) (p)) -#define InPortWord(p) VideoPortReadPortUshort ((PUSHORT) (p)) -#define InPortLong(p) VideoPortReadPortUlong ((PULONG) (p)) -#endif - - -/**********************************************************************/ -/* WIN CE */ -/**********************************************************************/ - -#ifdef WINCE_HEADER -#define OutPortByte(p,v) WRITE_PORT_UCHAR ((PUCHAR) (p), (UCHAR) (v)) -#define OutPortWord(p,v) WRITE_PORT_USHORT((PUSHORT) (p), (USHORT) (v)) -#define OutPortLong(p,v) WRITE_PORT_ULONG ((PULONG) (p), (ULONG) (v)) -#define InPortByte(p) READ_PORT_UCHAR ((PUCHAR) (p)) -#define InPortWord(p) READ_PORT_USHORT ((PUSHORT) (p)) -#define InPortLong(p) READ_PORT_ULONG ((PULONG) (p)) -#endif -#endif // _OSDEF_H_ diff --git a/drivers/staging/xgifb/vb_def.h b/drivers/staging/xgifb/vb_def.h index 17a7ada4926e..4de182b23d41 100644 --- a/drivers/staging/xgifb/vb_def.h +++ b/drivers/staging/xgifb/vb_def.h @@ -6,7 +6,7 @@ #define NewScratch #endif /* shampoo */ -#ifdef LINUX_KERNEL + #define SEQ_ADDRESS_PORT 0x0014 #define SEQ_DATA_PORT 0x0015 #define MISC_OUTPUT_REG_READ_PORT 0x001C @@ -17,7 +17,7 @@ #define CRTC_ADDRESS_PORT_COLOR 0x0024 #define VIDEO_SUBSYSTEM_ENABLE_PORT 0x0013 #define PCI_COMMAND 0x04 -#endif + /* ~shampoo */ diff --git a/drivers/staging/xgifb/vb_ext.c b/drivers/staging/xgifb/vb_ext.c index 49b39ee93a89..1ecf9e3e85fb 100644 --- a/drivers/staging/xgifb/vb_ext.c +++ b/drivers/staging/xgifb/vb_ext.c @@ -1,40 +1,7 @@ -#include "osdef.h" - - - - -#ifdef WIN2000 - -#include <dderror.h> -#include <devioctl.h> -#include <miniport.h> -#include <ntddvdeo.h> -#include <video.h> -#include "xgiv.h" -#include "dd_i2c.h" -#include "tools.h" -#endif /* WIN2000 */ - -#ifdef LINUX_XF86 -#include "xf86.h" -#include "xf86PciInfo.h" -#include "xgi.h" -#include "xgi_regs.h" -#endif - -#ifdef LINUX_KERNEL #include <linux/version.h> #include <asm/io.h> #include <linux/types.h> #include "XGIfb.h" -/*#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -#include <video/XGIfb.h> -#else -#include <linux/XGIfb.h> -#endif*/ -#endif - - #include "vb_def.h" #include "vgatypes.h" @@ -42,43 +9,33 @@ #include "vb_util.h" #include "vb_setmode.h" #include "vb_ext.h" -extern UCHAR XGI330_SoftSetting; -extern UCHAR XGI330_OutputSelect; -extern USHORT XGI330_RGBSenseData2; -extern USHORT XGI330_YCSenseData2; -extern USHORT XGI330_VideoSenseData2; -#ifdef WIN2000 -extern UCHAR SenseCHTV(PHW_DEVICE_EXTENSION pHWDE); /* 2007/05/17 Billy */ -#endif -void XGI_GetSenseStatus( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ); -BOOLEAN XGINew_GetPanelID(PVB_DEVICE_INFO pVBInfo); -USHORT XGINew_SenseLCD(PXGI_HW_DEVICE_INFO,PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGINew_GetLCDDDCInfo(PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); -void XGISetDPMS( PXGI_HW_DEVICE_INFO pXGIHWDE , ULONG VESA_POWER_STATE ) ; -BOOLEAN XGINew_BridgeIsEnable(PXGI_HW_DEVICE_INFO,PVB_DEVICE_INFO pVBInfo ); -BOOLEAN XGINew_Sense(USHORT tempbx,USHORT tempcx, PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGINew_SenseHiTV( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) ; +extern unsigned char XGI330_SoftSetting; +extern unsigned char XGI330_OutputSelect; +extern unsigned short XGI330_RGBSenseData2; +extern unsigned short XGI330_YCSenseData2; +extern unsigned short XGI330_VideoSenseData2; +void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo); +unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *, + struct vb_device_info *pVBInfo); +unsigned char XGINew_GetLCDDDCInfo(struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo); +void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE, + unsigned long VESA_POWER_STATE); +unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo); +unsigned char XGINew_Sense(unsigned short tempbx, unsigned short tempcx, + struct vb_device_info *pVBInfo); +unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo); /************************************************************** Dynamic Sense *************************************************************/ void XGI_WaitDisplay(void); -BOOLEAN XGI_Is301C(PVB_DEVICE_INFO); -BOOLEAN XGI_Is301LV(PVB_DEVICE_INFO); - -#ifdef WIN2000 -UCHAR XGI_SenseLCD(PHW_DEVICE_EXTENSION, PVB_DEVICE_INFO); -UCHAR XGI_GetLCDDDCInfo(PHW_DEVICE_EXTENSION,PVB_DEVICE_INFO); +unsigned char XGI_Is301C(struct vb_device_info *); +unsigned char XGI_Is301LV(struct vb_device_info *); -extern BOOL bGetDdcInfo( -PHW_DEVICE_EXTENSION pHWDE, -ULONG ulWhichOne, -PUCHAR pjQueryBuffer, -ULONG ulBufferSize - ); - -#endif /* --------------------------------------------------------------------- */ @@ -87,9 +44,9 @@ ULONG ulBufferSize /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGINew_Is301B( PVB_DEVICE_INFO pVBInfo ) +unsigned char XGINew_Is301B(struct vb_device_info *pVBInfo) { - USHORT flag ; + unsigned short flag ; flag = XGINew_GetReg1( pVBInfo->Part4Port , 0x01 ) ; @@ -105,7 +62,7 @@ BOOLEAN XGINew_Is301B( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_Is301C( PVB_DEVICE_INFO pVBInfo ) +unsigned char XGI_Is301C(struct vb_device_info *pVBInfo) { if ( ( XGINew_GetReg1( pVBInfo->Part4Port , 0x01 ) & 0xF0 ) == 0xC0 ) return( 1 ) ; @@ -126,7 +83,7 @@ BOOLEAN XGI_Is301C( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_Is301LV( PVB_DEVICE_INFO pVBInfo ) +unsigned char XGI_Is301LV(struct vb_device_info *pVBInfo) { if ( XGINew_GetReg1( pVBInfo->Part4Port , 0x01 ) >= 0xD0 ) { @@ -145,9 +102,11 @@ BOOLEAN XGI_Is301LV( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGINew_Sense( USHORT tempbx , USHORT tempcx, PVB_DEVICE_INFO pVBInfo ) +unsigned char XGINew_Sense(unsigned short tempbx, + unsigned short tempcx, + struct vb_device_info *pVBInfo) { - USHORT temp , i , tempch ; + unsigned short temp, i, tempch; temp = tempbx & 0xFF ; XGINew_SetReg1( pVBInfo->Part4Port , 0x11 , temp ) ; @@ -169,284 +128,6 @@ BOOLEAN XGINew_Sense( USHORT tempbx , USHORT tempcx, PVB_DEVICE_INFO pVBInfo ) return( 0 ) ; } -#ifdef WIN2000 -/* --------------------------------------------------------------------- */ -/* Function : XGI_SenseLCD */ -/* Input : */ -/* Output : */ -/* Description : */ -/* --------------------------------------------------------------------- */ -UCHAR XGI_SenseLCD( PHW_DEVICE_EXTENSION pHWDE, PVB_DEVICE_INFO pVBInfo) -{ - USHORT tempax , tempbx , tempcx ; - UCHAR SoftSetting = XGI330_SoftSetting ; - - if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV ) ) - return( 1 ) ; - - - if ( SoftSetting & HotPlugFunction ) /* Hot Plug Detection */ - { - XGINew_SetRegAND( pVBInfo->Part4Port , 0x0F , 0x3F ) ; - tempbx = 0 ; - tempcx = 0x9010 ; - if ( XGINew_Sense( tempbx , tempcx, pVBInfo ) ) - return( 1 ) ; - - return( 0 ) ; - } - else /* Get LCD Info from EDID */ - return(XGI_GetLCDDDCInfo(pHWDE, pVBInfo)); -} - - -/* --------------------------------------------------------------------- */ -/* Function : XGI_GetLCDDDCInfo */ -/* Input : */ -/* Output : */ -/* Description : */ -/* --------------------------------------------------------------------- */ -UCHAR XGI_GetLCDDDCInfo( PHW_DEVICE_EXTENSION pHWDE , PVB_DEVICE_INFO pVBInfo) -{ - UCHAR tempah , tempbl , tempbh ; - USHORT tempbx , temp ; - UCHAR pjEDIDBuf[ 256 ] ; - ULONG ulBufferSize = 256 ; - UCHAR bMASK_OUTPUTSTATE_CRT2LCD = 2 ; /* 0423 shampoo */ - - bGetDdcInfo( pHWDE , MASK_OUTPUTSTATE_CRT2LCD , pjEDIDBuf , ulBufferSize ) ; - if ( ( *( ( PULONG )pjEDIDBuf ) == 0xFFFFFF00 ) && ( *( ( PULONG )( pjEDIDBuf + 4 ) ) == 0x00FFFFFF ) ) - { - tempah = Panel1024x768 ; - tempbl=( *( pjEDIDBuf + 0x3A ) ) & 0xf0 ; - - if ( tempbl != 0x40 ) - { - tempah = Panel1600x1200 ; - if ( tempbl != 0x60 ) - { - tempah = Panel1280x1024 ; - tempbh = ( *( pjEDIDBuf + 0x3B ) ) ; - if ( tempbh != 0x00 ) - { - tempah = Panel1280x960 ; - if ( tempbh != 0x0C0 ) - { - tempbx = ( ( *( pjEDIDBuf + 0x24 ) ) << 8 ) | ( *( pjEDIDBuf + 0x23 ) ) ; - tempah = Panel1280x1024 ; - if ( !( tempbx & 0x0100 ) ) - { - tempah = Panel1024x768 ; - if ( !( tempbx & 0x0E00 ) ) - { - tempah = Panel1280x1024 ; - } - } - } - - if ( tempbx & 0x00FF ) - { - temp = ScalingLCD ; - XGINew_SetRegOR( pVBInfo->P3d4 , 0x37 , temp ) ; - } - } - } - } - XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x36 , ( ~0x07 ) , tempah ) ; - tempah = ( ( *( pjEDIDBuf + 0x47 ) ) & 0x06 ) ; /* Polarity */ - tempah = ( tempah ^ 0x06 ) << 4 ; - tempah |= LCDSync ; - XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x37 , ( ~LCDSyncBit ) , tempah ) ; - tempbh= XGINew_GetReg1( pVBInfo->P3d4 , 0x36 ) ; - tempbh &= 0x07 ; - if ( tempbh == Panel1280x960 ) - XGINew_SetRegAND( pVBInfo->P3d4 , 0x37 , 0x0E ) ; - } - else if ( *pjEDIDBuf == 0x20 ) - { - tempah = Panel1024x768 ; - XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x36 , ( ~0x07 ) , tempah ) ; - } - else - { - return( 0 ) ; - } - - return( 1 ) ; -} - - -/* --------------------------------------------------------------------- */ -/* Function : XGI_DySense */ -/* Input : */ -/* Output : */ -/* Description : */ -/* --------------------------------------------------------------------- */ -BOOLEAN XGI_DySense( PHW_DEVICE_EXTENSION pHWDE , PUCHAR ujConnectStatus) -{ - UCHAR pre_CRD,pre_SR1E , pre_Part2_0 , pre_Part4_D ; - USHORT tempax , tempbx , tempcx , pushax , temp ; - VB_DEVICE_INFO VBINF; - PVB_DEVICE_INFO pVBInfo = &VBINF; - UCHAR OutputSelect = XGI330_OutputSelect ; - PXGI_HW_DEVICE_INFO HwDeviceExtension= pHWDE->pXGIHWDE ; - UCHAR bConnectStatus = 0 ; - pVBInfo->BaseAddr = HwDeviceExtension->pjIOAddress ; - pVBInfo->ROMAddr = pHWDE->pjVirtualRomBase ; - - pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12 ; - pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; - pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24 ; - pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10 ; - pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 ; - pushax = XGINew_GetReg1( pVBInfo->P3d4 , 0x17 ) ; /* 0512 Fix Dysense hanged */ - temp = ( pushax & 0x00FF ) | 0x80 ; - XGINew_SetRegOR( pVBInfo->P3d4 , 0x17 , temp ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x05 , 0x86 ) ; - /* beginning of dynamic sense CRT1 */ - - pVBInfo->IF_DEF_CH7007 = 0; - if (pHWDE->bCH7007) - { - InitTo330Pointer( pHWDE->pXGIHWDE->jChipType, pVBInfo ) ; - HwDeviceExtension->pDevice = (PVOID)pHWDE; - pVBInfo->IF_DEF_CH7007 = 1; - /* [Billy] 2007/05/14 For CH7007 */ - if ( pVBInfo->IF_DEF_CH7007 == 1 ) - { - bConnectStatus = SenseCHTV(HwDeviceExtension->pDevice) ; /* 07/05/28 */ - XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x32 , ~0x03 , (UCHAR)bConnectStatus ) ; - } - } - if(( pHWDE->jChipID >= XG40 ) || ( pHWDE->jChipID >= XG20 )) - { - - if ( pHWDE->jChipID >= XG40 ) - XGINew_SetReg1( pVBInfo->P3d4 , 0x57 , 0x4A ) ; /* write sense pattern 30->4a */ - else - XGINew_SetReg1( pVBInfo->P3d4 , 0x57 , 0x5F ) ; /* write sense pattern */ - - XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x53 , 0xFF , 0x02 ) ; /* enable sense DAC */ - XGI_WaitDisply(pVBInfo) ; - - if(XGINew_GetReg2( pVBInfo->P3c2 ) & 0x10 ) - bConnectStatus |= Monitor1Sense ; - - XGINew_SetRegAND( pVBInfo->P3d4 , 0x53 , 0xFD ) ; /* disable sense DAC */ - XGINew_SetRegAND( pVBInfo->P3d4 , 0x57 , 0x00 ) ; /* clear sense pattern */ - - - /* ---------- End of dynamic sense CRT1 ----------- */ - - /* ---------- beginning of dynamic sense VB ------------ */ - pre_SR1E = XGINew_GetReg1( pVBInfo->P3c4 , 0x1E ) ; - XGINew_SetRegOR( pVBInfo->P3c4 , 0x1E , 0x20 ) ; /* Enable CRT2,work-a-round for 301B/301LV/302LV */ - pre_Part2_0 = XGINew_GetReg1( pVBInfo->Part2Port , 0x00 ) ; - pre_Part4_D = XGINew_GetReg1( pVBInfo->Part4Port , 0x0D ) ; - - if ( XGI_Is301C( pVBInfo ) ) /* 301C only */ - XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x0D , ~0x07 , 0x01 ) ; /* Set Part4 0x0D D[2:0] to 001b */ - - /* tempax = 0 ; */ - if ( !XGI_Is301LV( pVBInfo ) ) - { - tempbx = XGI330_RGBSenseData2 ; - tempcx = 0x0E08 ; - if(XGINew_Sense( tempbx , tempcx, pVBInfo ) ) - { - bConnectStatus |= Monitor2Sense ; - if ( OutputSelect & SetSCARTOutput ) - { - bConnectStatus ^= ( Monitor2Sense | SCARTSense ) ; - } - } - } - if ( XGI_Is301C( pVBInfo ) ) /* 301C only */ - XGINew_SetRegOR( pVBInfo->Part4Port , 0x0D , 0x04 ) ; /* Set Part4 0x0D D[2]=1 for dynamic sense */ - - if ( ( XGINew_Is301B( pVBInfo ) ) ) - XGINew_SetRegOR( pVBInfo->Part2Port , 0x00 , 0x0C ) ; /* ????????? */ - - if ( XGINew_SenseHiTV( HwDeviceExtension , pVBInfo) ) /* add by kuku for Dysense HiTV //start */ - { - bConnectStatus|= YPbPrSense ; - } - else - { - tempbx = XGI330_YCSenseData2 ; /* Y/C Sense Data Ptr */ - tempcx = 0x0604 ; - if ( XGINew_Sense( tempbx , tempcx , pVBInfo) ) - bConnectStatus |= SVIDEOSense ; - - if ( OutputSelect & BoardTVType ) - { - tempbx = XGI330_VideoSenseData2 ; - tempcx = 0x0804 ; - if ( XGINew_Sense(tempbx , tempcx, pVBInfo) ) - bConnectStatus|= AVIDEOSense ; - } - else - { - if ( !( bConnectStatus & SVIDEOSense ) ) - { - tempbx = XGI330_VideoSenseData2 ; - tempcx = 0x0804 ; - if ( XGINew_Sense( tempbx , tempcx, pVBInfo ) ) - bConnectStatus |= AVIDEOSense ; - } - } - } /* end */ - /* DySenseVBCnt */ - - tempbx = 0 ; - tempcx = 0 ; - XGINew_Sense(tempbx , tempcx, pVBInfo ) ; - - if ( !( bConnectStatus & Monitor2Sense ) ) - { - if ( XGI_SenseLCD( pHWDE , pVBInfo ) ) - bConnectStatus |= LCDSense ; - } - - XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x32 , ~( AVIDEOSense | SVIDEOSense | LCDSense | Monitor2Sense | Monitor1Sense ) , bConnectStatus ) ; - - XGINew_SetReg1( pVBInfo->Part4Port , 0x0D , pre_Part4_D ) ; - XGINew_SetReg1( pVBInfo->Part2Port , 0x00 , pre_Part2_0 ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x1E , pre_SR1E ) ; - - if ( XGI_Is301C( pVBInfo ) ) /* 301C only */ - { - tempax = XGINew_GetReg1( pVBInfo->Part2Port , 0x00 ) ; - if ( tempax & 0x20 ) - { - /* Reset VBPro */ - for( tempcx = 2 ; tempcx > 0 ; tempcx-- ) - { - tempax ^= 0x20 ; - XGINew_SetReg1( pVBInfo->Part2Port , 0x00 , tempax ) ; - } - } - } - /* End of dynamic sense VB */ - } - else - { - XGI_SenseCRT1(pVBInfo) ; - XGI_GetSenseStatus( HwDeviceExtension, pVBInfo ) ; /* sense CRT2 */ - bConnectStatus = XGINew_GetReg1( pVBInfo->P3d4 , 0x32 ) ; - } - temp = pushax & 0x00FF ; /* 0512 Fix Dysense hanged */ - XGINew_SetReg1( pVBInfo->P3d4 , 0x17 , temp ) ; - if ( bConnectStatus ) - { - *ujConnectStatus = bConnectStatus ; - return( 1 ) ; - } - else - return( 0 ) ; -} - -#endif /* WIN2000 */ /* --------------------------------------------------------------------- */ /* Function : XGISetDPMS */ @@ -454,13 +135,14 @@ BOOLEAN XGI_DySense( PHW_DEVICE_EXTENSION pHWDE , PUCHAR ujConnectStatus) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -VOID XGISetDPMS( PXGI_HW_DEVICE_INFO pXGIHWDE , ULONG VESA_POWER_STATE ) +void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE, + unsigned long VESA_POWER_STATE) { - USHORT ModeNo, ModeIdIndex ; - UCHAR temp ; - VB_DEVICE_INFO VBINF; - PVB_DEVICE_INFO pVBInfo = &VBINF; - pVBInfo->BaseAddr = (ULONG)pXGIHWDE->pjIOAddress ; + unsigned short ModeNo, ModeIdIndex; + unsigned char temp; + struct vb_device_info VBINF; + struct vb_device_info *pVBInfo = &VBINF; + pVBInfo->BaseAddr = (unsigned long)pXGIHWDE->pjIOAddress ; pVBInfo->ROMAddr = pXGIHWDE->pjVirtualRomBase ; @@ -527,18 +209,18 @@ VOID XGISetDPMS( PXGI_HW_DEVICE_INFO pXGIHWDE , ULONG VESA_POWER_STATE ) } if ( VESA_POWER_STATE == 0x00000400 ) - XGINew_SetReg1( pVBInfo->Part4Port , 0x31 , ( UCHAR )( XGINew_GetReg1( pVBInfo->Part4Port , 0x31 ) & 0xFE ) ) ; + XGINew_SetReg1(pVBInfo->Part4Port, 0x31, (unsigned char)(XGINew_GetReg1(pVBInfo->Part4Port, 0x31) & 0xFE)); else - XGINew_SetReg1( pVBInfo->Part4Port , 0x31 , ( UCHAR )( XGINew_GetReg1( pVBInfo->Part4Port , 0x31 ) | 0x01 ) ) ; + XGINew_SetReg1(pVBInfo->Part4Port, 0x31, (unsigned char)(XGINew_GetReg1(pVBInfo->Part4Port, 0x31) | 0x01)); - temp = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x1f ) ; + temp = (unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x1f); temp &= 0x3f ; switch ( VESA_POWER_STATE ) { case 0x00000000: /* on */ if ( ( pXGIHWDE->ujVBChipID == VB_CHIP_301 ) || ( pXGIHWDE->ujVBChipID == VB_CHIP_302 ) ) { - XGINew_SetReg1( pVBInfo->P3c4 , 0x1f , ( UCHAR )( temp | 0x00 ) ) ; + XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char)(temp | 0x00)); XGI_EnableBridge( pXGIHWDE, pVBInfo ) ; } else @@ -596,7 +278,7 @@ VOID XGISetDPMS( PXGI_HW_DEVICE_INFO pXGIHWDE , ULONG VESA_POWER_STATE ) XGI_DisplayOff( pXGIHWDE, pVBInfo ); } - XGINew_SetReg1( pVBInfo->P3c4 , 0x1f , ( UCHAR )( temp | 0x40 ) ) ; + XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char)(temp | 0x40)); break ; case 0x00000200: /* suspend */ if ( pXGIHWDE->jChipType == XG21 ) @@ -609,12 +291,12 @@ VOID XGISetDPMS( PXGI_HW_DEVICE_INFO pXGIHWDE , ULONG VESA_POWER_STATE ) XGI_DisplayOff( pXGIHWDE, pVBInfo ); XGI_XG27BLSignalVDD( 0x20 , 0x00, pVBInfo ) ; /* LVDS signal off */ } - XGINew_SetReg1( pVBInfo->P3c4 , 0x1f , ( UCHAR )( temp | 0x80 ) ) ; + XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char)(temp | 0x80)); break ; case 0x00000400: /* off */ if ( (pXGIHWDE->ujVBChipID == VB_CHIP_301 ) || ( pXGIHWDE->ujVBChipID == VB_CHIP_302 ) ) { - XGINew_SetReg1( pVBInfo->P3c4 , 0x1f , ( UCHAR )( temp | 0xc0 ) ) ; + XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char)(temp | 0xc0)); XGI_DisableBridge( pXGIHWDE, pVBInfo ) ; } else @@ -677,12 +359,12 @@ VOID XGISetDPMS( PXGI_HW_DEVICE_INFO pXGIHWDE , ULONG VESA_POWER_STATE ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetSenseStatus( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT tempax = 0 , tempbx , tempcx , temp , + unsigned short tempax = 0 , tempbx , tempcx , temp , P2reg0 = 0 , SenseModeNo = 0 , OutputSelect = *pVBInfo->pOutputSelect , ModeIdIndex , i ; - pVBInfo->BaseAddr = (ULONG)HwDeviceExtension->pjIOAddress ; + pVBInfo->BaseAddr = (unsigned long)HwDeviceExtension->pjIOAddress ; if ( pVBInfo->IF_DEF_LVDS == 1 ) { @@ -876,10 +558,11 @@ void XGI_GetSenseStatus( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -USHORT XGINew_SenseLCD( PXGI_HW_DEVICE_INFO HwDeviceExtension ,PVB_DEVICE_INFO pVBInfo) +unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo) { - /* USHORT SoftSetting ; */ - USHORT temp ; + /* unsigned short SoftSetting ; */ + unsigned short temp ; if ( ( HwDeviceExtension->jChipType >= XG20 ) || ( HwDeviceExtension->jChipType >= XG40 ) ) temp = 0 ; @@ -899,9 +582,9 @@ USHORT XGINew_SenseLCD( PXGI_HW_DEVICE_INFO HwDeviceExtension ,PVB_DEVICE_INFO p /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGINew_GetLCDDDCInfo( PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo) +unsigned char XGINew_GetLCDDDCInfo(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT temp ; + unsigned short temp ; /* add lcd sense */ if ( HwDeviceExtension->ulCRT2LCDType == LCD_UNKNOWN ) @@ -910,7 +593,7 @@ BOOLEAN XGINew_GetLCDDDCInfo( PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_I } else { - temp = ( USHORT )HwDeviceExtension->ulCRT2LCDType ; + temp = (unsigned short)HwDeviceExtension->ulCRT2LCDType ; switch( HwDeviceExtension->ulCRT2LCDType ) { case LCD_INVALID: @@ -952,26 +635,27 @@ BOOLEAN XGINew_GetLCDDDCInfo( PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_I /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGINew_GetPanelID(PVB_DEVICE_INFO pVBInfo ) +unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo) { - USHORT PanelTypeTable[ 16 ] = { SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType00 , - SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType01 , - SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType02 , - SyncNN | PanelRGB18Bit | Panel640x480 | _PanelType03 , - SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType04 , - SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType05 , - SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType06 , - SyncNN | PanelRGB24Bit | Panel1024x768 | _PanelType07 , - SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType08 , - SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType09 , - SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType0A , - SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0B , - SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0C , - SyncNN | PanelRGB24Bit | Panel1024x768 | _PanelType0D , - SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0E , - SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0F } ; - USHORT tempax , tempbx , temp ; - /* USHORT return_flag ; */ + unsigned short PanelTypeTable[16] = { + SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType00, + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType01, + SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType02, + SyncNN | PanelRGB18Bit | Panel640x480 | _PanelType03, + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType04, + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType05, + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType06, + SyncNN | PanelRGB24Bit | Panel1024x768 | _PanelType07, + SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType08, + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType09, + SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType0A, + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0B, + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0C, + SyncNN | PanelRGB24Bit | Panel1024x768 | _PanelType0D, + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0E, + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0F }; + unsigned short tempax , tempbx, temp; + /* unsigned short return_flag ; */ tempax = XGINew_GetReg1( pVBInfo->P3c4 , 0x1A ) ; tempbx = tempax & 0x1E ; @@ -1024,9 +708,9 @@ BOOLEAN XGINew_GetPanelID(PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGINew_BridgeIsEnable( PXGI_HW_DEVICE_INFO HwDeviceExtension ,PVB_DEVICE_INFO pVBInfo) +unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT flag ; + unsigned short flag ; if ( XGI_BridgeIsOn( pVBInfo ) == 0 ) { @@ -1051,9 +735,9 @@ BOOLEAN XGINew_BridgeIsEnable( PXGI_HW_DEVICE_INFO HwDeviceExtension ,PVB_DEVICE /* Output : */ /* Description : */ /* ------------------------------------------------------ */ -BOOLEAN XGINew_SenseHiTV( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) +unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT tempbx , tempcx , temp , i , tempch; + unsigned short tempbx , tempcx , temp , i , tempch; tempbx = *pVBInfo->pYCSenseData2 ; @@ -1132,14 +816,14 @@ BOOLEAN XGINew_SenseHiTV( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INF ; DX: PAnel V. resolution ;----------------------------------------------------------------------------- */ -void XGI_XG21Fun14Sub70( PVB_DEVICE_INFO pVBInfo , PX86_REGS pBiosArguments ) +void XGI_XG21Fun14Sub70(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments) { - USHORT ModeIdIndex; - USHORT ModeNo; + unsigned short ModeIdIndex; + unsigned short ModeNo; - USHORT EModeCount; - USHORT lvdstableindex; + unsigned short EModeCount; + unsigned short lvdstableindex; lvdstableindex = XGI_GetLVDSOEMTableIndex( pVBInfo ); pBiosArguments->h.bl = 0x81; @@ -1153,7 +837,7 @@ void XGI_XG21Fun14Sub70( PVB_DEVICE_INFO pVBInfo , PX86_REGS pBiosArguments ) ModeNo = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeID; if ( pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeID == 0xFF ) { - pBiosArguments->h.bh = (UCHAR) EModeCount; + pBiosArguments->h.bh = (unsigned char) EModeCount; return; } if ( !XGI_XG21CheckLVDSMode( ModeNo , ModeIdIndex, pVBInfo) ) @@ -1175,13 +859,13 @@ void XGI_XG21Fun14Sub70( PVB_DEVICE_INFO pVBInfo , PX86_REGS pBiosArguments ) ; ;----------------------------------------------------------------------------- */ -void XGI_XG21Fun14Sub71( PVB_DEVICE_INFO pVBInfo , PX86_REGS pBiosArguments ) +void XGI_XG21Fun14Sub71(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments) { - USHORT EModeCount; - USHORT ModeIdIndex,resindex; - USHORT ModeNo; - USHORT EModeIndex = pBiosArguments->h.bh; + unsigned short EModeCount; + unsigned short ModeIdIndex, resindex; + unsigned short ModeNo; + unsigned short EModeIndex = pBiosArguments->h.bh; EModeCount = 0; for( ModeIdIndex = 0 ; ; ModeIdIndex ++ ) @@ -1199,7 +883,7 @@ void XGI_XG21Fun14Sub71( PVB_DEVICE_INFO pVBInfo , PX86_REGS pBiosArguments ) if (EModeCount == EModeIndex) { resindex = XGI_GetResInfo( ModeNo , ModeIdIndex, pVBInfo ) ; - pBiosArguments->h.bl = (UCHAR) ModeNo; + pBiosArguments->h.bl = (unsigned char) ModeNo; pBiosArguments->x.cx = pVBInfo->ModeResInfo[ resindex ].HTotal ; /* xres->ax */ pBiosArguments->x.dx = pVBInfo->ModeResInfo[ resindex ].VTotal ; /* yres->bx */ pBiosArguments->x.ax = 0x0014; @@ -1221,10 +905,10 @@ void XGI_XG21Fun14Sub71( PVB_DEVICE_INFO pVBInfo , PX86_REGS pBiosArguments ) ; ;----------------------------------------------------------------------------- */ -void XGI_XG21Fun14Sub72( PVB_DEVICE_INFO pVBInfo , PX86_REGS pBiosArguments ) +void XGI_XG21Fun14Sub72(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments) { - USHORT ModeIdIndex,resindex; - USHORT ModeNo; + unsigned short ModeIdIndex, resindex; + unsigned short ModeNo; ModeNo = pBiosArguments->h.bl ; @@ -1280,11 +964,11 @@ void XGI_XG21Fun14Sub72( PVB_DEVICE_INFO pVBInfo , PX86_REGS pBiosArguments ) ; BX[6]: *Value1 D[6] Panel H. Polarity ;----------------------------------------------------------------------------- */ -void XGI_XG21Fun14Sub73( PVB_DEVICE_INFO pVBInfo , PX86_REGS pBiosArguments ) +void XGI_XG21Fun14Sub73(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments) { - UCHAR Select; + unsigned char Select; - USHORT lvdstableindex; + unsigned short lvdstableindex; lvdstableindex = XGI_GetLVDSOEMTableIndex( pVBInfo ); Select = pBiosArguments->h.bl; @@ -1314,10 +998,10 @@ void XGI_XG21Fun14Sub73( PVB_DEVICE_INFO pVBInfo , PX86_REGS pBiosArguments ) } -void XGI_XG21Fun14( PXGI_HW_DEVICE_INFO pXGIHWDE, PX86_REGS pBiosArguments) +void XGI_XG21Fun14(struct xgi_hw_device_info *pXGIHWDE, PX86_REGS pBiosArguments) { - VB_DEVICE_INFO VBINF; - PVB_DEVICE_INFO pVBInfo = &VBINF; + struct vb_device_info VBINF; + struct vb_device_info *pVBInfo = &VBINF; pVBInfo->IF_DEF_LVDS = 0 ; pVBInfo->IF_DEF_CH7005 = 0 ; diff --git a/drivers/staging/xgifb/vb_ext.h b/drivers/staging/xgifb/vb_ext.h index 9a72f5ecb713..5cc4d12c2254 100644 --- a/drivers/staging/xgifb/vb_ext.h +++ b/drivers/staging/xgifb/vb_ext.h @@ -2,15 +2,17 @@ #define _VBEXT_ struct DWORDREGS { - ULONG Eax, Ebx, Ecx, Edx, Esi, Edi, Ebp; + unsigned long Eax, Ebx, Ecx, Edx, Esi, Edi, Ebp; }; struct WORDREGS { - USHORT ax, hi_ax, bx, hi_bx, cx, hi_cx, dx, hi_dx, si, hi_si, di ,hi_di, bp, hi_bp; + unsigned short ax, hi_ax, bx, hi_bx, cx, hi_cx, dx, hi_dx, si, + hi_si, di, hi_di, bp, hi_bp; }; struct BYTEREGS { - UCHAR al, ah, hi_al, hi_ah, bl, bh, hi_bl, hi_bh, cl, ch, hi_cl, hi_ch, dl, dh, hi_dl, hi_dh; + unsigned char al, ah, hi_al, hi_ah, bl, bh, hi_bl, hi_bh, cl, ch, + hi_cl, hi_ch, dl, dh, hi_dl, hi_dh; }; typedef union _X86_REGS { @@ -19,14 +21,14 @@ typedef union _X86_REGS { struct BYTEREGS h; } X86_REGS, *PX86_REGS; -extern void XGI_XG21Fun14( PXGI_HW_DEVICE_INFO pXGIHWDE, PX86_REGS pBiosArguments); -extern void XGISetDPMS( PXGI_HW_DEVICE_INFO pXGIHWDE , ULONG VESA_POWER_STATE ) ; -extern void XGI_GetSenseStatus( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ); -extern void XGINew_SetModeScratch ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) ; -extern void ReadVBIOSTablData( UCHAR ChipType , PVB_DEVICE_INFO pVBInfo); -extern USHORT XGINew_SenseLCD(PXGI_HW_DEVICE_INFO,PVB_DEVICE_INFO pVBInfo); -#ifdef WIN2000 -extern BOOLEAN XGI_DySense( PHW_DEVICE_EXTENSION pHWDE , PUCHAR ujConnectStatus ); -#endif /* WIN2000 */ +extern void XGI_XG21Fun14(struct xgi_hw_device_info *pXGIHWDE, PX86_REGS pBiosArguments); +extern void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE, + unsigned long VESA_POWER_STATE); +extern void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +extern void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ; +extern void ReadVBIOSTablData(unsigned char ChipType, + struct vb_device_info *pVBInfo); +extern unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *, + struct vb_device_info *pVBInfo); #endif diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c index b85ca9ba8076..e02722d05f68 100644 --- a/drivers/staging/xgifb/vb_init.c +++ b/drivers/staging/xgifb/vb_init.c @@ -1,29 +1,9 @@ -#include "osdef.h" #include "vgatypes.h" - -#ifdef LINUX_KERNEL #include <linux/version.h> #include <linux/types.h> #include <linux/delay.h> /* udelay */ #include "XGIfb.h" -/*#if LINUX_VERSxION_CODE >= KERNEL_VERSION(2,5,0) -#include <video/XGIfb.h> -#else -#include <linux/XGIfb.h> -#endif */ -#endif - -#ifdef WIN2000 -#include <dderror.h> -#include <devioctl.h> -#include <miniport.h> -#include <ntddvdeo.h> -#include <video.h> -#include "xgiv.h" -#include "dd_i2c.h" -#include "tools.h" -#endif #include "vb_def.h" #include "vb_struct.h" @@ -32,123 +12,105 @@ #include "vb_init.h" #include "vb_ext.h" -#ifdef LINUX_XF86 -#include "xf86.h" -#include "xf86PciInfo.h" -#include "xgi.h" -#include "xgi_regs.h" -#endif -#ifdef LINUX_KERNEL #include <asm/io.h> -#include <linux/types.h> -#endif -UCHAR XGINew_ChannelAB,XGINew_DataBusWidth; - -USHORT XGINew_DRAMType[17][5]={{0x0C,0x0A,0x02,0x40,0x39},{0x0D,0x0A,0x01,0x40,0x48}, - {0x0C,0x09,0x02,0x20,0x35},{0x0D,0x09,0x01,0x20,0x44}, - {0x0C,0x08,0x02,0x10,0x31},{0x0D,0x08,0x01,0x10,0x40}, - {0x0C,0x0A,0x01,0x20,0x34},{0x0C,0x09,0x01,0x08,0x32}, - {0x0B,0x08,0x02,0x08,0x21},{0x0C,0x08,0x01,0x08,0x30}, - {0x0A,0x08,0x02,0x04,0x11},{0x0B,0x0A,0x01,0x10,0x28}, - {0x09,0x08,0x02,0x02,0x01},{0x0B,0x09,0x01,0x08,0x24}, - {0x0B,0x08,0x01,0x04,0x20},{0x0A,0x08,0x01,0x02,0x10}, - {0x09,0x08,0x01,0x01,0x00}}; - -USHORT XGINew_SDRDRAM_TYPE[13][5]= -{ -{ 2,12, 9,64,0x35}, -{ 1,13, 9,64,0x44}, -{ 2,12, 8,32,0x31}, -{ 2,11, 9,32,0x25}, -{ 1,12, 9,32,0x34}, -{ 1,13, 8,32,0x40}, -{ 2,11, 8,16,0x21}, -{ 1,12, 8,16,0x30}, -{ 1,11, 9,16,0x24}, -{ 1,11, 8, 8,0x20}, -{ 2, 9, 8, 4,0x01}, -{ 1,10, 8, 4,0x10}, -{ 1, 9, 8, 2,0x00} -}; - -USHORT XGINew_DDRDRAM_TYPE[4][5]= -{ -{ 2,12, 9,64,0x35}, -{ 2,12, 8,32,0x31}, -{ 2,11, 8,16,0x21}, -{ 2, 9, 8, 4,0x01} -}; -USHORT XGINew_DDRDRAM_TYPE340[4][5]= -{ -{ 2,13, 9,64,0x45}, -{ 2,12, 9,32,0x35}, -{ 2,12, 8,16,0x31}, -{ 2,11, 8, 8,0x21} -}; -USHORT XGINew_DDRDRAM_TYPE20[12][5]= -{ -{ 2,14,11,128,0x5D}, -{ 2,14,10,64,0x59}, -{ 2,13,11,64,0x4D}, -{ 2,14, 9,32,0x55}, -{ 2,13,10,32,0x49}, -{ 2,12,11,32,0x3D}, -{ 2,14, 8,16,0x51}, -{ 2,13, 9,16,0x45}, -{ 2,12,10,16,0x39}, -{ 2,13, 8, 8,0x41}, -{ 2,12, 9, 8,0x35}, -{ 2,12, 8, 4,0x31} -}; - -void XGINew_SetDRAMSize_340(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); -void XGINew_SetDRAMSize_310(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); -void XGINew_SetMemoryClock(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO ); -void XGINew_SetDRAMModeRegister(PVB_DEVICE_INFO ); -void XGINew_SetDRAMModeRegister340( PXGI_HW_DEVICE_INFO HwDeviceExtension ); -void XGINew_SetDRAMDefaultRegister340(PXGI_HW_DEVICE_INFO HwDeviceExtension, ULONG, PVB_DEVICE_INFO ); -UCHAR XGINew_GetXG20DRAMType( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGIInitNew( PXGI_HW_DEVICE_INFO HwDeviceExtension) ; - -int XGINew_DDRSizing340( PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO ); -void XGINew_DisableRefresh( PXGI_HW_DEVICE_INFO ,PVB_DEVICE_INFO) ; -void XGINew_CheckBusWidth_310( PVB_DEVICE_INFO) ; -int XGINew_SDRSizing(PVB_DEVICE_INFO); -int XGINew_DDRSizing( PVB_DEVICE_INFO ); -void XGINew_EnableRefresh( PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); +unsigned char XGINew_ChannelAB, XGINew_DataBusWidth; + +unsigned short XGINew_DRAMType[17][5] = { + {0x0C, 0x0A, 0x02, 0x40, 0x39}, {0x0D, 0x0A, 0x01, 0x40, 0x48}, + {0x0C, 0x09, 0x02, 0x20, 0x35}, {0x0D, 0x09, 0x01, 0x20, 0x44}, + {0x0C, 0x08, 0x02, 0x10, 0x31}, {0x0D, 0x08, 0x01, 0x10, 0x40}, + {0x0C, 0x0A, 0x01, 0x20, 0x34}, {0x0C, 0x09, 0x01, 0x08, 0x32}, + {0x0B, 0x08, 0x02, 0x08, 0x21}, {0x0C, 0x08, 0x01, 0x08, 0x30}, + {0x0A, 0x08, 0x02, 0x04, 0x11}, {0x0B, 0x0A, 0x01, 0x10, 0x28}, + {0x09, 0x08, 0x02, 0x02, 0x01}, {0x0B, 0x09, 0x01, 0x08, 0x24}, + {0x0B, 0x08, 0x01, 0x04, 0x20}, {0x0A, 0x08, 0x01, 0x02, 0x10}, + {0x09, 0x08, 0x01, 0x01, 0x00} }; + +unsigned short XGINew_SDRDRAM_TYPE[13][5] = { + { 2, 12, 9, 64, 0x35}, + { 1, 13, 9, 64, 0x44}, + { 2, 12, 8, 32, 0x31}, + { 2, 11, 9, 32, 0x25}, + { 1, 12, 9, 32, 0x34}, + { 1, 13, 8, 32, 0x40}, + { 2, 11, 8, 16, 0x21}, + { 1, 12, 8, 16, 0x30}, + { 1, 11, 9, 16, 0x24}, + { 1, 11, 8, 8, 0x20}, + { 2, 9, 8, 4, 0x01}, + { 1, 10, 8, 4, 0x10}, + { 1, 9, 8, 2, 0x00} }; + +unsigned short XGINew_DDRDRAM_TYPE[4][5] = { + { 2, 12, 9, 64, 0x35}, + { 2, 12, 8, 32, 0x31}, + { 2, 11, 8, 16, 0x21}, + { 2, 9, 8, 4, 0x01} }; + +unsigned short XGINew_DDRDRAM_TYPE340[4][5] = { + { 2, 13, 9, 64, 0x45}, + { 2, 12, 9, 32, 0x35}, + { 2, 12, 8, 16, 0x31}, + { 2, 11, 8, 8, 0x21} }; + +unsigned short XGINew_DDRDRAM_TYPE20[12][5] = { + { 2, 14, 11, 128, 0x5D}, + { 2, 14, 10, 64, 0x59}, + { 2, 13, 11, 64, 0x4D}, + { 2, 14, 9, 32, 0x55}, + { 2, 13, 10, 32, 0x49}, + { 2, 12, 11, 32, 0x3D}, + { 2, 14, 8, 16, 0x51}, + { 2, 13, 9, 16, 0x45}, + { 2, 12, 10, 16, 0x39}, + { 2, 13, 8, 8, 0x41}, + { 2, 12, 9, 8, 0x35}, + { 2, 12, 8, 4, 0x31} }; + +void XGINew_SetDRAMSize_340(struct xgi_hw_device_info *, struct vb_device_info *); +void XGINew_SetDRAMSize_310(struct xgi_hw_device_info *, struct vb_device_info *); +void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *); +void XGINew_SetDRAMModeRegister(struct vb_device_info *); +void XGINew_SetDRAMModeRegister340(struct xgi_hw_device_info *HwDeviceExtension); +void XGINew_SetDRAMDefaultRegister340(struct xgi_hw_device_info *HwDeviceExtension, + unsigned long, struct vb_device_info *); +unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo); +unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension); + +int XGINew_DDRSizing340(struct xgi_hw_device_info *, struct vb_device_info *); +void XGINew_DisableRefresh(struct xgi_hw_device_info *, struct vb_device_info *) ; +void XGINew_CheckBusWidth_310(struct vb_device_info *) ; +int XGINew_SDRSizing(struct vb_device_info *); +int XGINew_DDRSizing(struct vb_device_info *); +void XGINew_EnableRefresh(struct xgi_hw_device_info *, struct vb_device_info *); int XGINew_RAMType; /*int ModeIDOffset,StandTable,CRT1Table,ScreenOffset,REFIndex;*/ -ULONG UNIROM; /* UNIROM */ -BOOLEAN ChkLFB( PVB_DEVICE_INFO ); -void XGINew_Delay15us(ULONG); -void SetPowerConsume (PXGI_HW_DEVICE_INFO HwDeviceExtension,ULONG XGI_P3d4Port); -void ReadVBIOSTablData( UCHAR ChipType , PVB_DEVICE_INFO pVBInfo); -void XGINew_DDR1x_MRS_XG20( ULONG P3c4 , PVB_DEVICE_INFO pVBInfo); -void XGINew_SetDRAMModeRegister_XG20( PXGI_HW_DEVICE_INFO HwDeviceExtension ); -void XGINew_SetDRAMModeRegister_XG27( PXGI_HW_DEVICE_INFO HwDeviceExtension ); -void XGINew_ChkSenseStatus ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) ; -void XGINew_SetModeScratch ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) ; -void XGINew_GetXG21Sense(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) ; -UCHAR GetXG21FPBits(PVB_DEVICE_INFO pVBInfo); -void XGINew_GetXG27Sense(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) ; -UCHAR GetXG27FPBits(PVB_DEVICE_INFO pVBInfo); - -#ifdef WIN2000 -/* [Billy] 2007/05/20 For CH7007 */ -extern UCHAR CH7007TVReg_UNTSC[][8],CH7007TVReg_ONTSC[][8],CH7007TVReg_UPAL[][8],CH7007TVReg_OPAL[][8]; -extern UCHAR XGI7007_CHTVVCLKUNTSC[],XGI7007_CHTVVCLKONTSC[],XGI7007_CHTVVCLKUPAL[],XGI7007_CHTVVCLKOPAL[]; -#endif - -#ifdef LINUX_KERNEL -void DelayUS(ULONG MicroSeconds) +unsigned long UNIROM; /* UNIROM */ +unsigned char ChkLFB(struct vb_device_info *); +void XGINew_Delay15us(unsigned long); +void SetPowerConsume(struct xgi_hw_device_info *HwDeviceExtension, + unsigned long XGI_P3d4Port); +void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo); +void XGINew_DDR1x_MRS_XG20(unsigned long P3c4, struct vb_device_info *pVBInfo); +void XGINew_SetDRAMModeRegister_XG20(struct xgi_hw_device_info *HwDeviceExtension); +void XGINew_SetDRAMModeRegister_XG27(struct xgi_hw_device_info *HwDeviceExtension); +void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ; +void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ; +void XGINew_GetXG21Sense(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ; +unsigned char GetXG21FPBits(struct vb_device_info *pVBInfo); +void XGINew_GetXG27Sense(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ; +unsigned char GetXG27FPBits(struct vb_device_info *pVBInfo); + +void DelayUS(unsigned long MicroSeconds) { udelay(MicroSeconds); } -#endif + /* --------------------------------------------------------------------- */ /* Function : XGIInitNew */ @@ -156,46 +118,44 @@ void DelayUS(ULONG MicroSeconds) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGIInitNew( PXGI_HW_DEVICE_INFO HwDeviceExtension ) +unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension) { - VB_DEVICE_INFO VBINF; - PVB_DEVICE_INFO pVBInfo = &VBINF; - UCHAR i , temp = 0 , temp1 ; + struct vb_device_info VBINF; + struct vb_device_info *pVBInfo = &VBINF; + unsigned char i, temp = 0, temp1 ; // VBIOSVersion[ 5 ] ; - PUCHAR volatile pVideoMemory; + volatile unsigned char *pVideoMemory; - /* ULONG j, k ; */ + /* unsigned long j, k ; */ - PXGI_DSReg pSR ; + struct XGI_DSReg *pSR ; - ULONG Temp ; + unsigned long Temp ; pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; - pVBInfo->BaseAddr = (ULONG)HwDeviceExtension->pjIOAddress ; + pVBInfo->BaseAddr = (unsigned long)HwDeviceExtension->pjIOAddress ; - pVideoMemory = ( PUCHAR )pVBInfo->ROMAddr; + pVideoMemory = (unsigned char *)pVBInfo->ROMAddr; // Newdebugcode( 0x99 ) ; /* if ( pVBInfo->ROMAddr == 0 ) */ - /* return( FALSE ) ; */ + /* return( 0 ) ; */ - if ( pVBInfo->FBAddr == 0 ) -{ + if (pVBInfo->FBAddr == 0) { printk("\n pVBInfo->FBAddr == 0 "); - return( FALSE ) ; -} + return 0; + } printk("1"); - if ( pVBInfo->BaseAddr == 0 ) -{ - printk("\npVBInfo->BaseAddr == 0 "); - return( FALSE ) ; +if (pVBInfo->BaseAddr == 0) { + printk("\npVBInfo->BaseAddr == 0 "); + return 0; } printk("2"); @@ -205,12 +165,9 @@ printk("2"); printk("3"); if ( !HwDeviceExtension->bIntegratedMMEnabled ) -{ - return( FALSE ) ; /* alan */ -} -printk("4"); + return 0; /* alan */ -// XGI_MemoryCopy( VBIOSVersion , HwDeviceExtension->szVBIOSVer , 4 ) ; +printk("4"); // VBIOSVersion[ 4 ] = 0x0 ; @@ -407,8 +364,8 @@ printk("15"); XGI_UnLockCRT2( HwDeviceExtension, pVBInfo) ; XGINew_SetRegANDOR( pVBInfo->Part0Port , 0x3F , 0xEF , 0x00 ) ; /* alan, disable VideoCapture */ XGINew_SetReg1( pVBInfo->Part1Port , 0x00 , 0x00 ) ; - temp1 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x7B ) ; /* chk if BCLK>=100MHz */ - temp = ( UCHAR )( ( temp1 >> 4 ) & 0x0F ) ; + temp1 = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x7B); /* chk if BCLK>=100MHz */ + temp = (unsigned char)((temp1 >> 4) & 0x0F); XGINew_SetReg1( pVBInfo->Part1Port , 0x02 , ( *pVBInfo->pCRT2Data_1_2 ) ) ; @@ -460,15 +417,14 @@ printk("18"); XGINew_SetReg1( pVBInfo->P3d4 , 0x83 , 0x00 ) ; printk("181"); - if ( HwDeviceExtension->bSkipSense == FALSE ) - { -printk("182"); +if (HwDeviceExtension->bSkipSense == 0) { + printk("182"); XGI_SenseCRT1(pVBInfo) ; -printk("183"); + printk("183"); /* XGINew_DetectMonitor( HwDeviceExtension ) ; */ -pVBInfo->IF_DEF_CH7007 = 0; + pVBInfo->IF_DEF_CH7007 = 0; if ( ( HwDeviceExtension->jChipType == XG21 ) && (pVBInfo->IF_DEF_CH7007) ) { printk("184"); @@ -504,8 +460,7 @@ printk("19"); XGINew_SetDRAMDefaultRegister340( HwDeviceExtension , pVBInfo->P3d4, pVBInfo ) ; - if ( HwDeviceExtension->bSkipDramSizing == TRUE ) - { + if (HwDeviceExtension->bSkipDramSizing == 1) { pSR = HwDeviceExtension->pSR ; if ( pSR!=NULL ) { @@ -519,15 +474,6 @@ printk("19"); } /* SkipDramSizing */ else { -#if 0 - if ( HwDeviceExtension->jChipType == XG20 ) - { - XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , pVBInfo->SR15[0][XGINew_RAMType] ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , pVBInfo->SR15[1][XGINew_RAMType] ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x20 , 0x20 ) ; - } - else -#endif { printk("20"); @@ -544,7 +490,7 @@ printk("22"); /* SetDefExt2Regs begin */ /* AGP = 1 ; - temp =( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x3A ) ; + temp =(unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x3A) ; temp &= 0x30 ; if ( temp == 0x30 ) AGP = 0 ; @@ -563,7 +509,7 @@ printk("22"); // Temp = ( InPortLong( 0xcfc ) & 0xFFFF ) ; // if ( Temp == 0x1039 ) // { - XGINew_SetReg1( pVBInfo->P3c4 , 0x22 , ( UCHAR )( ( *pVBInfo->pSR22 ) & 0xFE ) ) ; + XGINew_SetReg1(pVBInfo->P3c4, 0x22, (unsigned char)((*pVBInfo->pSR22) & 0xFE)); // } // else // { @@ -585,7 +531,7 @@ XGINew_SetReg1( pVBInfo->P3d4 , 0x8c , 0x87); XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x31); printk("25"); - return( TRUE ) ; +return 1; } /* end of init */ @@ -600,9 +546,10 @@ printk("25"); /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -UCHAR XGINew_GetXG20DRAMType( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo) { - UCHAR data, temp ; + unsigned char data, temp; if ( HwDeviceExtension->jChipType < XG20 ) { @@ -670,9 +617,9 @@ UCHAR XGINew_GetXG20DRAMType( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -UCHAR XGINew_Get310DRAMType(PVB_DEVICE_INFO pVBInfo) +unsigned char XGINew_Get310DRAMType(struct vb_device_info *pVBInfo) { - UCHAR data ; + unsigned char data ; /* index = XGINew_GetReg1( pVBInfo->P3c4 , 0x1A ) ; */ /* index &= 07 ; */ @@ -694,7 +641,7 @@ UCHAR XGINew_Get310DRAMType(PVB_DEVICE_INFO pVBInfo) /* Description : */ /* --------------------------------------------------------------------- */ /* -void XGINew_Delay15us(ULONG ulMicrsoSec) +void XGINew_Delay15us(unsigned long ulMicrsoSec) { } */ @@ -706,9 +653,9 @@ void XGINew_Delay15us(ULONG ulMicrsoSec) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SDR_MRS( PVB_DEVICE_INFO pVBInfo ) +void XGINew_SDR_MRS(struct vb_device_info *pVBInfo) { - USHORT data ; + unsigned short data ; data = XGINew_GetReg1( pVBInfo->P3c4 , 0x16 ) ; data &= 0x3F ; /* SR16 D7=0,D6=0 */ @@ -726,7 +673,7 @@ void XGINew_SDR_MRS( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DDR1x_MRS_340( ULONG P3c4 , PVB_DEVICE_INFO pVBInfo) +void XGINew_DDR1x_MRS_340(unsigned long P3c4, struct vb_device_info *pVBInfo) { XGINew_SetReg1( P3c4 , 0x18 , 0x01 ) ; XGINew_SetReg1( P3c4 , 0x19 , 0x20 ) ; @@ -764,7 +711,7 @@ void XGINew_DDR1x_MRS_340( ULONG P3c4 , PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DDR2x_MRS_340( ULONG P3c4 , PVB_DEVICE_INFO pVBInfo) +void XGINew_DDR2x_MRS_340(unsigned long P3c4, struct vb_device_info *pVBInfo) { XGINew_SetReg1( P3c4 , 0x18 , 0x00 ) ; XGINew_SetReg1( P3c4 , 0x19 , 0x20 ) ; @@ -793,9 +740,10 @@ void XGINew_DDR2x_MRS_340( ULONG P3c4 , PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DDRII_Bootup_XG27( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULONG P3c4 , PVB_DEVICE_INFO pVBInfo) +void XGINew_DDRII_Bootup_XG27(struct xgi_hw_device_info *HwDeviceExtension, + unsigned long P3c4, struct vb_device_info *pVBInfo) { - ULONG P3d4 = P3c4 + 0x10 ; + unsigned long P3d4 = P3c4 + 0x10 ; XGINew_RAMType = ( int )XGINew_GetXG20DRAMType( HwDeviceExtension , pVBInfo ) ; XGINew_SetMemoryClock( HwDeviceExtension , pVBInfo ) ; @@ -871,9 +819,10 @@ void XGINew_DDRII_Bootup_XG27( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULONG P3 /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DDR2_MRS_XG20( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULONG P3c4 , PVB_DEVICE_INFO pVBInfo) +void XGINew_DDR2_MRS_XG20(struct xgi_hw_device_info *HwDeviceExtension, + unsigned long P3c4, struct vb_device_info *pVBInfo) { - ULONG P3d4 = P3c4 + 0x10 ; + unsigned long P3d4 = P3c4 + 0x10 ; XGINew_RAMType = ( int )XGINew_GetXG20DRAMType( HwDeviceExtension , pVBInfo ) ; XGINew_SetMemoryClock( HwDeviceExtension , pVBInfo ) ; @@ -923,9 +872,10 @@ void XGINew_DDR2_MRS_XG20( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULONG P3c4 , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DDR2_MRS_XG27( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULONG P3c4 , PVB_DEVICE_INFO pVBInfo) +void XGINew_DDR2_MRS_XG27(struct xgi_hw_device_info *HwDeviceExtension, + unsigned long P3c4, struct vb_device_info *pVBInfo) { - ULONG P3d4 = P3c4 + 0x10 ; + unsigned long P3d4 = P3c4 + 0x10 ; XGINew_RAMType = ( int )XGINew_GetXG20DRAMType( HwDeviceExtension , pVBInfo ) ; XGINew_SetMemoryClock( HwDeviceExtension , pVBInfo ) ; @@ -1001,9 +951,10 @@ void XGINew_DDR2_MRS_XG27( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULONG P3c4 , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DDR1x_DefaultRegister( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULONG Port , PVB_DEVICE_INFO pVBInfo) +void XGINew_DDR1x_DefaultRegister(struct xgi_hw_device_info *HwDeviceExtension, + unsigned long Port, struct vb_device_info *pVBInfo) { - ULONG P3d4 = Port , + unsigned long P3d4 = Port , P3c4 = Port - 0x10 ; if ( HwDeviceExtension->jChipType >= XG20 ) @@ -1061,9 +1012,10 @@ void XGINew_DDR1x_DefaultRegister( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULON /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DDR2x_DefaultRegister( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULONG Port ,PVB_DEVICE_INFO pVBInfo) +void XGINew_DDR2x_DefaultRegister(struct xgi_hw_device_info *HwDeviceExtension, + unsigned long Port, struct vb_device_info *pVBInfo) { - ULONG P3d4 = Port , + unsigned long P3d4 = Port , P3c4 = Port - 0x10 ; XGINew_SetMemoryClock( HwDeviceExtension , pVBInfo ) ; @@ -1112,9 +1064,10 @@ void XGINew_DDR2x_DefaultRegister( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULON /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DDR2_DefaultRegister( PXGI_HW_DEVICE_INFO HwDeviceExtension, ULONG Port , PVB_DEVICE_INFO pVBInfo) +void XGINew_DDR2_DefaultRegister(struct xgi_hw_device_info *HwDeviceExtension, + unsigned long Port, struct vb_device_info *pVBInfo) { - ULONG P3d4 = Port , + unsigned long P3d4 = Port , P3c4 = Port - 0x10 ; /* keep following setting sequence, each setting in the same reg insert idle */ @@ -1150,12 +1103,13 @@ void XGINew_DDR2_DefaultRegister( PXGI_HW_DEVICE_INFO HwDeviceExtension, ULONG P /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetDRAMDefaultRegister340( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULONG Port , PVB_DEVICE_INFO pVBInfo) +void XGINew_SetDRAMDefaultRegister340(struct xgi_hw_device_info *HwDeviceExtension, + unsigned long Port, struct vb_device_info *pVBInfo) { - UCHAR temp , temp1 , temp2 , temp3 , + unsigned char temp, temp1, temp2, temp3 , i , j , k ; - ULONG P3d4 = Port , + unsigned long P3d4 = Port , P3c4 = Port - 0x10 ; XGINew_SetReg1( P3d4 , 0x6D , pVBInfo->CR40[ 8 ][ XGINew_RAMType ] ) ; @@ -1293,11 +1247,11 @@ void XGINew_SetDRAMDefaultRegister340( PXGI_HW_DEVICE_INFO HwDeviceExtension , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DDR_MRS(PVB_DEVICE_INFO pVBInfo) +void XGINew_DDR_MRS(struct vb_device_info *pVBInfo) { - USHORT data ; + unsigned short data ; - PUCHAR volatile pVideoMemory = ( PUCHAR )pVBInfo->ROMAddr ; + volatile unsigned char *pVideoMemory = (unsigned char *)pVBInfo->ROMAddr; /* SR16 <- 1F,DF,2F,AF */ /* yriver modified SR16 <- 0F,DF,0F,AF */ @@ -1361,11 +1315,11 @@ void XGINew_DDR_MRS(PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_VerifyMclk( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +void XGINew_VerifyMclk(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - PUCHAR pVideoMemory = pVBInfo->FBAddr ; - UCHAR i , j ; - USHORT Temp , SR21 ; + unsigned char *pVideoMemory = pVBInfo->FBAddr ; + unsigned char i, j ; + unsigned short Temp , SR21 ; pVideoMemory[ 0 ] = 0xaa ; /* alan */ pVideoMemory[ 16 ] = 0x55 ; /* note: PCI read cache is off */ @@ -1407,9 +1361,9 @@ void XGINew_VerifyMclk( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetDRAMSize_340( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +void XGINew_SetDRAMSize_340(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT data ; + unsigned short data ; pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; @@ -1418,7 +1372,7 @@ void XGINew_SetDRAMSize_340( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_ data = XGINew_GetReg1( pVBInfo->P3c4 , 0x21 ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , ( USHORT )( data & 0xDF ) ) ; /* disable read cache */ + XGINew_SetReg1(pVBInfo->P3c4, 0x21, (unsigned short)(data & 0xDF)); /* disable read cache */ XGI_DisplayOff( HwDeviceExtension, pVBInfo ); /*data = XGINew_GetReg1( pVBInfo->P3c4 , 0x1 ) ;*/ @@ -1426,8 +1380,7 @@ void XGINew_SetDRAMSize_340( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_ /*XGINew_SetReg1( pVBInfo->P3c4 , 0x01 , data ) ;*/ /* Turn OFF Display */ XGINew_DDRSizing340( HwDeviceExtension, pVBInfo ) ; data=XGINew_GetReg1( pVBInfo->P3c4 , 0x21 ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , ( USHORT )( data | 0x20 ) ) ; /* enable read cache */ - + XGINew_SetReg1(pVBInfo->P3c4, 0x21, (unsigned short)(data | 0x20)); /* enable read cache */ } @@ -1437,9 +1390,9 @@ void XGINew_SetDRAMSize_340( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_ /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetDRAMSize_310( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +void XGINew_SetDRAMSize_310(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT data ; + unsigned short data ; pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase , pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; #ifdef XGI301 @@ -1455,7 +1408,7 @@ void XGINew_SetDRAMSize_310( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_ XGISetModeNew( HwDeviceExtension , 0x2e ) ; data = XGINew_GetReg1( pVBInfo->P3c4 , 0x21 ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , ( USHORT )( data & 0xDF ) ) ; /* disable read cache */ + XGINew_SetReg1(pVBInfo->P3c4, 0x21, (unsigned short)(data & 0xDF)); /* disable read cache */ data = XGINew_GetReg1( pVBInfo->P3c4 , 0x1 ) ; data |= 0x20 ; @@ -1464,7 +1417,7 @@ void XGINew_SetDRAMSize_310( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_ data = XGINew_GetReg1( pVBInfo->P3c4 , 0x16 ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , ( USHORT )( data | 0x0F ) ) ; /* assume lowest speed DRAM */ + XGINew_SetReg1(pVBInfo->P3c4, 0x16, (unsigned short)(data | 0x0F)); /* assume lowest speed DRAM */ XGINew_SetDRAMModeRegister( pVBInfo ) ; XGINew_DisableRefresh( HwDeviceExtension, pVBInfo ) ; @@ -1485,11 +1438,11 @@ void XGINew_SetDRAMSize_310( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_ - XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , pVBInfo->SR15[ 1 ][ XGINew_RAMType ] ) ; /* restore SR16 */ + XGINew_SetReg1(pVBInfo->P3c4, 0x16, pVBInfo->SR15[1][XGINew_RAMType]); /* restore SR16 */ XGINew_EnableRefresh( HwDeviceExtension, pVBInfo ) ; data=XGINew_GetReg1( pVBInfo->P3c4 ,0x21 ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , ( USHORT )( data | 0x20 ) ) ; /* enable read cache */ + XGINew_SetReg1(pVBInfo->P3c4, 0x21, (unsigned short)(data | 0x20)); /* enable read cache */ } @@ -1501,14 +1454,14 @@ void XGINew_SetDRAMSize_310( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetDRAMModeRegister340( PXGI_HW_DEVICE_INFO HwDeviceExtension ) +void XGINew_SetDRAMModeRegister340(struct xgi_hw_device_info *HwDeviceExtension) { - UCHAR data ; - VB_DEVICE_INFO VBINF; - PVB_DEVICE_INFO pVBInfo = &VBINF; + unsigned char data ; + struct vb_device_info VBINF; + struct vb_device_info *pVBInfo = &VBINF; pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; - pVBInfo->BaseAddr = (ULONG)HwDeviceExtension->pjIOAddress ; + pVBInfo->BaseAddr = (unsigned long)HwDeviceExtension->pjIOAddress ; pVBInfo->ISXPDOS = 0 ; pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; @@ -1555,7 +1508,7 @@ void XGINew_SetDRAMModeRegister340( PXGI_HW_DEVICE_INFO HwDeviceExtension ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetDRAMModeRegister( PVB_DEVICE_INFO pVBInfo) +void XGINew_SetDRAMModeRegister(struct vb_device_info *pVBInfo) { if ( XGINew_Get310DRAMType( pVBInfo ) < 2 ) { @@ -1575,9 +1528,9 @@ void XGINew_SetDRAMModeRegister( PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DisableRefresh( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +void XGINew_DisableRefresh(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT data ; + unsigned short data ; data = XGINew_GetReg1( pVBInfo->P3c4 , 0x1B ) ; @@ -1593,7 +1546,7 @@ void XGINew_DisableRefresh( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_I /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_EnableRefresh( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +void XGINew_EnableRefresh(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { XGINew_SetReg1( pVBInfo->P3c4 , 0x1B , pVBInfo->SR15[ 3 ][ XGINew_RAMType ] ) ; /* SR1B */ @@ -1608,9 +1561,11 @@ void XGINew_EnableRefresh( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_IN /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DisableChannelInterleaving( int index , USHORT XGINew_DDRDRAM_TYPE[][ 5 ] , PVB_DEVICE_INFO pVBInfo) +void XGINew_DisableChannelInterleaving(int index, + unsigned short XGINew_DDRDRAM_TYPE[][5], + struct vb_device_info *pVBInfo) { - USHORT data ; + unsigned short data ; data = XGINew_GetReg1( pVBInfo->P3c4 , 0x15 ) ; data &= 0x1F ; @@ -1642,9 +1597,11 @@ void XGINew_DisableChannelInterleaving( int index , USHORT XGINew_DDRDRAM_TYPE[] /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetDRAMSizingType( int index , USHORT DRAMTYPE_TABLE[][ 5 ] ,PVB_DEVICE_INFO pVBInfo) +void XGINew_SetDRAMSizingType(int index, + unsigned short DRAMTYPE_TABLE[][5], + struct vb_device_info *pVBInfo) { - USHORT data ; + unsigned short data; data = DRAMTYPE_TABLE[ index ][ 4 ] ; XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x13 , 0x80 , data ) ; @@ -1659,12 +1616,12 @@ void XGINew_SetDRAMSizingType( int index , USHORT DRAMTYPE_TABLE[][ 5 ] ,PVB_DEV /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_CheckBusWidth_310( PVB_DEVICE_INFO pVBInfo) +void XGINew_CheckBusWidth_310(struct vb_device_info *pVBInfo) { - USHORT data ; - PULONG volatile pVideoMemory ; + unsigned short data ; + volatile unsigned long *pVideoMemory ; - pVideoMemory = (PULONG) pVBInfo->FBAddr; + pVideoMemory = (unsigned long *) pVBInfo->FBAddr; if ( XGINew_Get310DRAMType( pVBInfo ) < 2 ) { @@ -1690,7 +1647,7 @@ void XGINew_CheckBusWidth_310( PVB_DEVICE_INFO pVBInfo) XGINew_DataBusWidth = 64 ; XGINew_ChannelAB = 0 ; data=XGINew_GetReg1( pVBInfo->P3c4 , 0x14 ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , ( USHORT )( data & 0xFD ) ) ; + XGINew_SetReg1(pVBInfo->P3c4, 0x14, (unsigned short)(data & 0xFD)); } if ( ( pVideoMemory[ 1 ] != 0x456789ABL ) || ( pVideoMemory[ 0 ] != 0x01234567L ) ) @@ -1699,7 +1656,8 @@ void XGINew_CheckBusWidth_310( PVB_DEVICE_INFO pVBInfo) XGINew_DataBusWidth = 64 ; XGINew_ChannelAB = 1 ; data=XGINew_GetReg1( pVBInfo->P3c4 , 0x14 ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , ( USHORT )( ( data & 0xFD ) | 0x01 ) ) ; + XGINew_SetReg1(pVBInfo->P3c4, 0x14, + (unsigned short)((data & 0xFD) | 0x01)); } return ; @@ -1792,9 +1750,13 @@ void XGINew_CheckBusWidth_310( PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_SetRank( int index , UCHAR RankNo , UCHAR XGINew_ChannelAB , USHORT DRAMTYPE_TABLE[][ 5 ] , PVB_DEVICE_INFO pVBInfo) +int XGINew_SetRank(int index, + unsigned char RankNo, + unsigned char XGINew_ChannelAB, + unsigned short DRAMTYPE_TABLE[][5], + struct vb_device_info *pVBInfo) { - USHORT data ; + unsigned short data; int RankSize ; if ( ( RankNo == 2 ) && ( DRAMTYPE_TABLE[ index ][ 0 ] == 2 ) ) @@ -1829,9 +1791,13 @@ int XGINew_SetRank( int index , UCHAR RankNo , UCHAR XGINew_ChannelAB , USHORT D /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_SetDDRChannel( int index , UCHAR ChannelNo , UCHAR XGINew_ChannelAB , USHORT DRAMTYPE_TABLE[][ 5 ] , PVB_DEVICE_INFO pVBInfo) +int XGINew_SetDDRChannel(int index, + unsigned char ChannelNo, + unsigned char XGINew_ChannelAB, + unsigned short DRAMTYPE_TABLE[][5], + struct vb_device_info *pVBInfo) { - USHORT data ; + unsigned short data; int RankSize ; RankSize = DRAMTYPE_TABLE[index][3]/2 * XGINew_DataBusWidth/32; @@ -1865,30 +1831,29 @@ int XGINew_SetDDRChannel( int index , UCHAR ChannelNo , UCHAR XGINew_ChannelAB , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_CheckColumn( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +int XGINew_CheckColumn(int index, + unsigned short DRAMTYPE_TABLE[][5], + struct vb_device_info *pVBInfo) { int i ; - ULONG Increment , Position ; + unsigned long Increment , Position ; /* Increment = 1 << ( DRAMTYPE_TABLE[ index ][ 2 ] + XGINew_DataBusWidth / 64 + 1 ) ; */ Increment = 1 << ( 10 + XGINew_DataBusWidth / 64 ) ; for( i = 0 , Position = 0 ; i < 2 ; i++ ) { - *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; - Position += Increment ; + *((unsigned long *)(pVBInfo->FBAddr + Position)) = Position; + Position += Increment ; } -#ifdef WIN2000 /* chiawen for linux solution */ - DelayUS( 100 ) ; -#endif for( i = 0 , Position = 0 ; i < 2 ; i++ ) { /* if ( pVBInfo->FBAddr[ Position ] != Position ) */ - if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) - return( 0 ) ; - Position += Increment ; + if ((*(unsigned long *)(pVBInfo->FBAddr + Position)) != Position) + return 0; + Position += Increment; } return( 1 ) ; } @@ -1900,26 +1865,28 @@ int XGINew_CheckColumn( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INF /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_CheckBanks( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +int XGINew_CheckBanks(int index, + unsigned short DRAMTYPE_TABLE[][5], + struct vb_device_info *pVBInfo) { int i ; - ULONG Increment , Position ; + unsigned long Increment , Position ; Increment = 1 << ( DRAMTYPE_TABLE[ index ][ 2 ] + XGINew_DataBusWidth / 64 + 2 ) ; for( i = 0 , Position = 0 ; i < 4 ; i++ ) { /* pVBInfo->FBAddr[ Position ] = Position ; */ - *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; - Position += Increment ; + *((unsigned long *)(pVBInfo->FBAddr + Position)) = Position; + Position += Increment ; } for( i = 0 , Position = 0 ; i < 4 ; i++ ) { /* if (pVBInfo->FBAddr[ Position ] != Position ) */ - if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) - return( 0 ) ; - Position += Increment ; + if ((*(unsigned long *)(pVBInfo->FBAddr + Position)) != Position) + return 0; + Position += Increment; } return( 1 ) ; } @@ -1931,10 +1898,12 @@ int XGINew_CheckBanks( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_CheckRank( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +int XGINew_CheckRank(int RankNo, int index, + unsigned short DRAMTYPE_TABLE[][5], + struct vb_device_info *pVBInfo) { int i ; - ULONG Increment , Position ; + unsigned long Increment , Position ; Increment = 1 << ( DRAMTYPE_TABLE[ index ][ 2 ] + DRAMTYPE_TABLE[ index ][ 1 ] + DRAMTYPE_TABLE[ index ][ 0 ] + XGINew_DataBusWidth / 64 + RankNo ) ; @@ -1942,18 +1911,18 @@ int XGINew_CheckRank( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB for( i = 0 , Position = 0 ; i < 2 ; i++ ) { /* pVBInfo->FBAddr[ Position ] = Position ; */ - /* *( ( PULONG )( pVBInfo->FBAddr ) ) = Position ; */ - *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; - Position += Increment ; + /* *( (unsigned long *)( pVBInfo->FBAddr ) ) = Position ; */ + *((unsigned long *)(pVBInfo->FBAddr + Position)) = Position; + Position += Increment; } for( i = 0 , Position = 0 ; i < 2 ; i++ ) { /* if ( pVBInfo->FBAddr[ Position ] != Position ) */ - /* if ( ( *( PULONG )( pVBInfo->FBAddr ) ) != Position ) */ - if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) - return( 0 ) ; - Position += Increment ; + /* if ( ( *(unsigned long *)( pVBInfo->FBAddr ) ) != Position ) */ + if ((*(unsigned long *)(pVBInfo->FBAddr + Position)) != Position) + return 0; + Position += Increment; } return( 1 ); } @@ -1965,10 +1934,12 @@ int XGINew_CheckRank( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_CheckDDRRank( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +int XGINew_CheckDDRRank(int RankNo, int index, + unsigned short DRAMTYPE_TABLE[][5], + struct vb_device_info *pVBInfo) { - ULONG Increment , Position ; - USHORT data ; + unsigned long Increment , Position ; + unsigned short data ; Increment = 1 << ( DRAMTYPE_TABLE[ index ][ 2 ] + DRAMTYPE_TABLE[ index ][ 1 ] + DRAMTYPE_TABLE[ index ][ 0 ] + XGINew_DataBusWidth / 64 + RankNo ) ; @@ -1976,18 +1947,18 @@ int XGINew_CheckDDRRank( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], Increment += Increment / 2 ; Position = 0; - *( ( PULONG )( pVBInfo->FBAddr + Position + 0 ) ) = 0x01234567 ; - *( ( PULONG )( pVBInfo->FBAddr + Position + 1 ) ) = 0x456789AB ; - *( ( PULONG )( pVBInfo->FBAddr + Position + 2 ) ) = 0x55555555 ; - *( ( PULONG )( pVBInfo->FBAddr + Position + 3 ) ) = 0x55555555 ; - *( ( PULONG )( pVBInfo->FBAddr + Position + 4 ) ) = 0xAAAAAAAA ; - *( ( PULONG )( pVBInfo->FBAddr + Position + 5 ) ) = 0xAAAAAAAA ; - - if ( ( *( PULONG )( pVBInfo->FBAddr + 1 ) ) == 0x456789AB ) - return( 1 ) ; + *((unsigned long *)(pVBInfo->FBAddr + Position + 0)) = 0x01234567; + *((unsigned long *)(pVBInfo->FBAddr + Position + 1)) = 0x456789AB; + *((unsigned long *)(pVBInfo->FBAddr + Position + 2)) = 0x55555555; + *((unsigned long *)(pVBInfo->FBAddr + Position + 3)) = 0x55555555; + *((unsigned long *)(pVBInfo->FBAddr + Position + 4)) = 0xAAAAAAAA; + *((unsigned long *)(pVBInfo->FBAddr + Position + 5)) = 0xAAAAAAAA; - if ( ( *( PULONG )( pVBInfo->FBAddr + 0 ) ) == 0x01234567 ) - return( 0 ) ; + if ((*(unsigned long *)(pVBInfo->FBAddr + 1)) == 0x456789AB) + return 1; + + if ((*(unsigned long *)(pVBInfo->FBAddr + 0)) == 0x01234567) + return 0; data = XGINew_GetReg1( pVBInfo->P3c4 , 0x14 ) ; data &= 0xF3 ; @@ -2007,7 +1978,9 @@ int XGINew_CheckDDRRank( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_CheckRanks( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +int XGINew_CheckRanks(int RankNo, int index, + unsigned short DRAMTYPE_TABLE[][5], + struct vb_device_info *pVBInfo) { int r ; @@ -2033,7 +2006,9 @@ int XGINew_CheckRanks( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PV /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_CheckDDRRanks( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +int XGINew_CheckDDRRanks(int RankNo, int index, + unsigned short DRAMTYPE_TABLE[][5], + struct vb_device_info *pVBInfo) { int r ; @@ -2059,10 +2034,10 @@ int XGINew_CheckDDRRanks( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_SDRSizing(PVB_DEVICE_INFO pVBInfo) +int XGINew_SDRSizing(struct vb_device_info *pVBInfo) { int i ; - UCHAR j ; + unsigned char j ; for( i = 0 ; i < 13 ; i++ ) { @@ -2070,7 +2045,8 @@ int XGINew_SDRSizing(PVB_DEVICE_INFO pVBInfo) for( j = 2 ; j > 0 ; j-- ) { - if ( !XGINew_SetRank( i , ( UCHAR )j , XGINew_ChannelAB , XGINew_SDRDRAM_TYPE , pVBInfo) ) + if (!XGINew_SetRank(i, (unsigned char)j, XGINew_ChannelAB, + XGINew_SDRDRAM_TYPE, pVBInfo)) continue ; else { @@ -2089,11 +2065,13 @@ int XGINew_SDRSizing(PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -USHORT XGINew_SetDRAMSizeReg( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +unsigned short XGINew_SetDRAMSizeReg(int index, + unsigned short DRAMTYPE_TABLE[][5], + struct vb_device_info *pVBInfo) { - USHORT data = 0 , memsize = 0 ; + unsigned short data = 0 , memsize = 0; int RankSize ; - UCHAR ChannelNo ; + unsigned char ChannelNo ; RankSize = DRAMTYPE_TABLE[ index ][ 3 ] * XGINew_DataBusWidth / 32 ; data = XGINew_GetReg1( pVBInfo->P3c4 , 0x13 ) ; @@ -2138,11 +2116,13 @@ USHORT XGINew_SetDRAMSizeReg( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVI /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -USHORT XGINew_SetDRAMSize20Reg( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +unsigned short XGINew_SetDRAMSize20Reg(int index, + unsigned short DRAMTYPE_TABLE[][5], + struct vb_device_info *pVBInfo) { - USHORT data = 0 , memsize = 0 ; + unsigned short data = 0 , memsize = 0; int RankSize ; - UCHAR ChannelNo ; + unsigned char ChannelNo ; RankSize = DRAMTYPE_TABLE[ index ][ 3 ] * XGINew_DataBusWidth / 8 ; data = XGINew_GetReg1( pVBInfo->P3c4 , 0x13 ) ; @@ -2188,31 +2168,32 @@ USHORT XGINew_SetDRAMSize20Reg( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DE /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_ReadWriteRest( USHORT StopAddr , USHORT StartAddr, PVB_DEVICE_INFO pVBInfo) +int XGINew_ReadWriteRest(unsigned short StopAddr, unsigned short StartAddr, + struct vb_device_info *pVBInfo) { int i ; - ULONG Position = 0 ; + unsigned long Position = 0 ; - *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; + *((unsigned long *)(pVBInfo->FBAddr + Position)) = Position; for( i = StartAddr ; i <= StopAddr ; i++ ) { Position = 1 << i ; - *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; + *((unsigned long *)(pVBInfo->FBAddr + Position)) = Position; } DelayUS( 500 ) ; /* [Vicent] 2004/04/16. Fix #1759 Memory Size error in Multi-Adapter. */ Position = 0 ; - if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) - return( 0 ) ; + if ((*(unsigned long *)(pVBInfo->FBAddr + Position)) != Position) + return 0; for( i = StartAddr ; i <= StopAddr ; i++ ) { Position = 1 << i ; - if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) - return( 0 ) ; + if ((*(unsigned long *)(pVBInfo->FBAddr + Position)) != Position) + return 0; } return( 1 ) ; } @@ -2224,9 +2205,9 @@ int XGINew_ReadWriteRest( USHORT StopAddr , USHORT StartAddr, PVB_DEVICE_INFO pV /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -UCHAR XGINew_CheckFrequence( PVB_DEVICE_INFO pVBInfo ) +unsigned char XGINew_CheckFrequence(struct vb_device_info *pVBInfo) { - UCHAR data ; + unsigned char data ; data = XGINew_GetReg1( pVBInfo->P3d4 , 0x97 ) ; @@ -2247,9 +2228,9 @@ UCHAR XGINew_CheckFrequence( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_CheckChannel( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - UCHAR data; + unsigned char data; switch( HwDeviceExtension->jChipType ) { @@ -2528,10 +2509,10 @@ void XGINew_CheckChannel( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_DDRSizing340( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +int XGINew_DDRSizing340(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { int i ; - USHORT memsize , addr ; + unsigned short memsize , addr ; XGINew_SetReg1( pVBInfo->P3c4 , 0x15 , 0x00 ) ; /* noninterleaving */ XGINew_SetReg1( pVBInfo->P3c4 , 0x1C , 0x00 ) ; /* nontiling */ @@ -2548,7 +2529,7 @@ int XGINew_DDRSizing340( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO continue ; addr = memsize + ( XGINew_ChannelAB - 2 ) + 20 ; - if ( ( HwDeviceExtension->ulVideoMemorySize - 1 ) < ( ULONG )( 1 << addr ) ) + if ((HwDeviceExtension->ulVideoMemorySize - 1) < (unsigned long)(1 << addr)) continue ; if ( XGINew_ReadWriteRest( addr , 5, pVBInfo ) == 1 ) @@ -2566,7 +2547,7 @@ int XGINew_DDRSizing340( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO continue ; addr = memsize + ( XGINew_ChannelAB - 2 ) + 20 ; - if ( ( HwDeviceExtension->ulVideoMemorySize - 1 ) < ( ULONG )( 1 << addr ) ) + if ((HwDeviceExtension->ulVideoMemorySize - 1) < (unsigned long)(1 << addr)) continue ; if ( XGINew_ReadWriteRest( addr , 9, pVBInfo ) == 1 ) @@ -2583,10 +2564,10 @@ int XGINew_DDRSizing340( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_DDRSizing(PVB_DEVICE_INFO pVBInfo) +int XGINew_DDRSizing(struct vb_device_info *pVBInfo) { int i ; - UCHAR j ; + unsigned char j ; for( i = 0 ; i < 4 ; i++ ) { @@ -2595,7 +2576,8 @@ int XGINew_DDRSizing(PVB_DEVICE_INFO pVBInfo) for( j = 2 ; j > 0 ; j-- ) { XGINew_SetDDRChannel( i , j , XGINew_ChannelAB , XGINew_DDRDRAM_TYPE , pVBInfo ) ; - if ( !XGINew_SetRank( i , ( UCHAR )j , XGINew_ChannelAB , XGINew_DDRDRAM_TYPE, pVBInfo ) ) + if (!XGINew_SetRank(i, (unsigned char)j, XGINew_ChannelAB, + XGINew_DDRDRAM_TYPE, pVBInfo)) continue ; else { @@ -2613,7 +2595,7 @@ int XGINew_DDRSizing(PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetMemoryClock( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { @@ -2634,9 +2616,7 @@ void XGINew_SetMemoryClock( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_IN if ( ( pVBInfo->MCLKData[ XGINew_RAMType ].SR28 == 0x1C ) && ( pVBInfo->MCLKData[ XGINew_RAMType ].SR29 == 0x01 ) && ( ( ( pVBInfo->ECLKData[ XGINew_RAMType ].SR2E == 0x1C ) && ( pVBInfo->ECLKData[ XGINew_RAMType ].SR2F == 0x01 ) ) || ( ( pVBInfo->ECLKData[ XGINew_RAMType ].SR2E == 0x22 ) && ( pVBInfo->ECLKData[ XGINew_RAMType ].SR2F == 0x01 ) ) ) ) - { - XGINew_SetReg1( pVBInfo->P3c4 , 0x32 , ( ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x32 ) & 0xFC ) | 0x02 ) ; - } + XGINew_SetReg1(pVBInfo->P3c4, 0x32, ((unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x32) & 0xFC) | 0x02); } } @@ -2647,12 +2627,12 @@ void XGINew_SetMemoryClock( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_IN /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN ChkLFB( PVB_DEVICE_INFO pVBInfo ) +unsigned char ChkLFB(struct vb_device_info *pVBInfo) { - if ( LFBDRAMTrap & XGINew_GetReg1( pVBInfo->P3d4 , 0x78 ) ) - return( TRUE ) ; - else - return( FALSE ); + if (LFBDRAMTrap & XGINew_GetReg1(pVBInfo->P3d4 , 0x78)) + return 1; + else + return 0; } @@ -2664,17 +2644,18 @@ BOOLEAN ChkLFB( PVB_DEVICE_INFO pVBInfo ) /* in second chip, assume CR A1 D[6]="1" in this case */ /* output : none */ /* --------------------------------------------------------------------- */ -void SetPowerConsume ( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULONG XGI_P3d4Port ) +void SetPowerConsume(struct xgi_hw_device_info *HwDeviceExtension, + unsigned long XGI_P3d4Port) { - ULONG lTemp ; - UCHAR bTemp; + unsigned long lTemp ; + unsigned char bTemp; HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , 0x08 , 0 , &lTemp ) ; /* Get */ if ((lTemp&0xFF)==0) { /* set CR58 D[5]=0 D[3]=0 */ XGINew_SetRegAND( XGI_P3d4Port , 0x58 , 0xD7 ) ; - bTemp = (UCHAR) XGINew_GetReg1( XGI_P3d4Port , 0xCB ) ; + bTemp = (unsigned char) XGINew_GetReg1(XGI_P3d4Port, 0xCB); if (bTemp&0x20) { if (!(bTemp&0x10)) @@ -2692,15 +2673,13 @@ void SetPowerConsume ( PXGI_HW_DEVICE_INFO HwDeviceExtension , ULONG XGI_P3d4Por } - -#if defined(LINUX_XF86)||defined(LINUX_KERNEL) -void XGINew_InitVBIOSData(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +void XGINew_InitVBIOSData(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - /* ULONG ROMAddr = (ULONG)HwDeviceExtension->pjVirtualRomBase; */ + /* unsigned long ROMAddr = (unsigned long)HwDeviceExtension->pjVirtualRomBase; */ pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; - pVBInfo->BaseAddr = (ULONG)HwDeviceExtension->pjIOAddress ; + pVBInfo->BaseAddr = (unsigned long)HwDeviceExtension->pjIOAddress ; pVBInfo->ISXPDOS = 0 ; pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; @@ -2736,7 +2715,6 @@ void XGINew_InitVBIOSData(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO } } -#endif /* For Linux */ /* --------------------------------------------------------------------- */ /* Function : ReadVBIOSTablData */ @@ -2744,200 +2722,11 @@ void XGINew_InitVBIOSData(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void ReadVBIOSTablData( UCHAR ChipType , PVB_DEVICE_INFO pVBInfo) +void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo) { - PUCHAR volatile pVideoMemory = ( PUCHAR )pVBInfo->ROMAddr ; - ULONG i ; - UCHAR j , k ; -#if 0 - ULONG ii , jj ; - i = pVideoMemory[ 0x1CF ] | ( pVideoMemory[ 0x1D0 ] << 8 ) ; /* UniROM */ - if ( i != 0 ) - UNIROM = 1 ; - - ii = 0x90 ; - for( jj = 0x00 ; jj < 0x08 ; jj++ ) - { - pVBInfo->MCLKData[ jj ].SR28 = pVideoMemory[ ii ] ; - pVBInfo->MCLKData[ jj ].SR29 = pVideoMemory[ ii + 1] ; - pVBInfo->MCLKData[ jj ].SR2A = pVideoMemory[ ii + 2] ; - pVBInfo->MCLKData[ jj ].CLOCK = pVideoMemory[ ii + 3 ] | ( pVideoMemory[ ii + 4 ] << 8 ) ; - ii += 0x05 ; - } - - ii = 0xB8 ; - for( jj = 0x00 ; jj < 0x08 ; jj++ ) - { - pVBInfo->ECLKData[ jj ].SR2E = pVideoMemory[ ii ] ; - pVBInfo->ECLKData[ jj ].SR2F=pVideoMemory[ ii + 1 ] ; - pVBInfo->ECLKData[ jj ].SR30= pVideoMemory[ ii + 2 ] ; - pVBInfo->ECLKData[ jj ].CLOCK= pVideoMemory[ ii + 3 ] | ( pVideoMemory[ ii + 4 ] << 8 ) ; - ii += 0x05 ; - } - - /* Volari customize data area start */ - /* if ( ChipType == XG40 ) */ - if ( ChipType >= XG40 ) - { - ii = 0xE0 ; - for( jj = 0x00 ; jj < 0x03 ; jj++ ) - { - pVBInfo->SR15[ jj ][ 0 ] = pVideoMemory[ ii ] ; /* SR13, SR14, and SR18 */ - pVBInfo->SR15[ jj ][ 1 ] = pVideoMemory[ ii + 1 ] ; - pVBInfo->SR15[ jj ][ 2 ] = pVideoMemory[ ii + 2 ] ; - pVBInfo->SR15[ jj ][ 3 ] = pVideoMemory[ ii + 3 ] ; - pVBInfo->SR15[ jj ][ 4 ] = pVideoMemory[ ii + 4 ] ; - pVBInfo->SR15[ jj ][ 5 ] = pVideoMemory[ ii + 5 ] ; - pVBInfo->SR15[ jj ][ 6 ] = pVideoMemory[ ii + 6 ] ; - pVBInfo->SR15[ jj ][ 7 ] = pVideoMemory[ ii + 7 ] ; - ii += 0x08 ; - } - ii = 0x110 ; - jj = 0x03 ; - pVBInfo->SR15[ jj ][ 0 ] = pVideoMemory[ ii ] ; /* SR1B */ - pVBInfo->SR15[ jj ][ 1 ] = pVideoMemory[ ii + 1 ] ; - pVBInfo->SR15[ jj ][ 2 ] = pVideoMemory[ ii + 2 ] ; - pVBInfo->SR15[ jj ][ 3 ] = pVideoMemory[ ii + 3 ] ; - pVBInfo->SR15[ jj ][ 4 ] = pVideoMemory[ ii + 4 ] ; - pVBInfo->SR15[ jj ][ 5 ] = pVideoMemory[ ii + 5 ] ; - pVBInfo->SR15[ jj ][ 6 ] = pVideoMemory[ ii + 6 ] ; - pVBInfo->SR15[ jj ][ 7 ] = pVideoMemory[ ii + 7 ] ; - - *pVBInfo->pSR07 = pVideoMemory[ 0x74 ] ; - *pVBInfo->pSR1F = pVideoMemory[ 0x75 ] ; - *pVBInfo->pSR21 = pVideoMemory[ 0x76 ] ; - *pVBInfo->pSR22 = pVideoMemory[ 0x77 ] ; - *pVBInfo->pSR23 = pVideoMemory[ 0x78 ] ; - *pVBInfo->pSR24 = pVideoMemory[ 0x79 ] ; - pVBInfo->SR25[ 0 ] = pVideoMemory[ 0x7A ] ; - *pVBInfo->pSR31 = pVideoMemory[ 0x7B ] ; - *pVBInfo->pSR32 = pVideoMemory[ 0x7C ] ; - *pVBInfo->pSR33 = pVideoMemory[ 0x7D ] ; - ii = 0xF8 ; - - for( jj = 0 ; jj < 3 ; jj++ ) - { - pVBInfo->CR40[ jj ][ 0 ] = pVideoMemory[ ii ] ; - pVBInfo->CR40[ jj ][ 1 ] = pVideoMemory[ ii + 1 ] ; - pVBInfo->CR40[ jj ][ 2 ] = pVideoMemory[ ii + 2 ] ; - pVBInfo->CR40[ jj ][ 3 ] = pVideoMemory[ ii + 3 ] ; - pVBInfo->CR40[ jj ][ 4 ] = pVideoMemory[ ii + 4 ] ; - pVBInfo->CR40[ jj ][ 5 ] = pVideoMemory[ ii + 5 ] ; - pVBInfo->CR40[ jj ][ 6 ] = pVideoMemory[ ii + 6 ] ; - pVBInfo->CR40[ jj ][ 7 ] = pVideoMemory[ ii + 7 ] ; - ii += 0x08 ; - } - - ii = 0x118 ; - for( j = 3 ; j < 24 ; j++ ) - { - pVBInfo->CR40[ j ][ 0 ] = pVideoMemory[ ii ] ; - pVBInfo->CR40[ j ][ 1 ] = pVideoMemory[ ii + 1 ] ; - pVBInfo->CR40[ j ][ 2 ] = pVideoMemory[ ii + 2 ] ; - pVBInfo->CR40[ j ][ 3 ] = pVideoMemory[ ii + 3 ] ; - pVBInfo->CR40[ j ][ 4 ] = pVideoMemory[ ii + 4 ] ; - pVBInfo->CR40[ j ][ 5 ] = pVideoMemory[ ii + 5 ] ; - pVBInfo->CR40[ j ][ 6 ] = pVideoMemory[ ii + 6 ] ; - pVBInfo->CR40[ j ][ 7 ] = pVideoMemory[ ii + 7 ] ; - ii += 0x08 ; - } - - i = pVideoMemory[ 0x1C0 ] | ( pVideoMemory[ 0x1C1 ] << 8 ) ; - - for( j = 0 ; j < 8 ; j++ ) - { - for( k = 0 ; k < 4 ; k++ ) - pVBInfo->CR6B[ j ][ k ] = pVideoMemory[ i + 4 * j + k ] ; - } - - i = pVideoMemory[ 0x1C2 ] | ( pVideoMemory[ 0x1C3 ] << 8 ) ; - - for( j = 0 ; j < 8 ; j++ ) - { - for( k = 0 ; k < 4 ; k++ ) - pVBInfo->CR6E[ j ][ k ] = pVideoMemory[ i + 4 * j + k ] ; - } - - i = pVideoMemory[ 0x1C4 ] | ( pVideoMemory[ 0x1C5 ] << 8 ) ; - for( j = 0 ; j < 8 ; j++ ) - { - for( k = 0 ; k < 32 ; k++ ) - pVBInfo->CR6F[ j ][ k ] = pVideoMemory[ i + 32 * j + k ] ; - } - - i = pVideoMemory[ 0x1C6 ] | ( pVideoMemory[ 0x1C7 ] << 8 ) ; - - for( j = 0 ; j < 8 ; j++ ) - { - for( k = 0 ; k < 2 ; k++ ) - pVBInfo->CR89[ j ][ k ] = pVideoMemory[ i + 2 * j + k ] ; - } - - i = pVideoMemory[ 0x1C8 ] | ( pVideoMemory[ 0x1C9 ] << 8 ) ; - for( j = 0 ; j < 12 ; j++ ) - pVBInfo->AGPReg[ j ] = pVideoMemory[ i + j ] ; - - i = pVideoMemory[ 0x1CF ] | ( pVideoMemory[ 0x1D0 ] << 8 ) ; - for( j = 0 ; j < 4 ; j++ ) - pVBInfo->SR16[ j ] = pVideoMemory[ i + j ] ; - - if ( ChipType == XG21 ) - { - if (pVideoMemory[ 0x67 ] & 0x80) - { - *pVBInfo->pDVOSetting = pVideoMemory[ 0x67 ]; - } - if ( (pVideoMemory[ 0x67 ] & 0xC0) == 0xC0 ) - { - *pVBInfo->pCR2E = pVideoMemory[ i + 4 ] ; - *pVBInfo->pCR2F = pVideoMemory[ i + 5 ] ; - *pVBInfo->pCR46 = pVideoMemory[ i + 6 ] ; - *pVBInfo->pCR47 = pVideoMemory[ i + 7 ] ; - } - } - - if ( ChipType == XG27 ) - { - jj = i+j; - for( i = 0 ; i <= 0xB ; i++,jj++ ) - pVBInfo->pCRD0[i] = pVideoMemory[ jj ] ; - for( i = 0x0 ; i <= 0x1 ; i++,jj++ ) - pVBInfo->pCRDE[i] = pVideoMemory[ jj ] ; - - *pVBInfo->pSR40 = pVideoMemory[ jj ] ; - jj++; - *pVBInfo->pSR41 = pVideoMemory[ jj ] ; - - if (pVideoMemory[ 0x67 ] & 0x80) - { - *pVBInfo->pDVOSetting = pVideoMemory[ 0x67 ]; - } - if ( (pVideoMemory[ 0x67 ] & 0xC0) == 0xC0 ) - { - jj++; - *pVBInfo->pCR2E = pVideoMemory[ jj ] ; - *pVBInfo->pCR2F = pVideoMemory[ jj + 1 ] ; - *pVBInfo->pCR46 = pVideoMemory[ jj + 2 ] ; - *pVBInfo->pCR47 = pVideoMemory[ jj + 3 ] ; - } - - } - - *pVBInfo->pCRCF = pVideoMemory[ 0x1CA ] ; - *pVBInfo->pXGINew_DRAMTypeDefinition = pVideoMemory[ 0x1CB ] ; - *pVBInfo->pXGINew_I2CDefinition = pVideoMemory[ 0x1D1 ] ; - if ( ChipType >= XG20 ) - { - *pVBInfo->pXGINew_CR97 = pVideoMemory[ 0x1D2 ] ; - if ( ChipType == XG27 ) - { - *pVBInfo->pSR36 = pVideoMemory[ 0x1D3 ] ; - *pVBInfo->pCR8F = pVideoMemory[ 0x1D5 ] ; - } - } - - } -#endif + volatile unsigned char *pVideoMemory = (unsigned char *)pVBInfo->ROMAddr; + unsigned long i ; + unsigned char j, k ; /* Volari customize data area end */ if ( ChipType == XG21 ) @@ -2972,7 +2761,8 @@ void ReadVBIOSTablData( UCHAR ChipType , PVB_DEVICE_INFO pVBInfo) i += 25; j--; k++; - } while ( (j>0) && ( k < (sizeof(XGI21_LCDCapList)/sizeof(XGI21_LVDSCapStruct)) ) ); + } while ((j > 0) && + (k < (sizeof(XGI21_LCDCapList)/sizeof(struct XGI21_LVDSCapStruct)))); } else { @@ -3003,7 +2793,7 @@ void ReadVBIOSTablData( UCHAR ChipType , PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_DDR1x_MRS_XG20( ULONG P3c4 , PVB_DEVICE_INFO pVBInfo) +void XGINew_DDR1x_MRS_XG20(unsigned long P3c4, struct vb_device_info *pVBInfo) { XGINew_SetReg1( P3c4 , 0x18 , 0x01 ) ; @@ -3039,13 +2829,13 @@ void XGINew_DDR1x_MRS_XG20( ULONG P3c4 , PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetDRAMModeRegister_XG20( PXGI_HW_DEVICE_INFO HwDeviceExtension ) +void XGINew_SetDRAMModeRegister_XG20(struct xgi_hw_device_info *HwDeviceExtension) { - VB_DEVICE_INFO VBINF; - PVB_DEVICE_INFO pVBInfo = &VBINF; + struct vb_device_info VBINF; + struct vb_device_info *pVBInfo = &VBINF; pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; - pVBInfo->BaseAddr = (ULONG)HwDeviceExtension->pjIOAddress ; + pVBInfo->BaseAddr = (unsigned long)HwDeviceExtension->pjIOAddress ; pVBInfo->ISXPDOS = 0 ; pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; @@ -3078,13 +2868,13 @@ void XGINew_SetDRAMModeRegister_XG20( PXGI_HW_DEVICE_INFO HwDeviceExtension ) XGINew_SetReg1( pVBInfo->P3c4 , 0x1B , 0x03 ) ; } -void XGINew_SetDRAMModeRegister_XG27( PXGI_HW_DEVICE_INFO HwDeviceExtension ) +void XGINew_SetDRAMModeRegister_XG27(struct xgi_hw_device_info *HwDeviceExtension) { - VB_DEVICE_INFO VBINF; - PVB_DEVICE_INFO pVBInfo = &VBINF; + struct vb_device_info VBINF; + struct vb_device_info *pVBInfo = &VBINF; pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; - pVBInfo->BaseAddr = (ULONG)HwDeviceExtension->pjIOAddress ; + pVBInfo->BaseAddr = (unsigned long)HwDeviceExtension->pjIOAddress ; pVBInfo->ISXPDOS = 0 ; pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; @@ -3120,13 +2910,12 @@ void XGINew_SetDRAMModeRegister_XG27( PXGI_HW_DEVICE_INFO HwDeviceExtension ) } /* -void XGINew_SetDRAMModeRegister_XG27( PXGI_HW_DEVICE_INFO HwDeviceExtension ) +void XGINew_SetDRAMModeRegister_XG27(struct xgi_hw_device_info *HwDeviceExtension) { -#ifndef LINUX_XF86 - UCHAR data ; -#endif - VB_DEVICE_INFO VBINF; - PVB_DEVICE_INFO pVBInfo = &VBINF; + + unsigned char data ; + struct vb_device_info VBINF; + struct vb_device_info *pVBInfo = &VBINF; pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; pVBInfo->BaseAddr = HwDeviceExtension->pjIOAddress ; @@ -3168,9 +2957,9 @@ void XGINew_SetDRAMModeRegister_XG27( PXGI_HW_DEVICE_INFO HwDeviceExtension ) /* Output : */ /* Description : */ /* -------------------------------------------------------- */ -void XGINew_ChkSenseStatus ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT tempbx=0 , temp , tempcx , CR3CData; + unsigned short tempbx = 0, temp, tempcx, CR3CData; temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x32 ) ; @@ -3229,9 +3018,9 @@ void XGINew_ChkSenseStatus ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_ /* Output : */ /* Description : */ /* -------------------------------------------------------- */ -void XGINew_SetModeScratch ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) +void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT temp , tempcl = 0 , tempch = 0 , CR31Data , CR38Data; + unsigned short temp , tempcl = 0 , tempch = 0 , CR31Data , CR38Data; temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x3d ) ; temp |= XGINew_GetReg1( pVBInfo->P3d4 , 0x3e ) << 8 ; @@ -3326,23 +3115,13 @@ void XGINew_SetModeScratch ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_ /* Output : */ /* Description : */ /* -------------------------------------------------------- */ -void XGINew_GetXG21Sense(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +void XGINew_GetXG21Sense(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - UCHAR Temp; - PUCHAR volatile pVideoMemory = ( PUCHAR )pVBInfo->ROMAddr ; + unsigned char Temp; + volatile unsigned char *pVideoMemory = (unsigned char *)pVBInfo->ROMAddr; pVBInfo->IF_DEF_LVDS = 0 ; -#ifdef WIN2000 - pVBInfo->IF_DEF_CH7007 = 0 ; - if ( ( pVideoMemory[ 0x65 ] & 0x02 ) ) /* For XG21 CH7007 */ - { - /* VideoDebugPrint((0, "ReadVBIOSTablData: pVideoMemory[ 0x65 ] =%x\n",pVideoMemory[ 0x65 ])); */ - pVBInfo->IF_DEF_CH7007 = 1 ; /* [Billy] 07/05/03 */ - XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x38 , ~0xE0 , 0x60 ) ; /* CH7007 on chip */ - } - else -#endif #if 1 if (( pVideoMemory[ 0x65 ] & 0x01 ) ) /* For XG21 LVDS */ { @@ -3378,9 +3157,9 @@ void XGINew_GetXG21Sense(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO /* Output : */ /* Description : */ /* -------------------------------------------------------- */ -void XGINew_GetXG27Sense(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +void XGINew_GetXG27Sense(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - UCHAR Temp,bCR4A; + unsigned char Temp, bCR4A; pVBInfo->IF_DEF_LVDS = 0 ; bCR4A = XGINew_GetReg1( pVBInfo->P3d4 , 0x4A ) ; @@ -3402,9 +3181,9 @@ void XGINew_GetXG27Sense(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO } -UCHAR GetXG21FPBits(PVB_DEVICE_INFO pVBInfo) +unsigned char GetXG21FPBits(struct vb_device_info *pVBInfo) { - UCHAR CR38,CR4A,temp; + unsigned char CR38, CR4A, temp; CR4A = XGINew_GetReg1( pVBInfo->P3d4 , 0x4A ) ; XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x4A , ~0x10 , 0x10 ) ; /* enable GPIOE read */ @@ -3422,9 +3201,9 @@ UCHAR GetXG21FPBits(PVB_DEVICE_INFO pVBInfo) return temp; } -UCHAR GetXG27FPBits(PVB_DEVICE_INFO pVBInfo) +unsigned char GetXG27FPBits(struct vb_device_info *pVBInfo) { - UCHAR CR4A,temp; + unsigned char CR4A, temp; CR4A = XGINew_GetReg1( pVBInfo->P3d4 , 0x4A ) ; XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x4A , ~0x03 , 0x03 ) ; /* enable GPIOA/B/C read */ diff --git a/drivers/staging/xgifb/vb_init.h b/drivers/staging/xgifb/vb_init.h index 1f39d9c74cdd..b47352b8e34a 100644 --- a/drivers/staging/xgifb/vb_init.h +++ b/drivers/staging/xgifb/vb_init.h @@ -1,7 +1,7 @@ #ifndef _VBINIT_ #define _VBINIT_ -extern BOOLEAN XGIInitNew( PXGI_HW_DEVICE_INFO HwDeviceExtension ) ; -extern XGI21_LVDSCapStruct XGI21_LCDCapList[13]; +extern unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension) ; +extern struct XGI21_LVDSCapStruct XGI21_LCDCapList[13]; #endif diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index bd7f73898644..d90bf06bf62f 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -1,43 +1,9 @@ -#include "osdef.h" -#ifdef TC -#include <stdio.h> -#include <string.h> -#include <conio.h> -#include <dos.h> -#endif - - -#ifdef LINUX_XF86 -#include "xf86.h" -#include "xf86PciInfo.h" -#include "xgi.h" -#include "xgi_regs.h" -#endif - -#ifdef LINUX_KERNEL #include <asm/io.h> #include <linux/types.h> #include <linux/version.h> #include "XGIfb.h" -/*#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) -#include <video/XGIfb.h> -#else -#include <linux/XGIfb.h> -#endif*/ -#endif - -#ifdef WIN2000 -#include <dderror.h> -#include <devioctl.h> -#include <miniport.h> -#include <ntddvdeo.h> -#include <video.h> -#include "xgiv.h" -#include "dd_i2c.h" -#include "tools.h" -#endif #include "vb_def.h" #include "vgatypes.h" @@ -54,194 +20,218 @@ -BOOLEAN XGI_IsLCDDualLink(PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGI_SetCRT2Group301(USHORT ModeNo, PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGI_BacklightByDrv(PVB_DEVICE_INFO pVBInfo); - -BOOLEAN XGI_IsLCDON(PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGI_DisableChISLCD(PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGI_EnableChISLCD(PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGI_AjustCRT2Rate(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,USHORT *i, PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGI_SearchModeID( USHORT ModeNo,USHORT *ModeIdIndex, PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGI_GetLCDInfo(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGISetModeNew( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo ) ; -BOOLEAN XGI_BridgeIsOn(PVB_DEVICE_INFO pVBInfo); -UCHAR XGI_GetModePtr( USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); -USHORT XGI_GetOffset(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); -USHORT XGI_GetRatePtrCRT2( PXGI_HW_DEVICE_INFO pXGIHWDE, USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo ); -USHORT XGI_GetResInfo(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); -USHORT XGI_GetColorDepth(USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); -USHORT XGI_GetVGAHT2(PVB_DEVICE_INFO pVBInfo); -USHORT XGI_GetVCLK2Ptr(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); -void XGI_VBLongWait(PVB_DEVICE_INFO pVBInfo); -void XGI_SaveCRT2Info(USHORT ModeNo, PVB_DEVICE_INFO pVBInfo); -void XGI_GetCRT2Data(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_GetCRT2ResInfo(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_PreSetGroup1(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetGroup1(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetLockRegs(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetLCDRegs(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetGroup2(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); -void XGI_SetGroup3(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetGroup4(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); -void XGI_SetGroup5(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); -void* XGI_GetLcdPtr(USHORT BX, USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void* XGI_GetTVPtr(USHORT BX, USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_FirePWDEnable(PVB_DEVICE_INFO pVBInfo); -void XGI_EnableGatingCRT(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); -void XGI_DisableGatingCRT(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); -void XGI_SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo); -void XGI_SetPanelPower(USHORT tempah,USHORT tempbl, PVB_DEVICE_INFO pVBInfo); -void XGI_EnablePWD( PVB_DEVICE_INFO pVBInfo); -void XGI_DisablePWD( PVB_DEVICE_INFO pVBInfo); -void XGI_AutoThreshold( PVB_DEVICE_INFO pVBInfo); -void XGI_SetTap4Regs( PVB_DEVICE_INFO pVBInfo); - -void XGI_DisplayOn(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo); -void XGI_DisplayOff( PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo ); -void XGI_SetCRT1Group(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); -void XGI_SetXG21CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetXG21LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT ModeNo); -void XGI_SetXG27CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetXG27LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT ModeNo); -void XGI_UpdateXG21CRTC(USHORT ModeNo, PVB_DEVICE_INFO pVBInfo, USHORT RefreshRateTableIndex); -void XGI_WaitDisply(PVB_DEVICE_INFO pVBInfo); -void XGI_SenseCRT1(PVB_DEVICE_INFO pVBInfo); -void XGI_SetSeqRegs(USHORT ModeNo,USHORT StandTableIndex,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); -void XGI_SetMiscRegs(USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetCRTCRegs(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetATTRegs(USHORT ModeNo,USHORT StandTableIndex,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo ); -void XGI_SetGRCRegs(USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_ClearExt1Regs(PVB_DEVICE_INFO pVBInfo); - -void XGI_SetSync(USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); -void XGI_SetCRT1CRTC(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo,PXGI_HW_DEVICE_INFO HwDeviceExtension); -void XGI_SetCRT1Timing_H(PVB_DEVICE_INFO pVBInfo,PXGI_HW_DEVICE_INFO HwDeviceExtension); -void XGI_SetCRT1Timing_V(USHORT ModeIdIndex,USHORT ModeNo,PVB_DEVICE_INFO pVBInfo); -void XGI_SetCRT1DE(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); -void XGI_SetCRT1VCLK(USHORT ModeNo,USHORT ModeIdIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetCRT1FIFO(USHORT ModeNo,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); -void XGI_SetCRT1ModeRegs(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); -void XGI_SetVCLKState(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); - -void XGI_LoadDAC(USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); -void XGI_WriteDAC(USHORT dl, USHORT ah, USHORT al, USHORT dh, PVB_DEVICE_INFO pVBInfo); -/*void XGI_ClearBuffer(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,PVB_DEVICE_INFO pVBInfo);*/ -void XGI_SetLCDAGroup(USHORT ModeNo,USHORT ModeIdIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); -void XGI_GetLVDSResInfo( USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); -void XGI_GetLVDSData(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); -void XGI_ModCRT1Regs(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); -void XGI_SetLVDSRegs(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); -void XGI_UpdateModeInfo(PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); -void XGI_GetVGAType(PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); -void XGI_GetVBType(PVB_DEVICE_INFO pVBInfo); -void XGI_GetVBInfo(USHORT ModeNo,USHORT ModeIdIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); -void XGI_GetTVInfo(USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); -void XGI_SetCRT2ECLK( USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); -void InitTo330Pointer(UCHAR,PVB_DEVICE_INFO pVBInfo); -void XGI_GetLCDSync(USHORT* HSyncWidth, USHORT* VSyncWidth, PVB_DEVICE_INFO pVBInfo); -void XGI_DisableBridge(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); -void XGI_EnableBridge(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); -void XGI_SetCRT2VCLK(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_OEM310Setting(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetDelayComp(PVB_DEVICE_INFO pVBInfo); -void XGI_SetLCDCap(PVB_DEVICE_INFO pVBInfo); -void XGI_SetLCDCap_A(USHORT tempcx,PVB_DEVICE_INFO pVBInfo); -void XGI_SetLCDCap_B(USHORT tempcx,PVB_DEVICE_INFO pVBInfo); -void SetSpectrum(PVB_DEVICE_INFO pVBInfo); -void XGI_SetAntiFlicker(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetEdgeEnhance(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_SetPhaseIncr(PVB_DEVICE_INFO pVBInfo); -void XGI_SetYFilter(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_GetTVPtrIndex2(USHORT* tempbx,UCHAR* tempcl,UCHAR* tempch, PVB_DEVICE_INFO pVBInfo); -USHORT XGI_GetTVPtrIndex( PVB_DEVICE_INFO pVBInfo ); -void XGI_SetCRT2ModeRegs(USHORT ModeNo,PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo ); -void XGI_CloseCRTC(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo); -void XGI_OpenCRTC(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo); -void XGI_GetRAMDAC2DATA(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_UnLockCRT2(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo); -void XGI_LockCRT2(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo); -void XGINew_EnableCRT2(PVB_DEVICE_INFO pVBInfo); -void XGINew_LCD_Wait_Time(UCHAR DelayTime, PVB_DEVICE_INFO pVBInfo); -void XGI_LongWait(PVB_DEVICE_INFO pVBInfo); -void XGI_SetCRT1Offset( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo ); -void XGI_GetLCDVCLKPtr(UCHAR* di_0,UCHAR *di_1, PVB_DEVICE_INFO pVBInfo); -UCHAR XGI_GetVCLKPtr(USHORT RefreshRateTableIndex,USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); -void XGI_GetVCLKLen(UCHAR tempal,UCHAR* di_0,UCHAR* di_1, PVB_DEVICE_INFO pVBInfo); -USHORT XGI_GetLCDCapPtr(PVB_DEVICE_INFO pVBInfo); -USHORT XGI_GetLCDCapPtr1(PVB_DEVICE_INFO pVBInfo); -XGI301C_Tap4TimingStruct* XGI_GetTap4Ptr(USHORT tempcx, PVB_DEVICE_INFO pVBInfo); -void XGI_SetXG21FPBits(PVB_DEVICE_INFO pVBInfo); -void XGI_SetXG27FPBits(PVB_DEVICE_INFO pVBInfo); -UCHAR XGI_XG21GetPSCValue(PVB_DEVICE_INFO pVBInfo); -UCHAR XGI_XG27GetPSCValue(PVB_DEVICE_INFO pVBInfo); -void XGI_XG21BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo); -void XGI_XG27BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo); -void XGI_XG21SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo); -BOOLEAN XGI_XG21CheckLVDSMode(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ); -void XGI_SetXG21LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ); -void XGI_SetXG27LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ); -UCHAR XGI_SetDefaultVCLK( PVB_DEVICE_INFO pVBInfo ); - -extern void ReadVBIOSTablData( UCHAR ChipType , PVB_DEVICE_INFO pVBInfo); -#ifdef WIN2000 -/* [Billy] 2007/05/17 For CH7007 */ -extern UCHAR CH7007TVReg_UNTSC[][8],CH7007TVReg_ONTSC[][8],CH7007TVReg_UPAL[][8],CH7007TVReg_OPAL[][8]; -extern UCHAR CH7007TVCRT1UNTSC_H[][10],CH7007TVCRT1ONTSC_H[][10],CH7007TVCRT1UPAL_H[][10],CH7007TVCRT1OPAL_H[][10] ; -extern UCHAR CH7007TVCRT1UNTSC_V[][10],CH7007TVCRT1ONTSC_V[][10],CH7007TVCRT1UPAL_V[][10],CH7007TVCRT1OPAL_V[][10] ; -extern UCHAR XGI7007_CHTVVCLKUNTSC[],XGI7007_CHTVVCLKONTSC[],XGI7007_CHTVVCLKUPAL[],XGI7007_CHTVVCLKOPAL[]; - -extern BOOLEAN XGI_XG21CheckCH7007TVMode(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) ; -extern void SetCH7007Regs(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) ; -extern VP_STATUS TurnOnCH7007(PHW_DEVICE_EXTENSION pHWDE) ; -extern VP_STATUS TurnOffCH7007(PHW_DEVICE_EXTENSION pHWDE) ; -extern BOOLEAN IsCH7007TVMode(PVB_DEVICE_INFO pVBInfo) ; -#endif - -/* USHORT XGINew_flag_clearbuffer; 0: no clear frame buffer 1:clear frame buffer */ - - - - - -USHORT XGINew_MDA_DAC[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, - 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, - 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, - 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, - 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F}; - -USHORT XGINew_CGA_DAC[]={0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, - 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, - 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, - 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, - 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, - 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, - 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, - 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F}; - -USHORT XGINew_EGA_DAC[]={0x00,0x10,0x04,0x14,0x01,0x11,0x05,0x15, - 0x20,0x30,0x24,0x34,0x21,0x31,0x25,0x35, - 0x08,0x18,0x0C,0x1C,0x09,0x19,0x0D,0x1D, - 0x28,0x38,0x2C,0x3C,0x29,0x39,0x2D,0x3D, - 0x02,0x12,0x06,0x16,0x03,0x13,0x07,0x17, - 0x22,0x32,0x26,0x36,0x23,0x33,0x27,0x37, - 0x0A,0x1A,0x0E,0x1E,0x0B,0x1B,0x0F,0x1F, - 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F}; - -USHORT XGINew_VGA_DAC[]={0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, - 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, - 0x00,0x05,0x08,0x0B,0x0E,0x11,0x14,0x18, - 0x1C,0x20,0x24,0x28,0x2D,0x32,0x38,0x3F, - - 0x00,0x10,0x1F,0x2F,0x3F,0x1F,0x27,0x2F, - 0x37,0x3F,0x2D,0x31,0x36,0x3A,0x3F,0x00, - 0x07,0x0E,0x15,0x1C,0x0E,0x11,0x15,0x18, - 0x1C,0x14,0x16,0x18,0x1A,0x1C,0x00,0x04, - 0x08,0x0C,0x10,0x08,0x0A,0x0C,0x0E,0x10, - 0x0B,0x0C,0x0D,0x0F,0x10}; +unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo); +unsigned char XGI_SetCRT2Group301(unsigned short ModeNo, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo); +unsigned char XGI_BacklightByDrv(struct vb_device_info *pVBInfo); + +unsigned char XGI_IsLCDON(struct vb_device_info *pVBInfo); +unsigned char XGI_DisableChISLCD(struct vb_device_info *pVBInfo); +unsigned char XGI_EnableChISLCD(struct vb_device_info *pVBInfo); +unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo, + unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + unsigned short *i, struct vb_device_info *pVBInfo); +unsigned char XGI_SearchModeID(unsigned short ModeNo, + unsigned short *ModeIdIndex, + struct vb_device_info *pVBInfo); +unsigned char XGI_GetLCDInfo(unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo); +unsigned char XGISetModeNew(struct xgi_hw_device_info *HwDeviceExtension, + unsigned short ModeNo); +unsigned char XGI_BridgeIsOn(struct vb_device_info *pVBInfo); +unsigned char XGI_GetModePtr(unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo); +unsigned short XGI_GetOffset(unsigned short ModeNo, + unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo); +unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE, + unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo); +unsigned short XGI_GetResInfo(unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo); +unsigned short XGI_GetColorDepth(unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo); +unsigned short XGI_GetVGAHT2(struct vb_device_info *pVBInfo); +unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo, + unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo); +void XGI_VBLongWait(struct vb_device_info *pVBInfo); +void XGI_SaveCRT2Info(unsigned short ModeNo, struct vb_device_info *pVBInfo); +void XGI_GetCRT2Data(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_SetGroup3(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_SetGroup5(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_FirePWDEnable(struct vb_device_info *pVBInfo); +void XGI_EnableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_DisableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo); +void XGI_SetPanelPower(unsigned short tempah, unsigned short tempbl, struct vb_device_info *pVBInfo); +void XGI_EnablePWD(struct vb_device_info *pVBInfo); +void XGI_DisablePWD(struct vb_device_info *pVBInfo); +void XGI_AutoThreshold(struct vb_device_info *pVBInfo); +void XGI_SetTap4Regs(struct vb_device_info *pVBInfo); + +void XGI_DisplayOn(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo); +void XGI_DisplayOff(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo); +void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetXG21LCD(struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex, unsigned short ModeNo); +void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetXG27LCD(struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex, unsigned short ModeNo); +void XGI_UpdateXG21CRTC(unsigned short ModeNo, struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex); +void XGI_WaitDisply(struct vb_device_info *pVBInfo); +void XGI_SenseCRT1(struct vb_device_info *pVBInfo); +void XGI_SetSeqRegs(unsigned short ModeNo, unsigned short StandTableIndex, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_SetMiscRegs(unsigned short StandTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension, unsigned short StandTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetATTRegs(unsigned short ModeNo, unsigned short StandTableIndex, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_SetGRCRegs(unsigned short StandTableIndex, struct vb_device_info *pVBInfo); +void XGI_ClearExt1Regs(struct vb_device_info *pVBInfo); + +void XGI_SetSync(unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo, struct xgi_hw_device_info *HwDeviceExtension); +void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, struct xgi_hw_device_info *HwDeviceExtension); +void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, unsigned short ModeNo, struct vb_device_info *pVBInfo); +void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetCRT1VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetCRT1FIFO(unsigned short ModeNo, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); + +void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_WriteDAC(unsigned short dl, unsigned short ah, unsigned short al, unsigned short dh, struct vb_device_info *pVBInfo); +/*void XGI_ClearBuffer(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, struct vb_device_info *pVBInfo);*/ +void XGI_SetLCDAGroup(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_GetLVDSResInfo(unsigned short ModeNo, unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo); +void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo); +void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_GetVGAType(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_GetVBType(struct vb_device_info *pVBInfo); +void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_SetCRT2ECLK(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void InitTo330Pointer(unsigned char, struct vb_device_info *pVBInfo); +void XGI_GetLCDSync(unsigned short *HSyncWidth, unsigned short *VSyncWidth, struct vb_device_info *pVBInfo); +void XGI_DisableBridge(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_SetCRT2VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_OEM310Setting(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_SetDelayComp(struct vb_device_info *pVBInfo); +void XGI_SetLCDCap(struct vb_device_info *pVBInfo); +void XGI_SetLCDCap_A(unsigned short tempcx, struct vb_device_info *pVBInfo); +void XGI_SetLCDCap_B(unsigned short tempcx, struct vb_device_info *pVBInfo); +void SetSpectrum(struct vb_device_info *pVBInfo); +void XGI_SetAntiFlicker(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_SetEdgeEnhance(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_SetPhaseIncr(struct vb_device_info *pVBInfo); +void XGI_SetYFilter(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_GetTVPtrIndex2(unsigned short *tempbx, unsigned char* tempcl, + unsigned char *tempch, struct vb_device_info *pVBInfo); +unsigned short XGI_GetTVPtrIndex(struct vb_device_info *pVBInfo); +void XGI_SetCRT2ModeRegs(unsigned short ModeNo, struct xgi_hw_device_info *, struct vb_device_info *pVBInfo); +void XGI_CloseCRTC(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo); +void XGI_OpenCRTC(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo); +void XGI_GetRAMDAC2DATA(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo); +void XGI_UnLockCRT2(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo); +void XGI_LockCRT2(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo); +void XGINew_EnableCRT2(struct vb_device_info *pVBInfo); +void XGINew_LCD_Wait_Time(unsigned char DelayTime, struct vb_device_info *pVBInfo); +void XGI_LongWait(struct vb_device_info *pVBInfo); +void XGI_SetCRT1Offset(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); +void XGI_GetLCDVCLKPtr(unsigned char *di_0, unsigned char *di_1, + struct vb_device_info *pVBInfo); +unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex, + unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo); +void XGI_GetVCLKLen(unsigned char tempal, unsigned char *di_0, + unsigned char *di_1, struct vb_device_info *pVBInfo); +unsigned short XGI_GetLCDCapPtr(struct vb_device_info *pVBInfo); +unsigned short XGI_GetLCDCapPtr1(struct vb_device_info *pVBInfo); +struct XGI301C_Tap4TimingStruct *XGI_GetTap4Ptr(unsigned short tempcx, struct vb_device_info *pVBInfo); +void XGI_SetXG21FPBits(struct vb_device_info *pVBInfo); +void XGI_SetXG27FPBits(struct vb_device_info *pVBInfo); +unsigned char XGI_XG21GetPSCValue(struct vb_device_info *pVBInfo); +unsigned char XGI_XG27GetPSCValue(struct vb_device_info *pVBInfo); +void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo); +void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo); +void XGI_XG21SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo); +unsigned char XGI_XG21CheckLVDSMode(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo); + +extern void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo); + +/* unsigned short XGINew_flag_clearbuffer; 0: no clear frame buffer 1:clear frame buffer */ + + +unsigned short XGINew_MDA_DAC[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, + 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, + 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F}; + +unsigned short XGINew_CGA_DAC[] = { + 0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x09, 0x15, + 0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x09, 0x15, + 0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F, + 0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F, + 0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x09, 0x15, + 0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x09, 0x15, + 0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F, + 0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F}; + +unsigned short XGINew_EGA_DAC[] = { + 0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x05, 0x15, + 0x20, 0x30, 0x24, 0x34, 0x21, 0x31, 0x25, 0x35, + 0x08, 0x18, 0x0C, 0x1C, 0x09, 0x19, 0x0D, 0x1D, + 0x28, 0x38, 0x2C, 0x3C, 0x29, 0x39, 0x2D, 0x3D, + 0x02, 0x12, 0x06, 0x16, 0x03, 0x13, 0x07, 0x17, + 0x22, 0x32, 0x26, 0x36, 0x23, 0x33, 0x27, 0x37, + 0x0A, 0x1A, 0x0E, 0x1E, 0x0B, 0x1B, 0x0F, 0x1F, + 0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F}; + +unsigned short XGINew_VGA_DAC[] = { + 0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x09, 0x15, + 0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F, + 0x00, 0x05, 0x08, 0x0B, 0x0E, 0x11, 0x14, 0x18, + 0x1C, 0x20, 0x24, 0x28, 0x2D, 0x32, 0x38, 0x3F, + 0x00, 0x10, 0x1F, 0x2F, 0x3F, 0x1F, 0x27, 0x2F, + 0x37, 0x3F, 0x2D, 0x31, 0x36, 0x3A, 0x3F, 0x00, + 0x07, 0x0E, 0x15, 0x1C, 0x0E, 0x11, 0x15, 0x18, + 0x1C, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x00, 0x04, + 0x08, 0x0C, 0x10, 0x08, 0x0A, 0x0C, 0x0E, 0x10, + 0x0B, 0x0C, 0x0D, 0x0F, 0x10}; /* --------------------------------------------------------------------- */ @@ -250,35 +240,35 @@ USHORT XGINew_VGA_DAC[]={0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void InitTo330Pointer( UCHAR ChipType ,PVB_DEVICE_INFO pVBInfo) +void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo) { - pVBInfo->SModeIDTable = (XGI_StStruct *) XGI330_SModeIDTable ; - pVBInfo->StandTable = (XGI_StandTableStruct *) XGI330_StandTable ; - pVBInfo->EModeIDTable = (XGI_ExtStruct *) XGI330_EModeIDTable ; - pVBInfo->RefIndex = (XGI_Ext2Struct *) XGI330_RefIndex ; - pVBInfo->XGINEWUB_CRT1Table = (XGI_CRT1TableStruct *) XGI_CRT1Table ; + pVBInfo->SModeIDTable = (struct XGI_StStruct *) XGI330_SModeIDTable ; + pVBInfo->StandTable = (struct XGI_StandTableStruct *) XGI330_StandTable ; + pVBInfo->EModeIDTable = (struct XGI_ExtStruct *) XGI330_EModeIDTable ; + pVBInfo->RefIndex = (struct XGI_Ext2Struct *) XGI330_RefIndex ; + pVBInfo->XGINEWUB_CRT1Table = (struct XGI_CRT1TableStruct *) XGI_CRT1Table ; /* add for new UNIVGABIOS */ - /* XGINew_UBLCDDataTable = (XGI_LCDDataTablStruct *) XGI_LCDDataTable ; */ + /* XGINew_UBLCDDataTable = (struct XGI_LCDDataTablStruct *) XGI_LCDDataTable ; */ /* XGINew_UBTVDataTable = (XGI_TVDataTablStruct *) XGI_TVDataTable ; */ if ( ChipType >= XG40 ) { - pVBInfo->MCLKData = (XGI_MCLKDataStruct *) XGI340New_MCLKData ; - pVBInfo->ECLKData = (XGI_ECLKDataStruct *) XGI340_ECLKData ; + pVBInfo->MCLKData = (struct XGI_MCLKDataStruct *) XGI340New_MCLKData; + pVBInfo->ECLKData = (struct XGI_ECLKDataStruct *) XGI340_ECLKData; } else { - pVBInfo->MCLKData = (XGI_MCLKDataStruct *) XGI330New_MCLKData ; - pVBInfo->ECLKData = (XGI_ECLKDataStruct *) XGI330_ECLKData ; + pVBInfo->MCLKData = (struct XGI_MCLKDataStruct *) XGI330New_MCLKData; + pVBInfo->ECLKData = (struct XGI_ECLKDataStruct *) XGI330_ECLKData; } - pVBInfo->VCLKData = (XGI_VCLKDataStruct *) XGI_VCLKData ; - pVBInfo->VBVCLKData = (XGI_VBVCLKDataStruct *) XGI_VBVCLKData ; + pVBInfo->VCLKData = (struct XGI_VCLKDataStruct *) XGI_VCLKData ; + pVBInfo->VBVCLKData = (struct XGI_VBVCLKDataStruct *) XGI_VBVCLKData ; pVBInfo->ScreenOffset = XGI330_ScreenOffset ; - pVBInfo->StResInfo = (XGI_StResInfoStruct *) XGI330_StResInfo ; - pVBInfo->ModeResInfo = (XGI_ModeResInfoStruct *) XGI330_ModeResInfo ; + pVBInfo->StResInfo = (struct XGI_StResInfoStruct *) XGI330_StResInfo ; + pVBInfo->ModeResInfo = (struct XGI_ModeResInfoStruct *) XGI330_ModeResInfo ; pVBInfo->pOutputSelect = &XGI330_OutputSelect ; pVBInfo->pSoftSetting = &XGI330_SoftSetting ; @@ -342,9 +332,9 @@ void InitTo330Pointer( UCHAR ChipType ,PVB_DEVICE_INFO pVBInfo) pVBInfo->Ren750pGroup3 = XGI330_Ren750pGroup3 ; - pVBInfo->TimingH = (XGI_TimingHStruct *) XGI_TimingH ; - pVBInfo->TimingV = (XGI_TimingVStruct *) XGI_TimingV ; - pVBInfo->UpdateCRT1 = (XGI_XG21CRT1Struct *) XGI_UpdateCRT1Table ; + pVBInfo->TimingH = (struct XGI_TimingHStruct *) XGI_TimingH ; + pVBInfo->TimingV = (struct XGI_TimingVStruct *) XGI_TimingV ; + pVBInfo->UpdateCRT1 = (struct XGI_XG21CRT1Struct *) XGI_UpdateCRT1Table ; pVBInfo->CHTVVCLKUNTSC = XGI330_CHTVVCLKUNTSC ; pVBInfo->CHTVVCLKONTSC = XGI330_CHTVVCLKONTSC ; @@ -371,7 +361,7 @@ void InitTo330Pointer( UCHAR ChipType ,PVB_DEVICE_INFO pVBInfo) if ( ChipType == XG27 ) { - pVBInfo->MCLKData = (XGI_MCLKDataStruct *) XGI27New_MCLKData ; + pVBInfo->MCLKData = (struct XGI_MCLKDataStruct *) XGI27New_MCLKData; pVBInfo->CR40 = XGI27_cr41 ; pVBInfo->pXGINew_CR97 = &XG27_CR97 ; pVBInfo->pSR36 = &XG27_SR36 ; @@ -405,14 +395,15 @@ void InitTo330Pointer( UCHAR ChipType ,PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGISetModeNew( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo ) +unsigned char XGISetModeNew(struct xgi_hw_device_info *HwDeviceExtension, + unsigned short ModeNo) { - USHORT ModeIdIndex ; - /* PUCHAR pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; */ - VB_DEVICE_INFO VBINF; - PVB_DEVICE_INFO pVBInfo = &VBINF; + unsigned short ModeIdIndex ; + /* unsigned char *pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; */ + struct vb_device_info VBINF; + struct vb_device_info *pVBInfo = &VBINF; pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; - pVBInfo->BaseAddr = (ULONG)HwDeviceExtension->pjIOAddress ; + pVBInfo->BaseAddr = (unsigned long)HwDeviceExtension->pjIOAddress ; pVBInfo->IF_DEF_LVDS = 0 ; pVBInfo->IF_DEF_CH7005 = 0 ; pVBInfo->IF_DEF_LCDA = 1 ; @@ -485,9 +476,6 @@ BOOLEAN XGISetModeNew( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo ) XGI_GetVBType( pVBInfo ) ; InitTo330Pointer( HwDeviceExtension->jChipType, pVBInfo ) ; -#ifdef WIN2000 - ReadVBIOSTablData( HwDeviceExtension->jChipType , pVBInfo) ; -#endif if ( ModeNo & 0x80 ) { ModeNo = ModeNo & 0x7F ; @@ -560,30 +548,9 @@ BOOLEAN XGISetModeNew( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo ) } /* !XG20 */ else { -#ifdef WIN2000 - if ( pVBInfo->IF_DEF_CH7007 == 1 ) - { - - VideoDebugPrint((0, "XGISetModeNew: pVBIfo->IF_DEF_CH7007==1\n")); - pVBInfo->VBType = VB_CH7007 ; - XGI_GetVBInfo(ModeNo , ModeIdIndex , HwDeviceExtension, pVBInfo ) ; - XGI_GetTVInfo(ModeNo , ModeIdIndex, pVBInfo ) ; - XGI_GetLCDInfo(ModeNo , ModeIdIndex, pVBInfo ) ; - if( !(XGI_XG21CheckCH7007TVMode(ModeNo, ModeIdIndex, pVBInfo )) ) - { - return FALSE; - } - } -#endif - - - if ( pVBInfo->IF_DEF_LVDS == 1 ) - { - if ( !XGI_XG21CheckLVDSMode(ModeNo , ModeIdIndex, pVBInfo) ) - { - return FALSE; - } - } + if (pVBInfo->IF_DEF_LVDS == 1) + if (!XGI_XG21CheckLVDSMode(ModeNo , ModeIdIndex, pVBInfo)) + return 0; if ( ModeNo <= 0x13 ) { @@ -642,7 +609,7 @@ BOOLEAN XGISetModeNew( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo ) XGI_LockCRT2( HwDeviceExtension, pVBInfo ) ; } - return( TRUE ) ; + return 1; } @@ -652,14 +619,16 @@ BOOLEAN XGISetModeNew( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT1Group( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension, + unsigned short ModeNo, + unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { - USHORT StandTableIndex , + unsigned short StandTableIndex , RefreshRateTableIndex , b3CC , temp ; - USHORT XGINew_P3cc = pVBInfo->P3cc; + unsigned short XGINew_P3cc = pVBInfo->P3cc; /* XGINew_CRT1Mode = ModeNo ; // SaveModeID */ StandTableIndex = XGI_GetModePtr( ModeNo , ModeIdIndex, pVBInfo ) ; @@ -710,14 +679,14 @@ void XGI_SetCRT1Group( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo , U { XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , 0x4E) ; XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , 0xE9) ; - b3CC =(UCHAR) XGINew_GetReg2(XGINew_P3cc) ; + b3CC = (unsigned char) XGINew_GetReg2(XGINew_P3cc) ; XGINew_SetReg3(XGINew_P3cc , (b3CC |= 0x0C) ) ; } else if ( ( ModeNo == 0x04) | ( ModeNo == 0x05) | ( ModeNo == 0x0D) ) { XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , 0x1B) ; XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , 0xE3) ; - b3CC = (UCHAR)XGINew_GetReg2(XGINew_P3cc) ; + b3CC = (unsigned char)XGINew_GetReg2(XGINew_P3cc) ; XGINew_SetReg3(XGINew_P3cc , (b3CC |= 0x0C) ) ; } } @@ -763,13 +732,6 @@ void XGI_SetCRT1Group( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo , U XGI_LoadDAC( ModeNo , ModeIdIndex, pVBInfo ) ; /* XGI_ClearBuffer( HwDeviceExtension , ModeNo, pVBInfo ) ; */ -#ifdef WIN2000 - if ( pVBInfo->IF_DEF_CH7007 == 1 ) /* [Billy] 2007/05/14 */ - { - VideoDebugPrint((0, "XGI_SetCRT1Group: VBInfo->IF_DEF_CH7007==1\n")); - SetCH7007Regs(HwDeviceExtension, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo ) ; /* 07/05/28 */ - } -#endif } @@ -779,9 +741,10 @@ void XGI_SetCRT1Group( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo , U /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -UCHAR XGI_GetModePtr( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +unsigned char XGI_GetModePtr(unsigned short ModeNo, unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - UCHAR index ; + unsigned char index ; if ( ModeNo <= 0x13 ) index = pVBInfo->SModeIDTable[ ModeIdIndex ].St_StTableIndex ; @@ -802,7 +765,7 @@ UCHAR XGI_GetModePtr( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInf /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -/*UCHAR XGI_SetBIOSData( USHORT ModeNo , USHORT ModeIdIndex ) +/*unsigned char XGI_SetBIOSData(unsigned short ModeNo, unsigned short ModeIdIndex) { return( 0 ) ; } @@ -814,7 +777,7 @@ UCHAR XGI_GetModePtr( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInf /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -/*UCHAR XGI_ClearBankRegs( USHORT ModeNo , USHORT ModeIdIndex ) +/*unsigned char XGI_ClearBankRegs(unsigned short ModeNo, unsigned short ModeIdIndex) { return( 0 ) ; } @@ -826,12 +789,13 @@ UCHAR XGI_GetModePtr( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInf /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetSeqRegs( USHORT ModeNo , USHORT StandTableIndex , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetSeqRegs(unsigned short ModeNo, unsigned short StandTableIndex, + unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { - UCHAR tempah , + unsigned char tempah , SRdata ; - USHORT i , + unsigned short i , modeflag ; if ( ModeNo <= 0x13 ) @@ -873,9 +837,9 @@ void XGI_SetSeqRegs( USHORT ModeNo , USHORT StandTableIndex , USHORT ModeIdInde /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetMiscRegs( USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetMiscRegs(unsigned short StandTableIndex, struct vb_device_info *pVBInfo) { - UCHAR Miscdata ; + unsigned char Miscdata ; Miscdata = pVBInfo->StandTable[ StandTableIndex ].MISC ; /* Get Misc from file */ /* @@ -898,12 +862,13 @@ void XGI_SetMiscRegs( USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRTCRegs( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension, + unsigned short StandTableIndex, struct vb_device_info *pVBInfo) { - UCHAR CRTCdata ; - USHORT i ; + unsigned char CRTCdata ; + unsigned short i ; - CRTCdata = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; + CRTCdata = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x11); CRTCdata &= 0x7f ; XGINew_SetReg1( pVBInfo->P3d4 , 0x11 , CRTCdata ) ; /* Unlock CRTC */ @@ -933,11 +898,11 @@ void XGI_SetCRTCRegs( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT StandTableI /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetATTRegs( USHORT ModeNo , USHORT StandTableIndex , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetATTRegs(unsigned short ModeNo, unsigned short StandTableIndex, + unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { - UCHAR ARdata ; - USHORT i , - modeflag ; + unsigned char ARdata ; + unsigned short i, modeflag; if ( ModeNo <= 0x13 ) modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; @@ -983,10 +948,10 @@ void XGI_SetATTRegs( USHORT ModeNo , USHORT StandTableIndex , USHORT ModeIdIndex /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetGRCRegs( USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetGRCRegs(unsigned short StandTableIndex, struct vb_device_info *pVBInfo) { - UCHAR GRdata ; - USHORT i ; + unsigned char GRdata ; + unsigned short i ; for( i = 0 ; i <= 0x08 ; i++ ) { @@ -996,7 +961,7 @@ void XGI_SetGRCRegs( USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo ) if ( pVBInfo->ModeType > ModeVGA ) { - GRdata = ( UCHAR )XGINew_GetReg1( pVBInfo->P3ce , 0x05 ) ; + GRdata = (unsigned char)XGINew_GetReg1(pVBInfo->P3ce, 0x05); GRdata &= 0xBF ; /* 256 color disable */ XGINew_SetReg1( pVBInfo->P3ce , 0x05 , GRdata ) ; } @@ -1009,9 +974,9 @@ void XGI_SetGRCRegs( USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_ClearExt1Regs(PVB_DEVICE_INFO pVBInfo) +void XGI_ClearExt1Regs(struct vb_device_info *pVBInfo) { - USHORT i ; + unsigned short i ; for( i = 0x0A ; i <= 0x0E ; i++ ) XGINew_SetReg1( pVBInfo->P3c4 , i , 0x00 ) ; /* Clear SR0A-SR0E */ @@ -1024,7 +989,7 @@ void XGI_ClearExt1Regs(PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -UCHAR XGI_SetDefaultVCLK( PVB_DEVICE_INFO pVBInfo ) +unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo) { XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x31 , ~0x30 , 0x20 ) ; @@ -1046,13 +1011,15 @@ UCHAR XGI_SetDefaultVCLK( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -USHORT XGI_GetRatePtrCRT2( PXGI_HW_DEVICE_INFO pXGIHWDE, USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE, + unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - SHORT LCDRefreshIndex[] = { 0x00 , 0x00 , 0x03 , 0x01 } , + short LCDRefreshIndex[] = { 0x00 , 0x00 , 0x03 , 0x01 } , LCDARefreshIndex[] = { 0x00 , 0x00 , 0x03 , 0x01 , 0x01 , 0x01 , 0x01 } ; - USHORT RefreshRateTableIndex , i , - modeflag , index , temp ; + unsigned short RefreshRateTableIndex, i, modeflag, index, temp; if ( ModeNo <= 0x13 ) { @@ -1183,13 +1150,11 @@ USHORT XGI_GetRatePtrCRT2( PXGI_HW_DEVICE_INFO pXGIHWDE, USHORT ModeNo , USHORT /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_AjustCRT2Rate( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex , USHORT *i, PVB_DEVICE_INFO pVBInfo ) +unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo, unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + unsigned short *i, struct vb_device_info *pVBInfo) { - USHORT tempax , - tempbx , - resinfo , - modeflag , - infoflag ; + unsigned short tempax, tempbx, resinfo, modeflag, infoflag; if ( ModeNo <= 0x13 ) { @@ -1359,9 +1324,9 @@ BOOLEAN XGI_AjustCRT2Rate( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRa /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetSync(USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetSync(unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) { - USHORT sync , + unsigned short sync , temp ; sync = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_InfoFlag >> 8 ; /* di+0x00 */ @@ -1378,17 +1343,18 @@ void XGI_SetSync(USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT1CRTC( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo, PXGI_HW_DEVICE_INFO HwDeviceExtension ) +void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo, + struct xgi_hw_device_info *HwDeviceExtension) { - UCHAR index , - data ; - - USHORT i ; + unsigned char index, data; + unsigned short i; index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC ; /* Get index */ index = index&IndexMask ; - data =( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; + data = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x11); data &= 0x7F ; XGINew_SetReg1(pVBInfo->P3d4,0x11,data); /* Unlock CRTC */ @@ -1416,16 +1382,16 @@ void XGI_SetCRT1CRTC( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT1Timing_H( PVB_DEVICE_INFO pVBInfo, PXGI_HW_DEVICE_INFO HwDeviceExtension ) +void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, struct xgi_hw_device_info *HwDeviceExtension) { - UCHAR data , data1, pushax; - USHORT i , j ; + unsigned char data, data1, pushax; + unsigned short i, j; /* XGINew_SetReg1( pVBInfo->P3d4 , 0x51 , 0 ) ; */ /* XGINew_SetReg1( pVBInfo->P3d4 , 0x56 , 0 ) ; */ /* XGINew_SetRegANDOR( pVBInfo->P3d4 ,0x11 , 0x7f , 0x00 ) ; */ - data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; /* unlock cr0-7 */ + data = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x11); /* unlock cr0-7 */ data &= 0x7F ; XGINew_SetReg1( pVBInfo->P3d4 , 0x11 , data ) ; @@ -1435,16 +1401,16 @@ void XGI_SetCRT1Timing_H( PVB_DEVICE_INFO pVBInfo, PXGI_HW_DEVICE_INFO HwDeviceE for( i = 0x01 ; i <= 0x04 ; i++ ) { data = pVBInfo->TimingH[ 0 ].data[ i ] ; - XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 1 ) , data ) ; + XGINew_SetReg1( pVBInfo->P3d4, (unsigned short)(i + 1), data); } for( i = 0x05 ; i <= 0x06 ; i++ ) { data = pVBInfo->TimingH[ 0 ].data[ i ]; - XGINew_SetReg1( pVBInfo->P3c4 ,( USHORT )( i + 6 ) , data ) ; + XGINew_SetReg1(pVBInfo->P3c4, (unsigned short)(i + 6), data); } - j = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x0e ) ; + j = (unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x0e); j &= 0x1F ; data = pVBInfo->TimingH[ 0 ].data[ 7 ] ; data &= 0xE0 ; @@ -1453,17 +1419,17 @@ void XGI_SetCRT1Timing_H( PVB_DEVICE_INFO pVBInfo, PXGI_HW_DEVICE_INFO HwDeviceE if ( HwDeviceExtension->jChipType >= XG20 ) { - data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x04 ) ; + data = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x04); data = data - 1 ; XGINew_SetReg1( pVBInfo->P3d4 , 0x04 , data ) ; - data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x05 ) ; + data = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x05); data1 = data ; data1 &= 0xE0 ; data &= 0x1F ; if ( data == 0 ) { pushax = data ; - data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x0c ) ; + data = (unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x0c); data &= 0xFB ; XGINew_SetReg1( pVBInfo->P3c4 , 0x0c , data ) ; data = pushax ; @@ -1471,7 +1437,7 @@ void XGI_SetCRT1Timing_H( PVB_DEVICE_INFO pVBInfo, PXGI_HW_DEVICE_INFO HwDeviceE data = data - 1 ; data |= data1 ; XGINew_SetReg1( pVBInfo->P3d4 , 0x05 , data ) ; - data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x0e ) ; + data = (unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x0e); data = data >> 5 ; data = data + 3 ; if ( data > 7 ) @@ -1488,10 +1454,12 @@ void XGI_SetCRT1Timing_H( PVB_DEVICE_INFO pVBInfo, PXGI_HW_DEVICE_INFO HwDeviceE /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT1Timing_V( USHORT ModeIdIndex , USHORT ModeNo,PVB_DEVICE_INFO pVBInfo ) +void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, + unsigned short ModeNo, + struct vb_device_info *pVBInfo) { - UCHAR data ; - USHORT i , j ; + unsigned char data; + unsigned short i, j; /* XGINew_SetReg1( pVBInfo->P3d4 , 0x51 , 0 ) ; */ /* XGINew_SetReg1( pVBInfo->P3d4 , 0x56 , 0 ) ; */ @@ -1500,22 +1468,22 @@ void XGI_SetCRT1Timing_V( USHORT ModeIdIndex , USHORT ModeNo,PVB_DEVICE_INFO pVB for( i = 0x00 ; i <= 0x01 ; i++ ) { data = pVBInfo->TimingV[ 0 ].data[ i ] ; - XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 6 ) , data ) ; + XGINew_SetReg1(pVBInfo->P3d4, (unsigned short)(i + 6), data); } for( i = 0x02 ; i <= 0x03 ; i++ ) { data = pVBInfo->TimingV[ 0 ].data[ i ] ; - XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 0x0e ) , data ) ; + XGINew_SetReg1(pVBInfo->P3d4, (unsigned short)(i + 0x0e), data); } for( i = 0x04 ; i <= 0x05 ; i++ ) { data = pVBInfo->TimingV[ 0 ].data[ i ] ; - XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 0x11 ) , data ) ; + XGINew_SetReg1(pVBInfo->P3d4, (unsigned short)(i + 0x11), data); } - j = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x0a ) ; + j = (unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x0a); j &= 0xC0 ; data = pVBInfo->TimingV[ 0 ].data[ 6 ] ; data &= 0x3F ; @@ -1535,7 +1503,7 @@ void XGI_SetCRT1Timing_V( USHORT ModeIdIndex , USHORT ModeNo,PVB_DEVICE_INFO pVB if ( i ) data |= 0x80 ; - j = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x09 ) ; + j = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x09); j &= 0x5F ; data |= j ; XGINew_SetReg1( pVBInfo->P3d4 , 0x09 , data ) ; @@ -1548,10 +1516,12 @@ void XGI_SetCRT1Timing_V( USHORT ModeIdIndex , USHORT ModeNo,PVB_DEVICE_INFO pVB /* Output : Fill CRT Hsync/Vsync to SR2E/SR2F/SR30/SR33/SR34/SR3F */ /* Description : Set LCD timing */ /* --------------------------------------------------------------------- */ -void XGI_SetXG21CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo) +void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - UCHAR StandTableIndex, index, Tempax, Tempbx, Tempcx, Tempdx ; - USHORT Temp1, Temp2, Temp3 ; + unsigned char StandTableIndex, index, Tempax, Tempbx, Tempcx, Tempdx; + unsigned short Temp1, Temp2, Temp3; if ( ModeNo <= 0x13 ) { @@ -1580,7 +1550,7 @@ void XGI_SetXG21CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableI Tempdx |= Tempcx ; /* Tempdx: VRS[8:1] */ XGINew_SetReg1( pVBInfo->P3c4 , 0x34 , Tempdx ) ; /* SR34[7:0]: VRS[8:1] */ - Temp1 = Tempcx << 1 ; /* Temp1[8]: VRS[8] UCHAR -> USHORT */ + Temp1 = Tempcx << 1 ; /* Temp1[8]: VRS[8] unsigned char -> unsigned short */ Temp1 |= Tempbx ; /* Temp1[8:0]: VRS[8:0] */ Tempax &= 0x80 ; /* Tempax[7]: CR7[7] */ Temp2 = Tempax << 2 ; /* Temp2[9]: VRS[9] */ @@ -1594,11 +1564,11 @@ void XGI_SetXG21CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableI if ( Tempax < Temp3 ) /* VRE[3:0]<VRS[3:0] */ Temp2 |= 0x10 ; /* Temp2: VRE + 0x10 */ Temp2 &= 0xFF ; /* Temp2[7:0]: VRE[7:0] */ - Tempax = (UCHAR)Temp2 ; /* Tempax[7:0]: VRE[7:0] */ + Tempax = (unsigned char)Temp2; /* Tempax[7:0]: VRE[7:0] */ Tempax <<= 2 ; /* Tempax << 2: VRE[5:0] */ Temp1 &= 0x600 ; /* Temp1[10:9]: VRS[10:9] */ Temp1 >>= 9 ; /* [10:9]->[1:0] */ - Tempbx = (UCHAR)Temp1 ; /* Tempbx[1:0]: VRS[10:9] */ + Tempbx = (unsigned char)Temp1; /* Tempbx[1:0]: VRS[10:9] */ Tempax |= Tempbx ; /* VRE[5:0]VRS[10:9] */ Tempax &= 0x7F ; XGINew_SetReg1( pVBInfo->P3c4 , 0x3F , Tempax ) ; /* SR3F D[7:2]->VRE D[1:0]->VRS */ @@ -1632,7 +1602,7 @@ void XGI_SetXG21CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableI Temp2 |= 0x40 ; /* Temp2 + 0x40 */ Temp2 &= 0xFF ; - Tempax = (UCHAR)Temp2 ; /* Tempax: HRE[7:0] */ + Tempax = (unsigned char)Temp2; /* Tempax: HRE[7:0] */ Tempax <<= 2 ; /* Tempax[7:2]: HRE[5:0] */ Tempdx >>= 6 ; /* Tempdx[7:6]->[1:0] HRS[9:8] */ Tempax |= Tempdx ; /* HRE[5:0]HRS[9:8] */ @@ -1676,20 +1646,22 @@ void XGI_SetXG21CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableI Temp2 |= 0x20 ; /* VRE + 0x20 */ Temp2 &= 0xFF ; - Tempax = (UCHAR)Temp2 ; /* Tempax: VRE[7:0] */ + Tempax = (unsigned char)Temp2; /* Tempax: VRE[7:0] */ Tempax <<= 2 ; /* Tempax[7:0]; VRE[5:0]00 */ Temp1 &= 0x600 ; /* Temp1[10:9]: VRS[10:9] */ Temp1 >>= 9 ; /* Temp1[1:0]: VRS[10:9] */ - Tempbx = (UCHAR)Temp1 ; + Tempbx = (unsigned char)Temp1; Tempax |= Tempbx ; /* Tempax[7:0]: VRE[5:0]VRS[10:9] */ Tempax &= 0x7F ; XGINew_SetReg1( pVBInfo->P3c4 , 0x3F , Tempax ) ; /* SR3F D[7:2]->VRE D[1:0]->VRS */ } } -void XGI_SetXG27CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo) +void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - USHORT StandTableIndex, index, Tempax, Tempbx, Tempcx, Tempdx ; + unsigned short StandTableIndex, index, Tempax, Tempbx, Tempcx, Tempdx; if ( ModeNo <= 0x13 ) { @@ -1726,7 +1698,7 @@ void XGI_SetXG27CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableI Tempbx |= Tempax ; /* Tempbx[9:0]: VRE[9:0] */ if ( Tempax <= (Tempcx & 0x0F) ) /* VRE[3:0]<=VRS[3:0] */ Tempbx |= 0x10 ; /* Tempbx: VRE + 0x10 */ - Tempax = (UCHAR)Tempbx & 0xFF; /* Tempax[7:0]: VRE[7:0] */ + Tempax = (unsigned char)Tempbx & 0xFF; /* Tempax[7:0]: VRE[7:0] */ Tempax <<= 2 ; /* Tempax << 2: VRE[5:0] */ Tempcx = (Tempcx&0x600)>>8; /* Tempcx VRS[10:9] */ XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x3F , ~0xFC, Tempax ) ; /* SR3F D[7:2]->VRE D[5:0] */ @@ -1810,10 +1782,12 @@ void XGI_SetXG27CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableI /* Output : FCLK duty cycle, FCLK delay compensation */ /* Description : All values set zero */ /* --------------------------------------------------------------------- */ -void XGI_SetXG21LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT ModeNo) +void XGI_SetXG21LCD(struct vb_device_info *pVBInfo, + unsigned short RefreshRateTableIndex, + unsigned short ModeNo) { - USHORT Data , Temp , b3CC ; - USHORT XGI_P3cc ; + unsigned short Data, Temp, b3CC; + unsigned short XGI_P3cc; XGI_P3cc = pVBInfo->P3cc ; @@ -1844,7 +1818,7 @@ void XGI_SetXG21LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT if ( ModeNo <= 0x13 ) { - b3CC = (UCHAR) XGINew_GetReg2( XGI_P3cc ) ; + b3CC = (unsigned char) XGINew_GetReg2(XGI_P3cc); if ( b3CC & 0x40 ) XGINew_SetRegOR( pVBInfo->P3c4 , 0x30 , 0x20 ) ; /* Hsync polarity */ if ( b3CC & 0x80 ) @@ -1860,10 +1834,12 @@ void XGI_SetXG21LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT } } -void XGI_SetXG27LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT ModeNo) +void XGI_SetXG27LCD(struct vb_device_info *pVBInfo, + unsigned short RefreshRateTableIndex, + unsigned short ModeNo) { - USHORT Data , Temp , b3CC ; - USHORT XGI_P3cc ; + unsigned short Data , Temp , b3CC ; + unsigned short XGI_P3cc ; XGI_P3cc = pVBInfo->P3cc ; @@ -1896,7 +1872,7 @@ void XGI_SetXG27LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT if ( ModeNo <= 0x13 ) { - b3CC = (UCHAR) XGINew_GetReg2( XGI_P3cc ) ; + b3CC = (unsigned char) XGINew_GetReg2(XGI_P3cc); if ( b3CC & 0x40 ) XGINew_SetRegOR( pVBInfo->P3c4 , 0x30 , 0x20 ) ; /* Hsync polarity */ if ( b3CC & 0x80 ) @@ -1918,7 +1894,9 @@ void XGI_SetXG27LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT /* Output : CRT1 CRTC */ /* Description : Modify CRT1 Hsync/Vsync to fix LCD mode timing */ /* --------------------------------------------------------------------- */ -void XGI_UpdateXG21CRTC( USHORT ModeNo , PVB_DEVICE_INFO pVBInfo , USHORT RefreshRateTableIndex ) +void XGI_UpdateXG21CRTC(unsigned short ModeNo, + struct vb_device_info *pVBInfo, + unsigned short RefreshRateTableIndex) { int i , index = -1; @@ -1961,16 +1939,15 @@ void XGI_UpdateXG21CRTC( USHORT ModeNo , PVB_DEVICE_INFO pVBInfo , USHORT Refres /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT1DE( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo,USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension, + unsigned short ModeNo, + unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - USHORT resindex , - tempax , - tempbx , - tempcx , - temp , - modeflag ; + unsigned short resindex, tempax, tempbx, tempcx, temp, modeflag; - UCHAR data ; + unsigned char data; resindex = XGI_GetResInfo( ModeNo , ModeIdIndex, pVBInfo ) ; @@ -2013,13 +1990,13 @@ void XGI_SetCRT1DE( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo,USHORT tempax -= 1 ; tempbx -= 1 ; tempcx = tempax ; - temp = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; - data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; + temp = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x11); + data = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x11); data &= 0x7F ; XGINew_SetReg1( pVBInfo->P3d4 , 0x11 , data ) ; /* Unlock CRTC */ - XGINew_SetReg1( pVBInfo->P3d4 , 0x01 , ( USHORT )( tempcx & 0xff ) ) ; - XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x0b , ~0x0c , ( USHORT )( ( tempcx & 0x0ff00 ) >> 10 ) ) ; - XGINew_SetReg1( pVBInfo->P3d4 , 0x12 , ( USHORT )( tempbx & 0xff ) ) ; + XGINew_SetReg1(pVBInfo->P3d4, 0x01, (unsigned short)(tempcx & 0xff)); + XGINew_SetRegANDOR(pVBInfo->P3d4, 0x0b, ~0x0c, (unsigned short)((tempcx & 0x0ff00) >> 10)); + XGINew_SetReg1(pVBInfo->P3d4, 0x12, (unsigned short)(tempbx & 0xff)); tempax = 0 ; tempbx = tempbx >> 8 ; @@ -2030,7 +2007,7 @@ void XGI_SetCRT1DE( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo,USHORT tempax |= 0x40 ; XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x07 , ~0x42 , tempax ) ; - data =( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x07 ) ; + data = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x07); data &= 0xFF ; tempax = 0 ; @@ -2048,9 +2025,11 @@ void XGI_SetCRT1DE( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo,USHORT /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -USHORT XGI_GetResInfo(USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +unsigned short XGI_GetResInfo(unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - USHORT resindex ; + unsigned short resindex; if ( ModeNo <= 0x13 ) { @@ -2070,9 +2049,13 @@ USHORT XGI_GetResInfo(USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBIn /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT1Offset( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetCRT1Offset(unsigned short ModeNo, + unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo) { - USHORT temp , + unsigned short temp , ah , al , temp2 , @@ -2131,7 +2114,7 @@ void XGI_SetCRT1Offset( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRate i |= temp ; XGINew_SetReg1( pVBInfo->P3c4 , 0x0E , i ) ; - temp =( UCHAR )temp2 ; + temp = (unsigned char)temp2; temp &= 0xFF ; /* al */ XGINew_SetReg1( pVBInfo->P3d4 , 0x13 , temp ) ; @@ -2163,11 +2146,13 @@ void XGI_SetCRT1Offset( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRate /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT1VCLK( USHORT ModeNo , USHORT ModeIdIndex , - PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetCRT1VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, + struct xgi_hw_device_info *HwDeviceExtension, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - UCHAR index , data ; - USHORT vclkindex ; + unsigned char index, data; + unsigned short vclkindex ; if ( pVBInfo->IF_DEF_LVDS == 1 ) { @@ -2224,9 +2209,11 @@ void XGI_SetCRT1VCLK( USHORT ModeNo , USHORT ModeIdIndex , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT1FIFO( USHORT ModeNo , PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo ) +void XGI_SetCRT1FIFO(unsigned short ModeNo, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo) { - USHORT data ; + unsigned short data ; data = XGINew_GetReg1( pVBInfo->P3c4 , 0x3D ) ; data &= 0xfe ; @@ -2273,10 +2260,12 @@ void XGI_SetCRT1FIFO( USHORT ModeNo , PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_ /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT1ModeRegs( PXGI_HW_DEVICE_INFO HwDeviceExtension , - USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo ) +void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension, + unsigned short ModeNo, unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - USHORT data , + unsigned short data , data2 , data3 , infoflag = 0 , @@ -2411,13 +2400,16 @@ void XGI_SetCRT1ModeRegs( PXGI_HW_DEVICE_INFO HwDeviceExtension , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetVCLKState( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo , USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo ) +void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension, + unsigned short ModeNo, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - USHORT data , + unsigned short data , data2 = 0 ; - SHORT VCLK ; + short VCLK ; - UCHAR index ; + unsigned char index; if ( ModeNo <= 0x13 ) VCLK = 0 ; @@ -2475,9 +2467,9 @@ void XGI_SetVCLKState( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -/*void XGI_VesaLowResolution( USHORT ModeNo , USHORT ModeIdIndex ,PVB_DEVICE_INFO pVBInfo) +/*void XGI_VesaLowResolution(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { - USHORT modeflag; + unsigned short modeflag; if ( ModeNo > 0x13 ) modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; @@ -2518,9 +2510,11 @@ void XGI_SetVCLKState( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_LoadDAC( USHORT ModeNo , USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo ) +void XGI_LoadDAC(unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - USHORT data , data2 , time , + unsigned short data , data2 , time , i , j , k , m , n , o , si , di , bx , dl , al , ah , dh , *table = NULL ; @@ -2627,9 +2621,11 @@ void XGI_LoadDAC( USHORT ModeNo , USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_WriteDAC( USHORT dl , USHORT ah , USHORT al , USHORT dh,PVB_DEVICE_INFO pVBInfo ) +void XGI_WriteDAC(unsigned short dl, unsigned short ah, + unsigned short al, unsigned short dh, + struct vb_device_info *pVBInfo) { - USHORT temp , bh , bl ; + unsigned short temp , bh , bl ; bh = ah ; bl = al ; @@ -2652,70 +2648,24 @@ void XGI_WriteDAC( USHORT dl , USHORT ah , USHORT al , USHORT dh,PVB_DEVICE_INFO bh = temp ; } } - XGINew_SetReg3( pVBInfo->P3c9 , ( USHORT )dh ) ; - XGINew_SetReg3( pVBInfo->P3c9 , ( USHORT )bh ) ; - XGINew_SetReg3( pVBInfo->P3c9 , ( USHORT )bl ) ; + XGINew_SetReg3(pVBInfo->P3c9, (unsigned short)dh); + XGINew_SetReg3(pVBInfo->P3c9, (unsigned short)bh); + XGINew_SetReg3(pVBInfo->P3c9, (unsigned short)bl); } -#if 0 -/* --------------------------------------------------------------------- */ -/* Function : XGI_ClearBuffer */ -/* Input : */ -/* Output : */ -/* Description : */ -/* --------------------------------------------------------------------- */ -void XGI_ClearBuffer( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo, PVB_DEVICE_INFO pVBInfo) -{ - PVOID VideoMemoryAddress = ( PVOID )HwDeviceExtension->pjVideoMemoryAddress ; - ULONG AdapterMemorySize = ( ULONG )HwDeviceExtension->ulVideoMemorySize ; - PUSHORT pBuffer ; -#ifndef LINUX_XF86 - int i ; -#endif - - if ( pVBInfo->ModeType >= ModeEGA ) - { - if ( ModeNo > 0x13 ) - { - AdapterMemorySize = 0x40000 ; /* clear 256k */ - /* GetDRAMSize( HwDeviceExtension ) ; */ - XGI_SetMemory( VideoMemoryAddress , AdapterMemorySize , 0 ) ; - } - else - { -/* - pBuffer = VideoMemoryAddress ; - for( i = 0 ; i < 0x4000 ; i++ ) - pBuffer[ i ] = 0x0000 ; -*/ - } - } - else - { - pBuffer = VideoMemoryAddress ; - if ( pVBInfo->ModeType < ModeCGA ) - { -/* - for ( i = 0 ; i < 0x4000 ; i++ ) - pBuffer[ i ] = 0x0720 ; -*/ - } - else - XGI_SetMemory( VideoMemoryAddress , 0x8000 , 0 ) ; - } -} - -#endif /* --------------------------------------------------------------------- */ /* Function : XGI_SetLCDAGroup */ /* Input : */ /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetLCDAGroup( USHORT ModeNo , USHORT ModeIdIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetLCDAGroup(unsigned short ModeNo, + unsigned short ModeIdIndex, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo) { - USHORT RefreshRateTableIndex ; - /* USHORT temp ; */ + unsigned short RefreshRateTableIndex ; + /* unsigned short temp ; */ /* pVBInfo->SelectCRT2Rate = 0 ; */ @@ -2735,9 +2685,11 @@ void XGI_SetLCDAGroup( USHORT ModeNo , USHORT ModeIdIndex , PXGI_HW_DEVICE_INFO /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetLVDSResInfo( USHORT ModeNo , USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo ) +void XGI_GetLVDSResInfo(unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - USHORT resindex , xres , yres , modeflag ; + unsigned short resindex , xres , yres , modeflag ; if ( ModeNo <= 0x13 ) { @@ -2803,17 +2755,20 @@ void XGI_GetLVDSResInfo( USHORT ModeNo , USHORT ModeIdIndex,PVB_DEVICE_INFO pVB /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetLVDSData( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_GetLVDSData(unsigned short ModeNo, + unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - USHORT tempbx ; - XGI330_LVDSDataStruct *LCDPtr = NULL ; - XGI330_CHTVDataStruct *TVPtr = NULL ; + unsigned short tempbx ; + struct XGI330_LVDSDataStruct *LCDPtr = NULL ; + struct XGI330_CHTVDataStruct *TVPtr = NULL ; tempbx = 2 ; if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) { - LCDPtr = ( XGI330_LVDSDataStruct * )XGI_GetLcdPtr( tempbx, ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo) ; + LCDPtr = (struct XGI330_LVDSDataStruct *)XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); pVBInfo->VGAHT = LCDPtr->VGAHT ; pVBInfo->VGAVT = LCDPtr->VGAVT ; pVBInfo->HT = LCDPtr->LCDHT ; @@ -2823,7 +2778,7 @@ void XGI_GetLVDSData( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTa { if ( pVBInfo->VBInfo & SetCRT2ToTV ) { - TVPtr = ( XGI330_CHTVDataStruct * )XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + TVPtr = (struct XGI330_CHTVDataStruct *)XGI_GetTVPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); pVBInfo->VGAHT = TVPtr->VGAHT ; pVBInfo->VGAVT = TVPtr->VGAVT ; pVBInfo->HT = TVPtr->LCDHT ; @@ -2866,16 +2821,18 @@ void XGI_GetLVDSData( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTa /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_ModCRT1Regs( USHORT ModeNo , USHORT ModeIdIndex , - USHORT RefreshRateTableIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo ) +void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo) { - UCHAR index ; - USHORT tempbx , i ; - XGI_LVDSCRT1HDataStruct *LCDPtr = NULL ; - XGI_LVDSCRT1VDataStruct *LCDPtr1 =NULL ; - /* XGI330_CHTVDataStruct *TVPtr = NULL ; */ - XGI_CH7007TV_TimingHStruct *CH7007TV_TimingHPtr = NULL; - XGI_CH7007TV_TimingVStruct *CH7007TV_TimingVPtr = NULL; + unsigned char index; + unsigned short tempbx , i ; + struct XGI_LVDSCRT1HDataStruct *LCDPtr = NULL; + struct XGI_LVDSCRT1VDataStruct *LCDPtr1 = NULL; + /* struct XGI330_CHTVDataStruct *TVPtr = NULL ; */ + struct XGI_CH7007TV_TimingHStruct *CH7007TV_TimingHPtr = NULL; + struct XGI_CH7007TV_TimingVStruct *CH7007TV_TimingVPtr = NULL; if( ModeNo <= 0x13 ) index = pVBInfo->SModeIDTable[ ModeIdIndex ].St_CRT2CRTC ; @@ -2890,7 +2847,7 @@ void XGI_ModCRT1Regs( USHORT ModeNo , USHORT ModeIdIndex , if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) { - LCDPtr = ( XGI_LVDSCRT1HDataStruct * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + LCDPtr = (struct XGI_LVDSCRT1HDataStruct *)XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); for( i = 0 ; i < 8 ; i++ ) pVBInfo->TimingH[ 0 ].data[ i ] = LCDPtr[ 0 ].Reg[ i ] ; @@ -2900,7 +2857,7 @@ void XGI_ModCRT1Regs( USHORT ModeNo , USHORT ModeIdIndex , { if ( pVBInfo->VBInfo & SetCRT2ToTV ) { - CH7007TV_TimingHPtr = ( XGI_CH7007TV_TimingHStruct *)XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + CH7007TV_TimingHPtr = (struct XGI_CH7007TV_TimingHStruct *)XGI_GetTVPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); for( i = 0 ; i < 8 ; i++ ) pVBInfo->TimingH[ 0 ].data[ i ] = CH7007TV_TimingHPtr[ 0 ].data[ i ] ; @@ -2910,7 +2867,7 @@ void XGI_ModCRT1Regs( USHORT ModeNo , USHORT ModeIdIndex , /* if ( pVBInfo->IF_DEF_CH7017 == 1 ) { if ( pVBInfo->VBInfo & SetCRT2ToTV ) - TVPtr = ( XGI330_CHTVDataStruct *)XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + TVPtr = ( struct XGI330_CHTVDataStruct *)XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; } */ XGI_SetCRT1Timing_H(pVBInfo,HwDeviceExtension) ; @@ -2925,7 +2882,7 @@ void XGI_ModCRT1Regs( USHORT ModeNo , USHORT ModeIdIndex , if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) { - LCDPtr1 = ( XGI_LVDSCRT1VDataStruct * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + LCDPtr1 = (struct XGI_LVDSCRT1VDataStruct *)XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); for( i = 0 ; i < 7 ; i++ ) pVBInfo->TimingV[ 0 ].data[ i ] = LCDPtr1[ 0 ].Reg[ i ] ; } @@ -2934,7 +2891,7 @@ void XGI_ModCRT1Regs( USHORT ModeNo , USHORT ModeIdIndex , { if ( pVBInfo->VBInfo & SetCRT2ToTV ) { - CH7007TV_TimingVPtr = ( XGI_CH7007TV_TimingVStruct *)XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + CH7007TV_TimingVPtr = (struct XGI_CH7007TV_TimingVStruct *)XGI_GetTVPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); for( i = 0 ; i < 7 ; i++ ) pVBInfo->TimingV[ 0 ].data[ i ] = CH7007TV_TimingVPtr[ 0 ].data[ i ] ; @@ -2943,7 +2900,7 @@ void XGI_ModCRT1Regs( USHORT ModeNo , USHORT ModeIdIndex , /* if ( pVBInfo->IF_DEF_CH7017 == 1 ) { if ( pVBInfo->VBInfo & SetCRT2ToTV ) - TVPtr = ( XGI330_CHTVDataStruct *)XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + TVPtr = ( struct XGI330_CHTVDataStruct *)XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; } */ XGI_SetCRT1Timing_V( ModeIdIndex , ModeNo , pVBInfo) ; @@ -2966,12 +2923,14 @@ void XGI_ModCRT1Regs( USHORT ModeNo , USHORT ModeIdIndex , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - USHORT tempbx , tempax , tempcx , tempdx , push1 , push2 , modeflag ; + unsigned short tempbx , tempax , tempcx , tempdx , push1 , push2 , modeflag ; unsigned long temp , temp1 , temp2 , temp3 , push3 ; - XGI330_LCDDataDesStruct *LCDPtr = NULL ; - XGI330_LCDDataDesStruct2 *LCDPtr1 = NULL ; + struct XGI330_LCDDataDesStruct *LCDPtr = NULL ; + struct XGI330_LCDDataDesStruct2 *LCDPtr1 = NULL ; if ( ModeNo > 0x13 ) modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; @@ -2985,16 +2944,16 @@ void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab if ( pVBInfo->IF_DEF_OEMUtil == 1 ) { tempbx = 8 ; - LCDPtr = ( XGI330_LCDDataDesStruct * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + LCDPtr = (struct XGI330_LCDDataDesStruct *)XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); } if ( ( pVBInfo->IF_DEF_OEMUtil == 0 ) || ( LCDPtr == 0 ) ) { tempbx = 3 ; if ( pVBInfo->LCDInfo & EnableScalingLCD ) - LCDPtr1 = ( XGI330_LCDDataDesStruct2 * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + LCDPtr1 = (struct XGI330_LCDDataDesStruct2 *)XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); else - LCDPtr = ( XGI330_LCDDataDesStruct * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + LCDPtr = (struct XGI330_LCDDataDesStruct *)XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); } XGI_GetLCDSync( &tempax , &tempbx ,pVBInfo) ; @@ -3056,8 +3015,8 @@ void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab tempcx = tempcx >> 3 ; tempbx = tempbx >> 3 ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x16 , ( USHORT )( tempbx & 0xff ) ) ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x17 , ( USHORT )( tempcx & 0xff ) ) ; + XGINew_SetReg1(pVBInfo->Part1Port, 0x16, (unsigned short)(tempbx & 0xff)); + XGINew_SetReg1(pVBInfo->Part1Port, 0x17, (unsigned short)(tempcx & 0xff)); tempax = pVBInfo->HT ; @@ -3085,7 +3044,7 @@ void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab tempax |= tempcx ; XGINew_SetReg1( pVBInfo->Part1Port , 0x15 , tempax ) ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x14 , ( USHORT )( tempbx & 0xff ) ) ; + XGINew_SetReg1(pVBInfo->Part1Port, 0x14, (unsigned short)(tempbx & 0xff)); tempax = pVBInfo->VT ; if ( pVBInfo->LCDInfo & EnableScalingLCD ) @@ -3099,13 +3058,13 @@ void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab if ( tempcx >= tempax ) tempcx -= tempax ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x1b , ( USHORT )( tempbx & 0xff ) ) ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x1c , ( USHORT )( tempcx & 0xff ) ) ; + XGINew_SetReg1(pVBInfo->Part1Port, 0x1b, (unsigned short)(tempbx & 0xff)); + XGINew_SetReg1(pVBInfo->Part1Port, 0x1c, (unsigned short)(tempcx & 0xff)); tempbx = ( tempbx >> 8 ) & 0x07 ; tempcx = ( tempcx >> 8 ) & 0x07 ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x1d , ( USHORT )( ( tempcx << 3 ) | tempbx ) ) ; + XGINew_SetReg1(pVBInfo->Part1Port, 0x1d, (unsigned short)((tempcx << 3) | tempbx)); tempax = pVBInfo->VT ; if ( pVBInfo->LCDInfo & EnableScalingLCD ) @@ -3123,8 +3082,8 @@ void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab if ( tempcx >= tempax ) tempcx -= tempax ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x18 , ( USHORT )( tempbx & 0xff ) ) ; - XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x19 , ~0x0f , ( USHORT )( tempcx & 0x0f ) ) ; + XGINew_SetReg1(pVBInfo->Part1Port, 0x18, (unsigned short)(tempbx & 0xff)); + XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x19, ~0x0f, (unsigned short)(tempcx & 0x0f)); tempax = ( ( tempbx >> 8 ) & 0x07 ) << 3 ; @@ -3145,7 +3104,7 @@ void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab temp = tempax ; /* 0430 ylshieh */ temp1 = ( temp << 18 ) / tempbx ; - tempdx = ( USHORT )( ( temp << 18 ) % tempbx ) ; + tempdx = (unsigned short)((temp << 18) % tempbx); if ( tempdx != 0 ) temp1 += 1 ; @@ -3153,10 +3112,10 @@ void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab temp2 = temp1 ; push3 = temp2 ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x37 , ( USHORT )( temp2 & 0xff ) ) ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x36 , ( USHORT )( ( temp2 >> 8 ) & 0xff ) ) ; + XGINew_SetReg1(pVBInfo->Part1Port, 0x37, (unsigned short)(temp2 & 0xff)); + XGINew_SetReg1(pVBInfo->Part1Port, 0x36, (unsigned short)((temp2 >> 8) & 0xff)); - tempbx = ( USHORT )( temp2 >> 16 ) ; + tempbx = (unsigned short)(temp2 >> 16); tempax = tempbx & 0x03 ; tempbx = pVBInfo->VGAVDE ; @@ -3168,10 +3127,10 @@ void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab if ( pVBInfo->VBType & VB_XGI301C ) { temp2 = push3 ; - XGINew_SetReg1( pVBInfo->Part4Port , 0x3c , ( USHORT )( temp2 & 0xff ) ) ; - XGINew_SetReg1( pVBInfo->Part4Port , 0x3b , ( USHORT )( ( temp2 >> 8 ) & 0xff ) ) ; - tempbx = ( USHORT )( temp2 >> 16 ) ; - XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x3a , ~0xc0 , ( USHORT )( ( tempbx & 0xff ) << 6 ) ) ; + XGINew_SetReg1(pVBInfo->Part4Port, 0x3c, (unsigned short)(temp2 & 0xff)); + XGINew_SetReg1(pVBInfo->Part4Port, 0x3b, (unsigned short)((temp2 >> 8) & 0xff)); + tempbx = (unsigned short)(temp2 >> 16); + XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x3a, ~0xc0, (unsigned short)((tempbx & 0xff) << 6)); tempcx = pVBInfo->VGAVDE ; if ( tempcx == pVBInfo->VDE ) @@ -3185,7 +3144,7 @@ void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab temp1 = tempcx << 16 ; - tempax = ( USHORT )( temp1 / tempbx ) ; + tempax = (unsigned short)(temp1 / tempbx); if ( ( tempbx & 0xffff ) == ( tempcx & 0xffff ) ) tempax = 65535 ; @@ -3199,28 +3158,28 @@ void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab temp3 = ( temp3 & 0xffff0000 ) + ( temp1 & 0xffff ) ; - tempax = ( USHORT )( temp3 & 0xff ) ; + tempax = (unsigned short)(temp3 & 0xff); XGINew_SetReg1( pVBInfo->Part1Port , 0x1f , tempax ) ; temp1 = pVBInfo->VGAVDE << 18 ; temp1 = temp1 / push3 ; - tempbx = ( USHORT )( temp1 & 0xffff ) ; + tempbx = (unsigned short)(temp1 & 0xffff); if ( pVBInfo->LCDResInfo == Panel1024x768 ) tempbx -= 1 ; tempax = ( ( tempbx >> 8 ) & 0xff ) << 3 ; - tempax |= ( USHORT )( ( temp3 >> 8 ) & 0x07 ) ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x20 , ( USHORT )( tempax & 0xff ) ) ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x21 , ( USHORT )( tempbx & 0xff ) ) ; + tempax |= (unsigned short)((temp3 >> 8) & 0x07); + XGINew_SetReg1(pVBInfo->Part1Port, 0x20, (unsigned short)(tempax & 0xff)); + XGINew_SetReg1(pVBInfo->Part1Port, 0x21, (unsigned short)(tempbx & 0xff)); temp3 = temp3 >> 16 ; if ( modeflag & HalfDCLK ) temp3 = temp3 >> 1 ; - XGINew_SetReg1(pVBInfo->Part1Port , 0x22 , ( USHORT )( ( temp3 >> 8 ) & 0xff ) ) ; - XGINew_SetReg1(pVBInfo->Part1Port , 0x23 , ( USHORT )( temp3 & 0xff ) ) ; + XGINew_SetReg1(pVBInfo->Part1Port , 0x22, (unsigned short)((temp3 >> 8) & 0xff)); + XGINew_SetReg1(pVBInfo->Part1Port , 0x23, (unsigned short)(temp3 & 0xff)); } } } @@ -3232,9 +3191,9 @@ void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT2ECLK( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetCRT2ECLK(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) { - UCHAR di_0 , di_1 , tempal ; + unsigned char di_0, di_1, tempal; int i ; tempal = XGI_GetVCLKPtr( RefreshRateTableIndex , ModeNo , ModeIdIndex, pVBInfo ) ; @@ -3243,7 +3202,7 @@ void XGI_SetCRT2ECLK( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab for( i = 0 ; i < 4 ; i++ ) { - XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x31 , ~0x30 , ( USHORT )( 0x10 * i ) ) ; + XGINew_SetRegANDOR(pVBInfo->P3d4, 0x31, ~0x30, (unsigned short)(0x10 * i)); if ( pVBInfo->IF_DEF_CH7007 == 1 ) { XGINew_SetReg1( pVBInfo->P3c4 , 0x2b , di_0 ) ; @@ -3269,9 +3228,9 @@ void XGI_SetCRT2ECLK( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_UpdateModeInfo( PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo ) +void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT tempcl , + unsigned short tempcl , tempch , temp , tempbl , @@ -3377,7 +3336,7 @@ void XGI_UpdateModeInfo( PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetVGAType( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +void XGI_GetVGAType(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { /* if ( HwDeviceExtension->jChipType >= XG20 ) @@ -3399,9 +3358,9 @@ void XGI_GetVGAType( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVB /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetVBType(PVB_DEVICE_INFO pVBInfo) +void XGI_GetVBType(struct vb_device_info *pVBInfo) { - USHORT flag , tempbx , tempah ; + unsigned short flag , tempbx , tempah ; if ( pVBInfo->IF_DEF_CH7007 == 1 ) { @@ -3462,9 +3421,9 @@ void XGI_GetVBType(PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetVBInfo( USHORT ModeNo , USHORT ModeIdIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT tempax , + unsigned short tempax , push , tempbx , temp , @@ -3703,9 +3662,9 @@ void XGI_GetVBInfo( USHORT ModeNo , USHORT ModeIdIndex , PXGI_HW_DEVICE_INFO HwD /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetTVInfo( USHORT ModeNo , USHORT ModeIdIndex ,PVB_DEVICE_INFO pVBInfo ) +void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { - USHORT temp , + unsigned short temp , tempbx = 0 , resinfo = 0 , modeflag , @@ -3838,9 +3797,10 @@ void XGI_GetTVInfo( USHORT ModeNo , USHORT ModeIdIndex ,PVB_DEVICE_INFO pVBInfo /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_GetLCDInfo( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +unsigned char XGI_GetLCDInfo(unsigned short ModeNo, unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - USHORT temp , + unsigned short temp , tempax , tempbx , modeflag , @@ -4047,96 +4007,12 @@ BOOLEAN XGI_GetLCDInfo( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBI /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_SearchModeID( USHORT ModeNo , USHORT *ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +unsigned char XGI_SearchModeID(unsigned short ModeNo, + unsigned short *ModeIdIndex, + struct vb_device_info *pVBInfo) { -#ifdef TC - - if ( ModeNo <= 5 ) - ModeNo |= 1 ; - - if ( ModeNo <= 0x13 ) - { - /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->SModeIDTable)/sizeof(XGI_StStruct);(*ModeIdIndex)++) */ - for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) - { - if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == ModeNo ) - break ; - if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == 0xFF ) - return( FALSE ) ; - } - - VGA_INFO = ( PUCHAR )MK_FP( 0 , 0x489 ) ; - - if ( ModeNo == 0x07 ) - { - if ( ( *VGA_INFO & 0x10 ) != 0 ) - ( *ModeIdIndex )++ ; /* 400 lines */ - /* else 350 lines */ - } - - if ( ModeNo <= 3 ) - { - if ( ( *VGA_INFO & 0x80 ) == 0 ) - { - ( *ModeIdIndex )++ ; - if ( ( *VGA_INFO & 0x10 ) != 0 ) - ( *ModeIdIndex )++ ; /* 400 lines */ - /* else 350 lines */ - } - /* else 200 lines */ - } - } - else - { - /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->EModeIDTable)/sizeof(XGI_ExtStruct);(*ModeIdIndex)++) */ - for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) - { - if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == ModeNo ) - break ; - if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == 0xFF ) - return( FALSE ) ; - } - } - - -#endif - -#ifdef WIN2000 - - if ( ModeNo <= 5 ) - ModeNo |= 1 ; - if ( ModeNo <= 0x13 ) - { - /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->SModeIDTable)/sizeof(XGI_StStruct);(*ModeIdIndex)++) */ - for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) - { - if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == ModeNo ) - break ; - if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == 0xFF ) - return( FALSE ) ; - } - - if ( ModeNo == 0x07 ) - ( *ModeIdIndex )++ ; /* 400 lines */ - - if ( ModeNo <=3 ) - ( *ModeIdIndex ) += 2 ; /* 400 lines */ - /* else 350 lines */ - } - else - { - /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->EModeIDTable)/sizeof(XGI_ExtStruct);(*ModeIdIndex)++) */ - for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) - { - if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == ModeNo ) - break ; - if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == 0xFF ) - return( FALSE ) ; - } - } -#endif #ifdef LINUX /* chiawen for linux solution */ @@ -4144,13 +4020,13 @@ BOOLEAN XGI_SearchModeID( USHORT ModeNo , USHORT *ModeIdIndex, PVB_DEVICE_INFO p ModeNo |= 1 ; if ( ModeNo <= 0x13 ) { - /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->SModeIDTable)/sizeof(XGI_StStruct);(*ModeIdIndex)++) */ + /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->SModeIDTable)/sizeof(struct XGI_StStruct);(*ModeIdIndex)++) */ for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) { - if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == ModeNo ) - break ; - if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == 0xFF ) - return( FALSE ) ; + if (pVBInfo->SModeIDTable[*ModeIdIndex].St_ModeID == ModeNo) + break; + if (pVBInfo->SModeIDTable[*ModeIdIndex].St_ModeID == 0xFF) + return 0; } if ( ModeNo == 0x07 ) @@ -4162,19 +4038,19 @@ BOOLEAN XGI_SearchModeID( USHORT ModeNo , USHORT *ModeIdIndex, PVB_DEVICE_INFO p } else { - /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->EModeIDTable)/sizeof(XGI_ExtStruct);(*ModeIdIndex)++) */ + /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->EModeIDTable)/sizeof(struct XGI_ExtStruct);(*ModeIdIndex)++) */ for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) { - if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == ModeNo ) - break ; - if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == 0xFF ) - return( FALSE ) ; + if (pVBInfo->EModeIDTable[*ModeIdIndex].Ext_ModeID == ModeNo) + break; + if (pVBInfo->EModeIDTable[*ModeIdIndex].Ext_ModeID == 0xFF) + return 0; } } #endif - return( TRUE ) ; + return 1; } @@ -4188,9 +4064,12 @@ BOOLEAN XGI_SearchModeID( USHORT ModeNo , USHORT *ModeIdIndex, PVB_DEVICE_INFO p /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGINew_CheckMemorySize(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo) +unsigned char XGINew_CheckMemorySize(struct xgi_hw_device_info *HwDeviceExtension, + unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - USHORT memorysize , + unsigned short memorysize , modeflag , temp , temp1 , @@ -4199,7 +4078,7 @@ BOOLEAN XGINew_CheckMemorySize(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT Mode /* if ( ( HwDeviceExtension->jChipType == XGI_650 ) || ( HwDeviceExtension->jChipType == XGI_650M ) ) { - return( TRUE ) ; + return 1; } */ if ( ModeNo <= 0x13 ) @@ -4257,10 +4136,10 @@ BOOLEAN XGINew_CheckMemorySize(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT Mode temp <<= 1 ; } } - if ( temp < memorysize ) - return( FALSE ) ; + if (temp < memorysize) + return 0; else - return( TRUE ) ; + return 1; } @@ -4270,10 +4149,10 @@ BOOLEAN XGINew_CheckMemorySize(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT Mode /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -/*void XGINew_IsLowResolution( USHORT ModeNo , USHORT ModeIdIndex, BOOLEAN XGINew_CheckMemorySize(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo) +/*void XGINew_IsLowResolution(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned char XGINew_CheckMemorySize(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { - USHORT data ; - USHORT ModeFlag ; + unsigned short data ; + unsigned short ModeFlag ; data = XGINew_GetReg1( pVBInfo->P3c4 , 0x0F ) ; data &= 0x7F ; @@ -4302,7 +4181,7 @@ BOOLEAN XGINew_CheckMemorySize(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT Mode /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_DisplayOn( PXGI_HW_DEVICE_INFO pXGIHWDE , PVB_DEVICE_INFO pVBInfo ) +void XGI_DisplayOn(struct xgi_hw_device_info *pXGIHWDE, struct vb_device_info *pVBInfo) { XGINew_SetRegANDOR(pVBInfo->P3c4,0x01,0xDF,0x00); @@ -4331,12 +4210,6 @@ void XGI_DisplayOn( PXGI_HW_DEVICE_INFO pXGIHWDE , PVB_DEVICE_INFO pVBInfo ) if (pVBInfo->IF_DEF_CH7007 == 1) /* [Billy] 07/05/23 For CH7007 */ { -#ifdef WIN2000 - if ( IsCH7007TVMode( pVBInfo ) ) - { - TurnOnCH7007(pXGIHWDE->pDevice) ; /* 07/05/28 */ - } -#endif } @@ -4372,7 +4245,7 @@ void XGI_DisplayOn( PXGI_HW_DEVICE_INFO pXGIHWDE , PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_DisplayOff( PXGI_HW_DEVICE_INFO pXGIHWDE , PVB_DEVICE_INFO pVBInfo ) +void XGI_DisplayOff(struct xgi_hw_device_info *pXGIHWDE, struct vb_device_info *pVBInfo) { if ( pXGIHWDE->jChipType == XG21 ) @@ -4392,9 +4265,6 @@ void XGI_DisplayOff( PXGI_HW_DEVICE_INFO pXGIHWDE , PVB_DEVICE_INFO pVBInfo ) { /* if( IsCH7007TVMode( pVBInfo ) == 0 ) */ { -#ifdef WIN2000 - TurnOffCH7007(pXGIHWDE->pDevice) ; /* 07/05/28 */ -#endif } } @@ -4423,7 +4293,7 @@ void XGI_DisplayOff( PXGI_HW_DEVICE_INFO pXGIHWDE , PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : chiawen for sensecrt1 */ /* --------------------------------------------------------------------- */ -void XGI_WaitDisply( PVB_DEVICE_INFO pVBInfo ) +void XGI_WaitDisply(struct vb_device_info *pVBInfo) { while( ( XGINew_GetReg2( pVBInfo->P3da ) & 0x01 ) ) break ; @@ -4439,58 +4309,59 @@ void XGI_WaitDisply( PVB_DEVICE_INFO pVBInfo ) /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SenseCRT1( PVB_DEVICE_INFO pVBInfo ) +void XGI_SenseCRT1(struct vb_device_info *pVBInfo) { - UCHAR CRTCData[ 17 ] = { 0x5F , 0x4F , 0x50 , 0x82 , 0x55 , 0x81 , - 0x0B , 0x3E , 0xE9 , 0x0B , 0xDF , 0xE7 , - 0x04 , 0x00 , 0x00 , 0x05 , 0x00 } ; + unsigned char CRTCData[17] = { + 0x5F , 0x4F , 0x50 , 0x82 , 0x55 , 0x81 , + 0x0B , 0x3E , 0xE9 , 0x0B , 0xDF , 0xE7 , + 0x04 , 0x00 , 0x00 , 0x05 , 0x00 }; - UCHAR SR01 = 0 , SR1F = 0 , SR07 = 0 , SR06 = 0 ; + unsigned char SR01 = 0, SR1F = 0, SR07 = 0, SR06 = 0; - UCHAR CR17 , CR63 , SR31 ; - USHORT temp ; - UCHAR DAC_TEST_PARMS[ 3 ] = { 0x0F , 0x0F , 0x0F } ; + unsigned char CR17, CR63, SR31; + unsigned short temp ; + unsigned char DAC_TEST_PARMS[3] = { 0x0F, 0x0F, 0x0F } ; int i ; XGINew_SetReg1( pVBInfo->P3c4 , 0x05 , 0x86 ) ; /* [2004/05/06] Vicent to fix XG42 single LCD sense to CRT+LCD */ XGINew_SetReg1( pVBInfo->P3d4 , 0x57 , 0x4A ) ; - XGINew_SetReg1( pVBInfo->P3d4 , 0x53 , ( UCHAR )( XGINew_GetReg1( pVBInfo->P3d4 , 0x53 ) | 0x02 ) ) ; + XGINew_SetReg1(pVBInfo->P3d4, 0x53, (unsigned char)(XGINew_GetReg1(pVBInfo->P3d4, 0x53) | 0x02)); - SR31 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x31 ) ; - CR63 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x63 ) ; - SR01 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x01 ) ; + SR31 = (unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x31); + CR63 = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x63); + SR01 = (unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x01); - XGINew_SetReg1( pVBInfo->P3c4 , 0x01 , ( UCHAR )( SR01 & 0xDF ) ) ; - XGINew_SetReg1( pVBInfo->P3d4 , 0x63 , ( UCHAR )( CR63 & 0xBF ) ) ; + XGINew_SetReg1(pVBInfo->P3c4, 0x01, (unsigned char)(SR01 & 0xDF)); + XGINew_SetReg1(pVBInfo->P3d4, 0x63, (unsigned char)(CR63 & 0xBF)); - CR17 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x17 ) ; - XGINew_SetReg1( pVBInfo->P3d4 , 0x17 , ( UCHAR )( CR17 | 0x80 ) ) ; + CR17 = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x17); + XGINew_SetReg1(pVBInfo->P3d4, 0x17, (unsigned char)(CR17 | 0x80)) ; - SR1F = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x1F ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x1F , ( UCHAR )( SR1F | 0x04 ) ) ; + SR1F = (unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x1F); + XGINew_SetReg1(pVBInfo->P3c4, 0x1F, (unsigned char)(SR1F | 0x04)); - SR07 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x07 ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x07 , ( UCHAR )( SR07 & 0xFB ) ) ; - SR06 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x06 ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x06 , ( UCHAR )( SR06 & 0xC3 ) ) ; + SR07 = (unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x07); + XGINew_SetReg1(pVBInfo->P3c4, 0x07, (unsigned char)(SR07 & 0xFB)); + SR06 = (unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x06); + XGINew_SetReg1(pVBInfo->P3c4, 0x06, (unsigned char)(SR06 & 0xC3)); XGINew_SetReg1( pVBInfo->P3d4 , 0x11 , 0x00 ) ; for( i = 0 ; i < 8 ; i++ ) - XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )i , CRTCData[ i ] ) ; + XGINew_SetReg1(pVBInfo->P3d4, (unsigned short)i, CRTCData[i]); for( i = 8 ; i < 11 ; i++ ) - XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 8 ) , CRTCData[ i ] ) ; + XGINew_SetReg1(pVBInfo->P3d4, (unsigned short)(i + 8), CRTCData[i]); for( i = 11 ; i < 13 ; i++ ) - XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 4 ) , CRTCData[ i ] ) ; + XGINew_SetReg1(pVBInfo->P3d4, (unsigned short)(i + 4), CRTCData[i]); for( i = 13 ; i < 16 ; i++ ) - XGINew_SetReg1( pVBInfo->P3c4 , ( USHORT )( i - 3 ) , CRTCData[ i ] ) ; + XGINew_SetReg1(pVBInfo->P3c4, (unsigned short)(i - 3), CRTCData[i]); - XGINew_SetReg1( pVBInfo->P3c4 , 0x0E , ( UCHAR )( CRTCData[ 16 ] & 0xE0 ) ) ; + XGINew_SetReg1(pVBInfo->P3c4, 0x0E, (unsigned char)(CRTCData[16] & 0xE0)); XGINew_SetReg1( pVBInfo->P3c4 , 0x31 , 0x00 ) ; XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , 0x1B ) ; @@ -4500,9 +4371,9 @@ void XGI_SenseCRT1( PVB_DEVICE_INFO pVBInfo ) for( i = 0 ; i < 256 ; i++ ) { - XGINew_SetReg3( ( pVBInfo->P3c8 + 1 ) , ( UCHAR )DAC_TEST_PARMS[ 0 ] ) ; - XGINew_SetReg3( ( pVBInfo->P3c8 + 1 ) , ( UCHAR )DAC_TEST_PARMS[ 1 ] ) ; - XGINew_SetReg3( ( pVBInfo->P3c8 + 1 ) , ( UCHAR )DAC_TEST_PARMS[ 2 ] ) ; + XGINew_SetReg3((pVBInfo->P3c8 + 1), (unsigned char)DAC_TEST_PARMS[0]); + XGINew_SetReg3((pVBInfo->P3c8 + 1), (unsigned char)DAC_TEST_PARMS[1]); + XGINew_SetReg3((pVBInfo->P3c8 + 1), (unsigned char)DAC_TEST_PARMS[2]); } XGI_VBLongWait( pVBInfo ) ; @@ -4538,148 +4409,18 @@ void XGI_SenseCRT1( PVB_DEVICE_INFO pVBInfo ) XGINew_SetReg1( pVBInfo->P3c4 , 0x31 , SR31 ) ; /* [2004/05/11] Vicent */ - XGINew_SetReg1( pVBInfo->P3d4 , 0x53 , ( UCHAR )( XGINew_GetReg1( pVBInfo->P3d4 , 0x53 ) & 0xFD ) ) ; - XGINew_SetReg1( pVBInfo->P3c4 , 0x1F , ( UCHAR ) SR1F ) ; + XGINew_SetReg1(pVBInfo->P3d4, 0x53, + (unsigned char)(XGINew_GetReg1(pVBInfo->P3d4, 0x53) & 0xFD)); + XGINew_SetReg1(pVBInfo->P3c4, 0x1F, (unsigned char)SR1F); } -#ifdef TC -/* --------------------------------------------------------------------- */ -/* Function : INT1AReturnCode */ -/* Input : */ -/* Output : */ -/* Description : */ -/* --------------------------------------------------------------------- */ -int INT1AReturnCode( union REGS regs ) -{ - if ( regs.x.cflag ) - { - /* printf( "Error to find pci device!\n" ) ; */ - return( 1 ) ; - } - switch(regs.h.ah) - { - case 0: return 0; - break ; - case 0x81: - printf( "Function not support\n" ) ; - break ; - case 0x83: - printf( "bad vendor id\n" ) ; - break ; - case 0x86: - printf( "device not found\n" ) ; - break ; - case 0x87: - printf( "bad register number\n" ) ; - break ; - case 0x88: - printf( "set failed\n" ) ; - break ; - case 0x89: - printf( "buffer too small" ) ; - break ; - default: - break ; - } - return( 1 ) ; -} -/* --------------------------------------------------------------------- */ -/* Function : FindPCIIOBase */ -/* Input : */ -/* Output : */ -/* Description : */ -/* --------------------------------------------------------------------- */ -unsigned FindPCIIOBase( unsigned index , unsigned deviceid ) -{ - union REGS regs ; - - regs.h.ah = 0xb1 ; /* PCI_FUNCTION_ID */ - regs.h.al = 0x02 ; /* FIND_PCI_DEVICE */ - regs.x.cx = deviceid ; - regs.x.dx = 0x1039 ; - regs.x.si = index ; /* find n-th device */ - - int86( 0x1A , ®s , ®s ) ; - - if ( INT1AReturnCode( regs ) != 0 ) - return( 0 ) ; - - /* regs.h.bh bus number */ - /* regs.h.bl device number */ - regs.h.ah = 0xb1 ; /* PCI_FUNCTION_ID */ - regs.h.al = 0x09 ; /* READ_CONFIG_WORD */ - regs.x.cx = deviceid ; - regs.x.dx = 0x1039 ; - regs.x.di = 0x18 ; /* register number */ - int86( 0x1A , ®s , ®s ) ; - - if ( INT1AReturnCode( regs ) != 0 ) - return( 0 ) ; - - return( regs.x.cx ) ; -} - -#endif - - - -#ifdef TC -/* --------------------------------------------------------------------- */ -/* Function : main */ -/* Input : */ -/* Output : */ -/* Description : */ -/* --------------------------------------------------------------------- */ -void main(int argc, char *argv[]) -{ - XGI_HW_DEVICE_INFO HwDeviceExtension ; - USHORT temp ; - USHORT ModeNo ; - - /* HwDeviceExtension.pjVirtualRomBase =(PUCHAR) MK_FP(0xC000,0); */ - /* HwDeviceExtension.pjVideoMemoryAddress = (PUCHAR)MK_FP(0xA000,0); */ - - - HwDeviceExtension.pjIOAddress = ( FindPCIIOBase( 0 ,0x6300 ) & 0xFF80 ) + 0x30 ; - HwDeviceExtension.jChipType = XGI_340 ; - - - - /* HwDeviceExtension.pjIOAddress = ( FindPCIIOBase( 0 , 0x5315 ) & 0xFF80 ) + 0x30 ; */ - - HwDeviceExtension.pjIOAddress = ( FindPCIIOBase( 0 , 0x330 ) & 0xFF80 ) + 0x30 ; - HwDeviceExtension.jChipType = XGI_340 ; - - - HwDeviceExtension.ujVBChipID = VB_CHIP_301 ; - StrCpy(HwDeviceExtension.szVBIOSVer , "0.84" ) ; - HwDeviceExtension.bSkipDramSizing = FALSE ; - HwDeviceExtension.ulVideoMemorySize = 0 ; - - if ( argc == 2 ) - { - ModeNo = atoi( argv[ 1 ] ) ; - } - else - { - ModeNo = 0x2e ; - /* ModeNo = 0x37 ; 1024x768x 4bpp */ - /* ModeNo = 0x38 ; 1024x768x 8bpp */ - /* ModeNo = 0x4A ; 1024x768x 16bpp */ - /* ModeNo = 0x47 ; 800x600x 16bpp */ - } - - /* XGIInitNew( &HwDeviceExtension ) ; */ - XGISetModeNew( &HwDeviceExtension , ModeNo ) ; -} -#endif /* --------------------------------------------------------------------- */ @@ -4688,7 +4429,7 @@ void main(int argc, char *argv[]) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_WaitDisplay( PVB_DEVICE_INFO pVBInfo ) +void XGI_WaitDisplay(struct vb_device_info *pVBInfo) { while( !( XGINew_GetReg2( pVBInfo->P3da ) & 0x01 ) ) ; @@ -4704,9 +4445,11 @@ void XGI_WaitDisplay( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_SetCRT2Group301( USHORT ModeNo , PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +unsigned char XGI_SetCRT2Group301(unsigned short ModeNo, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo) { - USHORT tempbx , + unsigned short tempbx , ModeIdIndex , RefreshRateTableIndex ; @@ -4739,7 +4482,7 @@ BOOLEAN XGI_SetCRT2Group301( USHORT ModeNo , PXGI_HW_DEVICE_INFO HwDeviceExtensi /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_AutoThreshold( PVB_DEVICE_INFO pVBInfo ) +void XGI_AutoThreshold(struct vb_device_info *pVBInfo) { if ( !( pVBInfo->SetFlag & Win9xDOSMode ) ) XGINew_SetRegOR( pVBInfo->Part1Port , 0x01 , 0x40 ) ; @@ -4752,9 +4495,9 @@ void XGI_AutoThreshold( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SaveCRT2Info( USHORT ModeNo , PVB_DEVICE_INFO pVBInfo) +void XGI_SaveCRT2Info(unsigned short ModeNo, struct vb_device_info *pVBInfo) { - USHORT temp1 , + unsigned short temp1 , temp2 ; XGINew_SetReg1( pVBInfo->P3d4 , 0x34 , ModeNo ) ; /* reserve CR34 for CRT1 Mode No */ @@ -4770,9 +4513,11 @@ void XGI_SaveCRT2Info( USHORT ModeNo , PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetCRT2ResInfo( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_GetCRT2ResInfo(unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - USHORT xres , + unsigned short xres , yres , modeflag , resindex ; @@ -4867,7 +4612,7 @@ void XGI_GetCRT2ResInfo( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVB /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_IsLCDDualLink( PVB_DEVICE_INFO pVBInfo ) +unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo) { if ( ( ( ( pVBInfo->VBInfo & SetCRT2ToLCD ) | SetCRT2ToLCDA ) ) && ( pVBInfo->LCDInfo & SetLCDDualLink ) ) /* shampoo0129 */ @@ -4883,15 +4628,15 @@ BOOLEAN XGI_IsLCDDualLink( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetCRT2Data( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_GetCRT2Data(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) { - USHORT tempax = 0, + unsigned short tempax = 0, tempbx , modeflag , resinfo ; - XGI_LCDDataStruct *LCDPtr = NULL ; - XGI_TVDataStruct *TVPtr = NULL ; + struct XGI_LCDDataStruct *LCDPtr = NULL ; + struct XGI_TVDataStruct *TVPtr = NULL ; if ( ModeNo <= 0x13 ) { @@ -4917,7 +4662,7 @@ void XGI_GetCRT2Data( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTa if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) { - LCDPtr = (XGI_LCDDataStruct* )XGI_GetLcdPtr( tempbx, ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + LCDPtr = (struct XGI_LCDDataStruct *)XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); pVBInfo->RVBHCMAX = LCDPtr->RVBHCMAX ; pVBInfo->RVBHCFACT = LCDPtr->RVBHCFACT ; @@ -5021,7 +4766,7 @@ void XGI_GetCRT2Data( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTa if ( pVBInfo->VBInfo & ( SetCRT2ToTV ) ) { tempbx = 4 ; - TVPtr = ( XGI_TVDataStruct * )XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + TVPtr = (struct XGI_TVDataStruct *)XGI_GetTVPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); pVBInfo->RVBHCMAX = TVPtr->RVBHCMAX ; pVBInfo->RVBHCFACT = TVPtr->RVBHCFACT ; @@ -5109,11 +4854,9 @@ void XGI_GetCRT2Data( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTa /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT2VCLK( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetCRT2VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) { - UCHAR di_0 , - di_1 , - tempal ; + unsigned char di_0, di_1, tempal; tempal = XGI_GetVCLKPtr( RefreshRateTableIndex , ModeNo , ModeIdIndex, pVBInfo ) ; XGI_GetVCLKLen( tempal, &di_0 , &di_1, pVBInfo ) ; @@ -5146,9 +4889,10 @@ void XGI_SetCRT2VCLK( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTab /* Output : al -> VCLK Index */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetLCDVCLKPtr( UCHAR* di_0 , UCHAR *di_1, PVB_DEVICE_INFO pVBInfo ) +void XGI_GetLCDVCLKPtr(unsigned char *di_0, unsigned char *di_1, + struct vb_device_info *pVBInfo) { - USHORT index ; + unsigned short index ; if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) { @@ -5182,17 +4926,16 @@ void XGI_GetLCDVCLKPtr( UCHAR* di_0 , UCHAR *di_1, PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -UCHAR XGI_GetVCLKPtr(USHORT RefreshRateTableIndex,USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex, + unsigned short ModeNo, unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - USHORT index , + unsigned short index , modeflag ; -#ifndef LINUX_XF86 - USHORT tempbx ; -#endif - - UCHAR tempal ; - UCHAR *CHTVVCLKPtr = NULL ; + unsigned short tempbx ; + unsigned char tempal; + unsigned char *CHTVVCLKPtr = NULL; if ( ModeNo <= 0x13 ) modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; /* si+St_ResInfo */ @@ -5344,7 +5087,7 @@ UCHAR XGI_GetVCLKPtr(USHORT RefreshRateTableIndex,USHORT ModeNo,USHORT ModeIdInd } - tempal = ( UCHAR )XGINew_GetReg2( ( pVBInfo->P3ca + 0x02 ) ) ; + tempal = (unsigned char)XGINew_GetReg2((pVBInfo->P3ca + 0x02)); tempal = tempal >> 2 ; tempal &= 0x03 ; @@ -5365,19 +5108,20 @@ UCHAR XGI_GetVCLKPtr(USHORT RefreshRateTableIndex,USHORT ModeNo,USHORT ModeIdInd /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetVCLKLen(UCHAR tempal,UCHAR* di_0,UCHAR* di_1, PVB_DEVICE_INFO pVBInfo) +void XGI_GetVCLKLen(unsigned char tempal, unsigned char *di_0, + unsigned char *di_1, struct vb_device_info *pVBInfo) { if ( pVBInfo->IF_DEF_CH7007 == 1 ) /* [Billy] 2007/05/16 */ { /* VideoDebugPrint((0, "XGI_GetVCLKLen: pVBInfo->IF_DEF_CH7007==1\n")); */ - *di_0 = ( UCHAR )XGI_CH7007VCLKData[ tempal ].SR2B ; - *di_1 = ( UCHAR )XGI_CH7007VCLKData[ tempal ].SR2C ; + *di_0 = (unsigned char)XGI_CH7007VCLKData[tempal].SR2B; + *di_1 = (unsigned char)XGI_CH7007VCLKData[tempal].SR2C; } else if ( pVBInfo->VBType & ( VB_XGI301 | VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) { if ( ( !( pVBInfo->VBInfo & SetCRT2ToLCDA ) ) && ( pVBInfo->SetFlag & ProgrammingCRT2 ) ) { - *di_0 = ( UCHAR )XGI_VBVCLKData[ tempal ].SR2B ; + *di_0 = (unsigned char)XGI_VBVCLKData[tempal].SR2B; *di_1 = XGI_VBVCLKData[ tempal ].SR2C ; } } @@ -5395,11 +5139,14 @@ void XGI_GetVCLKLen(UCHAR tempal,UCHAR* di_0,UCHAR* di_1, PVB_DEVICE_INFO pVBInf /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT2Offset( USHORT ModeNo , - USHORT ModeIdIndex , USHORT RefreshRateTableIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetCRT2Offset(unsigned short ModeNo, + unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo) { - USHORT offset ; - UCHAR temp ; + unsigned short offset ; + unsigned char temp; if ( pVBInfo->VBInfo & SetInSlaveMode ) { @@ -5407,12 +5154,12 @@ void XGI_SetCRT2Offset( USHORT ModeNo , } offset = XGI_GetOffset( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; - temp = ( UCHAR )( offset & 0xFF ) ; + temp = (unsigned char)(offset & 0xFF); XGINew_SetReg1( pVBInfo->Part1Port , 0x07 , temp ) ; - temp =( UCHAR)( ( offset & 0xFF00 ) >> 8 ) ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x09 , temp ) ; - temp =( UCHAR )( ( ( offset >> 3 ) & 0xFF ) + 1 ) ; - XGINew_SetReg1( pVBInfo->Part1Port , 0x03 , temp ) ; + temp = (unsigned char)((offset & 0xFF00) >> 8); + XGINew_SetReg1(pVBInfo->Part1Port , 0x09 , temp); + temp = (unsigned char)(((offset >> 3) & 0xFF) + 1) ; + XGINew_SetReg1(pVBInfo->Part1Port, 0x03, temp); } @@ -5422,9 +5169,9 @@ void XGI_SetCRT2Offset( USHORT ModeNo , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -USHORT XGI_GetOffset(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo) +unsigned short XGI_GetOffset(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT temp , + unsigned short temp , colordepth , modeinfo , index , @@ -5471,7 +5218,7 @@ USHORT XGI_GetOffset(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableInd /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT2FIFO( PVB_DEVICE_INFO pVBInfo) +void XGI_SetCRT2FIFO(struct vb_device_info *pVBInfo) { XGINew_SetReg1( pVBInfo->Part1Port , 0x01 , 0x3B ) ; /* threshold high ,disable auto threshold */ XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x02 , ~( 0x3F ) , 0x04 ) ; /* threshold low default 04h */ @@ -5484,10 +5231,12 @@ void XGI_SetCRT2FIFO( PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_PreSetGroup1(USHORT ModeNo , USHORT ModeIdIndex ,PXGI_HW_DEVICE_INFO HwDeviceExtension, - USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, + struct xgi_hw_device_info *HwDeviceExtension, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - USHORT tempcx = 0 , + unsigned short tempcx = 0 , CRT1Index = 0 , resinfo = 0 ; @@ -5518,10 +5267,12 @@ void XGI_PreSetGroup1(USHORT ModeNo , USHORT ModeIdIndex ,PXGI_HW_DEVICE_INFO Hw /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetGroup1( USHORT ModeNo , USHORT ModeIdIndex , - PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, + struct xgi_hw_device_info *HwDeviceExtension, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - USHORT temp = 0 , + unsigned short temp = 0 , tempax = 0 , tempbx = 0 , tempcx = 0 , @@ -5694,10 +5445,12 @@ void XGI_SetGroup1( USHORT ModeNo , USHORT ModeIdIndex , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetLockRegs( USHORT ModeNo , USHORT ModeIdIndex , - PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex, + struct xgi_hw_device_info *HwDeviceExtension, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - USHORT push1 , + unsigned short push1 , push2 , tempax , tempbx = 0 , @@ -6141,10 +5894,10 @@ void XGI_SetLockRegs( USHORT ModeNo , USHORT ModeIdIndex , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetGroup2( USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, - PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, + struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT i , + unsigned short i , j , tempax , tempbx , @@ -6155,9 +5908,9 @@ void XGI_SetGroup2( USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIn modeflag , resinfo , crt2crtc ; - UCHAR *TimingPoint ; + unsigned char *TimingPoint ; - ULONG longtemp , + unsigned long longtemp , tempeax , tempebx , temp2 , @@ -6266,7 +6019,7 @@ void XGI_SetGroup2( USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIn tempax = ( tempax & 0x00FF ) | ( ( tempax & 0x00FF ) << 8 ) ; push1 = tempax ; temp = ( tempax & 0xFF00 ) >> 8 ; - temp += ( USHORT )TimingPoint[ 0 ] ; + temp += (unsigned short)TimingPoint[0]; if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) { @@ -6543,7 +6296,7 @@ void XGI_SetGroup2( USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIn tempeax += 1 ; } - tempax = ( USHORT )tempeax ; + tempax = (unsigned short)tempeax; /* 301b */ if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) @@ -6553,8 +6306,8 @@ void XGI_SetGroup2( USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIn /* end 301b */ tempbx = push1 ; - tempbx =( USHORT )( ( ( tempeax & 0x0000FF00 ) & 0x1F00 ) | ( tempbx & 0x00FF ) ) ; - tempax =( USHORT )( ( ( tempeax & 0x000000FF ) << 8 ) | ( tempax & 0x00FF ) ) ; + tempbx = (unsigned short)(((tempeax & 0x0000FF00) & 0x1F00) | (tempbx & 0x00FF)); + tempax = (unsigned short)(((tempeax & 0x000000FF) << 8) | (tempax & 0x00FF)); temp = ( tempax & 0xFF00 ) >> 8 ; } else @@ -6607,7 +6360,7 @@ void XGI_SetGroup2( USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIn XGINew_SetReg1( pVBInfo->Part2Port , 0x4d , temp ) ; temp=XGINew_GetReg1( pVBInfo->Part2Port , 0x43 ) ; /* 301b change */ - XGINew_SetReg1( pVBInfo->Part2Port , 0x43 , ( USHORT )( temp - 3 ) ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x43, (unsigned short)( temp - 3 ) ) ; if ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) ) { @@ -6631,7 +6384,7 @@ void XGI_SetGroup2( USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIn if ( pVBInfo->TVInfo & SetPALMTV ) { - tempax = ( UCHAR )XGINew_GetReg1( pVBInfo->Part2Port , 0x01 ) ; + tempax = (unsigned char)XGINew_GetReg1(pVBInfo->Part2Port, 0x01); tempax-- ; XGINew_SetRegAND( pVBInfo->Part2Port , 0x01 , tempax ) ; @@ -6660,9 +6413,9 @@ void XGI_SetGroup2( USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIn /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetLCDRegs(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo) +void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) { - USHORT push1 , + unsigned short push1 , push2 , pushbx , tempax , @@ -6676,7 +6429,7 @@ void XGI_SetLCDRegs(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDev modeflag , CRT1Index ; - XGI_LCDDesStruct *LCDBDesPtr = NULL ; + struct XGI_LCDDesStruct *LCDBDesPtr = NULL ; if ( ModeNo <= 0x13 ) @@ -6746,7 +6499,7 @@ void XGI_SetLCDRegs(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDev /* Customized LCDB Des no add */ tempbx = 5 ; - LCDBDesPtr = ( XGI_LCDDesStruct * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + LCDBDesPtr = (struct XGI_LCDDesStruct *)XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); tempah = pVBInfo->LCDResInfo ; tempah &= PanelResInfo ; @@ -6914,13 +6667,14 @@ void XGI_SetLCDRegs(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDev /* Output : di -> Tap4 Reg. Setting Pointer */ /* Description : */ /* --------------------------------------------------------------------- */ -XGI301C_Tap4TimingStruct* XGI_GetTap4Ptr(USHORT tempcx, PVB_DEVICE_INFO pVBInfo) +struct XGI301C_Tap4TimingStruct *XGI_GetTap4Ptr(unsigned short tempcx, + struct vb_device_info *pVBInfo) { - USHORT tempax , + unsigned short tempax , tempbx , i ; - XGI301C_Tap4TimingStruct *Tap4TimingPtr ; + struct XGI301C_Tap4TimingStruct *Tap4TimingPtr ; if ( tempcx == 0 ) { @@ -6974,12 +6728,12 @@ XGI301C_Tap4TimingStruct* XGI_GetTap4Ptr(USHORT tempcx, PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetTap4Regs( PVB_DEVICE_INFO pVBInfo) +void XGI_SetTap4Regs(struct vb_device_info *pVBInfo) { - USHORT i , + unsigned short i , j ; - XGI301C_Tap4TimingStruct *Tap4TimingPtr ; + struct XGI301C_Tap4TimingStruct *Tap4TimingPtr ; if ( !( pVBInfo->VBType & VB_XGI301C ) ) return ; @@ -7012,11 +6766,11 @@ void XGI_SetTap4Regs( PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetGroup3(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +void XGI_SetGroup3(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { - USHORT i; - UCHAR *tempdi; - USHORT modeflag; + unsigned short i; + unsigned char *tempdi; + unsigned short modeflag; if(ModeNo<=0x13) { @@ -7099,16 +6853,16 @@ void XGI_SetGroup3(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetGroup4(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT tempax , + unsigned short tempax , tempcx , tempbx , modeflag , temp , temp2 ; - ULONG tempebx , + unsigned long tempebx , tempeax , templong ; @@ -7230,12 +6984,12 @@ void XGI_SetGroup4(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex } - temp = ( USHORT )( tempebx & 0x000000FF ) ; + temp = (unsigned short)(tempebx & 0x000000FF); XGINew_SetReg1( pVBInfo->Part4Port , 0x1B , temp ) ; - temp = ( USHORT )( ( tempebx & 0x0000FF00 ) >> 8 ) ; + temp = (unsigned short)((tempebx & 0x0000FF00) >> 8); XGINew_SetReg1( pVBInfo->Part4Port , 0x1A , temp ) ; - tempbx = ( USHORT )( tempebx >> 16 ) ; + tempbx = (unsigned short)(tempebx >> 16); temp = tempbx & 0x00FF ; temp = temp << 4 ; temp |= ( ( tempcx & 0xFF00 ) >> 8 ) ; @@ -7350,9 +7104,9 @@ void XGI_SetGroup4(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetGroup5( USHORT ModeNo , USHORT ModeIdIndex , PVB_DEVICE_INFO pVBInfo) +void XGI_SetGroup5(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { - USHORT Pindex , + unsigned short Pindex , Pdata ; Pindex = pVBInfo->Part5Port ; @@ -7375,9 +7129,13 @@ void XGI_SetGroup5( USHORT ModeNo , USHORT ModeIdIndex , PVB_DEVICE_INFO pVBInfo /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void* XGI_GetLcdPtr( USHORT BX , USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void *XGI_GetLcdPtr(unsigned short BX, + unsigned short ModeNo, + unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - USHORT i , + unsigned short i , tempdx , tempcx , tempbx , @@ -7385,7 +7143,7 @@ void* XGI_GetLcdPtr( USHORT BX , USHORT ModeNo , USHORT ModeIdIndex , USHORT Ref modeflag , table ; - XGI330_LCDDataTablStruct *tempdi = 0 ; + struct XGI330_LCDDataTablStruct *tempdi = 0 ; tempbx = BX; @@ -7877,10 +7635,13 @@ void* XGI_GetLcdPtr( USHORT BX , USHORT ModeNo , USHORT ModeIdIndex , USHORT Ref /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void* XGI_GetTVPtr (USHORT BX,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo, + unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { - USHORT i , tempdx , tempbx , tempal , modeflag , table ; - XGI330_TVDataTablStruct *tempdi = 0 ; + unsigned short i , tempdx , tempbx , tempal , modeflag , table ; + struct XGI330_TVDataTablStruct *tempdi = 0 ; tempbx = BX ; @@ -7955,53 +7716,9 @@ void* XGI_GetTVPtr (USHORT BX,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRat if ( table == 0x00 ) /* 07/05/22 */ { -#ifdef WIN2000 - if ( pVBInfo->IF_DEF_CH7007 == 1 ) - { - switch( tempdi[ i ].DATAPTR ) - { - case 0: - return &CH7007TVCRT1UNTSC_H[ tempal ] ; - break ; - case 1: - return &CH7007TVCRT1ONTSC_H[ tempal ] ; - break ; - case 2: - return &CH7007TVCRT1UPAL_H[ tempal ] ; - break ; - case 3: - return &CH7007TVCRT1OPAL_H[ tempal ] ; - break ; - default: - break ; - } - } -#endif } else if ( table == 0x01 ) { -#ifdef WIN2000 - if ( pVBInfo->IF_DEF_CH7007 == 1 ) - { - switch( tempdi[ i ].DATAPTR ) - { - case 0: - return &CH7007TVCRT1UNTSC_V[ tempal ] ; - break ; - case 1: - return &CH7007TVCRT1ONTSC_V[ tempal ] ; - break ; - case 2: - return &CH7007TVCRT1UPAL_V[ tempal ] ; - break ; - case 3: - return &CH7007TVCRT1OPAL_V[ tempal ] ; - break ; - default: - break ; - } - } -#endif } else if ( table == 0x04 ) { @@ -8075,49 +7792,6 @@ void* XGI_GetTVPtr (USHORT BX,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRat } else if( table == 0x06 ) { -#ifdef WIN2000 - if ( pVBInfo->IF_DEF_CH7007 == 1 ) - { - /* VideoDebugPrint((0, "XGI_GetTVPtr: pVBInfo->IF_DEF_CH7007==1\n")); */ - switch( tempdi[ i ].DATAPTR ) - { - case 0: - return &CH7007TVReg_UNTSC[ tempal ] ; - break ; - case 1: - return &CH7007TVReg_ONTSC[ tempal ] ; - break ; - case 2: - return &CH7007TVReg_UPAL[ tempal ] ; - break ; - case 3: - return &CH7007TVReg_OPAL[ tempal ] ; - break ; - default: - break ; - } - } - else - { - switch( tempdi[ i ].DATAPTR ) - { - case 0: - return &XGI_CHTVRegUNTSC[ tempal ] ; - break ; - case 1: - return &XGI_CHTVRegONTSC[ tempal ] ; - break ; - case 2: - return &XGI_CHTVRegUPAL[ tempal ] ; - break ; - case 3: - return &XGI_CHTVRegOPAL[ tempal ] ; - break ; - default: - break ; - } - } -#endif } return( 0 ) ; } @@ -8126,18 +7800,18 @@ void* XGI_GetTVPtr (USHORT BX,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRat /* --------------------------------------------------------------------- */ /* Function : XGI_BacklightByDrv */ /* Input : */ -/* Output : TRUE -> Skip backlight control */ +/* Output : 1 -> Skip backlight control */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_BacklightByDrv( PVB_DEVICE_INFO pVBInfo ) +unsigned char XGI_BacklightByDrv(struct vb_device_info *pVBInfo) { - UCHAR tempah ; + unsigned char tempah ; - tempah = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x3A ) ; - if ( tempah & BacklightControlBit ) - return TRUE ; + tempah = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x3A) ; + if (tempah & BacklightControlBit) + return 1; else - return FALSE ; + return 0; } @@ -8148,7 +7822,7 @@ BOOLEAN XGI_BacklightByDrv( PVB_DEVICE_INFO pVBInfo ) /* Description : Turn off VDD & Backlight : Fire disable procedure */ /* --------------------------------------------------------------------- */ /* -void XGI_FirePWDDisable( PVB_DEVICE_INFO pVBInfo ) +void XGI_FirePWDDisable(struct vb_device_info *pVBInfo) { XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x26 , 0x00 , 0xFC ) ; } @@ -8160,7 +7834,7 @@ void XGI_FirePWDDisable( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : Turn on VDD & Backlight : Fire enable procedure */ /* --------------------------------------------------------------------- */ -void XGI_FirePWDEnable(PVB_DEVICE_INFO pVBInfo ) +void XGI_FirePWDEnable(struct vb_device_info *pVBInfo) { XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x26 , 0x03 , 0xFC ) ; } @@ -8172,7 +7846,7 @@ void XGI_FirePWDEnable(PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_EnableGatingCRT(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +void XGI_EnableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x63 , 0xBF , 0x40 ) ; } @@ -8184,7 +7858,7 @@ void XGI_EnableGatingCRT(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_DisableGatingCRT(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +void XGI_DisableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x63 , 0xBF , 0x00 ) ; @@ -8201,9 +7875,9 @@ void XGI_DisableGatingCRT(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO /* : bl : 3 ; T3 : the duration between CPL off and signal off */ /* : bl : 4 ; T4 : the duration signal off and Vdd off */ /* --------------------------------------------------------------------- */ -void XGI_SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo) +void XGI_SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo) { - USHORT index ; + unsigned short index ; index = XGI_GetLCDCapPtr(pVBInfo) ; @@ -8231,7 +7905,7 @@ void XGI_SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo) /* = 1011b = 0Bh ; Backlight off, Power on */ /* = 1111b = 0Fh ; Backlight off, Power off */ /* --------------------------------------------------------------------- */ -void XGI_SetPanelPower(USHORT tempah,USHORT tempbl, PVB_DEVICE_INFO pVBInfo) +void XGI_SetPanelPower(unsigned short tempah, unsigned short tempbl, struct vb_device_info *pVBInfo) { if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x26 , tempbl , tempah ) ; @@ -8239,10 +7913,10 @@ void XGI_SetPanelPower(USHORT tempah,USHORT tempbl, PVB_DEVICE_INFO pVBInfo) XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x11 , tempbl , tempah ) ; } -UCHAR XG21GPIODataTransfer(UCHAR ujDate) +unsigned char XG21GPIODataTransfer(unsigned char ujDate) { - UCHAR ujRet = 0; - UCHAR i = 0; + unsigned char ujRet = 0; + unsigned char i = 0; for (i=0; i<8; i++) { @@ -8260,9 +7934,9 @@ UCHAR XG21GPIODataTransfer(UCHAR ujDate) /* bl[1] : LVDS backlight */ /* bl[0] : LVDS VDD */ /*----------------------------------------------------------------------------*/ -UCHAR XGI_XG21GetPSCValue(PVB_DEVICE_INFO pVBInfo) +unsigned char XGI_XG21GetPSCValue(struct vb_device_info *pVBInfo) { - UCHAR CR4A,temp; + unsigned char CR4A, temp; CR4A = XGINew_GetReg1( pVBInfo->P3d4 , 0x4A ) ; XGINew_SetRegAND( pVBInfo->P3d4 , 0x4A , ~0x23 ) ; /* enable GPIO write */ @@ -8281,9 +7955,9 @@ UCHAR XGI_XG21GetPSCValue(PVB_DEVICE_INFO pVBInfo) /* bl[1] : LVDS backlight */ /* bl[0] : LVDS VDD */ /*----------------------------------------------------------------------------*/ -UCHAR XGI_XG27GetPSCValue(PVB_DEVICE_INFO pVBInfo) +unsigned char XGI_XG27GetPSCValue(struct vb_device_info *pVBInfo) { - UCHAR CR4A,CRB4,temp; + unsigned char CR4A, CRB4, temp; CR4A = XGINew_GetReg1( pVBInfo->P3d4 , 0x4A ) ; XGINew_SetRegAND( pVBInfo->P3d4 , 0x4A , ~0x0C ) ; /* enable GPIO write */ @@ -8306,9 +7980,9 @@ UCHAR XGI_XG27GetPSCValue(PVB_DEVICE_INFO pVBInfo) /* 000010b : clear bit 1, to set bit1 */ /* 000001b : clear bit 0, to set bit0 */ /*----------------------------------------------------------------------------*/ -void XGI_XG21BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo) +void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo) { - UCHAR CR4A,temp; + unsigned char CR4A, temp; CR4A = XGINew_GetReg1( pVBInfo->P3d4 , 0x4A ) ; tempbh &= 0x23; @@ -8331,10 +8005,10 @@ void XGI_XG21BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo) XGINew_SetReg1( pVBInfo->P3d4 , 0x48 , temp ) ; } -void XGI_XG27BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo) +void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo) { - UCHAR CR4A,temp; - USHORT tempbh0,tempbl0; + unsigned char CR4A, temp; + unsigned short tempbh0, tempbl0; tempbh0 = tempbh; tempbl0 = tempbl; @@ -8362,15 +8036,13 @@ void XGI_XG27BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo) } /* --------------------------------------------------------------------- */ -USHORT XGI_GetLVDSOEMTableIndex(PVB_DEVICE_INFO pVBInfo) +unsigned short XGI_GetLVDSOEMTableIndex(struct vb_device_info *pVBInfo) { - USHORT index ; + unsigned short index ; index = XGINew_GetReg1( pVBInfo->P3d4 , 0x36 ) ; - if (index<sizeof(XGI21_LCDCapList)/sizeof(XGI21_LVDSCapStruct)) - { - return index; - } + if (index < sizeof(XGI21_LCDCapList)/sizeof(struct XGI21_LVDSCapStruct)) + return index; return 0; } @@ -8384,9 +8056,9 @@ USHORT XGI_GetLVDSOEMTableIndex(PVB_DEVICE_INFO pVBInfo) /* : bl : 3 ; T3 : the duration between CPL off and signal off */ /* : bl : 4 ; T4 : the duration signal off and Vdd off */ /* --------------------------------------------------------------------- */ -void XGI_XG21SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo) +void XGI_XG21SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo) { - USHORT index ; + unsigned short index ; index = XGI_GetLVDSOEMTableIndex( pVBInfo ); if ( tempbl == 1 ) @@ -8402,9 +8074,11 @@ void XGI_XG21SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo) XGINew_LCD_Wait_Time( pVBInfo->XG21_LVDSCapList[ index ].PSC_S4, pVBInfo ) ; } -BOOLEAN XGI_XG21CheckLVDSMode(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +unsigned char XGI_XG21CheckLVDSMode(unsigned short ModeNo, + unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - USHORT xres , + unsigned short xres , yres , colordepth , modeflag , @@ -8445,10 +8119,10 @@ BOOLEAN XGI_XG21CheckLVDSMode(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO lvdstableindex = XGI_GetLVDSOEMTableIndex( pVBInfo ); if ( xres > (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHDE) ) - return FALSE; + return 0; if ( yres > (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE) ) - return FALSE; + return 0; if ( ModeNo > 0x13 ) { @@ -8456,18 +8130,17 @@ BOOLEAN XGI_XG21CheckLVDSMode(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO ( yres != (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE)) ) { colordepth = XGI_GetColorDepth( ModeNo , ModeIdIndex, pVBInfo ) ; - if ( colordepth > 2 ) - { - return FALSE; - } + if (colordepth > 2) + return 0; + } } - return TRUE; + return 1; } -void XGI_SetXG21FPBits(PVB_DEVICE_INFO pVBInfo) +void XGI_SetXG21FPBits(struct vb_device_info *pVBInfo) { - UCHAR temp; + unsigned char temp; temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x37 ) ; /* D[0] 1: 18bit */ temp = ( temp & 1 ) << 6; @@ -8476,9 +8149,9 @@ void XGI_SetXG21FPBits(PVB_DEVICE_INFO pVBInfo) } -void XGI_SetXG27FPBits(PVB_DEVICE_INFO pVBInfo) +void XGI_SetXG27FPBits(struct vb_device_info *pVBInfo) { - UCHAR temp; + unsigned char temp; temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x37 ) ; /* D[1:0] 01: 18bit, 00: dual 12, 10: single 24 */ temp = ( temp & 3 ) << 6; @@ -8487,27 +8160,28 @@ void XGI_SetXG27FPBits(PVB_DEVICE_INFO pVBInfo) } -void XGI_SetXG21LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - UCHAR temp,Miscdata; - USHORT xres , + unsigned char temp, Miscdata; + unsigned short xres , yres , modeflag , resindex , lvdstableindex ; - USHORT LVDSHT,LVDSHBS,LVDSHRS,LVDSHRE,LVDSHBE; - USHORT LVDSVT,LVDSVBS,LVDSVRS,LVDSVRE,LVDSVBE; - USHORT value; + unsigned short LVDSHT,LVDSHBS,LVDSHRS,LVDSHRE,LVDSHBE; + unsigned short LVDSVT,LVDSVBS,LVDSVRS,LVDSVRE,LVDSVBE; + unsigned short value; lvdstableindex = XGI_GetLVDSOEMTableIndex( pVBInfo ); - temp = (UCHAR) ( ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & (LCDPolarity << 8 ) ) >> 8 ); + temp = (unsigned char) ((pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & (LCDPolarity << 8)) >> 8); temp &= LCDPolarity; - Miscdata =(UCHAR) XGINew_GetReg2(pVBInfo->P3cc) ; + Miscdata = (unsigned char) XGINew_GetReg2(pVBInfo->P3cc) ; XGINew_SetReg3( pVBInfo->P3c2 , (Miscdata & 0x3F) | temp ) ; - temp = (UCHAR) ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & LCDPolarity ) ; + temp = (unsigned char) (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & LCDPolarity) ; XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x35 , ~0x80 , temp&0x80 ) ; /* SR35[7] FP VSync polarity */ XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x30 , ~0x20 , (temp&0x40)>>1 ) ; /* SR30[5] FP HSync polarity */ @@ -8563,7 +8237,7 @@ void XGI_SetXG21LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBIn LVDSVBE = LVDSVBS + LVDSVT - pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE ; - temp = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; + temp = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x11) ; XGINew_SetReg1( pVBInfo->P3d4 , 0x11 , temp & 0x7f ) ; /* Unlock CRTC */ if (!( modeflag & Charx8Dot )) @@ -8670,26 +8344,27 @@ void XGI_SetXG21LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBIn } /* no shadow case */ -void XGI_SetXG27LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - UCHAR temp,Miscdata; - USHORT xres , + unsigned char temp, Miscdata; + unsigned short xres , yres , modeflag , resindex , lvdstableindex ; - USHORT LVDSHT,LVDSHBS,LVDSHRS,LVDSHRE,LVDSHBE; - USHORT LVDSVT,LVDSVBS,LVDSVRS,LVDSVRE,LVDSVBE; - USHORT value; + unsigned short LVDSHT,LVDSHBS,LVDSHRS,LVDSHRE,LVDSHBE; + unsigned short LVDSVT,LVDSVBS,LVDSVRS,LVDSVRE,LVDSVBE; + unsigned short value; lvdstableindex = XGI_GetLVDSOEMTableIndex( pVBInfo ); - temp = (UCHAR) ( ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & (LCDPolarity << 8 ) ) >> 8 ); + temp = (unsigned char) ((pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & (LCDPolarity << 8)) >> 8); temp &= LCDPolarity; - Miscdata =(UCHAR) XGINew_GetReg2(pVBInfo->P3cc) ; + Miscdata = (unsigned char) XGINew_GetReg2(pVBInfo->P3cc); XGINew_SetReg3( pVBInfo->P3c2 , (Miscdata & 0x3F) | temp ) ; - temp = (UCHAR) ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & LCDPolarity ) ; + temp = (unsigned char) (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & LCDPolarity) ; XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x35 , ~0x80 , temp&0x80 ) ; /* SR35[7] FP VSync polarity */ XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x30 , ~0x20 , (temp&0x40)>>1 ) ; /* SR30[5] FP HSync polarity */ @@ -8745,7 +8420,7 @@ void XGI_SetXG27LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBIn LVDSVBE = LVDSVBS + LVDSVT - pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE ; - temp = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; + temp = (unsigned char)XGINew_GetReg1(pVBInfo->P3d4, 0x11) ; XGINew_SetReg1( pVBInfo->P3d4 , 0x11 , temp & 0x7f ) ; /* Unlock CRTC */ if (!( modeflag & Charx8Dot )) @@ -8853,21 +8528,21 @@ void XGI_SetXG27LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBIn /* --------------------------------------------------------------------- */ /* Function : XGI_IsLCDON */ /* Input : */ -/* Output : FALSE : Skip PSC Control */ -/* TRUE: Disable PSC */ +/* Output : 0 : Skip PSC Control */ +/* 1: Disable PSC */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_IsLCDON(PVB_DEVICE_INFO pVBInfo) +unsigned char XGI_IsLCDON(struct vb_device_info *pVBInfo) { - USHORT tempax ; + unsigned short tempax ; tempax = pVBInfo->VBInfo ; if ( tempax & SetCRT2ToDualEdge ) - return FALSE ; + return 0; else if ( tempax & ( DisableCRT2Display | SwitchToCRT2 | SetSimuScanMode ) ) - return TRUE ; + return 1; - return FALSE ; + return 0; } @@ -8877,9 +8552,9 @@ BOOLEAN XGI_IsLCDON(PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_EnablePWD( PVB_DEVICE_INFO pVBInfo ) +void XGI_EnablePWD(struct vb_device_info *pVBInfo) { - USHORT index , + unsigned short index , temp ; index = XGI_GetLCDCapPtr(pVBInfo) ; @@ -8899,7 +8574,7 @@ void XGI_EnablePWD( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_DisablePWD( PVB_DEVICE_INFO pVBInfo ) +void XGI_DisablePWD(struct vb_device_info *pVBInfo) { XGINew_SetRegAND( pVBInfo->Part4Port , 0x27 , 0x7F ) ; /* disable PWD */ } @@ -8908,30 +8583,30 @@ void XGI_DisablePWD( PVB_DEVICE_INFO pVBInfo ) /* --------------------------------------------------------------------- */ /* Function : XGI_DisableChISLCD */ /* Input : */ -/* Output : FALSE -> Not LCD Mode */ +/* Output : 0 -> Not LCD Mode */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_DisableChISLCD(PVB_DEVICE_INFO pVBInfo) +unsigned char XGI_DisableChISLCD(struct vb_device_info *pVBInfo) { - USHORT tempbx , + unsigned short tempbx , tempah ; tempbx = pVBInfo->SetFlag & ( DisableChA | DisableChB ) ; - tempah = ~( ( USHORT )XGINew_GetReg1( pVBInfo->Part1Port , 0x2E ) ) ; + tempah = ~((unsigned short) XGINew_GetReg1(pVBInfo->Part1Port, 0x2E)); if ( tempbx & ( EnableChA | DisableChA ) ) { if ( !( tempah & 0x08 ) ) /* Chk LCDA Mode */ - return FALSE ; + return 0 ; } if ( !( tempbx & ( EnableChB | DisableChB ) ) ) - return FALSE ; + return 0; if ( tempah & 0x01 ) /* Chk LCDB Mode */ - return TRUE ; + return 1; - return FALSE ; + return 0; } @@ -8941,28 +8616,28 @@ BOOLEAN XGI_DisableChISLCD(PVB_DEVICE_INFO pVBInfo) /* Output : 0 -> Not LCD mode */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_EnableChISLCD(PVB_DEVICE_INFO pVBInfo) +unsigned char XGI_EnableChISLCD(struct vb_device_info *pVBInfo) { - USHORT tempbx , + unsigned short tempbx , tempah ; tempbx = pVBInfo->SetFlag & ( EnableChA | EnableChB ) ; - tempah = ~( ( USHORT )XGINew_GetReg1( pVBInfo->Part1Port , 0x2E ) ) ; + tempah = ~( (unsigned short)XGINew_GetReg1( pVBInfo->Part1Port , 0x2E ) ) ; if ( tempbx & ( EnableChA | DisableChA ) ) { if ( !( tempah & 0x08 ) ) /* Chk LCDA Mode */ - return FALSE ; + return 0; } if ( !( tempbx & ( EnableChB | DisableChB ) ) ) - return FALSE ; + return 0; if ( tempah & 0x01 ) /* Chk LCDB Mode */ - return TRUE ; + return 1; - return FALSE ; + return 0; } @@ -8972,9 +8647,9 @@ BOOLEAN XGI_EnableChISLCD(PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -USHORT XGI_GetLCDCapPtr( PVB_DEVICE_INFO pVBInfo ) +unsigned short XGI_GetLCDCapPtr(struct vb_device_info *pVBInfo) { - UCHAR tempal , + unsigned char tempal , tempah , tempbl , i ; @@ -9011,9 +8686,9 @@ USHORT XGI_GetLCDCapPtr( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -USHORT XGI_GetLCDCapPtr1( PVB_DEVICE_INFO pVBInfo ) +unsigned short XGI_GetLCDCapPtr1(struct vb_device_info *pVBInfo) { - USHORT tempah , + unsigned short tempah , tempal , tempbl , i ; @@ -9056,9 +8731,10 @@ USHORT XGI_GetLCDCapPtr1( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetLCDSync( USHORT* HSyncWidth , USHORT* VSyncWidth, PVB_DEVICE_INFO pVBInfo ) +void XGI_GetLCDSync(unsigned short *HSyncWidth , unsigned short *VSyncWidth, + struct vb_device_info *pVBInfo) { - USHORT Index ; + unsigned short Index ; Index = XGI_GetLCDCapPtr(pVBInfo) ; *HSyncWidth = pVBInfo->LCDCapList[ Index ].LCD_HSyncWidth ; @@ -9075,9 +8751,9 @@ void XGI_GetLCDSync( USHORT* HSyncWidth , USHORT* VSyncWidth, PVB_DEVICE_INFO pV /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_EnableBridge( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT tempbl , + unsigned short tempbl , tempah ; if ( pVBInfo->SetFlag == Win9xDOSMode ) @@ -9146,7 +8822,7 @@ void XGI_EnableBridge( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO p { if ( ( pVBInfo->SetFlag & EnableChB ) || ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToTV | SetCRT2ToRAMDAC ) ) ) { - tempah = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x32 ) ; + tempah = (unsigned char)XGINew_GetReg1(pVBInfo->P3c4, 0x32); tempah &= 0xDF; if ( pVBInfo->VBInfo & SetInSlaveMode ) { @@ -9156,8 +8832,7 @@ void XGI_EnableBridge( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO p XGINew_SetReg1( pVBInfo->P3c4 , 0x32 , tempah ) ; XGINew_SetRegOR( pVBInfo->P3c4 , 0x1E , 0x20 ) ; - - tempah = ( UCHAR )XGINew_GetReg1( pVBInfo->Part1Port , 0x2E ) ; + tempah = (unsigned char)XGINew_GetReg1(pVBInfo->Part1Port, 0x2E); if ( !( tempah & 0x80 ) ) XGINew_SetRegOR( pVBInfo->Part1Port , 0x2E , 0x80 ) ; /* BVBDOENABLE = 1 */ @@ -9238,7 +8913,7 @@ void XGI_EnableBridge( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO p - tempah = ( UCHAR )XGINew_GetReg1( pVBInfo->Part1Port , 0x2E ) ; + tempah = (unsigned char)XGINew_GetReg1(pVBInfo->Part1Port, 0x2E); if ( !( tempah & 0x80 ) ) XGINew_SetRegOR( pVBInfo->Part1Port , 0x2E , 0x80 ) ; /* BVBDOENABLE = 1 */ @@ -9289,9 +8964,9 @@ void XGI_EnableBridge( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO p /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_DisableBridge(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +void XGI_DisableBridge(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT tempax , + unsigned short tempax , tempbx , tempah = 0 , tempbl = 0 ; @@ -9470,9 +9145,9 @@ void XGI_DisableBridge(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pV /* A : Ext750p */ /* B : St750p */ /* --------------------------------------------------------------------- */ -USHORT XGI_GetTVPtrIndex( PVB_DEVICE_INFO pVBInfo ) +unsigned short XGI_GetTVPtrIndex(struct vb_device_info *pVBInfo) { - USHORT tempbx = 0 ; + unsigned short tempbx = 0 ; if ( pVBInfo->TVInfo & SetPALTV ) tempbx = 2 ; @@ -9497,7 +9172,7 @@ USHORT XGI_GetTVPtrIndex( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : Customized Param. for 301 */ /* --------------------------------------------------------------------- */ -void XGI_OEM310Setting( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +void XGI_OEM310Setting(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { if ( pVBInfo->SetFlag & Win9xDOSMode ) return ; @@ -9527,11 +9202,11 @@ void XGI_OEM310Setting( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBI /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetDelayComp( PVB_DEVICE_INFO pVBInfo ) +void XGI_SetDelayComp(struct vb_device_info *pVBInfo) { - USHORT index ; + unsigned short index ; - UCHAR tempah , + unsigned char tempah , tempbl , tempbh ; @@ -9605,9 +9280,9 @@ void XGI_SetDelayComp( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetLCDCap( PVB_DEVICE_INFO pVBInfo ) +void XGI_SetLCDCap(struct vb_device_info *pVBInfo) { - USHORT tempcx ; + unsigned short tempcx ; tempcx = pVBInfo->LCDCapList[ XGI_GetLCDCapPtr(pVBInfo) ].LCD_Capability ; @@ -9616,10 +9291,12 @@ void XGI_SetLCDCap( PVB_DEVICE_INFO pVBInfo ) if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) { /* 301LV/302LV only */ /* Set 301LV Capability */ - XGINew_SetReg1( pVBInfo->Part4Port , 0x24 , ( UCHAR )( tempcx & 0x1F ) ) ; + XGINew_SetReg1(pVBInfo->Part4Port, 0x24, (unsigned char)(tempcx & 0x1F)); } /* VB Driving */ - XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x0D , ~( ( EnableVBCLKDRVLOW | EnablePLLSPLOW ) >> 8 ) , ( USHORT )( ( tempcx & ( EnableVBCLKDRVLOW | EnablePLLSPLOW ) ) >> 8 ) ) ; + XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x0D, + ~((EnableVBCLKDRVLOW | EnablePLLSPLOW) >> 8), + (unsigned short)((tempcx & (EnableVBCLKDRVLOW | EnablePLLSPLOW)) >> 8)); } if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) @@ -9646,32 +9323,34 @@ void XGI_SetLCDCap( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetLCDCap_A(USHORT tempcx,PVB_DEVICE_INFO pVBInfo) +void XGI_SetLCDCap_A(unsigned short tempcx, struct vb_device_info *pVBInfo) { - USHORT temp ; + unsigned short temp ; temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x37 ) ; if ( temp & LCDRGB18Bit ) { - XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x19 , 0x0F , ( USHORT )( 0x20 | ( tempcx & 0x00C0 ) ) ) ; /* Enable Dither */ + XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x19, 0x0F, + (unsigned short)(0x20 | (tempcx & 0x00C0))); /* Enable Dither */ XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x1A , 0x7F , 0x80 ) ; } else { - XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x19 , 0x0F , ( USHORT )( 0x30 | ( tempcx & 0x00C0 ) ) ) ; + XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x19, 0x0F, + (unsigned short)(0x30 | (tempcx & 0x00C0))); XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x1A , 0x7F , 0x00 ) ; } /* if ( tempcx & EnableLCD24bpp ) // 24bits { - XGINew_SetRegANDOR(pVBInfo->Part1Port,0x19, 0x0F,(USHORT)(0x30|(tempcx&0x00C0)) ); + XGINew_SetRegANDOR(pVBInfo->Part1Port,0x19, 0x0F,(unsigned short)(0x30|(tempcx&0x00C0)) ); XGINew_SetRegANDOR(pVBInfo->Part1Port,0x1A,0x7F,0x00); } else { - XGINew_SetRegANDOR(pVBInfo->Part1Port,0x19, 0x0F,(USHORT)(0x20|(tempcx&0x00C0)) );//Enable Dither + XGINew_SetRegANDOR(pVBInfo->Part1Port,0x19, 0x0F,(unsigned short)(0x20|(tempcx&0x00C0)) ); // Enable Dither XGINew_SetRegANDOR(pVBInfo->Part1Port,0x1A,0x7F,0x80); } */ @@ -9684,12 +9363,14 @@ void XGI_SetLCDCap_A(USHORT tempcx,PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetLCDCap_B(USHORT tempcx,PVB_DEVICE_INFO pVBInfo) +void XGI_SetLCDCap_B(unsigned short tempcx, struct vb_device_info *pVBInfo) { if ( tempcx & EnableLCD24bpp ) /* 24bits */ - XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x1A , 0xE0 , ( USHORT )( ( ( tempcx & 0x00ff ) >> 6 ) | 0x0c ) ) ; + XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x1A, 0xE0, + (unsigned short)(((tempcx & 0x00ff) >> 6) | 0x0c)); else - XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x1A , 0xE0 , ( USHORT )( ( ( tempcx & 0x00ff ) >> 6 ) | 0x18 ) ) ; /* Enable Dither */ + XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x1A, 0xE0, + (unsigned short)(((tempcx & 0x00ff) >> 6) | 0x18)); /* Enable Dither */ } @@ -9699,9 +9380,9 @@ void XGI_SetLCDCap_B(USHORT tempcx,PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void SetSpectrum( PVB_DEVICE_INFO pVBInfo ) +void SetSpectrum(struct vb_device_info *pVBInfo) { - USHORT index ; + unsigned short index ; index = XGI_GetLCDCapPtr(pVBInfo) ; @@ -9725,12 +9406,13 @@ void SetSpectrum( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : Set TV Customized Param. */ /* --------------------------------------------------------------------- */ -void XGI_SetAntiFlicker( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_SetAntiFlicker(unsigned short ModeNo, unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - USHORT tempbx , + unsigned short tempbx , index ; - UCHAR tempah ; + unsigned char tempah ; if (pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) return ; @@ -9761,12 +9443,12 @@ void XGI_SetAntiFlicker( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVB /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetEdgeEnhance( USHORT ModeNo , USHORT ModeIdIndex , PVB_DEVICE_INFO pVBInfo) +void XGI_SetEdgeEnhance(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { - USHORT tempbx , + unsigned short tempbx , index ; - UCHAR tempah ; + unsigned char tempah ; tempbx = XGI_GetTVPtrIndex(pVBInfo ) ; @@ -9795,22 +9477,26 @@ void XGI_SetEdgeEnhance( USHORT ModeNo , USHORT ModeIdIndex , PVB_DEVICE_INFO pV /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetPhaseIncr( PVB_DEVICE_INFO pVBInfo ) +void XGI_SetPhaseIncr(struct vb_device_info *pVBInfo) { - USHORT tempbx ; + unsigned short tempbx ; - UCHAR tempcl , + unsigned char tempcl , tempch ; - ULONG tempData ; + unsigned long tempData ; XGI_GetTVPtrIndex2( &tempbx , &tempcl , &tempch, pVBInfo ) ; /* bx, cl, ch */ tempData = TVPhaseList[ tempbx ] ; - XGINew_SetReg1( pVBInfo->Part2Port , 0x31 , ( USHORT )( tempData & 0x000000FF ) ) ; - XGINew_SetReg1( pVBInfo->Part2Port , 0x32 , ( USHORT )( ( tempData & 0x0000FF00 ) >> 8 ) ) ; - XGINew_SetReg1( pVBInfo->Part2Port , 0x33 , ( USHORT )( ( tempData & 0x00FF0000 ) >> 16 ) ) ; - XGINew_SetReg1( pVBInfo->Part2Port , 0x34 , ( USHORT )( ( tempData & 0xFF000000 ) >> 24 ) ) ; + XGINew_SetReg1(pVBInfo->Part2Port, 0x31, + (unsigned short)(tempData & 0x000000FF)); + XGINew_SetReg1(pVBInfo->Part2Port, 0x32, + (unsigned short)((tempData & 0x0000FF00) >> 8)); + XGINew_SetReg1(pVBInfo->Part2Port, 0x33, + (unsigned short)((tempData & 0x00FF0000) >> 16)); + XGINew_SetReg1(pVBInfo->Part2Port, 0x34, + (unsigned short)((tempData & 0xFF000000) >> 24)); } @@ -9820,12 +9506,13 @@ void XGI_SetPhaseIncr( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_SetYFilter( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +void XGI_SetYFilter(unsigned short ModeNo, unsigned short ModeIdIndex, + struct vb_device_info *pVBInfo) { - USHORT tempbx , + unsigned short tempbx , index ; - UCHAR tempcl , + unsigned char tempcl , tempch , tempal , *filterPtr ; @@ -9924,7 +9611,8 @@ void XGI_SetYFilter( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo /* 1 : 301B/302B/301LV/302LV */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetTVPtrIndex2(USHORT* tempbx,UCHAR* tempcl,UCHAR* tempch, PVB_DEVICE_INFO pVBInfo) +void XGI_GetTVPtrIndex2(unsigned short *tempbx, unsigned char *tempcl, + unsigned char *tempch, struct vb_device_info *pVBInfo) { *tempbx = 0 ; *tempcl = 0 ; @@ -9966,12 +9654,14 @@ void XGI_GetTVPtrIndex2(USHORT* tempbx,UCHAR* tempcl,UCHAR* tempch, PVB_DEVICE_I /* Output : */ /* Description : Origin code for crt2group */ /* --------------------------------------------------------------------- */ -void XGI_SetCRT2ModeRegs(USHORT ModeNo,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +void XGI_SetCRT2ModeRegs(unsigned short ModeNo, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo) { - USHORT tempbl ; - SHORT tempcl ; + unsigned short tempbl ; + short tempcl ; - UCHAR tempah ; + unsigned char tempah ; /* XGINew_SetReg1( pVBInfo->Part1Port , 0x03 , 0x00 ) ; // fix write part1 index 0 BTDRAM bit Bug */ tempah=0; @@ -10195,9 +9885,9 @@ void XGI_SetCRT2ModeRegs(USHORT ModeNo,PXGI_HW_DEVICE_INFO HwDeviceExtension, PV /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_CloseCRTC( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +void XGI_CloseCRTC(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT tempbx ; + unsigned short tempbx ; tempbx = 0 ; @@ -10214,9 +9904,9 @@ void XGI_CloseCRTC( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBIn /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_OpenCRTC( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +void XGI_OpenCRTC(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { - USHORT tempbx ; + unsigned short tempbx ; tempbx = 0 ; @@ -10230,9 +9920,9 @@ void XGI_OpenCRTC( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInf /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_GetRAMDAC2DATA(USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +void XGI_GetRAMDAC2DATA(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) { - USHORT tempax , + unsigned short tempax , tempbx , temp1 , temp2 , @@ -10257,15 +9947,15 @@ void XGI_GetRAMDAC2DATA(USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateT modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; CRT1Index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC ; CRT1Index &= IndexMask ; - temp1 = ( USHORT )pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 0 ] ; - temp2 = ( USHORT )pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 5 ] ; + temp1 = (unsigned short)pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[0]; + temp2 = (unsigned short)pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[5]; tempax = ( temp1 & 0xFF ) | ( ( temp2 & 0x03 ) << 8 ) ; - tempbx = ( USHORT )pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 8 ] ; - tempcx = ( USHORT )pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 14 ] << 8 ; + tempbx = (unsigned short)pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[8]; + tempcx = (unsigned short)pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[14] << 8; tempcx &= 0x0100 ; tempcx = tempcx << 2 ; tempbx |= tempcx; - temp1 = ( USHORT )pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 9 ] ; + temp1 = (unsigned short)pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[9]; } if ( temp1 & 0x01 ) @@ -10295,11 +9985,11 @@ void XGI_GetRAMDAC2DATA(USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateT /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -USHORT XGI_GetColorDepth(USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +unsigned short XGI_GetColorDepth(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { - USHORT ColorDepth[ 6 ] = { 1 , 2 , 4 , 4 , 6 , 8 } ; - SHORT index ; - USHORT modeflag ; + unsigned short ColorDepth[ 6 ] = { 1 , 2 , 4 , 4 , 6 , 8 } ; + short index ; + unsigned short modeflag ; if ( ModeNo <= 0x13 ) { @@ -10326,7 +10016,7 @@ USHORT XGI_GetColorDepth(USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVB /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_UnLockCRT2( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +void XGI_UnLockCRT2(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2f , 0xFF , 0x01 ) ; @@ -10340,7 +10030,7 @@ void XGI_UnLockCRT2( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVB /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_LockCRT2( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +void XGI_LockCRT2(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) { XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2F , 0xFE , 0x00 ) ; @@ -10355,7 +10045,7 @@ void XGI_LockCRT2( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBIn /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_EnableCRT2( PVB_DEVICE_INFO pVBInfo) +void XGINew_EnableCRT2(struct vb_device_info *pVBInfo) { XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x1E , 0xFF , 0x20 ) ; } @@ -10368,12 +10058,12 @@ void XGINew_EnableCRT2( PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_LCD_Wait_Time(UCHAR DelayTime, PVB_DEVICE_INFO pVBInfo) +void XGINew_LCD_Wait_Time(unsigned char DelayTime, struct vb_device_info *pVBInfo) { - USHORT i , + unsigned short i , j ; - ULONG temp , + unsigned long temp , flag ; flag = 0 ; @@ -10405,9 +10095,9 @@ void XGINew_LCD_Wait_Time(UCHAR DelayTime, PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN XGI_BridgeIsOn( PVB_DEVICE_INFO pVBInfo ) +unsigned char XGI_BridgeIsOn(struct vb_device_info *pVBInfo) { - USHORT flag ; + unsigned short flag ; if ( pVBInfo->IF_DEF_LVDS == 1 ) { @@ -10431,9 +10121,9 @@ BOOLEAN XGI_BridgeIsOn( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_LongWait(PVB_DEVICE_INFO pVBInfo) +void XGI_LongWait(struct vb_device_info *pVBInfo) { - USHORT i ; + unsigned short i ; i = XGINew_GetReg1( pVBInfo->P3c4 , 0x1F ) ; @@ -10460,9 +10150,9 @@ void XGI_LongWait(PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGI_VBLongWait( PVB_DEVICE_INFO pVBInfo ) +void XGI_VBLongWait(struct vb_device_info *pVBInfo) { - USHORT tempal , + unsigned short tempal , temp , i , j ; @@ -10519,16 +10209,16 @@ return ; /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -USHORT XGI_GetVGAHT2( PVB_DEVICE_INFO pVBInfo ) +unsigned short XGI_GetVGAHT2(struct vb_device_info *pVBInfo) { - ULONG tempax , + unsigned long tempax , tempbx ; tempbx = ( ( pVBInfo->VGAVT - pVBInfo->VGAVDE ) * pVBInfo->RVBHCMAX ) & 0xFFFF ; tempax = ( pVBInfo->VT - pVBInfo->VDE ) * pVBInfo->RVBHCFACT ; tempax = ( tempax * pVBInfo->HT ) /tempbx ; - return( ( USHORT )tempax ) ; + return( (unsigned short)tempax ) ; } @@ -10538,19 +10228,23 @@ USHORT XGI_GetVGAHT2( PVB_DEVICE_INFO pVBInfo ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -USHORT XGI_GetVCLK2Ptr( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension ,PVB_DEVICE_INFO pVBInfo) +unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo, + unsigned short ModeIdIndex, + unsigned short RefreshRateTableIndex, + struct xgi_hw_device_info *HwDeviceExtension, + struct vb_device_info *pVBInfo) { - USHORT tempbx ; + unsigned short tempbx ; - USHORT LCDXlat1VCLK[ 4 ] = { VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 } ; - USHORT LCDXlat2VCLK[ 4 ] = { VCLK108_2 + 5 , VCLK108_2 + 5 , VCLK108_2 + 5 , VCLK108_2 + 5 } ; - USHORT LVDSXlat1VCLK[ 4 ] = { VCLK40 , VCLK40 , VCLK40 , VCLK40 } ; - USHORT LVDSXlat2VCLK[ 4 ] = { VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 } ; - USHORT LVDSXlat3VCLK[ 4 ] = { VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 } ; + unsigned short LCDXlat1VCLK[ 4 ] = { VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 } ; + unsigned short LCDXlat2VCLK[ 4 ] = { VCLK108_2 + 5 , VCLK108_2 + 5 , VCLK108_2 + 5 , VCLK108_2 + 5 } ; + unsigned short LVDSXlat1VCLK[ 4 ] = { VCLK40 , VCLK40 , VCLK40 , VCLK40 } ; + unsigned short LVDSXlat2VCLK[ 4 ] = { VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 } ; + unsigned short LVDSXlat3VCLK[ 4 ] = { VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 } ; - USHORT CRT2Index , VCLKIndex ; - USHORT modeflag , resinfo ; - UCHAR *CHTVVCLKPtr = NULL ; + unsigned short CRT2Index , VCLKIndex ; + unsigned short modeflag , resinfo ; + unsigned char *CHTVVCLKPtr = NULL ; if ( ModeNo <= 0x13 ) { @@ -10665,7 +10359,7 @@ USHORT XGI_GetVCLK2Ptr( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateT } else { /* for CRT2 */ - VCLKIndex = ( UCHAR )XGINew_GetReg2( ( pVBInfo->P3ca + 0x02 ) ) ; /* Port 3cch */ + VCLKIndex = (unsigned char)XGINew_GetReg2((pVBInfo->P3ca + 0x02)); /* Port 3cch */ VCLKIndex = ( ( VCLKIndex >> 2 ) & 0x03 ) ; if ( ModeNo > 0x13 ) { diff --git a/drivers/staging/xgifb/vb_setmode.h b/drivers/staging/xgifb/vb_setmode.h index 09753d706665..0dcc29796176 100644 --- a/drivers/staging/xgifb/vb_setmode.h +++ b/drivers/staging/xgifb/vb_setmode.h @@ -1,40 +1,42 @@ #ifndef _VBSETMODE_ #define _VBSETMODE_ -extern void InitTo330Pointer(UCHAR,PVB_DEVICE_INFO); -extern void XGI_UnLockCRT2(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO ); -extern void XGI_LockCRT2(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO ); -extern void XGI_LongWait( PVB_DEVICE_INFO ); -extern void XGI_SetCRT2ModeRegs(USHORT ModeNo,PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO ); -extern void XGI_DisableBridge(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO ); -extern void XGI_EnableBridge(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO ); -extern void XGI_DisplayOff( PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO ); -extern void XGI_DisplayOn( PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO ); -extern void XGI_GetVBType(PVB_DEVICE_INFO); -extern void XGI_SenseCRT1(PVB_DEVICE_INFO ); -extern void XGI_GetVGAType(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO ); -extern void XGI_GetVBInfo(USHORT ModeNo,USHORT ModeIdIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO ); -extern void XGI_GetTVInfo(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO ); -extern void XGI_SetCRT1Offset(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO ); -extern void XGI_SetLCDAGroup(USHORT ModeNo,USHORT ModeIdIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO ); -extern void XGI_WaitDisply( PVB_DEVICE_INFO ); -extern USHORT XGI_GetResInfo(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); +extern void InitTo330Pointer(unsigned char, struct vb_device_info *); +extern void XGI_UnLockCRT2(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *); +extern void XGI_LockCRT2(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *); +extern void XGI_LongWait(struct vb_device_info *); +extern void XGI_SetCRT2ModeRegs(unsigned short ModeNo, + struct xgi_hw_device_info *, + struct vb_device_info *); +extern void XGI_DisableBridge(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *); +extern void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *); +extern void XGI_DisplayOff(struct xgi_hw_device_info *, struct vb_device_info *); +extern void XGI_DisplayOn(struct xgi_hw_device_info *, struct vb_device_info *); +extern void XGI_GetVBType(struct vb_device_info *); +extern void XGI_SenseCRT1(struct vb_device_info *); +extern void XGI_GetVGAType(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *); +extern void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *); +extern void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *); +extern void XGI_SetCRT1Offset(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *); +extern void XGI_SetLCDAGroup(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *); +extern void XGI_WaitDisply(struct vb_device_info *); +extern unsigned short XGI_GetResInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); -extern BOOLEAN XGISetModeNew( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo ) ; +extern unsigned char XGISetModeNew(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo) ; -extern BOOLEAN XGI_SearchModeID( USHORT ModeNo,USHORT *ModeIdIndex, PVB_DEVICE_INFO ); -extern BOOLEAN XGI_GetLCDInfo(USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO ); -extern BOOLEAN XGI_BridgeIsOn( PVB_DEVICE_INFO ); -extern BOOLEAN XGI_SetCRT2Group301(USHORT ModeNo, PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO); -extern USHORT XGI_GetRatePtrCRT2( PXGI_HW_DEVICE_INFO pXGIHWDE, USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO ); +extern unsigned char XGI_SearchModeID(unsigned short ModeNo, unsigned short *ModeIdIndex, struct vb_device_info *); +extern unsigned char XGI_GetLCDInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *); +extern unsigned char XGI_BridgeIsOn(struct vb_device_info *); +extern unsigned char XGI_SetCRT2Group301(unsigned short ModeNo, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *); +extern unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE, unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *); -extern void XGI_SetXG21FPBits(PVB_DEVICE_INFO pVBInfo); -extern void XGI_SetXG27FPBits(PVB_DEVICE_INFO pVBInfo); -extern void XGI_XG21BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo); -extern void XGI_XG27BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo); -extern void XGI_XG21SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo); -extern BOOLEAN XGI_XG21CheckLVDSMode(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ); -extern void XGI_SetXG21LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ); -extern USHORT XGI_GetLVDSOEMTableIndex(PVB_DEVICE_INFO pVBInfo); +extern void XGI_SetXG21FPBits(struct vb_device_info *pVBInfo); +extern void XGI_SetXG27FPBits(struct vb_device_info *pVBInfo); +extern void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo); +extern void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo); +extern void XGI_XG21SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo); +extern unsigned char XGI_XG21CheckLVDSMode(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +extern void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo); +extern unsigned short XGI_GetLVDSOEMTableIndex(struct vb_device_info *pVBInfo); #endif diff --git a/drivers/staging/xgifb/vb_struct.h b/drivers/staging/xgifb/vb_struct.h index bb25c0e2785e..9c6e0c7ac781 100644 --- a/drivers/staging/xgifb/vb_struct.h +++ b/drivers/staging/xgifb/vb_struct.h @@ -10,525 +10,518 @@ -typedef struct _XGI_PanelDelayTblStruct +struct XGI_PanelDelayTblStruct { - UCHAR timer[2]; -} XGI_PanelDelayTblStruct; + unsigned char timer[2]; +}; -typedef struct _XGI_LCDDataStruct +struct XGI_LCDDataStruct { - USHORT RVBHCMAX; - USHORT RVBHCFACT; - USHORT VGAHT; - USHORT VGAVT; - USHORT LCDHT; - USHORT LCDVT; -} XGI_LCDDataStruct; + unsigned short RVBHCMAX; + unsigned short RVBHCFACT; + unsigned short VGAHT; + unsigned short VGAVT; + unsigned short LCDHT; + unsigned short LCDVT; +}; -typedef struct _XGI_LVDSCRT1HDataStruct +struct XGI_LVDSCRT1HDataStruct { - UCHAR Reg[8]; -} XGI_LVDSCRT1HDataStruct; -typedef struct _XGI_LVDSCRT1VDataStruct -{ - UCHAR Reg[7]; -} XGI_LVDSCRT1VDataStruct; - - -typedef struct _XGI_TVDataStruct -{ - USHORT RVBHCMAX; - USHORT RVBHCFACT; - USHORT VGAHT; - USHORT VGAVT; - USHORT TVHDE; - USHORT TVVDE; - USHORT RVBHRS; - UCHAR FlickerMode; - USHORT HALFRVBHRS; - UCHAR RY1COE; - UCHAR RY2COE; - UCHAR RY3COE; - UCHAR RY4COE; -} XGI_TVDataStruct; - -typedef struct _XGI_LVDSDataStruct -{ - USHORT VGAHT; - USHORT VGAVT; - USHORT LCDHT; - USHORT LCDVT; -} XGI_LVDSDataStruct; - -typedef struct _XGI_LVDSDesStruct -{ - USHORT LCDHDES; - USHORT LCDVDES; -} XGI_LVDSDesStruct; - -typedef struct _XGI_LVDSCRT1DataStruct -{ - UCHAR CR[15]; -} XGI_LVDSCRT1DataStruct; - -/*add for LCDA*/ + unsigned char Reg[8]; +}; - -typedef struct _XGI_StStruct -{ - UCHAR St_ModeID; - USHORT St_ModeFlag; - UCHAR St_StTableIndex; - UCHAR St_CRT2CRTC; - UCHAR St_CRT2CRTC2; - UCHAR St_ResInfo; - UCHAR VB_StTVFlickerIndex; - UCHAR VB_StTVEdgeIndex; - UCHAR VB_StTVYFilterIndex; -} XGI_StStruct; - -typedef struct _XGI_StandTableStruct -{ - UCHAR CRT_COLS; - UCHAR ROWS; - UCHAR CHAR_HEIGHT; - USHORT CRT_LEN; - UCHAR SR[4]; - UCHAR MISC; - UCHAR CRTC[0x19]; - UCHAR ATTR[0x14]; - UCHAR GRC[9]; -} XGI_StandTableStruct; - -typedef struct _XGI_ExtStruct -{ - UCHAR Ext_ModeID; - USHORT Ext_ModeFlag; - USHORT Ext_ModeInfo; - USHORT Ext_Point; - USHORT Ext_VESAID; - UCHAR Ext_VESAMEMSize; - UCHAR Ext_RESINFO; - UCHAR VB_ExtTVFlickerIndex; - UCHAR VB_ExtTVEdgeIndex; - UCHAR VB_ExtTVYFilterIndex; - UCHAR REFindex; -} XGI_ExtStruct; - -typedef struct _XGI_Ext2Struct +struct XGI_LVDSCRT1VDataStruct { - USHORT Ext_InfoFlag; - UCHAR Ext_CRT1CRTC; - UCHAR Ext_CRTVCLK; - UCHAR Ext_CRT2CRTC; - UCHAR Ext_CRT2CRTC2; - UCHAR ModeID; - USHORT XRes; - USHORT YRes; - /* USHORT ROM_OFFSET; */ -} XGI_Ext2Struct; - + unsigned char Reg[7]; +}; -typedef struct _XGI_MCLKDataStruct -{ - UCHAR SR28,SR29,SR2A; - USHORT CLOCK; -} XGI_MCLKDataStruct; -typedef struct _XGI_ECLKDataStruct +struct XGI_TVDataStruct { - UCHAR SR2E,SR2F,SR30; - USHORT CLOCK; -} XGI_ECLKDataStruct; + unsigned short RVBHCMAX; + unsigned short RVBHCFACT; + unsigned short VGAHT; + unsigned short VGAVT; + unsigned short TVHDE; + unsigned short TVVDE; + unsigned short RVBHRS; + unsigned char FlickerMode; + unsigned short HALFRVBHRS; + unsigned char RY1COE; + unsigned char RY2COE; + unsigned char RY3COE; + unsigned char RY4COE; +}; -typedef struct _XGI_VCLKDataStruct +struct XGI_LVDSDataStruct { - UCHAR SR2B,SR2C; - USHORT CLOCK; -} XGI_VCLKDataStruct; + unsigned short VGAHT; + unsigned short VGAVT; + unsigned short LCDHT; + unsigned short LCDVT; +}; -typedef struct _XGI_VBVCLKDataStruct +struct XGI_LVDSDesStruct { - UCHAR Part4_A,Part4_B; - USHORT CLOCK; -} XGI_VBVCLKDataStruct; + unsigned short LCDHDES; + unsigned short LCDVDES; +}; -typedef struct _XGI_StResInfoStruct +struct XGI_LVDSCRT1DataStruct { - USHORT HTotal; - USHORT VTotal; -} XGI_StResInfoStruct; + unsigned char CR[15]; +}; -typedef struct _XGI_ModeResInfoStruct -{ - USHORT HTotal; - USHORT VTotal; - UCHAR XChar; - UCHAR YChar; -} XGI_ModeResInfoStruct; +/*add for LCDA*/ -typedef struct _XGI_LCDNBDesStruct -{ - UCHAR NB[12]; -} XGI_LCDNBDesStruct; +struct XGI_StStruct +{ + unsigned char St_ModeID; + unsigned short St_ModeFlag; + unsigned char St_StTableIndex; + unsigned char St_CRT2CRTC; + unsigned char St_CRT2CRTC2; + unsigned char St_ResInfo; + unsigned char VB_StTVFlickerIndex; + unsigned char VB_StTVEdgeIndex; + unsigned char VB_StTVYFilterIndex; +}; + +struct XGI_StandTableStruct +{ + unsigned char CRT_COLS; + unsigned char ROWS; + unsigned char CHAR_HEIGHT; + unsigned short CRT_LEN; + unsigned char SR[4]; + unsigned char MISC; + unsigned char CRTC[0x19]; + unsigned char ATTR[0x14]; + unsigned char GRC[9]; +}; + +struct XGI_ExtStruct +{ + unsigned char Ext_ModeID; + unsigned short Ext_ModeFlag; + unsigned short Ext_ModeInfo; + unsigned short Ext_Point; + unsigned short Ext_VESAID; + unsigned char Ext_VESAMEMSize; + unsigned char Ext_RESINFO; + unsigned char VB_ExtTVFlickerIndex; + unsigned char VB_ExtTVEdgeIndex; + unsigned char VB_ExtTVYFilterIndex; + unsigned char REFindex; +}; + +struct XGI_Ext2Struct +{ + unsigned short Ext_InfoFlag; + unsigned char Ext_CRT1CRTC; + unsigned char Ext_CRTVCLK; + unsigned char Ext_CRT2CRTC; + unsigned char Ext_CRT2CRTC2; + unsigned char ModeID; + unsigned short XRes; + unsigned short YRes; + /* unsigned short ROM_OFFSET; */ +}; + + +struct XGI_MCLKDataStruct +{ + unsigned char SR28, SR29, SR2A; + unsigned short CLOCK; +}; + +struct XGI_ECLKDataStruct +{ + unsigned char SR2E, SR2F, SR30; + unsigned short CLOCK; +}; + +struct XGI_VCLKDataStruct +{ + unsigned char SR2B, SR2C; + unsigned short CLOCK; +}; + +struct XGI_VBVCLKDataStruct +{ + unsigned char Part4_A, Part4_B; + unsigned short CLOCK; +}; + +struct XGI_StResInfoStruct +{ + unsigned short HTotal; + unsigned short VTotal; +}; + +struct XGI_ModeResInfoStruct +{ + unsigned short HTotal; + unsigned short VTotal; + unsigned char XChar; + unsigned char YChar; +}; + +struct XGI_LCDNBDesStruct +{ + unsigned char NB[12]; +}; /*add for new UNIVGABIOS*/ -typedef struct _XGI_LCDDesStruct +struct XGI_LCDDesStruct { - USHORT LCDHDES; - USHORT LCDHRS; - USHORT LCDVDES; - USHORT LCDVRS; -} XGI_LCDDesStruct; + unsigned short LCDHDES; + unsigned short LCDHRS; + unsigned short LCDVDES; + unsigned short LCDVRS; +}; -typedef struct _XGI_LCDDataTablStruct +struct XGI_LCDDataTablStruct { - UCHAR PANELID; - USHORT MASK; - USHORT CAP; - USHORT DATAPTR; -} XGI_LCDDataTablStruct; + unsigned char PANELID; + unsigned short MASK; + unsigned short CAP; + unsigned short DATAPTR; +}; -typedef struct _XGI_TVTablDataStruct +struct XGI_TVTablDataStruct { - USHORT MASK; - USHORT CAP; - USHORT DATAPTR; -} XGI_TVDataTablStruct; + unsigned short MASK; + unsigned short CAP; + unsigned short DATAPTR; +}; -typedef struct _XGI330_LCDDesDataStruct +struct XGI330_LCDDataDesStruct { - USHORT LCDHDES; - USHORT LCDHRS; - USHORT LCDVDES; - USHORT LCDVRS; -} XGI330_LCDDataDesStruct; + unsigned short LCDHDES; + unsigned short LCDHRS; + unsigned short LCDVDES; + unsigned short LCDVRS; +}; -typedef struct _XGI330_LVDSDataStruct +struct XGI330_LVDSDataStruct { - USHORT VGAHT; - USHORT VGAVT; - USHORT LCDHT; - USHORT LCDVT; -} XGI330_LVDSDataStruct; + unsigned short VGAHT; + unsigned short VGAVT; + unsigned short LCDHT; + unsigned short LCDVT; +}; -typedef struct _XGI330_LCDDesDataStruct2 +struct XGI330_LCDDataDesStruct2 { - USHORT LCDHDES; - USHORT LCDHRS; - USHORT LCDVDES; - USHORT LCDVRS; - USHORT LCDHSync; - USHORT LCDVSync; -} XGI330_LCDDataDesStruct2; + unsigned short LCDHDES; + unsigned short LCDHRS; + unsigned short LCDVDES; + unsigned short LCDVRS; + unsigned short LCDHSync; + unsigned short LCDVSync; +}; -typedef struct _XGI330_LCDDataStruct +struct XGI330_LCDDataStruct { - USHORT RVBHCMAX; - USHORT RVBHCFACT; - USHORT VGAHT; - USHORT VGAVT; - USHORT LCDHT; - USHORT LCDVT; -} XGI330_LCDDataStruct; + unsigned short RVBHCMAX; + unsigned short RVBHCFACT; + unsigned short VGAHT; + unsigned short VGAVT; + unsigned short LCDHT; + unsigned short LCDVT; +}; -typedef struct _XGI330_TVDataStruct +struct XGI330_TVDataStruct { - USHORT RVBHCMAX; - USHORT RVBHCFACT; - USHORT VGAHT; - USHORT VGAVT; - USHORT TVHDE; - USHORT TVVDE; - USHORT RVBHRS; - UCHAR FlickerMode; - USHORT HALFRVBHRS; -} XGI330_TVDataStruct; - -typedef struct _XGI330_LCDDataTablStruct -{ - UCHAR PANELID; - USHORT MASK; - USHORT CAP; - USHORT DATAPTR; -} XGI330_LCDDataTablStruct; - -typedef struct _XGI330_TVDataTablStruct -{ - USHORT MASK; - USHORT CAP; - USHORT DATAPTR; -} XGI330_TVDataTablStruct; - - -typedef struct _XGI330_CHTVDataStruct -{ - USHORT VGAHT; - USHORT VGAVT; - USHORT LCDHT; - USHORT LCDVT; -} XGI330_CHTVDataStruct; + unsigned short RVBHCMAX; + unsigned short RVBHCFACT; + unsigned short VGAHT; + unsigned short VGAVT; + unsigned short TVHDE; + unsigned short TVVDE; + unsigned short RVBHRS; + unsigned char FlickerMode; + unsigned short HALFRVBHRS; +}; + +struct XGI330_LCDDataTablStruct +{ + unsigned char PANELID; + unsigned short MASK; + unsigned short CAP; + unsigned short DATAPTR; +}; + +struct XGI330_TVDataTablStruct +{ + unsigned short MASK; + unsigned short CAP; + unsigned short DATAPTR; +}; + + +struct XGI330_CHTVDataStruct +{ + unsigned short VGAHT; + unsigned short VGAVT; + unsigned short LCDHT; + unsigned short LCDVT; +}; -typedef struct _XGI_TimingHStruct -{ - UCHAR data[8]; -} XGI_TimingHStruct; - -typedef struct _XGI_TimingVStruct -{ - UCHAR data[7]; -} XGI_TimingVStruct; - -typedef struct _XGI_CH7007TV_TimingHStruct -{ - UCHAR data[10]; -} XGI_CH7007TV_TimingHStruct; - -typedef struct _XGI_CH7007TV_TimingVStruct -{ - UCHAR data[10]; -} XGI_CH7007TV_TimingVStruct; - -typedef struct _XGI_XG21CRT1Struct -{ - UCHAR ModeID,CR02,CR03,CR15,CR16; -} XGI_XG21CRT1Struct; - -typedef struct _XGI330_CHTVRegDataStruct -{ - UCHAR Reg[16]; -} XGI330_CHTVRegDataStruct; - -typedef struct _XGI330_LCDCapStruct -{ - UCHAR LCD_ID; - USHORT LCD_Capability; - UCHAR LCD_SetFlag; - UCHAR LCD_DelayCompensation; - UCHAR LCD_HSyncWidth; - UCHAR LCD_VSyncWidth; - UCHAR LCD_VCLK; - UCHAR LCDA_VCLKData1; - UCHAR LCDA_VCLKData2; - UCHAR LCUCHAR_VCLKData1; - UCHAR LCUCHAR_VCLKData2; - UCHAR PSC_S1; - UCHAR PSC_S2; - UCHAR PSC_S3; - UCHAR PSC_S4; - UCHAR PSC_S5; - UCHAR PWD_2B; - UCHAR PWD_2C; - UCHAR PWD_2D; - UCHAR PWD_2E; - UCHAR PWD_2F; - UCHAR Spectrum_31; - UCHAR Spectrum_32; - UCHAR Spectrum_33; - UCHAR Spectrum_34; -} XGI330_LCDCapStruct; - -typedef struct _XGI21_LVDSCapStruct -{ - USHORT LVDS_Capability; - USHORT LVDSHT; - USHORT LVDSVT; - USHORT LVDSHDE; - USHORT LVDSVDE; - USHORT LVDSHFP; - USHORT LVDSVFP; - USHORT LVDSHSYNC; - USHORT LVDSVSYNC; - UCHAR VCLKData1; - UCHAR VCLKData2; - UCHAR PSC_S1; - UCHAR PSC_S2; - UCHAR PSC_S3; - UCHAR PSC_S4; - UCHAR PSC_S5; -} XGI21_LVDSCapStruct; - -typedef struct _XGI_CRT1TableStruct -{ - UCHAR CR[16]; -} XGI_CRT1TableStruct; - - -typedef struct _XGI330_VCLKDataStruct -{ - UCHAR SR2B,SR2C; - USHORT CLOCK; -} XGI330_VCLKDataStruct; - -typedef struct _XGI301C_Tap4TimingStruct -{ - USHORT DE; - UCHAR Reg[64]; /* C0-FF */ -} XGI301C_Tap4TimingStruct; - -typedef struct _XGI_New_StandTableStruct -{ - UCHAR CRT_COLS; - UCHAR ROWS; - UCHAR CHAR_HEIGHT; - USHORT CRT_LEN; - UCHAR SR[4]; - UCHAR MISC; - UCHAR CRTC[0x19]; - UCHAR ATTR[0x14]; - UCHAR GRC[9]; -} XGI_New_StandTableStruct; - -typedef UCHAR DRAM8Type[8]; -typedef UCHAR DRAM4Type[4]; -typedef UCHAR DRAM32Type[32]; -typedef UCHAR DRAM2Type[2]; - -typedef struct _VB_DEVICE_INFO VB_DEVICE_INFO; -typedef VB_DEVICE_INFO * PVB_DEVICE_INFO; - -struct _VB_DEVICE_INFO -{ - BOOLEAN ISXPDOS; - ULONG P3c4,P3d4,P3c0,P3ce,P3c2,P3cc; - ULONG P3ca,P3c6,P3c7,P3c8,P3c9,P3da; - ULONG Part0Port,Part1Port,Part2Port; - ULONG Part3Port,Part4Port,Part5Port; - USHORT RVBHCFACT,RVBHCMAX,RVBHRS; - USHORT VGAVT,VGAHT,VGAVDE,VGAHDE; - USHORT VT,HT,VDE,HDE; - USHORT LCDHRS,LCDVRS,LCDHDES,LCDVDES; - - USHORT ModeType; - USHORT IF_DEF_LVDS,IF_DEF_TRUMPION,IF_DEF_DSTN;/* ,IF_DEF_FSTN; add for dstn */ - USHORT IF_DEF_CRT2Monitor,IF_DEF_VideoCapture; - USHORT IF_DEF_LCDA,IF_DEF_CH7017,IF_DEF_YPbPr,IF_DEF_ScaleLCD,IF_DEF_OEMUtil,IF_DEF_PWD; - USHORT IF_DEF_ExpLink; - USHORT IF_DEF_CH7005,IF_DEF_HiVision; - USHORT IF_DEF_CH7007; /* Billy 2007/05/03 */ - USHORT LCDResInfo,LCDTypeInfo, VBType;/*301b*/ - USHORT VBInfo,TVInfo,LCDInfo, Set_VGAType; - USHORT VBExtInfo;/*301lv*/ - USHORT SetFlag; - USHORT NewFlickerMode; - USHORT SelectCRT2Rate; - - PUCHAR ROMAddr; - PUCHAR FBAddr; - ULONG BaseAddr; - ULONG RelIO; - - DRAM4Type *CR6B; - DRAM4Type *CR6E; - DRAM32Type *CR6F; - DRAM2Type *CR89; - - DRAM8Type *SR15; /* pointer : point to array */ - DRAM8Type *CR40; - UCHAR *pSoftSetting; - UCHAR *pOutputSelect; - - USHORT *pRGBSenseData; - USHORT *pRGBSenseData2; /*301b*/ - USHORT *pVideoSenseData; - USHORT *pVideoSenseData2; - USHORT *pYCSenseData; - USHORT *pYCSenseData2; - - UCHAR *pSR07; - UCHAR *CR49; - UCHAR *pSR1F; - UCHAR *AGPReg; - UCHAR *SR16; - UCHAR *pSR21; - UCHAR *pSR22; - UCHAR *pSR23; - UCHAR *pSR24; - UCHAR *SR25; - UCHAR *pSR31; - UCHAR *pSR32; - UCHAR *pSR33; - UCHAR *pSR36; /* alan 12/07/2006 */ - UCHAR *pCRCF; - UCHAR *pCRD0; /* alan 12/07/2006 */ - UCHAR *pCRDE; /* alan 12/07/2006 */ - UCHAR *pCR8F; /* alan 12/07/2006 */ - UCHAR *pSR40; /* alan 12/07/2006 */ - UCHAR *pSR41; /* alan 12/07/2006 */ - UCHAR *pDVOSetting; - UCHAR *pCR2E; - UCHAR *pCR2F; - UCHAR *pCR46; - UCHAR *pCR47; - UCHAR *pCRT2Data_1_2; - UCHAR *pCRT2Data_4_D; - UCHAR *pCRT2Data_4_E; - UCHAR *pCRT2Data_4_10; - XGI_MCLKDataStruct *MCLKData; - XGI_ECLKDataStruct *ECLKData; - - UCHAR *XGI_TVDelayList; - UCHAR *XGI_TVDelayList2; - UCHAR *CHTVVCLKUNTSC; - UCHAR *CHTVVCLKONTSC; - UCHAR *CHTVVCLKUPAL; - UCHAR *CHTVVCLKOPAL; - UCHAR *NTSCTiming; - UCHAR *PALTiming; - UCHAR *HiTVExtTiming; - UCHAR *HiTVSt1Timing; - UCHAR *HiTVSt2Timing; - UCHAR *HiTVTextTiming; - UCHAR *YPbPr750pTiming; - UCHAR *YPbPr525pTiming; - UCHAR *YPbPr525iTiming; - UCHAR *HiTVGroup3Data; - UCHAR *HiTVGroup3Simu; - UCHAR *HiTVGroup3Text; - UCHAR *Ren525pGroup3; - UCHAR *Ren750pGroup3; - UCHAR *ScreenOffset; - UCHAR *pXGINew_DRAMTypeDefinition; - UCHAR *pXGINew_I2CDefinition ; - UCHAR *pXGINew_CR97 ; - - XGI330_LCDCapStruct *LCDCapList; - XGI21_LVDSCapStruct *XG21_LVDSCapList; - - XGI_TimingHStruct *TimingH; - XGI_TimingVStruct *TimingV; - - XGI_StStruct *SModeIDTable; - XGI_StandTableStruct *StandTable; - XGI_ExtStruct *EModeIDTable; - XGI_Ext2Struct *RefIndex; +struct XGI_TimingHStruct +{ + unsigned char data[8]; +}; + +struct XGI_TimingVStruct +{ + unsigned char data[7]; +}; + +struct XGI_CH7007TV_TimingHStruct +{ + unsigned char data[10]; +}; + +struct XGI_CH7007TV_TimingVStruct +{ + unsigned char data[10]; +}; + +struct XGI_XG21CRT1Struct +{ + unsigned char ModeID, CR02, CR03, CR15, CR16; +}; + +struct XGI330_CHTVRegDataStruct +{ + unsigned char Reg[16]; +}; + +struct XGI330_LCDCapStruct +{ + unsigned char LCD_ID; + unsigned short LCD_Capability; + unsigned char LCD_SetFlag; + unsigned char LCD_DelayCompensation; + unsigned char LCD_HSyncWidth; + unsigned char LCD_VSyncWidth; + unsigned char LCD_VCLK; + unsigned char LCDA_VCLKData1; + unsigned char LCDA_VCLKData2; + unsigned char LCUCHAR_VCLKData1; + unsigned char LCUCHAR_VCLKData2; + unsigned char PSC_S1; + unsigned char PSC_S2; + unsigned char PSC_S3; + unsigned char PSC_S4; + unsigned char PSC_S5; + unsigned char PWD_2B; + unsigned char PWD_2C; + unsigned char PWD_2D; + unsigned char PWD_2E; + unsigned char PWD_2F; + unsigned char Spectrum_31; + unsigned char Spectrum_32; + unsigned char Spectrum_33; + unsigned char Spectrum_34; +}; + +struct XGI21_LVDSCapStruct +{ + unsigned short LVDS_Capability; + unsigned short LVDSHT; + unsigned short LVDSVT; + unsigned short LVDSHDE; + unsigned short LVDSVDE; + unsigned short LVDSHFP; + unsigned short LVDSVFP; + unsigned short LVDSHSYNC; + unsigned short LVDSVSYNC; + unsigned char VCLKData1; + unsigned char VCLKData2; + unsigned char PSC_S1; + unsigned char PSC_S2; + unsigned char PSC_S3; + unsigned char PSC_S4; + unsigned char PSC_S5; +}; + +struct XGI_CRT1TableStruct +{ + unsigned char CR[16]; +}; + + +struct XGI330_VCLKDataStruct +{ + unsigned char SR2B, SR2C; + unsigned short CLOCK; +}; + +struct XGI301C_Tap4TimingStruct +{ + unsigned short DE; + unsigned char Reg[64]; /* C0-FF */ +}; + +struct XGI_New_StandTableStruct +{ + unsigned char CRT_COLS; + unsigned char ROWS; + unsigned char CHAR_HEIGHT; + unsigned short CRT_LEN; + unsigned char SR[4]; + unsigned char MISC; + unsigned char CRTC[0x19]; + unsigned char ATTR[0x14]; + unsigned char GRC[9]; +}; + +struct vb_device_info +{ + unsigned char ISXPDOS; + unsigned long P3c4,P3d4,P3c0,P3ce,P3c2,P3cc; + unsigned long P3ca,P3c6,P3c7,P3c8,P3c9,P3da; + unsigned long Part0Port,Part1Port,Part2Port; + unsigned long Part3Port,Part4Port,Part5Port; + unsigned short RVBHCFACT,RVBHCMAX,RVBHRS; + unsigned short VGAVT,VGAHT,VGAVDE,VGAHDE; + unsigned short VT,HT,VDE,HDE; + unsigned short LCDHRS,LCDVRS,LCDHDES,LCDVDES; + + unsigned short ModeType; + unsigned short IF_DEF_LVDS,IF_DEF_TRUMPION,IF_DEF_DSTN;/* ,IF_DEF_FSTN; add for dstn */ + unsigned short IF_DEF_CRT2Monitor,IF_DEF_VideoCapture; + unsigned short IF_DEF_LCDA,IF_DEF_CH7017,IF_DEF_YPbPr,IF_DEF_ScaleLCD,IF_DEF_OEMUtil,IF_DEF_PWD; + unsigned short IF_DEF_ExpLink; + unsigned short IF_DEF_CH7005,IF_DEF_HiVision; + unsigned short IF_DEF_CH7007; /* Billy 2007/05/03 */ + unsigned short LCDResInfo,LCDTypeInfo, VBType;/*301b*/ + unsigned short VBInfo,TVInfo,LCDInfo, Set_VGAType; + unsigned short VBExtInfo;/*301lv*/ + unsigned short SetFlag; + unsigned short NewFlickerMode; + unsigned short SelectCRT2Rate; + + unsigned char *ROMAddr; + unsigned char *FBAddr; + unsigned long BaseAddr; + unsigned long RelIO; + + unsigned char (*CR6B)[4]; + unsigned char (*CR6E)[4]; + unsigned char (*CR6F)[32]; + unsigned char (*CR89)[2]; + + unsigned char (*SR15)[8]; + unsigned char (*CR40)[8]; + + unsigned char *pSoftSetting; + unsigned char *pOutputSelect; + + unsigned short *pRGBSenseData; + unsigned short *pRGBSenseData2; /*301b*/ + unsigned short *pVideoSenseData; + unsigned short *pVideoSenseData2; + unsigned short *pYCSenseData; + unsigned short *pYCSenseData2; + + unsigned char *pSR07; + unsigned char *CR49; + unsigned char *pSR1F; + unsigned char *AGPReg; + unsigned char *SR16; + unsigned char *pSR21; + unsigned char *pSR22; + unsigned char *pSR23; + unsigned char *pSR24; + unsigned char *SR25; + unsigned char *pSR31; + unsigned char *pSR32; + unsigned char *pSR33; + unsigned char *pSR36; /* alan 12/07/2006 */ + unsigned char *pCRCF; + unsigned char *pCRD0; /* alan 12/07/2006 */ + unsigned char *pCRDE; /* alan 12/07/2006 */ + unsigned char *pCR8F; /* alan 12/07/2006 */ + unsigned char *pSR40; /* alan 12/07/2006 */ + unsigned char *pSR41; /* alan 12/07/2006 */ + unsigned char *pDVOSetting; + unsigned char *pCR2E; + unsigned char *pCR2F; + unsigned char *pCR46; + unsigned char *pCR47; + unsigned char *pCRT2Data_1_2; + unsigned char *pCRT2Data_4_D; + unsigned char *pCRT2Data_4_E; + unsigned char *pCRT2Data_4_10; + struct XGI_MCLKDataStruct *MCLKData; + struct XGI_ECLKDataStruct *ECLKData; + + unsigned char *XGI_TVDelayList; + unsigned char *XGI_TVDelayList2; + unsigned char *CHTVVCLKUNTSC; + unsigned char *CHTVVCLKONTSC; + unsigned char *CHTVVCLKUPAL; + unsigned char *CHTVVCLKOPAL; + unsigned char *NTSCTiming; + unsigned char *PALTiming; + unsigned char *HiTVExtTiming; + unsigned char *HiTVSt1Timing; + unsigned char *HiTVSt2Timing; + unsigned char *HiTVTextTiming; + unsigned char *YPbPr750pTiming; + unsigned char *YPbPr525pTiming; + unsigned char *YPbPr525iTiming; + unsigned char *HiTVGroup3Data; + unsigned char *HiTVGroup3Simu; + unsigned char *HiTVGroup3Text; + unsigned char *Ren525pGroup3; + unsigned char *Ren750pGroup3; + unsigned char *ScreenOffset; + unsigned char *pXGINew_DRAMTypeDefinition; + unsigned char *pXGINew_I2CDefinition ; + unsigned char *pXGINew_CR97 ; + + struct XGI330_LCDCapStruct *LCDCapList; + struct XGI21_LVDSCapStruct *XG21_LVDSCapList; + + struct XGI_TimingHStruct *TimingH; + struct XGI_TimingVStruct *TimingV; + + struct XGI_StStruct *SModeIDTable; + struct XGI_StandTableStruct *StandTable; + struct XGI_ExtStruct *EModeIDTable; + struct XGI_Ext2Struct *RefIndex; /* XGINew_CRT1TableStruct *CRT1Table; */ - XGI_CRT1TableStruct *XGINEWUB_CRT1Table; - XGI_VCLKDataStruct *VCLKData; - XGI_VBVCLKDataStruct *VBVCLKData; - XGI_StResInfoStruct *StResInfo; - XGI_ModeResInfoStruct *ModeResInfo; - XGI_XG21CRT1Struct *UpdateCRT1; -}; /* _VB_DEVICE_INFO */ - - -typedef struct -{ - USHORT Horizontal_ACTIVE; - USHORT Horizontal_FP; - USHORT Horizontal_SYNC; - USHORT Horizontal_BP; - USHORT Vertical_ACTIVE; - USHORT Vertical_FP; - USHORT Vertical_SYNC; - USHORT Vertical_BP; + struct XGI_CRT1TableStruct *XGINEWUB_CRT1Table; + struct XGI_VCLKDataStruct *VCLKData; + struct XGI_VBVCLKDataStruct *VBVCLKData; + struct XGI_StResInfoStruct *StResInfo; + struct XGI_ModeResInfoStruct *ModeResInfo; + struct XGI_XG21CRT1Struct *UpdateCRT1; +}; /* _struct vb_device_info */ + + +struct TimingInfo +{ + unsigned short Horizontal_ACTIVE; + unsigned short Horizontal_FP; + unsigned short Horizontal_SYNC; + unsigned short Horizontal_BP; + unsigned short Vertical_ACTIVE; + unsigned short Vertical_FP; + unsigned short Vertical_SYNC; + unsigned short Vertical_BP; double DCLK; - UCHAR FrameRate; - UCHAR Interlace; - USHORT Margin; -} TimingInfo; + unsigned char FrameRate; + unsigned char Interlace; + unsigned short Margin; +}; #define _VB_STRUCT_ #endif /* _VB_STRUCT_ */ diff --git a/drivers/staging/xgifb/vb_table.h b/drivers/staging/xgifb/vb_table.h index 781caefc56b1..510ef7678685 100644 --- a/drivers/staging/xgifb/vb_table.h +++ b/drivers/staging/xgifb/vb_table.h @@ -1,7 +1,7 @@ #define Tap4 -XGI_MCLKDataStruct XGI330New_MCLKData[]= +struct XGI_MCLKDataStruct XGI330New_MCLKData[] = { { 0x5c,0x23,0x01,166}, { 0x5c,0x23,0x01,166}, @@ -13,7 +13,7 @@ XGI_MCLKDataStruct XGI330New_MCLKData[]= { 0x29,0x01,0x81,300} }; //yilin modify for xgi20 -XGI_MCLKDataStruct XGI340New_MCLKData[]= +struct XGI_MCLKDataStruct XGI340New_MCLKData[] = { { 0x16,0x01,0x01,166}, { 0x19,0x02,0x01,124}, @@ -25,7 +25,7 @@ XGI_MCLKDataStruct XGI340New_MCLKData[]= { 0x5c,0x23,0x01,166} }; -XGI_MCLKDataStruct XGI27New_MCLKData[]= +struct XGI_MCLKDataStruct XGI27New_MCLKData[] = { { 0x5c,0x23,0x01,166}, { 0x19,0x02,0x01,124}, @@ -37,7 +37,7 @@ XGI_MCLKDataStruct XGI27New_MCLKData[]= { 0x5c,0x23,0x01,166} }; -XGI_ECLKDataStruct XGI330_ECLKData[]= +struct XGI_ECLKDataStruct XGI330_ECLKData[] = { { 0x7c,0x08,0x01,200}, { 0x7c,0x08,0x01,200}, @@ -49,7 +49,7 @@ XGI_ECLKDataStruct XGI330_ECLKData[]= { 0x29,0x01,0x81,300} }; //yilin modify for xgi20 -XGI_ECLKDataStruct XGI340_ECLKData[]= +struct XGI_ECLKDataStruct XGI340_ECLKData[] = { { 0x5c,0x23,0x01,166}, { 0x55,0x84,0x01,123}, @@ -63,14 +63,14 @@ XGI_ECLKDataStruct XGI340_ECLKData[]= -UCHAR XGI340_SR13[4][8]={ +unsigned char XGI340_SR13[4][8] = { {0x35,0x45,0xb1,0x00,0x00,0x00,0x00,0x00},/* SR13 */ {0x41,0x51,0x5c,0x00,0x00,0x00,0x00,0x00},/* SR14 */ {0x31,0x42,0x42,0x00,0x00,0x00,0x00,0x00},/* SR18 */ {0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00}/* SR1B */ }; -UCHAR XGI340_cr41[24][8]= +unsigned char XGI340_cr41[24][8] = {{0x20,0x50,0x60,0x00,0x00,0x00,0x00,0x00},/* 0 CR41 */ {0xc4,0x40,0x84,0x00,0x00,0x00,0x00,0x00},/* 1 CR8A */ {0xc4,0x40,0x84,0x00,0x00,0x00,0x00,0x00},/* 2 CR8B */ @@ -98,7 +98,7 @@ UCHAR XGI340_cr41[24][8]= }; -UCHAR XGI27_cr41[24][8]= +unsigned char XGI27_cr41[24][8] = { {0x20,0x40,0x60,0x00,0x00,0x00,0x00,0x00},/* 0 CR41 */ {0xC4,0x40,0x84,0x00,0x00,0x00,0x00,0x00},/* 1 CR8A */ @@ -126,37 +126,7 @@ UCHAR XGI27_cr41[24][8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}/* 23 CRC5 */ }; - -#if 0 -UCHAR XGI27_cr41[24][8]= -{ -{0x20,0x60,0x60,0x00,0x00,0x00,0x00,0x00},/* 0 CR41 */ -{0x04,0x44,0x84,0x00,0x00,0x00,0x00,0x00},/* 1 CR8A */ -{0x04,0x40,0x84,0x00,0x00,0x00,0x00,0x00},/* 2 CR8B */ -{0xb5,0x03,0xa4,0x00,0x00,0x00,0x00,0x00},/* 3 CR40[7],CR99[2:0],CR45[3:0]*/ -{0xf0,0xf5,0xf0,0x00,0x00,0x00,0x00,0x00},/* 4 CR59 */ -{0xa4,0x1C,0x24,0x00,0x00,0x00,0x00,0x00},/* 5 CR68 */ -{0x77,0x77,0x44,0x00,0x00,0x00,0x00,0x00},/* 6 CR69 */ -{0x77,0x77,0x44,0x00,0x00,0x00,0x00,0x00},/* 7 CR6A */ -{0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00},/* 8 CR6D */ -{0x55,0x55,0x55,0x00,0x00,0x00,0x00,0x00},/* 9 CR80 */ -{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/* 10 CR81 */ -{0x48,0xa8,0x48,0x00,0x00,0x00,0x00,0x00},/* 11 CR82 */ -{0x77,0x88,0x77,0x00,0x00,0x00,0x00,0x00},/* 12 CR85 */ -{0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00},/* 13 CR86 */ -{0x44,0x32,0x44,0x00,0x00,0x00,0x00,0x00},/* 14 CR90 */ -{0x44,0x33,0x44,0x00,0x00,0x00,0x00,0x00},/* 15 CR91 */ -{0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00},/* 16 CR92 */ -{0x44,0x63,0x44,0x00,0x00,0x00,0x00,0x00},/* 17 CR93 */ -{0x0A,0x14,0x0A,0x00,0x00,0x00,0x00,0x00},/* 18 CR94 */ -{0x0C,0x0B,0x0C,0x00,0x00,0x00,0x00,0x00},/* 19 CR95 */ -{0x05,0x22,0x05,0x00,0x00,0x00,0x00,0x00},/* 20 CR96 */ -{0xf0,0xf0,0xf0,0x00,0x00,0x00,0x00,0x00},/* 21 CRC3 */ -{0x03,0x00,0x02,0x00,0x00,0x00,0x00,0x00},/* 22 CRC4 */ -{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}/* 23 CRC5 */ -}; -#endif -UCHAR XGI340_CR6B[8][4]={ +unsigned char XGI340_CR6B[8][4] = { {0xaa,0xaa,0xaa,0xaa}, {0xaa,0xaa,0xaa,0xaa}, {0xaa,0xaa,0xaa,0xaa}, @@ -167,7 +137,7 @@ UCHAR XGI340_CR6B[8][4]={ {0x00,0x00,0x00,0x00} }; -UCHAR XGI340_CR6E[8][4]={ +unsigned char XGI340_CR6E[8][4] = { {0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00}, @@ -178,7 +148,7 @@ UCHAR XGI340_CR6E[8][4]={ {0x00,0x00,0x00,0x00} }; -UCHAR XGI340_CR6F[8][32]={ +unsigned char XGI340_CR6F[8][32] = { {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, @@ -189,7 +159,7 @@ UCHAR XGI340_CR6F[8][32]={ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00} }; -UCHAR XGI340_CR89[8][2]={ +unsigned char XGI340_CR89[8][2] = { {0x00,0x00}, {0x00,0x00}, {0x00,0x00}, @@ -200,11 +170,12 @@ UCHAR XGI340_CR89[8][2]={ {0x00,0x00} }; /* CR47,CR48,CR49,CR4A,CR4B,CR4C,CR70,CR71,CR74,CR75,CR76,CR77 */ -UCHAR XGI340_AGPReg[12]={0x28,0x23,0x00,0x20,0x00,0x20,0x00,0x05,0xd0,0x10,0x10,0x00}; +unsigned char XGI340_AGPReg[12] = {0x28, 0x23, 0x00, 0x20, 0x00, 0x20, 0x00, + 0x05, 0xd0, 0x10, 0x10, 0x00}; -UCHAR XGI340_SR16[4]={0x03,0x83,0x03,0x83}; +unsigned char XGI340_SR16[4] = {0x03, 0x83, 0x03, 0x83}; -UCHAR XGI330_SR15_1[8][8]={ +unsigned char XGI330_SR15_1[8][8] = { {0x0,0x0,0x00,0x00,0x20,0x20,0x00,0x00}, {0x5,0x15,0x15,0x15,0x15,0x15,0x00,0x00}, {0xba,0xba,0xba,0xba,0xBA,0xBA,0x00,0x00}, @@ -215,7 +186,7 @@ UCHAR XGI330_SR15_1[8][8]={ {0x0,0xa5,0xfb,0xf6,0xF6,0xF6,0x00,0x00} }; -UCHAR XGI330_cr40_1[15][8]={ +unsigned char XGI330_cr40_1[15][8] = { {0x66,0x40,0x40,0x28,0x24,0x24,0x00,0x00}, {0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, @@ -233,14 +204,14 @@ UCHAR XGI330_cr40_1[15][8]={ {0x00,0xA2,0x00,0x00,0xA2,0xA2,0x00,0x00}, }; -UCHAR XGI330_sr25[]={0x00,0x0}; -UCHAR XGI330_sr31=0xc0; -UCHAR XGI330_sr32=0x11; -UCHAR XGI330_SR33=0x00; -UCHAR XG40_CRCF=0x13; -UCHAR XG40_DRAMTypeDefinition=0xFF ; +unsigned char XGI330_sr25[] = {0x00, 0x0}; +unsigned char XGI330_sr31 = 0xc0; +unsigned char XGI330_sr32 = 0x11; +unsigned char XGI330_SR33 = 0x00; +unsigned char XG40_CRCF = 0x13; +unsigned char XG40_DRAMTypeDefinition = 0xFF ; -XGI_StStruct XGI330_SModeIDTable[]= +struct XGI_StStruct XGI330_SModeIDTable[] = { {0x01,0x9208,0x01,0x00,0x10,0x00,0x00,0x01,0x00}, {0x01,0x1210,0x14,0x01,0x00,0x01,0x00,0x01,0x00}, @@ -265,7 +236,7 @@ XGI_StStruct XGI330_SModeIDTable[]= }; -XGI_ExtStruct XGI330_EModeIDTable[]= +struct XGI_ExtStruct XGI330_EModeIDTable[] = { {0x6a,0x2212,0x0407,0x3a81,0x0102,0x08,0x07,0x00,0x00,0x07,0x0e}, {0x2e,0x0a1b,0x0306,0x3a57,0x0101,0x08,0x06,0x00,0x00,0x05,0x06}, @@ -337,7 +308,7 @@ XGI_ExtStruct XGI330_EModeIDTable[]= {0xff,0x0000,0x0000,0x0000,0x0000,0x00,0x00,0x00,0x00,0x00,0x00} }; -XGI_StandTableStruct XGI330_StandTable[]= +struct XGI_StandTableStruct XGI330_StandTable[] = { /* MD_0_200 */ { @@ -775,13 +746,13 @@ XGI_StandTableStruct XGI330_StandTable[]= } }; -XGI_TimingHStruct XGI_TimingH[]= +struct XGI_TimingHStruct XGI_TimingH[] = {{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}}; -XGI_TimingVStruct XGI_TimingV[]= +struct XGI_TimingVStruct XGI_TimingV[] = {{{0x00,0x00,0x00,0x00,0x00,0x00,0x00}}}; -XGI_XG21CRT1Struct XGI_UpdateCRT1Table[]= +struct XGI_XG21CRT1Struct XGI_UpdateCRT1Table[] = { {0x01,0x27,0x91,0x8f,0xc0}, /* 00 */ {0x03,0x4f,0x83,0x8f,0xc0}, /* 01 */ @@ -802,7 +773,7 @@ XGI_XG21CRT1Struct XGI_UpdateCRT1Table[]= {0x59,0x27,0x91,0x8f,0xc0} /* 16 */ }; -XGI_CRT1TableStruct XGI_CRT1Table[]= +struct XGI_CRT1TableStruct XGI_CRT1Table[] = { {{0x2d,0x28,0x90,0x2c,0x90,0x00,0x04,0x00, 0xbf,0x1f,0x9c,0x8e,0x96,0xb9,0x30}}, /* 0x0 */ @@ -950,7 +921,7 @@ XGI_CRT1TableStruct XGI_CRT1Table[]= 0x03,0xDE,0xC0,0x84,0xBF,0x04,0x90}} /* 0x47 */ }; -XGI330_CHTVRegDataStruct XGI_CHTVRegUNTSC[] = { +struct XGI330_CHTVRegDataStruct XGI_CHTVRegUNTSC[] = { /* Index:000h,001h,002h,004h,003h,005h,006h,007h,008h,015h,01Fh,00Ch,00Dh,00Eh,00Fh,010h */ {{ 0x4A,0x77,0xBB,0x94,0x84,0x48,0xFE,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01 }},/* 00 (640x200,640x400) */ {{ 0x4A,0x77,0xBB,0x94,0x84,0x48,0xFE,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01 }},/* 01 (640x350) */ @@ -961,7 +932,7 @@ XGI330_CHTVRegDataStruct XGI_CHTVRegUNTSC[] = { {{ 0xEE,0x77,0xBB,0x66,0x87,0x32,0x01,0x5A,0x04,0x00,0x80,0x1B,0xD4,0x2F,0x6F,0x00 }}/* 06 (1024x768) ;;5/6/02 */ }; -XGI330_CHTVRegDataStruct XGI_CHTVRegONTSC[]= { +struct XGI330_CHTVRegDataStruct XGI_CHTVRegONTSC[] = { /* Index:000h,001h,002h,004h,003h,005h,006h,007h,008h,015h,01Fh,00Ch,00Dh,00Eh,00Fh,010h */ {{ 0x49,0x77,0xBB,0x7B,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01 }},/* 00 (640x200,640x400) */ {{ 0x49,0x77,0xBB,0x7B,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01 }},/* 01 (640x350) */ @@ -972,7 +943,7 @@ XGI330_CHTVRegDataStruct XGI_CHTVRegONTSC[]= { {{ 0xED,0x77,0xBB,0x66,0x8C,0x21,0x02,0x5A,0x04,0x00,0x80,0x1F,0xA0,0x7E,0x73,0x00 }}/* 06 (1024x768) ;;5/6/02 */ }; -XGI330_CHTVRegDataStruct XGI_CHTVRegUPAL[]= { +struct XGI330_CHTVRegDataStruct XGI_CHTVRegUPAL[] = { /* Index:000h,001h,002h,004h,003h,005h,006h,007h,008h,015h,01Fh,00Ch,00Dh,00Eh,00Fh,010h */ {{ 0x41,0x7F,0xB7,0x34,0xAD,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01 }},/* ; 00 (640x200,640x400) */ {{ 0x41,0x7F,0xB7,0x80,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01 }},/* ; 01 (640x350) */ @@ -983,7 +954,7 @@ XGI330_CHTVRegDataStruct XGI_CHTVRegUPAL[]= { {{ 0xE5,0x7F,0xB7,0x1D,0xA7,0x3E,0x04,0x5A,0x05,0x00,0x80,0x20,0x3E,0xE4,0x22,0x00 }}/* ; 06 (1024x768) ;;1/12/02 */ }; -XGI330_CHTVRegDataStruct XGI_CHTVRegOPAL[]={ +struct XGI330_CHTVRegDataStruct XGI_CHTVRegOPAL[] = { /* Index:000,0x01,0x02,0x04,0x03,0x05,0x06,0x07,0x08,0x15,0x1F,0x0C,0x0D,0x0E,0x0F,0x10h */ {{ 0x41,0x7F,0xB7,0x36,0xAD,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01 }},/* 00 (640x200,640x400) */ {{ 0x41,0x7F,0xB7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01 }},/* 01 (640x350) */ @@ -994,14 +965,14 @@ XGI330_CHTVRegDataStruct XGI_CHTVRegOPAL[]={ {{ 0xE4,0x7F,0xB7,0x1E,0xAF,0x29,0x37,0x5A,0x05,0x00,0x80,0x25,0x8C,0xB2,0x2A,0x00 }}/* 06 (1024x768) ;;1/12/02 */ }; -UCHAR XGI_CH7017LV1024x768[]={0x60,0x02,0x00,0x07,0x40,0xED,0xA3, - 0xC8,0xC7,0xAC,0xE0,0x02}; -UCHAR XGI_CH7017LV1400x1050[]={0x60,0x03,0x11,0x00,0x40,0xE3,0xAD, - 0xDB,0xF6,0xAC,0xE0,0x02}; +unsigned char XGI_CH7017LV1024x768[] = {0x60, 0x02, 0x00, 0x07, 0x40, 0xED, 0xA3, + 0xC8, 0xC7, 0xAC, 0xE0, 0x02}; +unsigned char XGI_CH7017LV1400x1050[] = {0x60, 0x03, 0x11, 0x00, 0x40, 0xE3, 0xAD, + 0xDB, 0xF6, 0xAC, 0xE0, 0x02}; /*add for new UNIVGABIOS*/ -XGI330_LCDDataStruct XGI_StLCD1024x768Data[]= +struct XGI330_LCDDataStruct XGI_StLCD1024x768Data[] = { { 62, 25, 800, 546,1344, 806}, { 32, 15, 930, 546,1344, 806}, @@ -1012,7 +983,7 @@ XGI330_LCDDataStruct XGI_StLCD1024x768Data[]= { 1, 1,1344, 806,1344, 806} }; -XGI330_LCDDataStruct XGI_ExtLCD1024x768Data[]= +struct XGI330_LCDDataStruct XGI_ExtLCD1024x768Data[] = { { 42, 25,1536, 419,1344, 806}, /* { 12, 5, 896, 512,1344, 806}, // alan 09/12/2003 */ { 48, 25,1536, 369,1344, 806}, /* { 12, 5, 896, 510,1344, 806}, // alan 09/12/2003 */ @@ -1029,7 +1000,7 @@ XGI330_LCDDataStruct XGI_ExtLCD1024x768Data[]= { 1, 1,1344, 806,1344, 806} }; -/*XGI330_LCDDataStruct XGI_St2LCD1024x768Data[]= +/*struct XGI330_LCDDataStruct XGI_St2LCD1024x768Data[] = { { 62, 25, 800, 546,1344, 806}, { 32, 15, 930, 546,1344, 806}, @@ -1040,7 +1011,7 @@ XGI330_LCDDataStruct XGI_ExtLCD1024x768Data[]= { 1, 1,1344, 806,1344, 806} };*/ -XGI330_LCDDataStruct XGI_CetLCD1024x768Data[]= +struct XGI330_LCDDataStruct XGI_CetLCD1024x768Data[] = { { 1,1,1344,806,1344,806 }, /* ; 00 (320x200,320x400,640x200,640x400) */ { 1,1,1344,806,1344,806 }, /* 01 (320x350,640x350) */ @@ -1051,7 +1022,7 @@ XGI330_LCDDataStruct XGI_CetLCD1024x768Data[]= { 1,1,1344,806,1344,806 } /* 06 (1024x768x60Hz) */ }; -XGI330_LCDDataStruct XGI_StLCD1280x1024Data[]= +struct XGI330_LCDDataStruct XGI_StLCD1280x1024Data[] = { { 22, 5, 800, 510,1650,1088}, { 22, 5, 800, 510,1650,1088}, @@ -1063,7 +1034,7 @@ XGI330_LCDDataStruct XGI_StLCD1280x1024Data[]= { 1, 1,1688,1066,1688,1066} }; -XGI330_LCDDataStruct XGI_ExtLCD1280x1024Data[]= +struct XGI330_LCDDataStruct XGI_ExtLCD1280x1024Data[] = { { 211, 60,1024, 501,1688,1066}, { 211, 60,1024, 508,1688,1066}, @@ -1075,7 +1046,7 @@ XGI330_LCDDataStruct XGI_ExtLCD1280x1024Data[]= { 1, 1,1688,1066,1688,1066} }; -XGI330_LCDDataStruct XGI_St2LCD1280x1024Data[]= +struct XGI330_LCDDataStruct XGI_St2LCD1280x1024Data[] = { { 22, 5, 800, 510,1650,1088}, { 22, 5, 800, 510,1650,1088}, @@ -1087,7 +1058,7 @@ XGI330_LCDDataStruct XGI_St2LCD1280x1024Data[]= { 1, 1,1688,1066,1688,1066} }; -XGI330_LCDDataStruct XGI_CetLCD1280x1024Data[]= +struct XGI330_LCDDataStruct XGI_CetLCD1280x1024Data[] = { { 1,1,1688,1066,1688,1066 }, /* 00 (320x200,320x400,640x200,640x400) */ { 1,1,1688,1066,1688,1066 }, /* 01 (320x350,640x350) */ @@ -1100,7 +1071,7 @@ XGI330_LCDDataStruct XGI_CetLCD1280x1024Data[]= { 1,1,1688,1066,1688,1066 } /* 08 (1400x1050x60Hz) */ }; -XGI330_LCDDataStruct XGI_StLCD1400x1050Data[]= +struct XGI330_LCDDataStruct XGI_StLCD1400x1050Data[] = { { 211,100,2100,408,1688,1066 }, /* 00 (320x200,320x400,640x200,640x400) */ { 211,64,1536,358,1688,1066 }, /* 01 (320x350,640x350) */ @@ -1113,7 +1084,7 @@ XGI330_LCDDataStruct XGI_StLCD1400x1050Data[]= { 1,1,1688,1066,1688,1066 } /* 08 (1400x1050x60Hz) */ }; -XGI330_LCDDataStruct XGI_ExtLCD1400x1050Data[]= +struct XGI330_LCDDataStruct XGI_ExtLCD1400x1050Data[] = { { 211,100,2100,408,1688,1066 }, /* 00 (320x200,320x400,640x200,640x400) */ { 211,64,1536,358,1688,1066 }, /* 01 (320x350,640x350) */ @@ -1126,7 +1097,7 @@ XGI330_LCDDataStruct XGI_ExtLCD1400x1050Data[]= { 1,1,1688,1066,1688,1066 } /* 08 (1400x1050x60Hz) */ }; -XGI330_LCDDataStruct XGI_ExtLCD1600x1200Data[]= +struct XGI330_LCDDataStruct XGI_ExtLCD1600x1200Data[] = { { 4,1,1620,420,2160,1250 }, /* { 3,1,2160,425,2160,1250 }, // 00 (320x200,320x400,640x200,640x400) // alan 10/14/2003 */ { 27,7,1920,375,2160,1250 }, /* 01 (320x350,640x350) */ @@ -1140,7 +1111,7 @@ XGI330_LCDDataStruct XGI_ExtLCD1600x1200Data[]= { 1,1,2160,1250,2160,1250 } /* 09 (1600x1200x60Hz) ;302lv */ }; -XGI330_LCDDataStruct XGI_StLCD1600x1200Data[]= +struct XGI330_LCDDataStruct XGI_StLCD1600x1200Data[] = { { 27,4,800,500,2160,1250 },/* 00 (320x200,320x400,640x200,640x400) */ { 27,4,800,500,2160,1250 },/* 01 (320x350,640x350) */ @@ -1154,7 +1125,7 @@ XGI330_LCDDataStruct XGI_StLCD1600x1200Data[]= { 1,1,2160,1250,2160,1250 } /* 09 (1600x1200) */ }; -XGI330_LCDDataStruct XGI_CetLCD1400x1050Data[]= +struct XGI330_LCDDataStruct XGI_CetLCD1400x1050Data[] = { { 1,1,1688,1066,1688,1066 }, /* 00 (320x200,320x400,640x200,640x400) */ { 1,1,1688,1066,1688,1066 }, /* 01 (320x350,640x350) */ @@ -1167,7 +1138,7 @@ XGI330_LCDDataStruct XGI_CetLCD1400x1050Data[]= { 1,1,1688,1066,1688,1066 } /* 08 (1400x1050x60Hz) */ }; -XGI330_LCDDataStruct XGI_NoScalingData[]= +struct XGI330_LCDDataStruct XGI_NoScalingData[] = { { 1, 1, 800, 449, 800, 449}, { 1, 1, 800, 449, 800, 449}, @@ -1179,7 +1150,7 @@ XGI330_LCDDataStruct XGI_NoScalingData[]= { 1, 1,1688,1066,1688,1066} }; -XGI330_LCDDataStruct XGI_ExtLCD1024x768x75Data[]= +struct XGI330_LCDDataStruct XGI_ExtLCD1024x768x75Data[] = { {42,25,1536,419,1344,806 }, /* ; 00 (320x200,320x400,640x200,640x400) */ {48,25,1536,369,1344,806 }, /* ; 01 (320x350,640x350) */ @@ -1190,7 +1161,7 @@ XGI330_LCDDataStruct XGI_ExtLCD1024x768x75Data[]= {1,1,1312,800,1312,800 } /* ; 06 (1024x768x75Hz) */ }; -XGI330_LCDDataStruct XGI_StLCD1024x768x75Data[]= +struct XGI330_LCDDataStruct XGI_StLCD1024x768x75Data[] = { {42,25,1536,419,1344,806 }, /* ; 00 (320x200,320x400,640x200,640x400) */ {48,25,1536,369,1344,806 }, /* ; 01 (320x350,640x350) */ @@ -1201,7 +1172,7 @@ XGI330_LCDDataStruct XGI_StLCD1024x768x75Data[]= {1,1,1312,800,1312,800 } /* ; 06 (1024x768x75Hz) */ }; -XGI330_LCDDataStruct XGI_CetLCD1024x768x75Data[]= +struct XGI330_LCDDataStruct XGI_CetLCD1024x768x75Data[] = { {1,1,1312,800,1312,800}, /* ; 00 (320x200,320x400,640x200,640x400) */ {1,1,1312,800,1312,800}, /* ; 01 (320x350,640x350) */ @@ -1212,7 +1183,7 @@ XGI330_LCDDataStruct XGI_CetLCD1024x768x75Data[]= {1,1,1312,800,1312,800} /* ; 06 (1024x768x75Hz) */ }; -XGI330_LCDDataStruct XGI_ExtLCD1280x1024x75Data[]= +struct XGI330_LCDDataStruct XGI_ExtLCD1280x1024x75Data[] = { {211,60,1024,501,1688,1066 }, /* ; 00 (320x200,320x400,640x200,640x400) */ {211,60,1024,508,1688,1066 }, /* ; 01 (320x350,640x350) */ @@ -1224,7 +1195,7 @@ XGI330_LCDDataStruct XGI_ExtLCD1280x1024x75Data[]= {1,1,1688,1066,1688,1066 } /* ; 07 (1280x1024x75Hz) */ }; -XGI330_LCDDataStruct XGI_StLCD1280x1024x75Data[]= +struct XGI330_LCDDataStruct XGI_StLCD1280x1024x75Data[] = { {211,60,1024,501,1688,1066 }, /* ; 00 (320x200,320x400,640x200,640x400) */ {211,60,1024,508,1688,1066 }, /* ; 01 (320x350,640x350) */ @@ -1236,7 +1207,7 @@ XGI330_LCDDataStruct XGI_StLCD1280x1024x75Data[]= {1,1,1688,1066,1688,1066 } /* ; 07 (1280x1024x75Hz) */ }; -XGI330_LCDDataStruct XGI_CetLCD1280x1024x75Data[]= +struct XGI330_LCDDataStruct XGI_CetLCD1280x1024x75Data[] = { {1,1,1688,1066,1688,1066}, /* ; 00 (320x200,320x400,640x200,640x400) */ {1,1,1688,1066,1688,1066}, /* ; 01 (320x350,640x350) */ @@ -1248,7 +1219,7 @@ XGI330_LCDDataStruct XGI_CetLCD1280x1024x75Data[]= {1,1,1688,1066,1688,1066} /* ; 07 (1280x1024x75Hz) */ }; -XGI330_LCDDataStruct XGI_NoScalingDatax75[]= +struct XGI330_LCDDataStruct XGI_NoScalingDatax75[] = { {1,1,800,449,800,449 }, /* ; 00 (320x200,320x400,640x200,640x400) */ {1,1,800,449,800,449 }, /* ; 01 (320x350,640x350) */ @@ -1263,7 +1234,7 @@ XGI330_LCDDataStruct XGI_NoScalingDatax75[]= {1,1,1688,806,1688,806 } /* ; 0A (1280x768x75Hz) */ }; -XGI330_LCDDataDesStruct XGI_ExtLCDDes1024x768Data[]= +struct XGI330_LCDDataDesStruct XGI_ExtLCDDes1024x768Data[] = { { 9,1057,0, 771 }, /* ; 00 (320x200,320x400,640x200,640x400) */ { 9,1057,0, 771 }, /* ; 01 (320x350,640x350) */ @@ -1274,7 +1245,7 @@ XGI330_LCDDataDesStruct XGI_ExtLCDDes1024x768Data[]= { 9,1057,805, 770 } /* ; 06 (1024x768x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_StLCDDes1024x768Data[]= +struct XGI330_LCDDataDesStruct XGI_StLCDDes1024x768Data[] = { { 9,1057,737,703 }, /* ; 00 (320x200,320x400,640x200,640x400) */ { 9,1057,686,651 }, /* ; 01 (320x350,640x350) */ @@ -1285,7 +1256,7 @@ XGI330_LCDDataDesStruct XGI_StLCDDes1024x768Data[]= { 9,1057,805,770 } /* ; 06 (1024x768x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_CetLCDDes1024x768Data[]= +struct XGI330_LCDDataDesStruct XGI_CetLCDDes1024x768Data[] = { { 1152,856,622,587 }, /* ; 00 (320x200,320x400,640x200,640x400) */ { 1152,856,597,562 }, /* ; 01 (320x350,640x350) */ @@ -1296,7 +1267,7 @@ XGI330_LCDDataDesStruct XGI_CetLCDDes1024x768Data[]= { 0,1048,805,770 } /* ; 06 (1024x768x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1280x1024Data[]= +struct XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1280x1024Data[] = { { 18,1346,981,940 },/* 00 (320x200,320x400,640x200,640x400) */ { 18,1346,926,865 },/* 01 (320x350,640x350) */ @@ -1308,7 +1279,7 @@ XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1280x1024Data[]= { 18,1346,1065,1024 }/* 07 (1280x1024x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_StLCDDLDes1280x1024Data[]= +struct XGI330_LCDDataDesStruct XGI_StLCDDLDes1280x1024Data[] = { { 18,1346,970,907 },/* 00 (320x200,320x400,640x200,640x400) */ { 18,1346,917,854 },/* 01 (320x350,640x350) */ @@ -1320,7 +1291,7 @@ XGI330_LCDDataDesStruct XGI_StLCDDLDes1280x1024Data[]= { 18,1346,1065,1024 }/* 07 (1280x1024x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_CetLCDDLDes1280x1024Data[]= +struct XGI330_LCDDataDesStruct XGI_CetLCDDLDes1280x1024Data[] = { { 1368,1008,752,711 }, /* 00 (320x200,320x400,640x200,640x400) */ { 1368,1008,729,688 }, /* 01 (320x350,640x350) */ @@ -1332,7 +1303,7 @@ XGI330_LCDDataDesStruct XGI_CetLCDDLDes1280x1024Data[]= { 18,1346,1065,1024 } /* 07 (1280x1024x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_ExtLCDDes1280x1024Data[]= +struct XGI330_LCDDataDesStruct XGI_ExtLCDDes1280x1024Data[] = { { 9,1337,981,940 }, /* ; 00 (320x200,320x400,640x200,640x400) */ { 9,1337,926,884 }, /* ; 01 (320x350,640x350) alan, 2003/09/30 */ @@ -1344,7 +1315,7 @@ XGI330_LCDDataDesStruct XGI_ExtLCDDes1280x1024Data[]= { 9,1337,1065,1024 } /* ; 07 (1280x1024x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_StLCDDes1280x1024Data[]= +struct XGI330_LCDDataDesStruct XGI_StLCDDes1280x1024Data[] = { { 9,1337,970,907 }, /* ; 00 (320x200,320x400,640x200,640x400) */ { 9,1337,917,854 }, /* ; 01 (320x350,640x350) */ @@ -1356,7 +1327,7 @@ XGI330_LCDDataDesStruct XGI_StLCDDes1280x1024Data[]= { 9,1337,1065,1024 } /* ; 07 (1280x1024x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_CetLCDDes1280x1024Data[]= +struct XGI330_LCDDataDesStruct XGI_CetLCDDes1280x1024Data[] = { { 1368,1008,752,711 }, /* 00 (320x200,320x400,640x200,640x400) */ { 1368,1008,729,688 }, /* 01 (320x350,640x350) */ @@ -1368,7 +1339,7 @@ XGI330_LCDDataDesStruct XGI_CetLCDDes1280x1024Data[]= { 9,1337,1065,1024 } /* 07 (1280x1024x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_StLCDDLDes1400x1050Data[]= +struct XGI330_LCDDataDesStruct XGI_StLCDDLDes1400x1050Data[] = { { 18,1464,0,1051 }, /* 00 (320x200,320x400,640x200,640x400) */ { 18,1464,0,1051 }, /* 01 (320x350,640x350) */ @@ -1381,7 +1352,7 @@ XGI330_LCDDataDesStruct XGI_StLCDDLDes1400x1050Data[]= { 18,1464,0,1051 } /* 08 (1400x1050x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1400x1050Data[]= +struct XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1400x1050Data[] = { { 18,1464,0,1051 }, /* 00 (320x200,320x400,640x200,640x400) */ { 18,1464,0,1051 }, /* 01 (320x350,640x350) */ @@ -1394,7 +1365,7 @@ XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1400x1050Data[]= { 18,1464,0,1051 } /* 08 (1400x1050x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_StLCDDes1400x1050Data[]= +struct XGI330_LCDDataDesStruct XGI_StLCDDes1400x1050Data[] = { { 9,1455,0,1051 },/* 00 (320x200,320x400,640x200,640x400) */ { 9,1455,0,1051 },/* 01 (320x350,640x350) */ @@ -1407,7 +1378,7 @@ XGI330_LCDDataDesStruct XGI_StLCDDes1400x1050Data[]= { 9,1455,0,1051 } /* 08 (1400x1050x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_ExtLCDDes1400x1050Data[]= +struct XGI330_LCDDataDesStruct XGI_ExtLCDDes1400x1050Data[] = { { 9,1455,0,1051 },/* 00 (320x200,320x400,640x200,640x400) */ { 9,1455,0,1051 },/* 01 (320x350,640x350) */ @@ -1420,7 +1391,7 @@ XGI330_LCDDataDesStruct XGI_ExtLCDDes1400x1050Data[]= { 9,1455,0,1051 } /* 08 (1400x1050x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_CetLCDDes1400x1050Data[]= +struct XGI330_LCDDataDesStruct XGI_CetLCDDes1400x1050Data[] = { { 1308,1068,781,766 }, /* 00 (320x200,320x400,640x200,640x400) */ { 1308,1068,781,766 }, /* 01 (320x350,640x350) */ @@ -1433,7 +1404,7 @@ XGI330_LCDDataDesStruct XGI_CetLCDDes1400x1050Data[]= { 18,1464,0,1051 } /* 08 (1400x1050x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_CetLCDDes1400x1050Data2[]= +struct XGI330_LCDDataDesStruct XGI_CetLCDDes1400x1050Data2[] = { { 0,1448,0,1051 }, /* 00 (320x200,320x400,640x200,640x400) */ { 0,1448,0,1051 }, /* 01 (320x350,640x350) */ @@ -1444,7 +1415,7 @@ XGI330_LCDDataDesStruct XGI_CetLCDDes1400x1050Data2[]= -XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1600x1200Data[]= +struct XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1600x1200Data[] = { { 18,1682,0,1201 }, /* 00 (320x200,320x400,640x200,640x400) */ { 18,1682,0,1201 }, /* 01 (320x350,640x350) */ @@ -1458,7 +1429,7 @@ XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1600x1200Data[]= { 18,1682,0,1201 } /* 09 (1600x1200x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_StLCDDLDes1600x1200Data[]= +struct XGI330_LCDDataDesStruct XGI_StLCDDLDes1600x1200Data[] = { { 18,1682,1150,1101 }, /* 00 (320x200,320x400,640x200,640x400) */ { 18,1682,1083,1034 }, /* 01 (320x350,640x350) */ @@ -1472,7 +1443,7 @@ XGI330_LCDDataDesStruct XGI_StLCDDLDes1600x1200Data[]= { 18,1682,0,1201 } /* 09 (1600x1200x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_ExtLCDDes1600x1200Data[]= +struct XGI330_LCDDataDesStruct XGI_ExtLCDDes1600x1200Data[] = { { 9,1673,0,1201 },/* 00 (320x200,320x400,640x200,640x400) */ { 9,1673,0,1201 },/* 01 (320x350,640x350) */ @@ -1486,7 +1457,7 @@ XGI330_LCDDataDesStruct XGI_ExtLCDDes1600x1200Data[]= { 9,1673,0,1201 } /* 09 (1600x1200x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_StLCDDes1600x1200Data[]= +struct XGI330_LCDDataDesStruct XGI_StLCDDes1600x1200Data[] = { { 9,1673,1150,1101 },/* 00 (320x200,320x400,640x200,640x400) */ { 9,1673,1083,1034 },/* 01 (320x350,640x350) */ @@ -1500,7 +1471,7 @@ XGI330_LCDDataDesStruct XGI_StLCDDes1600x1200Data[]= { 9,1673,0,1201 } /* 09 (1600x1200x60Hz) */ }; -XGI330_LCDDataDesStruct2 XGI_NoScalingDesData[]= +struct XGI330_LCDDataDesStruct2 XGI_NoScalingDesData[] = { { 9,657,448,405,96,2 }, /* 00 (320x200,320x400,640x200,640x400) */ { 9,657,448,355,96,2 }, /* 01 (320x350,640x350) */ @@ -1515,7 +1486,7 @@ XGI330_LCDDataDesStruct2 XGI_NoScalingDesData[]= { 9,1337,0,771,112,6 } /* 0A (1280x768x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_ExtLCDDes1024x768x75Data[]= /* ;;1024x768x75Hz */ +struct XGI330_LCDDataDesStruct XGI_ExtLCDDes1024x768x75Data[] = /* ;;1024x768x75Hz */ { {9,1049,0,769}, /* ; 00 (320x200,320x400,640x200,640x400) */ {9,1049,0,769}, /* ; 01 (320x350,640x350) */ @@ -1526,7 +1497,7 @@ XGI330_LCDDataDesStruct XGI_ExtLCDDes1024x768x75Data[]= /* ;;1024x768x75Hz */ {9,1049,0,769} /* ; 06 (1024x768x75Hz) */ }; -XGI330_LCDDataDesStruct XGI_StLCDDes1024x768x75Data[]= +struct XGI330_LCDDataDesStruct XGI_StLCDDes1024x768x75Data[] = { {9,1049,0,769}, /* ; 00 (320x200,320x400,640x200,640x400) */ {9,1049,0,769}, /* ; 01 (320x350,640x350) */ @@ -1537,7 +1508,7 @@ XGI330_LCDDataDesStruct XGI_StLCDDes1024x768x75Data[]= {9,1049,0,769} /* ; 06 (1024x768x75Hz) */ }; -XGI330_LCDDataDesStruct XGI_CetLCDDes1024x768x75Data[]= /* ;;1024x768x75Hz */ +struct XGI330_LCDDataDesStruct XGI_CetLCDDes1024x768x75Data[] = /* ;;1024x768x75Hz */ { {1152,856,622,587}, /* ; 00 (320x200,320x400,640x200,640x400) */ {1152,856,597,562}, /* ; 01 (320x350,640x350) */ @@ -1548,7 +1519,7 @@ XGI330_LCDDataDesStruct XGI_CetLCDDes1024x768x75Data[]= /* ;;1024x768x75Hz */ {9,1049,0,769} /* ; 06 (1024x768x75Hz) */ }; -XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1280x1024x75Data[]= /* ;;1280x1024x75Hz */ +struct XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1280x1024x75Data[] = /* ;;1280x1024x75Hz */ { {18,1314,0,1025 },/* ; 00 (320x200,320x400,640x200,640x400) */ {18,1314,0,1025 },/* ; 01 (320x350,640x350) */ @@ -1560,7 +1531,7 @@ XGI330_LCDDataDesStruct XGI_ExtLCDDLDes1280x1024x75Data[]= /* ;;1280x10 {18,1314,0,1025 }/* ; 07 (1280x1024x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_StLCDDLDes1280x1024x75Data[]= +struct XGI330_LCDDataDesStruct XGI_StLCDDLDes1280x1024x75Data[] = { {18,1314,0,1025 },/* ; 00 (320x200,320x400,640x200,640x400) */ {18,1314,0,1025 },/* ; 01 (320x350,640x350) */ @@ -1572,7 +1543,7 @@ XGI330_LCDDataDesStruct XGI_StLCDDLDes1280x1024x75Data[]= {18,1314,0,1025 }/* ; 07 (1280x1024x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_CetLCDDLDes1280x1024x75Data[]= /* 1280x1024x75Hz */ +struct XGI330_LCDDataDesStruct XGI_CetLCDDLDes1280x1024x75Data[] = /* 1280x1024x75Hz */ { {1368,1008,752,711}, /* ; 00 (320x200,320x400,640x200,640x400) */ {1368,1008,729,688}, /* ; 01 (320x350,640x350) */ @@ -1584,7 +1555,7 @@ XGI330_LCDDataDesStruct XGI_CetLCDDLDes1280x1024x75Data[]= /* 1280x1024x75Hz */ {18,1314,0,1025} /* ; 07 (1280x1024x75Hz) */ }; -XGI330_LCDDataDesStruct XGI_ExtLCDDes1280x1024x75Data[]= /* ;;1280x1024x75Hz */ +struct XGI330_LCDDataDesStruct XGI_ExtLCDDes1280x1024x75Data[] = /* ;;1280x1024x75Hz */ { {9,1305,0,1025},/* ; 00 (320x200,320x400,640x200,640x400) */ {9,1305,0,1025},/* ; 01 (320x350,640x350) */ @@ -1596,7 +1567,7 @@ XGI330_LCDDataDesStruct XGI_ExtLCDDes1280x1024x75Data[]= /* ;;1280x1024 {9,1305,0,1025} /* ; 07 (1280x1024x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_StLCDDes1280x1024x75Data[]= +struct XGI330_LCDDataDesStruct XGI_StLCDDes1280x1024x75Data[] = { {9,1305,0,1025},/* ; 00 (320x200,320x400,640x200,640x400) */ {9,1305,0,1025},/* ; 01 (320x350,640x350) */ @@ -1608,7 +1579,7 @@ XGI330_LCDDataDesStruct XGI_StLCDDes1280x1024x75Data[]= {9,1305,0,1025} /* ; 07 (1280x1024x60Hz) */ }; -XGI330_LCDDataDesStruct XGI_CetLCDDes1280x1024x75Data[]= /* 1280x1024x75Hz */ +struct XGI330_LCDDataDesStruct XGI_CetLCDDes1280x1024x75Data[] = /* 1280x1024x75Hz */ { {1368,1008,752,711}, /* ; 00 (320x200,320x400,640x200,640x400) */ {1368,1008,729,688}, /* ; 01 (320x350,640x350) */ @@ -1620,7 +1591,7 @@ XGI330_LCDDataDesStruct XGI_CetLCDDes1280x1024x75Data[]= /* 1280x1024x75Hz */ {9,1305,0,1025} /* ; 07 (1280x1024x75Hz) */ }; -XGI330_LCDDataDesStruct2 XGI_NoScalingDesDatax75[]= /* Scaling LCD 75Hz */ +struct XGI330_LCDDataDesStruct2 XGI_NoScalingDesDatax75[] = /* Scaling LCD 75Hz */ { {9,657,448,405,96,2}, /* ; 00 (320x200,320x400,640x200,640x400) */ {9,657,448,355,96,2}, /* ; 01 (320x350,640x350) */ @@ -1635,7 +1606,7 @@ XGI330_LCDDataDesStruct2 XGI_NoScalingDesDatax75[]= /* Scaling LCD 75Hz */ {9,1337,0,771,112,6} /* ; 0A (1280x768x60Hz) */ }; -XGI330_TVDataStruct XGI_StPALData[]= +struct XGI330_TVDataStruct XGI_StPALData[] = { { 1, 1, 864, 525,1270, 400, 100, 0, 760}, { 1, 1, 864, 525,1270, 350, 100, 0, 760}, @@ -1645,7 +1616,7 @@ XGI330_TVDataStruct XGI_StPALData[]= { 1, 1, 864, 525,1270, 600, 50, 0, 0} }; -XGI330_TVDataStruct XGI_ExtPALData[]= +struct XGI330_TVDataStruct XGI_ExtPALData[] = { { 2, 1,1080, 463,1270, 500, 50, 0, 50}, { 15, 7,1152, 413,1270, 500, 50, 0, 50}, @@ -1657,7 +1628,7 @@ XGI330_TVDataStruct XGI_ExtPALData[]= { 3, 2,1080, 619,1270, 540, 438, 0, 438} }; -XGI330_TVDataStruct XGI_StNTSCData[]= +struct XGI330_TVDataStruct XGI_StNTSCData[] = { { 1, 1, 858, 525,1270, 400, 50, 0, 760}, { 1, 1, 858, 525,1270, 350, 50, 0, 640}, @@ -1666,7 +1637,7 @@ XGI330_TVDataStruct XGI_StNTSCData[]= { 1, 1, 858, 525,1270, 480, 0, 0, 760} }; -XGI330_TVDataStruct XGI_ExtNTSCData[]= +struct XGI330_TVDataStruct XGI_ExtNTSCData[] = { { 9, 5, 1001, 453,1270, 420, 171, 0, 171}, { 12, 5, 858, 403,1270, 420, 171, 0, 171}, @@ -1679,7 +1650,7 @@ XGI330_TVDataStruct XGI_ExtNTSCData[]= { 3, 2,1001, 533,1270, 420, 0, 0, 0} }; -XGI330_TVDataStruct XGI_St1HiTVData[]= +struct XGI330_TVDataStruct XGI_St1HiTVData[] = { { 1,1,892,563,690,800,0,0,0 }, /* 00 (320x200,320x400,640x200,640x400) */ { 1,1,892,563,690,700,0,0,0 }, /* 01 (320x350,640x350) */ @@ -1689,7 +1660,7 @@ XGI330_TVDataStruct XGI_St1HiTVData[]= { 8,5,1050,683,1648,960,0x150,1,0 } /* 05 (400x300,800x600) */ }; -XGI330_TVDataStruct XGI_St2HiTVData[]= +struct XGI330_TVDataStruct XGI_St2HiTVData[] = { { 3,1,840,483,1648,960,0x032,0,0 }, /* 00 (320x200,320x400,640x200,640x400) */ { 1,1,892,563,690,700,0,0,0 }, /* 01 (320x350,640x350) */ @@ -1700,7 +1671,7 @@ XGI330_TVDataStruct XGI_St2HiTVData[]= }; -XGI330_TVDataStruct XGI_ExtHiTVData[]= +struct XGI330_TVDataStruct XGI_ExtHiTVData[] = { { 6,1,840,563,1632,960,0,0,0 }, /* 00 (320x200,320x400,640x200,640x400) */ { 3,1,960,563,1632,960,0,0,0 }, /* 01 (320x350,640x350) */ @@ -1716,7 +1687,7 @@ XGI330_TVDataStruct XGI_ExtHiTVData[]= }; -XGI330_TVDataStruct XGI_ExtYPbPr525iData[]= +struct XGI330_TVDataStruct XGI_ExtYPbPr525iData[] = { { 9, 5, 1001, 453,1270, 420, 171, 0, 171}, { 12, 5, 858, 403,1270, 420, 171, 0, 171}, @@ -1729,7 +1700,7 @@ XGI330_TVDataStruct XGI_ExtYPbPr525iData[]= { 3, 2,1001, 533,1250, 420, 0, 0, 0} }; -XGI330_TVDataStruct XGI_StYPbPr525iData[]= +struct XGI330_TVDataStruct XGI_StYPbPr525iData[] = { { 1, 1, 858, 525,1270, 400, 50, 0, 760}, { 1, 1, 858, 525,1270, 350, 50, 0, 640}, @@ -1738,7 +1709,7 @@ XGI330_TVDataStruct XGI_StYPbPr525iData[]= { 1, 1, 858, 525,1270, 480, 0, 0, 760}, }; -XGI330_TVDataStruct XGI_ExtYPbPr525pData[]= +struct XGI330_TVDataStruct XGI_ExtYPbPr525pData[] = { { 9, 5, 1001, 453,1270, 420, 171, 0, 171}, { 12, 5, 858, 403,1270, 420, 171, 0, 171}, @@ -1751,7 +1722,7 @@ XGI330_TVDataStruct XGI_ExtYPbPr525pData[]= { 3, 2,1001, 533,1270, 420, 0, 0, 0} }; -XGI330_TVDataStruct XGI_StYPbPr525pData[]= +struct XGI330_TVDataStruct XGI_StYPbPr525pData[] = { { 1, 1,1716, 525,1270, 400, 50, 0, 760}, { 1, 1,1716, 525,1270, 350, 50, 0, 640}, @@ -1760,7 +1731,7 @@ XGI330_TVDataStruct XGI_StYPbPr525pData[]= { 1, 1,1716, 525,1270, 480, 0, 0, 760}, }; -XGI330_TVDataStruct XGI_ExtYPbPr750pData[]= +struct XGI330_TVDataStruct XGI_ExtYPbPr750pData[] = { { 3, 1, 935, 470,1130, 680, 50, 0, 0}, /* 00 (320x200,320x400,640x200,640x400) */ { 24, 7, 935, 420,1130, 680, 50, 0, 0}, /* 01 (320x350,640x350) */ @@ -1775,7 +1746,7 @@ XGI330_TVDataStruct XGI_ExtYPbPr750pData[]= { 10, 9,1320, 830,1130, 640, 50, 0, 0} }; -XGI330_TVDataStruct XGI_StYPbPr750pData[]= +struct XGI330_TVDataStruct XGI_StYPbPr750pData[] = { { 1, 1,1650, 750,1280, 400, 50, 0, 760}, { 1, 1,1650, 750,1280, 350, 50, 0, 640}, @@ -1784,7 +1755,7 @@ XGI330_TVDataStruct XGI_StYPbPr750pData[]= { 1, 1,1650, 750,1280, 480, 0, 0, 760}, }; -UCHAR XGI330_NTSCTiming[] = { +unsigned char XGI330_NTSCTiming[] = { 0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c, 0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a, 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b, @@ -1794,7 +1765,7 @@ UCHAR XGI330_NTSCTiming[] = { 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x50, 0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00}; -UCHAR XGI330_PALTiming[] = { +unsigned char XGI330_PALTiming[] = { 0x21,0x5A,0x35,0x6e,0x04,0x38,0x3d,0x70, 0x94,0x49,0x01,0x12,0x06,0x3e,0x35,0x6d, 0x06,0x14,0x3e,0x35,0x6d,0x00,0x45,0x2b, @@ -1804,7 +1775,7 @@ UCHAR XGI330_PALTiming[] = { 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x63, 0x00,0x40,0x3e,0x00,0xe1,0x02,0x28,0x00}; -UCHAR XGI330_HiTVExtTiming[] = +unsigned char XGI330_HiTVExtTiming[] = { 0x2D,0x60,0x2C,0x5F,0x08,0x31,0x3A,0x64, 0x28,0x02,0x01,0x3D,0x06,0x3E,0x35,0x6D, @@ -1818,7 +1789,7 @@ UCHAR XGI330_HiTVExtTiming[] = }; -UCHAR XGI330_HiTVSt1Timing[] = +unsigned char XGI330_HiTVSt1Timing[] = { 0x32,0x65,0x2C,0x5F,0x08,0x31,0x3A,0x65, 0x28,0x02,0x01,0x3D,0x06,0x3E,0x35,0x6D, @@ -1831,7 +1802,7 @@ UCHAR XGI330_HiTVSt1Timing[] = 0x0E,0x00,0xfc,0xff,0x2d,0x00 }; -UCHAR XGI330_HiTVSt2Timing[] = +unsigned char XGI330_HiTVSt2Timing[] = { 0x32,0x65,0x2C,0x5F,0x08,0x31,0x3A,0x64, 0x28,0x02,0x01,0x3D,0x06,0x3E,0x35,0x6D, @@ -1844,7 +1815,7 @@ UCHAR XGI330_HiTVSt2Timing[] = 0x27,0x00,0xFC,0xff,0x6a,0x00 }; -UCHAR XGI330_HiTVTextTiming[] = +unsigned char XGI330_HiTVTextTiming[] = { 0x32,0x65,0x2C,0x5F,0x08,0x31,0x3A,0x65, 0x28,0x02,0x01,0x3D,0x06,0x3E,0x35,0x6D, @@ -1857,7 +1828,7 @@ UCHAR XGI330_HiTVTextTiming[] = 0x11,0x00,0xFC,0xFF,0x32,0x00 }; -UCHAR XGI330_YPbPr750pTiming[] = +unsigned char XGI330_YPbPr750pTiming[] = { 0x30,0x1d,0xe8,0x09,0x09,0xed,0x0c,0x0c, 0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a, @@ -1870,7 +1841,7 @@ UCHAR XGI330_YPbPr750pTiming[] = 0x11,0x00,0xfc,0xff,0x32,0x00 }; -UCHAR XGI330_YPbPr525pTiming[] = +unsigned char XGI330_YPbPr525pTiming[] = { 0x3E,0x11,0x06,0x09,0x0b,0x0c,0x0c,0x0c, 0x98,0x0a,0x01,0x0d,0x06,0x0d,0x04,0x0a, @@ -1883,7 +1854,7 @@ UCHAR XGI330_YPbPr525pTiming[] = 0x11,0x00,0xFC,0xFF,0x32,0x00 }; -UCHAR XGI330_YPbPr525iTiming[] = +unsigned char XGI330_YPbPr525iTiming[] = { 0x1B,0x21,0x03,0x09,0x05,0x06,0x0C,0x0C, 0x94,0x49,0x01,0x0A,0x06,0x0D,0x04,0x0A, @@ -1897,7 +1868,7 @@ UCHAR XGI330_YPbPr525iTiming[] = }; -UCHAR XGI330_HiTVGroup3Data[] = +unsigned char XGI330_HiTVGroup3Data[] = { 0x00,0x1A,0x22,0x63,0x62,0x22,0x08,0x5F, 0x05,0x21,0xB2,0xB2,0x55,0x77,0x2A,0xA6, @@ -1909,7 +1880,7 @@ UCHAR XGI330_HiTVGroup3Data[] = 0x18,0x05,0x18,0x05,0x4C,0xA8,0x01 }; -UCHAR XGI330_HiTVGroup3Simu[] = +unsigned char XGI330_HiTVGroup3Simu[] = { 0x00,0x1A,0x22,0x63,0x62,0x22,0x08,0x95, 0xDB,0x20,0xB8,0xB8,0x55,0x47,0x2A,0xA6, @@ -1921,7 +1892,7 @@ UCHAR XGI330_HiTVGroup3Simu[] = 0x18,0x05,0x18,0x05,0x4C,0xA8,0x01 }; -UCHAR XGI330_HiTVGroup3Text[] = +unsigned char XGI330_HiTVGroup3Text[] = { 0x00,0x1A,0x22,0x63,0x62,0x22,0x08,0xA7, 0xF5,0x20,0xCE,0xCE,0x55,0x47,0x2A,0xA6, @@ -1933,7 +1904,7 @@ UCHAR XGI330_HiTVGroup3Text[] = 0x18,0x05,0x18,0x05,0x4C,0xA8,0x01 }; -UCHAR XGI330_Ren525pGroup3[] = +unsigned char XGI330_Ren525pGroup3[] = { 0x00,0x14,0x15,0x25,0x55,0x15,0x0b,0x13, 0xB1,0x41,0x62,0x62,0xFF,0xF4,0x45,0xa6, @@ -1945,7 +1916,7 @@ UCHAR XGI330_Ren525pGroup3[] = 0x1a,0x1F,0x25,0x2a,0x4C,0xAA,0x01 }; -UCHAR XGI330_Ren750pGroup3[] = +unsigned char XGI330_Ren750pGroup3[] = { 0x00,0x14,0x15,0x25,0x55,0x15,0x0b,0x7a, 0x54,0x41,0xE7,0xE7,0xFF,0xF4,0x45,0xa6, @@ -1957,7 +1928,7 @@ UCHAR XGI330_Ren750pGroup3[] = 0x18,0x1D,0x23,0x28,0x4C,0xAA,0x01 }; -XGI_PanelDelayTblStruct XGI330_PanelDelayTbl[]= +struct XGI_PanelDelayTblStruct XGI330_PanelDelayTbl[] = { {{0x00,0x00}}, {{0x00,0x00}}, @@ -1977,7 +1948,7 @@ XGI_PanelDelayTblStruct XGI330_PanelDelayTbl[]= {{0x00,0x00}} }; -XGI330_LVDSDataStruct XGI330_LVDS320x480Data_1[]= +struct XGI330_LVDSDataStruct XGI330_LVDS320x480Data_1[] = { {848, 433,400,525}, {848, 389,400,525}, @@ -1990,7 +1961,7 @@ XGI330_LVDSDataStruct XGI330_LVDS320x480Data_1[]= {800, 525,1000, 635} }; -XGI330_LVDSDataStruct XGI330_LVDS800x600Data_1[]= +struct XGI330_LVDSDataStruct XGI330_LVDS800x600Data_1[] = { {848, 433,1060, 629}, {848, 389,1060, 629}, @@ -2003,7 +1974,7 @@ XGI330_LVDSDataStruct XGI330_LVDS800x600Data_1[]= {800, 525,1000, 635} }; -XGI330_LVDSDataStruct XGI330_LVDS800x600Data_2[]= +struct XGI330_LVDSDataStruct XGI330_LVDS800x600Data_2[] = { {1056, 628,1056, 628}, {1056, 628,1056, 628}, @@ -2016,7 +1987,7 @@ XGI330_LVDSDataStruct XGI330_LVDS800x600Data_2[]= {800, 525,1000, 635} }; -XGI330_LVDSDataStruct XGI_LVDS1024x768Data_1[]= +struct XGI330_LVDSDataStruct XGI_LVDS1024x768Data_1[] = { { 960 , 438 , 1344 , 806 } , /* 00 (320x200,320x400,640x200,640x400) */ { 960 , 388 , 1344 , 806 } , /* 01 (320x350,640x350) */ @@ -2028,7 +1999,7 @@ XGI330_LVDSDataStruct XGI_LVDS1024x768Data_1[]= }; -XGI330_LVDSDataStruct XGI_LVDS1024x768Data_2[]= +struct XGI330_LVDSDataStruct XGI_LVDS1024x768Data_2[] = { {1344, 806,1344, 806}, {1344, 806,1344, 806}, @@ -2041,7 +2012,7 @@ XGI330_LVDSDataStruct XGI_LVDS1024x768Data_2[]= {800, 525,1280, 813} }; -XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_1[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_1[] = { {1048, 442,1688, 1066}, {1048, 392,1688, 1066}, @@ -2053,7 +2024,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_1[]= {1688, 1066,1688, 1066} }; -XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_2[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_2[] = { {1344, 806,1344, 806}, {1344, 806,1344, 806}, @@ -2066,7 +2037,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_2[]= {800, 525,1280, 813} }; /* -XGI330_LVDSDataStruct XGI_LVDS1280x768Data_1[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x768Data_1[] = { {768,438,1408,806}, {768,388,1408,806}, @@ -2079,7 +2050,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x768Data_1[]= {1408,806,1408,806} }; -XGI330_LVDSDataStruct XGI_LVDS1280x768Data_2[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x768Data_2[] = { {1408, 806,1408, 806}, {1408, 806,1408, 806}, @@ -2092,7 +2063,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x768Data_2[]= {1408, 806,1408, 806} }; -XGI330_LVDSDataStruct XGI_LVDS1280x768NData_1[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x768NData_1[] = { {704, 438,1344, 806}, {704, 388,1344, 806}, @@ -2105,7 +2076,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x768NData_1[]= {1344, 806,1344, 806} }; -XGI330_LVDSDataStruct XGI_LVDS1280x768NData_2[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x768NData_2[] = { {1344, 806,1344, 806}, {1344, 806,1344, 806}, @@ -2118,7 +2089,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x768NData_2[]= {1344, 806,1344, 806} }; -XGI330_LVDSDataStruct XGI_LVDS1280x768SData_1[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x768SData_1[] = { {1048,438,1688,806}, {1048,388,1688,806}, @@ -2131,7 +2102,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x768SData_1[]= {1688,806,1688,806} }; -XGI330_LVDSDataStruct XGI_LVDS1280x768SData_2[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x768SData_2[] = { {1688,806,1688,806}, {1688,806,1688,806}, @@ -2144,7 +2115,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x768SData_2[]= {1688,806,1688,806} }; */ -XGI330_LVDSDataStruct XGI_LVDS1400x1050Data_1[]= +struct XGI330_LVDSDataStruct XGI_LVDS1400x1050Data_1[] = { {928,416,1688,1066}, {928,366,1688,1066}, @@ -2157,7 +2128,7 @@ XGI330_LVDSDataStruct XGI_LVDS1400x1050Data_1[]= {1688,1066,1688,1066} }; -XGI330_LVDSDataStruct XGI_LVDS1400x1050Data_2[]= +struct XGI330_LVDSDataStruct XGI_LVDS1400x1050Data_2[] = { {1688,1066,1688,1066}, {1688,1066,1688,1066}, @@ -2170,7 +2141,7 @@ XGI330_LVDSDataStruct XGI_LVDS1400x1050Data_2[]= {1688,1066,1688,1066} }; -XGI330_LVDSDataStruct XGI_LVDS1600x1200Data_1[]= +struct XGI330_LVDSDataStruct XGI_LVDS1600x1200Data_1[] = { /* ;;[ycchen] 12/05/02 LCDHTxLCDVT=2048x1320 */ { 1088,520,2048,1320 },/* 00 (320x200,320x400,640x200,640x400) */ { 1088,470,2048,1320 },/* 01 (320x350,640x350) */ @@ -2184,7 +2155,7 @@ XGI330_LVDSDataStruct XGI_LVDS1600x1200Data_1[]= { 2048,1320,2048,1320 } /* 09 (1600x1200) */ }; -XGI330_LVDSDataStruct XGI_LVDSNoScalingData[]= +struct XGI330_LVDSDataStruct XGI_LVDSNoScalingData[] = { { 800,449,800,449 }, /* 00 (320x200,320x400,640x200,640x400) */ { 800,449,800,449 }, /* 01 (320x350,640x350) */ @@ -2199,7 +2170,7 @@ XGI330_LVDSDataStruct XGI_LVDSNoScalingData[]= { 1688,806,1688,806 } /* 0A (1280x768x60Hz) */ }; -XGI330_LVDSDataStruct XGI_LVDS1024x768Data_1x75[]= +struct XGI330_LVDSDataStruct XGI_LVDS1024x768Data_1x75[] = { {960,438,1312,800 }, /* 00 (320x200,320x400,640x200,640x400) */ {960,388,1312,800 }, /* 01 (320x350,640x350) */ @@ -2211,7 +2182,7 @@ XGI330_LVDSDataStruct XGI_LVDS1024x768Data_1x75[]= }; -XGI330_LVDSDataStruct XGI_LVDS1024x768Data_2x75[]= +struct XGI330_LVDSDataStruct XGI_LVDS1024x768Data_2x75[] = { {1312,800,1312,800}, /* ; 00 (320x200,320x400,640x200,640x400) */ {1312,800,1312,800}, /* ; 01 (320x350,640x350) */ @@ -2222,7 +2193,7 @@ XGI330_LVDSDataStruct XGI_LVDS1024x768Data_2x75[]= {1312,800,1312,800}, /* ; 06 (512x384,1024x768) */ }; -XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_1x75[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_1x75[] = { {1048,442,1688,1066 }, /* ; 00 (320x200,320x400,640x200,640x400) */ {1048,392,1688,1066 }, /* ; 01 (320x350,640x350) */ @@ -2234,7 +2205,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_1x75[]= {1688,1066,1688,1066 }, /* ; 06; 07 (640x512,1280x1024) */ }; -XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_2x75[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_2x75[] = { {1688,1066,1688,1066 }, /* ; 00 (320x200,320x400,640x200,640x400) */ {1688,1066,1688,1066 }, /* ; 01 (320x350,640x350) */ @@ -2246,7 +2217,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x1024Data_2x75[]= {1688,1066,1688,1066 }, /* ; 06; 07 (640x512,1280x1024) */ }; -XGI330_LVDSDataStruct XGI_LVDSNoScalingDatax75[]= +struct XGI330_LVDSDataStruct XGI_LVDSNoScalingDatax75[] = { {800,449,800,449 }, /* ; 00 (320x200,320x400,640x200,640x400) */ {800,449,800,449 }, /* ; 01 (320x350,640x350) */ @@ -2261,7 +2232,7 @@ XGI330_LVDSDataStruct XGI_LVDSNoScalingDatax75[]= {1688,806,1688,806 }, /* ; 0A (1280x768x75Hz) */ }; -XGI330_LVDSDataStruct XGI_LVDS1024x768Des_1[]= +struct XGI330_LVDSDataStruct XGI_LVDS1024x768Des_1[] = { { 0,1048, 0, 771 }, /* 00 (320x200,320x400,640x200,640x400) */ { 0,1048, 0, 771 }, /* 01 (320x350,640x350) */ @@ -2272,7 +2243,7 @@ XGI330_LVDSDataStruct XGI_LVDS1024x768Des_1[]= { 0,1048, 805, 770 } /* 06 (1024x768x60Hz) */ } ; -XGI330_LVDSDataStruct XGI_LVDS1024x768Des_2[]= +struct XGI330_LVDSDataStruct XGI_LVDS1024x768Des_2[] = { { 1142, 856, 622, 587 }, /* 00 (320x200,320x400,640x200,640x400) */ { 1142, 856, 597, 562 }, /* 01 (320x350,640x350) */ @@ -2283,7 +2254,7 @@ XGI330_LVDSDataStruct XGI_LVDS1024x768Des_2[]= { 0,1048, 805, 771 } /* 06 (1024x768x60Hz) */ }; -XGI330_LVDSDataStruct XGI_LVDS1024x768Des_3[]= +struct XGI330_LVDSDataStruct XGI_LVDS1024x768Des_3[] = { { 320, 24, 622, 587 }, /* 00 (320x200,320x400,640x200,640x400) */ { 320, 24, 597, 562 }, /* 01 (320x350,640x350) */ @@ -2292,7 +2263,7 @@ XGI330_LVDSDataStruct XGI_LVDS1024x768Des_3[]= { 320, 24, 722, 687 } /* 04 (640x480x60Hz) */ }; -XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_1[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_1[] = { { 0,1328, 0, 1025 }, /* 00 (320x200,320x400,640x200,640x400) */ { 0,1328, 0, 1025 }, /* 01 (320x350,640x350) */ @@ -2305,7 +2276,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_1[]= }; /* The Display setting for DE Mode Panel */ -XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_2[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_2[] = { { 1368,1008,752,711 }, /* 00 (320x200,320x400,640x200,640x400) */ { 1368,1008,729,688 }, /* 01 (320x350,640x350) */ @@ -2317,7 +2288,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_2[]= { 0000,1328,0,1025 } /* 07 (1280x1024x60Hz) */ }; -XGI330_LVDSDataStruct XGI_LVDS1400x1050Des_1[]= +struct XGI330_LVDSDataStruct XGI_LVDS1400x1050Des_1[] = { { 0,1448,0,1051 }, /* 00 (320x200,320x400,640x200,640x400) */ { 0,1448,0,1051 }, /* 01 (320x350,640x350) */ @@ -2330,7 +2301,7 @@ XGI330_LVDSDataStruct XGI_LVDS1400x1050Des_1[]= { 0,1448,0,1051 } /* 08 (1400x1050x60Hz) */ }; -XGI330_LVDSDataStruct XGI_LVDS1400x1050Des_2[]= +struct XGI330_LVDSDataStruct XGI_LVDS1400x1050Des_2[] = { { 1308,1068, 781, 766 }, /* 00 (320x200,320x400,640x200,640x400) */ { 1308,1068, 781, 766 }, /* 01 (320x350,640x350) */ @@ -2343,7 +2314,7 @@ XGI330_LVDSDataStruct XGI_LVDS1400x1050Des_2[]= { 0,1448,0,1051 } /* 08 (1400x1050x60Hz) */ }; -XGI330_LVDSDataStruct XGI_LVDS1600x1200Des_1[]= +struct XGI330_LVDSDataStruct XGI_LVDS1600x1200Des_1[] = { { 0,1664,0,1201 }, /* 00 (320x200,320x400,640x200,640x400) */ { 0,1664,0,1201 }, /* 01 (320x350,640x350) */ @@ -2359,7 +2330,7 @@ XGI330_LVDSDataStruct XGI_LVDS1600x1200Des_1[]= -XGI330_LCDDataDesStruct2 XGI_LVDSNoScalingDesData[]= +struct XGI330_LCDDataDesStruct2 XGI_LVDSNoScalingDesData[] = { { 0, 648, 448, 405, 96, 2 }, /* 00 (320x200,320x400,640x200,640x400) */ { 0, 648, 448, 355, 96, 2 }, /* 01 (320x350,640x350) */ @@ -2374,7 +2345,7 @@ XGI330_LCDDataDesStruct2 XGI_LVDSNoScalingDesData[]= { 0,1328,0,0771, 112, 6 } /* 0A (1280x768x60Hz) */ }; -XGI330_LVDSDataStruct XGI_LVDS1024x768Des_1x75[]= /* ; 1024x768 Full-screen */ +struct XGI330_LVDSDataStruct XGI_LVDS1024x768Des_1x75[] = /* ; 1024x768 Full-screen */ { {0,1040,0,769}, /* ; 00 (320x200,320x400,640x200,640x400) */ {0,1040,0,769}, /* ; 01 (320x350,640x350) */ @@ -2385,7 +2356,7 @@ XGI330_LVDSDataStruct XGI_LVDS1024x768Des_1x75[]= /* ; 1024x768 Full-screen */ {0,1040,0,769} /* ; 06 (1024x768x75Hz) */ }; -XGI330_LVDSDataStruct XGI_LVDS1024x768Des_2x75[]= /* ; 1024x768 center-screen (Enh. Mode) */ +struct XGI330_LVDSDataStruct XGI_LVDS1024x768Des_2x75[] = /* ; 1024x768 center-screen (Enh. Mode) */ { {1142, 856,622,587 }, /* 00 (320x200,320x400,640x200,640x400) */ {1142, 856,597,562 }, /* 01 (320x350,640x350) */ @@ -2396,7 +2367,7 @@ XGI330_LVDSDataStruct XGI_LVDS1024x768Des_2x75[]= /* ; 1024x768 center-screen (E { 0,1048,805,771 } /* 06 (1024x768x60Hz) */ }; -XGI330_LVDSDataStruct XGI_LVDS1024x768Des_3x75[]= /* ; 1024x768 center-screen (St.Mode) */ +struct XGI330_LVDSDataStruct XGI_LVDS1024x768Des_3x75[] = /* ; 1024x768 center-screen (St.Mode) */ { {320,24,622,587 }, /* ; 00 (320x200,320x400,640x200,640x400) */ {320,24,597,562 }, /* ; 01 (320x350,640x350) */ @@ -2405,7 +2376,7 @@ XGI330_LVDSDataStruct XGI_LVDS1024x768Des_3x75[]= /* ; 1024x768 center-screen (S {320,24,722,687 } /* ; 04 (640x480x60Hz) */ }; -XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_1x75[]= +struct XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_1x75[] = { {0,1296,0,1025}, /* ; 00 (320x200,320x400,640x200,640x400) */ {0,1296,0,1025}, /* ; 01 (320x350,640x350) */ @@ -2418,7 +2389,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_1x75[]= }; /* The Display setting for DE Mode Panel */ -XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_2x75[]= /* [ycchen] 02/18/03 Set DE as default */ +struct XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_2x75[] = /* [ycchen] 02/18/03 Set DE as default */ { {1368,976,752,711 }, /* ; 00 (320x200,320x400,640x200,640x400) */ {1368,976,729,688 }, /* ; 01 (320x350,640x350) */ @@ -2430,7 +2401,7 @@ XGI330_LVDSDataStruct XGI_LVDS1280x1024Des_2x75[]= /* [ycchen] 02/18/03 Set DE {0,1296,0,1025 } /* ; 07 (1280x1024x75Hz) */ }; -XGI330_LCDDataDesStruct2 XGI_LVDSNoScalingDesDatax75[]= /* Scaling LCD 75Hz */ +struct XGI330_LCDDataDesStruct2 XGI_LVDSNoScalingDesDatax75[] = /* Scaling LCD 75Hz */ { { 0,648,448,405,96,2 }, /* ; 00 (320x200,320x400,640x200,640x400) */ { 0,648,448,355,96,2 }, /* ; 01 (320x350,640x350) */ @@ -2445,7 +2416,7 @@ XGI330_LCDDataDesStruct2 XGI_LVDSNoScalingDesDatax75[]= /* Scaling LCD 75Hz */ { 0,1328,0,771,112,6 } /* ; 0A (1280x768x75Hz) */ }; -XGI330_LVDSDataStruct XGI330_LVDS640x480Data_1[]= +struct XGI330_LVDSDataStruct XGI330_LVDS640x480Data_1[] = { {800, 449, 800, 449}, {800, 449, 800, 449}, @@ -2458,7 +2429,7 @@ XGI330_LVDSDataStruct XGI330_LVDS640x480Data_1[]= {1056, 628,1056, 628} }; -XGI330_CHTVDataStruct XGI_CHTVUNTSCData[]= +struct XGI330_CHTVDataStruct XGI_CHTVUNTSCData[] = { {840, 600, 840, 600}, {840, 600, 840, 600}, @@ -2468,7 +2439,7 @@ XGI330_CHTVDataStruct XGI_CHTVUNTSCData[]= {1064, 750,1064, 750} }; -XGI330_CHTVDataStruct XGI_CHTVONTSCData[]= +struct XGI330_CHTVDataStruct XGI_CHTVONTSCData[] = { {840, 525, 840, 525}, {840, 525, 840, 525}, @@ -2478,7 +2449,7 @@ XGI330_CHTVDataStruct XGI_CHTVONTSCData[]= {1040, 700,1040, 700} }; -XGI330_CHTVDataStruct XGI_CHTVUPALData[]= +struct XGI330_CHTVDataStruct XGI_CHTVUPALData[] = { {1008, 625,1008, 625}, {1008, 625,1008, 625}, @@ -2488,7 +2459,7 @@ XGI330_CHTVDataStruct XGI_CHTVUPALData[]= {936, 836, 936, 836} }; -XGI330_CHTVDataStruct XGI_CHTVOPALData[]= +struct XGI330_CHTVDataStruct XGI_CHTVOPALData[] = { {1008, 625,1008, 625}, {1008, 625,1008, 625}, @@ -2498,7 +2469,7 @@ XGI330_CHTVDataStruct XGI_CHTVOPALData[]= {960, 750, 960, 750} }; -XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_1_H[]= +struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_1_H[] = { /* CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ {{ 0x4B,0x27,0x8F,0x32,0x1B,0x00,0x45,0x00 }}, /* 00 (320x) */ @@ -2511,7 +2482,7 @@ XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_1_H[]= {{ 0xA3,0x7F,0x87,0x86,0x97,0x00,0x02,0x00 }} /* 07 (1024x) */ }; -XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_1_H[]= +struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_1_H[] = { /* CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ {{ 0x56,0x27,0x9A,0x30,0x1E,0x00,0x05,0x00 }}, /* 00 (320x) */ @@ -2525,7 +2496,7 @@ XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_1_H[]= {{ 0xCE,0x9F,0x92,0xA8,0x16,0x00,0x07,0x00 }} /* 08 (1280x) */ }; -XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_2_H[]= +struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_2_H[] = { /* CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ {{ 0x63,0x27,0x87,0x3B,0x8C,0x00,0x01,0x00 }}, /* 00 (320x) */ @@ -2538,7 +2509,7 @@ XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_2_H[]= {{ 0xA3,0x7F,0x87,0x86,0x97,0x00,0x02,0x00 }} /* 07 (1024x) */ }; -XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_2_H[]= +struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_2_H[] = { /* CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ {{ 0x7E,0x3B,0x9A,0x44,0x12,0x00,0x01,0x00 }}, /* 00 (320x) */ @@ -2552,7 +2523,7 @@ XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_2_H[]= {{ 0xCE,0x9F,0x92,0xA8,0x16,0x00,0x07,0x00 }} /* 08 (1280x) */ }; -XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11400x1050_1_H[]= +struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11400x1050_1_H[] = { /* CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ {{ 0x47,0x27,0x8B,0x2C,0x1A,0x00,0x05,0x00 }}, /* 00 (320x) */ {{ 0x47,0x27,0x8B,0x30,0x1E,0x00,0x05,0x00 }}, /* 01 (360x) */ @@ -2566,7 +2537,7 @@ XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11400x1050_1_H[]= {{ 0xCE,0xAE,0x92,0xB3,0x01,0x00,0x03,0x00 }} /* 09 (1400x) */ }; -XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11400x1050_2_H[]= +struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11400x1050_2_H[] = { /* CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ {{ 0x76,0x3F,0x83,0x45,0x8C,0x00,0x41,0x00 }}, /* 00 (320x) */ {{ 0x76,0x3F,0x83,0x45,0x8C,0x00,0x41,0x00 }}, /* 01 (360x) */ @@ -2580,7 +2551,7 @@ XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11400x1050_2_H[]= {{ 0xCE,0xAE,0x92,0xBC,0x0A,0x00,0x03,0x00 }} /* 09 (1400x) */ }; -XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11600x1200_1_H[]= +struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11600x1200_1_H[] = /* ;302lv channelA [ycchen] 12/05/02 LCDHT=2048 */ { /* ; CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ {{ 0x5B,0x27,0x9F,0x32,0x0A,0x00,0x01,0x00 }},/* 00 (320x) */ @@ -2596,7 +2567,7 @@ XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11600x1200_1_H[]= {{ 0xFB,0xC7,0x9F,0xC9,0x81,0x00,0x07,0x00 }} /* 0A (1600x) */ }; -XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_1_V[]= +struct XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_1_V[] = { /* CR06,CR07,CR10,CR11,CR15,CR16,SR0A+CR09(5->7) */ {{ 0x97,0x1F,0x60,0x87,0x5D,0x83,0x10 }}, /* 00 (x350) */ {{ 0xB4,0x1F,0x92,0x89,0x8F,0xB5,0x30 }}, /* 01 (x400) */ @@ -2605,7 +2576,7 @@ XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_1_V[]= {{ 0x24,0xF5,0x02,0x88,0xFF,0x25,0x90 }} /* 04 (x768) */ }; -XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_2_V[]= +struct XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_2_V[] = { /* CR06,CR07,CR10,CR11,CR15,CR16,SR0A */ {{ 0x24,0xBB,0x31,0x87,0x5D,0x25,0x30 }}, /* 00 (x350) */ {{ 0x24,0xBB,0x4A,0x80,0x8F,0x25,0x30 }}, /* 01 (x400) */ @@ -2614,7 +2585,7 @@ XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_2_V[]= {{ 0x24,0xF5,0x02,0x88,0xFF,0x25,0x90 }} /* 04 (x768) */ }; -XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_1_V[]= +struct XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_1_V[] = { /* CR06,CR07,CR10,CR11,CR15,CR16,SR0A */ {{ 0x86,0x1F,0x5E,0x82,0x5D,0x87,0x00 }}, /* 00 (x350) */ {{ 0xB8,0x1F,0x90,0x84,0x8F,0xB9,0x30 }}, /* 01 (x400) */ @@ -2624,7 +2595,7 @@ XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_1_V[]= {{ 0x28,0x5A,0x13,0x87,0xFF,0x29,0xA9 }} /* 05 (x1024) */ }; -XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_2_V[]= +struct XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_2_V[] = { /* CR06,CR07,CR10,CR11,CR15,CR16,SR0A */ {{ 0x28,0xD2,0xAF,0x83,0xAE,0xD8,0xA1 }}, /* 00 (x350) */ {{ 0x28,0xD2,0xC8,0x8C,0xC7,0xF2,0x81 }}, /* 01 (x400) */ @@ -2634,7 +2605,7 @@ XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_2_V[]= {{ 0x28,0x5A,0x13,0x87,0xFF,0x29,0xA9 }} /* 05 (x1024) */ }; -XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11400x1050_1_V[]= +struct XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11400x1050_1_V[] = { /* CR06,CR07,CR10,CR11,CR15,CR16,SR0A */ {{ 0x6C,0x1F,0x60,0x84,0x5D,0x6D,0x10 }}, /* 00 (x350) */ {{ 0x9E,0x1F,0x93,0x86,0x8F,0x9F,0x30 }}, /* 01 (x400) */ @@ -2645,7 +2616,7 @@ XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11400x1050_1_V[]= {{ 0x28,0x10,0x1A,0x80,0x19,0x29,0x0F }} /* 06 (x1050) */ }; -XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11400x1050_2_V[]= +struct XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11400x1050_2_V[] = { /* CR06,CR07,CR10,CR11,CR15,CR16,SR0A */ {{ 0x28,0x92,0xB6,0x83,0xB5,0xCF,0x81 }}, /* 00 (x350) */ {{ 0x28,0x92,0xD5,0x82,0xD4,0xEE,0x81 }}, /* 01 (x400) */ @@ -2656,7 +2627,7 @@ XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11400x1050_2_V[]= {{ 0x28,0x10,0x1A,0x87,0x19,0x29,0x8F }} /* 06 (x1050) */ }; -XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11600x1200_1_V[]= +struct XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11600x1200_1_V[] = { /* CR06,CR07,CR10,CR11,CR15,CR16,SR0A+CR09(5->7) */ {{ 0xd4,0x1F,0x81,0x84,0x5D,0xd5,0x10 }}, /* 00 (x350) */ @@ -2669,7 +2640,7 @@ XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11600x1200_1_V[]= {{ 0x26,0x11,0xd3,0x86,0xaF,0x27,0x3f }} /* 07 (x1200) */ }; -XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_1_Hx75[]= +struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_1_Hx75[] = { /* CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ {{ 0x4B,0x27,0x8F,0x32,0x1B,0x00,0x45,0x00 }},/* ; 00 (320x) */ {{ 0x4B,0x27,0x8F,0x2B,0x03,0x00,0x44,0x00 }},/* ; 01 (360x) */ @@ -2681,7 +2652,7 @@ XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_1_Hx75[]= {{ 0x9F,0x7F,0x83,0x85,0x91,0x00,0x02,0x00 }} /* ; 07 (1024x) */ }; -XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_1_Vx75[]= +struct XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_1_Vx75[] = { /* CR06,CR07,CR10,CR11,CR15,CR16,SR0A+CR09(5->7) */ {{ 0x97,0x1F,0x60,0x87,0x5D,0x83,0x10 }},/* ; 00 (x350) */ {{ 0xB4,0x1F,0x92,0x89,0x8F,0xB5,0x30 }},/* ; 01 (x400) */ @@ -2690,7 +2661,7 @@ XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_1_Vx75[]= {{ 0x1E,0xF5,0x00,0x83,0xFF,0x1F,0x90 }} /* ; 04 (x768) */ }; -XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_2_Hx75[]= +struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_2_Hx75[] = { /* CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ {{ 0x63,0x27,0x87,0x3B,0x8C,0x00,0x01,0x00 }},/* ; 00 (320x) */ {{ 0x63,0x27,0x87,0x3B,0x8C,0x00,0x01,0x00 }},/* ; 01 (360x) */ @@ -2702,7 +2673,7 @@ XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_2_Hx75[]= {{ 0xA3,0x7F,0x87,0x86,0x97,0x00,0x02,0x00 }} /* ; 07 (1024x) */ }; -XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_2_Vx75[]= +struct XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_2_Vx75[] = { /* CR06,CR07,CR10,CR11,CR15,CR16,SR0A */ {{ 0x24,0xBB,0x31,0x87,0x5D,0x25,0x30 }},/* ; 00 (x350) */ {{ 0x24,0xBB,0x4A,0x80,0x8F,0x25,0x30 }},/* ; 01 (x400) */ @@ -2711,7 +2682,7 @@ XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11024x768_2_Vx75[]= {{ 0x24,0xF5,0x02,0x88,0xFF,0x25,0x90 }} /* ; 04 (x768) */ }; -XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_1_Hx75[]= +struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_1_Hx75[] = { /* CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ {{ 0x56,0x27,0x9A,0x30,0x1E,0x00,0x05,0x00 }},/* ; 00 (320x) */ {{ 0x56,0x27,0x9A,0x30,0x1E,0x00,0x05,0x00 }},/* ; 01 (360x) */ @@ -2724,7 +2695,7 @@ XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_1_Hx75[]= {{ 0xCE,0x9F,0x92,0xA5,0x17,0x00,0x07,0x00 }} /* ; 08 (1280x) */ }; -XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_1_Vx75[]= +struct XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_1_Vx75[] = { /* CR06,CR07,CR10,CR11,CR15,CR16,SR0A */ {{ 0x86,0xD1,0xBC,0x80,0xBB,0xE5,0x00 }},/* ; 00 (x350) */ {{ 0xB8,0x1F,0x90,0x84,0x8F,0xB9,0x30 }},/* ; 01 (x400) */ @@ -2734,7 +2705,7 @@ XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_1_Vx75[]= {{ 0x28,0x5A,0x13,0x87,0xFF,0x29,0xA9 }} /* ; 05 (x1024) */ }; -XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_2_Hx75[]= +struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_2_Hx75[] = { /* CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ {{ 0x7E,0x3B,0x9A,0x44,0x12,0x00,0x01,0x00 }},/* ; 00 (320x) */ @@ -2748,7 +2719,7 @@ XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11280x1024_2_Hx75[]= {{ 0xCE,0x9F,0x92,0xA8,0x16,0x00,0x07,0x00 }} /* ; 08 (1280x) */ }; -XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_2_Vx75[]= +struct XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_2_Vx75[] = { /* CR06,CR07,CR10,CR11,CR15,CR16,SR0A */ {{ 0x28,0xD2,0xAF,0x83,0xAE,0xD8,0xA1 }},/* ; 00 (x350) */ @@ -2759,7 +2730,7 @@ XGI_LVDSCRT1VDataStruct XGI_LVDSCRT11280x1024_2_Vx75[]= {{ 0x28,0x5A,0x13,0x87,0xFF,0x29,0xA9 }} /* ; 05 (x1024) */ }; -XGI_LVDSCRT1DataStruct XGI_CHTVCRT1UNTSC[]= +struct XGI_LVDSCRT1DataStruct XGI_CHTVCRT1UNTSC[] = { {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e, 0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,0x00 }}, @@ -2775,7 +2746,7 @@ XGI_LVDSCRT1DataStruct XGI_CHTVCRT1UNTSC[]= 0x90,0x8c,0x57,0xed,0x20,0x00,0x06,0x01 }} }; -XGI_LVDSCRT1DataStruct XGI_CHTVCRT1ONTSC[]= +struct XGI_LVDSCRT1DataStruct XGI_CHTVCRT1ONTSC[] = { {{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e, 0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,0x00 }}, @@ -2791,7 +2762,7 @@ XGI_LVDSCRT1DataStruct XGI_CHTVCRT1ONTSC[]= 0x7f,0x86,0x57,0xbb,0x00,0x00,0x06,0x01 }} }; -XGI_LVDSCRT1DataStruct XGI_CHTVCRT1UPAL[]= +struct XGI_LVDSCRT1DataStruct XGI_CHTVCRT1UPAL[] = { {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,0x00 }}, @@ -2807,7 +2778,7 @@ XGI_LVDSCRT1DataStruct XGI_CHTVCRT1UPAL[]= 0xc8,0x8c,0x57,0xe9,0x20,0x00,0x05,0x01 }} }; -XGI_LVDSCRT1DataStruct XGI_CHTVCRT1OPAL[]= +struct XGI_LVDSCRT1DataStruct XGI_CHTVCRT1OPAL[] = { {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e, 0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,0x00 }}, @@ -2824,7 +2795,7 @@ XGI_LVDSCRT1DataStruct XGI_CHTVCRT1OPAL[]= }; /*add for new UNIVGABIOS*/ -XGI330_LCDDataTablStruct XGI_LCDDataTable[]= +struct XGI330_LCDDataTablStruct XGI_LCDDataTable[] = { {Panel1024x768,0x0019,0x0001,0}, /* XGI_ExtLCD1024x768Data */ {Panel1024x768,0x0019,0x0000,1}, /* XGI_StLCD1024x768Data */ @@ -2848,7 +2819,7 @@ XGI330_LCDDataTablStruct XGI_LCDDataTable[]= {0xFF,0x0000,0x0000,0} /* End of table */ }; -XGI330_LCDDataTablStruct XGI_LCDDesDataTable[]= +struct XGI330_LCDDataTablStruct XGI_LCDDesDataTable[] = { {Panel1024x768,0x0019,0x0001,0}, /* XGI_ExtLCDDes1024x768Data */ {Panel1024x768,0x0019,0x0000,1}, /* XGI_StLCDDes1024x768Data */ @@ -2873,7 +2844,7 @@ XGI330_LCDDataTablStruct XGI_LCDDesDataTable[]= {0xFF,0x0000,0x0000,0} }; -XGI330_LCDDataTablStruct XGI_EPLLCDCRT1Ptr_H[]= +struct XGI330_LCDDataTablStruct XGI_EPLLCDCRT1Ptr_H[] = { {Panel1024x768,0x0018,0x0000,0}, /* XGI_LVDSCRT11024x768_1_H */ {Panel1024x768,0x0018,0x0010,1}, /* XGI_LVDSCRT11024x768_2_H */ @@ -2889,7 +2860,7 @@ XGI330_LCDDataTablStruct XGI_EPLLCDCRT1Ptr_H[]= {0xFF,0x0000,0x0000,0} }; -XGI330_LCDDataTablStruct XGI_EPLLCDCRT1Ptr_V[]= +struct XGI330_LCDDataTablStruct XGI_EPLLCDCRT1Ptr_V[] = { {Panel1024x768,0x0018,0x0000,0}, /* XGI_LVDSCRT11024x768_1_V */ {Panel1024x768,0x0018,0x0010,1}, /* XGI_LVDSCRT11024x768_2_V */ @@ -2905,7 +2876,7 @@ XGI330_LCDDataTablStruct XGI_EPLLCDCRT1Ptr_V[]= {0xFF,0x0000,0x0000,0} }; -XGI330_LCDDataTablStruct XGI_EPLLCDDataPtr[]= +struct XGI330_LCDDataTablStruct XGI_EPLLCDDataPtr[] = { {Panel1024x768,0x0018,0x0000,0}, /* XGI_LVDS1024x768Data_1 */ {Panel1024x768,0x0018,0x0010,1}, /* XGI_LVDS1024x768Data_2 */ @@ -2923,7 +2894,7 @@ XGI330_LCDDataTablStruct XGI_EPLLCDDataPtr[]= {0xFF,0x0000,0x0000,0} }; -XGI330_LCDDataTablStruct XGI_EPLLCDDesDataPtr[]= +struct XGI330_LCDDataTablStruct XGI_EPLLCDDesDataPtr[] = { {Panel1024x768,0x0018,0x0000,0}, /* XGI_LVDS1024x768Des_1 */ {Panel1024x768,0x0618,0x0410,1}, /* XGI_LVDS1024x768Des_3 */ @@ -2943,14 +2914,14 @@ XGI330_LCDDataTablStruct XGI_EPLLCDDesDataPtr[]= {0xFF,0x0000,0x0000,0} }; -XGI330_LCDDataTablStruct XGI_EPLCHLCDRegPtr[]= +struct XGI330_LCDDataTablStruct XGI_EPLCHLCDRegPtr[] = { {Panel1024x768,0x0000,0x0000,0}, /* XGI_CH7017LV1024x768 */ {Panel1400x1050,0x0000,0x0000,1}, /* XGI_CH7017LV1400x1050 */ {0xFF,0x0000,0x0000,0} }; -XGI330_TVDataTablStruct XGI_TVDataTable[]= +struct XGI330_TVDataTablStruct XGI_TVDataTable[] = { {0x09E1,0x0001,0}, /* XGI_ExtPALData */ {0x09E1,0x0000,1}, /* XGI_ExtNTSCData */ @@ -2968,7 +2939,7 @@ XGI330_TVDataTablStruct XGI_TVDataTable[]= {0xffff,0x0000,12} /* END */ }; -USHORT TVLenList[]= +unsigned short TVLenList[] = { LVDSCRT1Len_H, LVDSCRT1Len_V, @@ -2981,7 +2952,7 @@ USHORT TVLenList[]= } ; /* Chrontel 7017 TV CRT1 Timing List */ -XGI330_TVDataTablStruct XGI_EPLCHTVCRT1Ptr[]= +struct XGI330_TVDataTablStruct XGI_EPLCHTVCRT1Ptr[] = { {0x0011,0x0000,0}, /* XGI_CHTVCRT1UNTSC */ {0x0011,0x0010,1}, /* XGI_CHTVCRT1ONTSC */ @@ -2991,7 +2962,7 @@ XGI330_TVDataTablStruct XGI_EPLCHTVCRT1Ptr[]= }; /* ;;Chrontel 7017 TV Timing List */ -XGI330_TVDataTablStruct XGI_EPLCHTVDataPtr[]= +struct XGI330_TVDataTablStruct XGI_EPLCHTVDataPtr[] = { {0x0011,0x0000,0}, /* XGI_CHTVUNTSCData */ {0x0011,0x0010,1}, /* XGI_CHTVONTSCData */ @@ -3001,7 +2972,7 @@ XGI330_TVDataTablStruct XGI_EPLCHTVDataPtr[]= }; /* ;;Chrontel 7017 TV Reg. List */ -XGI330_TVDataTablStruct XGI_EPLCHTVRegPtr[]= +struct XGI330_TVDataTablStruct XGI_EPLCHTVRegPtr[] = { {0x0011,0x0000,0}, /* XGI_CHTVRegUNTSC */ {0x0011,0x0010,1}, /* XGI_CHTVRegONTSC */ @@ -3010,7 +2981,7 @@ XGI330_TVDataTablStruct XGI_EPLCHTVRegPtr[]= {0xFFFF,0x0000,4} }; -USHORT LCDLenList[]= +unsigned short LCDLenList[] = { LVDSCRT1Len_H, LVDSCRT1Len_V, @@ -3024,7 +2995,7 @@ USHORT LCDLenList[]= 0 } ; -XGI330_LCDCapStruct XGI660_LCDDLCapList[]= /* 660, Dual link */ +struct XGI330_LCDCapStruct XGI660_LCDDLCapList[] = /* 660, Dual link */ { /* LCDCap1024x768 */ {Panel1024x768, DefaultLCDCap, 0, 0x014, 0x88, 0x06, VCLK65, @@ -3056,7 +3027,7 @@ XGI330_LCDCapStruct XGI660_LCDDLCapList[]= /* 660, Dual link */ 0x30, 0x10, 0x5A, 0x10, 0x10, 0x0A, 0xC0, 0x28, 0x10} }; -XGI330_LCDCapStruct XGI_LCDDLCapList[]= /* Dual link only */ +struct XGI330_LCDCapStruct XGI_LCDDLCapList[] = /* Dual link only */ { /* LCDCap1024x768 */ {Panel1024x768, DefaultLCDCap, 0, 0x012, 0x88, 0x06, VCLK65, @@ -3088,7 +3059,7 @@ XGI330_LCDCapStruct XGI_LCDDLCapList[]= /* Dual link only */ 0x30, 0x10, 0x5A, 0x10, 0x10, 0x0A, 0xC0, 0x28, 0x10} }; -XGI330_LCDCapStruct XGI660_LCDCapList[]= +struct XGI330_LCDCapStruct XGI660_LCDCapList[] = { /* LCDCap1024x768 */ {Panel1024x768, DefaultLCDCap, 0, 0x014, 0x88, 0x06, VCLK65, @@ -3120,7 +3091,7 @@ XGI330_LCDCapStruct XGI660_LCDCapList[]= 0x30, 0x10, 0x5A, 0x10, 0x10, 0x0A, 0xC0, 0x28, 0x10} }; -XGI330_LCDCapStruct XGI_LCDCapList[]= +struct XGI330_LCDCapStruct XGI_LCDCapList[] = { /* LCDCap1024x768 */ {Panel1024x768, DefaultLCDCap, 0, 0x012, 0x88, 0x06, VCLK65, @@ -3152,7 +3123,7 @@ XGI330_LCDCapStruct XGI_LCDCapList[]= 0x30, 0x10, 0x5A, 0x10, 0x10, 0x0A, 0xC0, 0x28, 0x10} }; -XGI21_LVDSCapStruct XGI21_LCDCapList[]= +struct XGI21_LVDSCapStruct XGI21_LCDCapList[] = { {DisableLCD24bpp + LCDPolarity, 2160,1250,1600,1200, 64, 1, 192, 3, @@ -3181,7 +3152,7 @@ XGI21_LVDSCapStruct XGI21_LCDCapList[]= }; -XGI_Ext2Struct XGI330_RefIndex[]= +struct XGI_Ext2Struct XGI330_RefIndex[] = { {Support32Bpp + SupportAllCRT2 + SyncPN, RES320x200, VCLK25_175, 0x00,0x10,0x59, 320, 200},/* 00 */ {Support32Bpp + SupportAllCRT2 + SyncPN, RES320x200, VCLK25_175, 0x00,0x10,0x00, 320, 400},/* 01 */ @@ -3260,7 +3231,7 @@ XGI_Ext2Struct XGI330_RefIndex[]= -XGI330_VCLKDataStruct XGI330_VCLKData[]= +struct XGI330_VCLKDataStruct XGI330_VCLKData[] = { { 0x1b,0xe1, 25}, /* 0x0 */ { 0x4e,0xe4, 28}, /* 0x1 */ @@ -3344,7 +3315,7 @@ XGI330_VCLKDataStruct XGI330_VCLKData[]= { 0x3b,0x61,108} /* 0x4f */ }; -XGI_VBVCLKDataStruct XGI330_VBVCLKData[]= +struct XGI_VBVCLKDataStruct XGI330_VBVCLKData[] = { { 0x1b,0xe1, 25}, /* 0x0 */ { 0x4e,0xe4, 28}, /* 0x1 */ @@ -3422,9 +3393,11 @@ XGI_VBVCLKDataStruct XGI330_VBVCLKData[]= { 0x70,0x44,108}, /* 0x49 chiawen for 1400x1050*/ }; -UCHAR XGI330_ScreenOffset[]={ 0x14,0x19,0x20,0x28,0x32,0x40,0x50,0x64,0x78,0x80,0x2d,0x35,0x57,0x48 }; +unsigned char XGI330_ScreenOffset[] = { 0x14, 0x19, 0x20, 0x28, 0x32, 0x40, + 0x50, 0x64, 0x78, 0x80, 0x2d, 0x35, + 0x57, 0x48}; -XGI_StResInfoStruct XGI330_StResInfo[]= +struct XGI_StResInfoStruct XGI330_StResInfo[] = { { 640,400}, { 640,350}, @@ -3433,7 +3406,7 @@ XGI_StResInfoStruct XGI330_StResInfo[]= { 640,480} }; -XGI_ModeResInfoStruct XGI330_ModeResInfo[]= +struct XGI_ModeResInfoStruct XGI330_ModeResInfo[] = { { 320, 200, 8, 8}, { 320, 240, 8, 8}, @@ -3460,10 +3433,10 @@ XGI_ModeResInfoStruct XGI330_ModeResInfo[]= { 1152, 864, 8,16} }; -UCHAR XGI330_OutputSelect =0x40; -UCHAR XGI330_SoftSetting = 0x30; -UCHAR XGI330_SR07=0x18; -UCHAR XGI330New_SR15[8][8]={ +unsigned char XGI330_OutputSelect = 0x40; +unsigned char XGI330_SoftSetting = 0x30; +unsigned char XGI330_SR07 = 0x18; +unsigned char XGI330New_SR15[8][8] = { {0x0,0x4,0x60,0x60}, {0xf,0xf,0xf,0xf}, {0xba,0xba,0xba,0xba}, @@ -3474,7 +3447,7 @@ UCHAR XGI330New_SR15[8][8]={ {0x0,0xa5,0xfb,0xf6} }; -UCHAR XGI330New_CR40[5][8]={ +unsigned char XGI330New_CR40[5][8] = { {0x77,0x77,0x44,0x44}, {0x77,0x77,0x44,0x44}, {0x0,0x0,0x0,0x0}, @@ -3482,63 +3455,63 @@ UCHAR XGI330New_CR40[5][8]={ {0x0,0x0,0xf0,0xf8} }; -UCHAR XGI330_CR49[]={0xaa,0x88}; -UCHAR XGI330_SR1F=0x0; -UCHAR XGI330_SR21=0xa3; -UCHAR XGI330_650_SR21=0xa7; -UCHAR XGI330_SR22=0xfb; -UCHAR XGI330_SR23=0xf6; -UCHAR XGI330_SR24=0xd; - -UCHAR XGI660_SR21=0xa3;/* 2003.0312 */ -UCHAR XGI660_SR22=0xf3;/* 2003.0312 */ - -UCHAR XGI330_LVDS_SR32=0x00; /* ynlai for 650 LVDS */ -UCHAR XGI330_LVDS_SR33=0x00; /* chiawen for 650 LVDS */ -UCHAR XGI330_650_SR31=0x40; -UCHAR XGI330_650_SR33=0x04; -UCHAR XGI330_CRT2Data_1_2 = 0x0; -UCHAR XGI330_CRT2Data_4_D = 0x0; -UCHAR XGI330_CRT2Data_4_E = 0x0; -UCHAR XGI330_CRT2Data_4_10 = 0x80; -USHORT XGI330_RGBSenseData = 0xd1; -USHORT XGI330_VideoSenseData = 0xb9; -USHORT XGI330_YCSenseData = 0xb3; -USHORT XGI330_RGBSenseData2 = 0x0190; /*301b*/ -USHORT XGI330_VideoSenseData2 = 0x0110; -USHORT XGI330_YCSenseData2 = 0x016B; -UCHAR XGI330_NTSCPhase[] = {0x21,0xed,0x8a,0x8}; -UCHAR XGI330_PALPhase[] = {0x2a,0x5,0xd3,0x0}; -UCHAR XGI330_NTSCPhase2[] = {0x21,0xF0,0x7B,0xD6};/*301b*/ -UCHAR XGI330_PALPhase2[] = {0x2a,0x09,0x86,0xe9}; -UCHAR XGI330_PALMPhase[] = {0x21,0xE4,0x2E,0x9B}; /*palmn*/ -UCHAR XGI330_PALNPhase[] = {0x21,0xF4,0x3E,0xBA}; -UCHAR XG40_I2CDefinition = 0x00 ; -UCHAR XG20_CR97 = 0x10 ; - -UCHAR XG21_DVOSetting = 0x00 ; -UCHAR XG21_CR2E = 0x00 ; -UCHAR XG21_CR2F = 0x00 ; -UCHAR XG21_CR46 = 0x00 ; -UCHAR XG21_CR47 = 0x00 ; - -UCHAR XG27_CR97 = 0xC1 ; -UCHAR XG27_SR36 = 0x30 ; -UCHAR XG27_CR8F = 0x0C ; -UCHAR XG27_CRD0[] = {0,0,0,0,0,0,0,0x82,0x00,0x66,0x01,0x00} ; -UCHAR XG27_CRDE[] = {0,0} ; -UCHAR XG27_SR40 = 0x04 ; -UCHAR XG27_SR41 = 0x00 ; - -UCHAR XGI330_CHTVVCLKUNTSC[]={0x00 }; - -UCHAR XGI330_CHTVVCLKONTSC[]={0x00 }; - -UCHAR XGI330_CHTVVCLKUPAL[]={0x00 }; - -UCHAR XGI330_CHTVVCLKOPAL[]={0x00 }; - -UCHAR XGI7007_CHTVVCLKUNTSC[]={CH7007TVVCLK30_2, +unsigned char XGI330_CR49[] = {0xaa, 0x88}; +unsigned char XGI330_SR1F = 0x0; +unsigned char XGI330_SR21 = 0xa3; +unsigned char XGI330_650_SR21 = 0xa7; +unsigned char XGI330_SR22 = 0xfb; +unsigned char XGI330_SR23 = 0xf6; +unsigned char XGI330_SR24 = 0xd; + +unsigned char XGI660_SR21 = 0xa3;/* 2003.0312 */ +unsigned char XGI660_SR22 = 0xf3;/* 2003.0312 */ + +unsigned char XGI330_LVDS_SR32 = 0x00; /* ynlai for 650 LVDS */ +unsigned char XGI330_LVDS_SR33 = 0x00; /* chiawen for 650 LVDS */ +unsigned char XGI330_650_SR31 = 0x40; +unsigned char XGI330_650_SR33 = 0x04; +unsigned char XGI330_CRT2Data_1_2 = 0x0; +unsigned char XGI330_CRT2Data_4_D = 0x0; +unsigned char XGI330_CRT2Data_4_E = 0x0; +unsigned char XGI330_CRT2Data_4_10 = 0x80; +unsigned short XGI330_RGBSenseData = 0xd1; +unsigned short XGI330_VideoSenseData = 0xb9; +unsigned short XGI330_YCSenseData = 0xb3; +unsigned short XGI330_RGBSenseData2 = 0x0190; /*301b*/ +unsigned short XGI330_VideoSenseData2 = 0x0110; +unsigned short XGI330_YCSenseData2 = 0x016B; +unsigned char XGI330_NTSCPhase[] = {0x21, 0xed, 0x8a, 0x8}; +unsigned char XGI330_PALPhase[] = {0x2a, 0x5, 0xd3, 0x0}; +unsigned char XGI330_NTSCPhase2[] = {0x21, 0xF0, 0x7B, 0xD6};/*301b*/ +unsigned char XGI330_PALPhase2[] = {0x2a, 0x09, 0x86, 0xe9}; +unsigned char XGI330_PALMPhase[] = {0x21, 0xE4, 0x2E, 0x9B}; /*palmn*/ +unsigned char XGI330_PALNPhase[] = {0x21, 0xF4, 0x3E, 0xBA}; +unsigned char XG40_I2CDefinition = 0x00 ; +unsigned char XG20_CR97 = 0x10 ; + +unsigned char XG21_DVOSetting = 0x00 ; +unsigned char XG21_CR2E = 0x00 ; +unsigned char XG21_CR2F = 0x00 ; +unsigned char XG21_CR46 = 0x00 ; +unsigned char XG21_CR47 = 0x00 ; + +unsigned char XG27_CR97 = 0xC1 ; +unsigned char XG27_SR36 = 0x30 ; +unsigned char XG27_CR8F = 0x0C ; +unsigned char XG27_CRD0[] = {0, 0, 0, 0, 0, 0, 0, 0x82, 0x00, 0x66, 0x01, 0x00}; +unsigned char XG27_CRDE[] = {0, 0}; +unsigned char XG27_SR40 = 0x04 ; +unsigned char XG27_SR41 = 0x00 ; + +unsigned char XGI330_CHTVVCLKUNTSC[] = {0x00}; + +unsigned char XGI330_CHTVVCLKONTSC[] = {0x00}; + +unsigned char XGI330_CHTVVCLKUPAL[] = {0x00}; + +unsigned char XGI330_CHTVVCLKOPAL[] = {0x00}; + +unsigned char XGI7007_CHTVVCLKUNTSC[] = {CH7007TVVCLK30_2, CH7007TVVCLK30_2, CH7007TVVCLK30_2, CH7007TVVCLK30_2, @@ -3546,7 +3519,7 @@ UCHAR XGI7007_CHTVVCLKUNTSC[]={CH7007TVVCLK30_2, CH7007TVVCLK47_8 }; -UCHAR XGI7007_CHTVVCLKONTSC[]={CH7007TVVCLK26_4, +unsigned char XGI7007_CHTVVCLKONTSC[] = {CH7007TVVCLK26_4, CH7007TVVCLK26_4, CH7007TVVCLK26_4, CH7007TVVCLK26_4, @@ -3554,7 +3527,7 @@ UCHAR XGI7007_CHTVVCLKONTSC[]={CH7007TVVCLK26_4, CH7007TVVCLK43_6 }; -UCHAR XGI7007_CHTVVCLKUPAL[]={CH7007TVVCLK31_5, +unsigned char XGI7007_CHTVVCLKUPAL[] = {CH7007TVVCLK31_5, CH7007TVVCLK31_5, CH7007TVVCLK31_5, CH7007TVVCLK31_5, @@ -3562,7 +3535,7 @@ UCHAR XGI7007_CHTVVCLKUPAL[]={CH7007TVVCLK31_5, CH7007TVVCLK39 }; -UCHAR XGI7007_CHTVVCLKOPAL[]={CH7007TVVCLK31_5, +unsigned char XGI7007_CHTVVCLKOPAL[] = {CH7007TVVCLK31_5, CH7007TVVCLK31_5, CH7007TVVCLK31_5, CH7007TVVCLK31_5, @@ -3570,7 +3543,7 @@ UCHAR XGI7007_CHTVVCLKOPAL[]={CH7007TVVCLK31_5, CH7007TVVCLK36 }; -XGI330_VCLKDataStruct XGI_CH7007VCLKData[]= +struct XGI330_VCLKDataStruct XGI_CH7007VCLKData[] = { { 0x60,0x36,30}, /* 0 30.2 MHZ */ { 0x40,0x4A,28}, /* 1 28.19 MHZ */ @@ -3585,7 +3558,7 @@ XGI330_VCLKDataStruct XGI_CH7007VCLKData[]= { 0xFF,0x00,0 } /* End mark */ }; -XGI330_VCLKDataStruct XGI_VCLKData[]= +struct XGI330_VCLKDataStruct XGI_VCLKData[] = { /* SR2B,SR2C,SR2D */ { 0x1B,0xE1,25 },/* 00 (25.175MHz) */ @@ -3786,7 +3759,7 @@ XGI330_VCLKDataStruct XGI_VCLKData[]= { 0xFF,0x00,0 }/* End mark */ } ; -XGI330_VCLKDataStruct XGI_VBVCLKData[]= +struct XGI330_VCLKDataStruct XGI_VBVCLKData[] = { { 0x1B,0xE1,25 },/* 00 (25.175MHz) */ @@ -3987,7 +3960,7 @@ XGI330_VCLKDataStruct XGI_VBVCLKData[]= { 0xFF,0x00,0 } /* End mark */ }; -UCHAR XGI660_TVDelayList[]= +unsigned char XGI660_TVDelayList[] = { 0x44, /* ; 0 ExtNTSCDelay */ 0x44, /* ; 1 StNTSCDelay */ @@ -4003,7 +3976,7 @@ UCHAR XGI660_TVDelayList[]= 0x44 /* ; B StYPbPrDealy(750p) */ }; -UCHAR XGI660_TVDelayList2[]= +unsigned char XGI660_TVDelayList2[] = { 0x44, /* ; 0 ExtNTSCDelay */ 0x44, /* ; 1 StNTSCDelay */ @@ -4019,7 +3992,7 @@ UCHAR XGI660_TVDelayList2[]= 0x44 /* ; B StYPbPrDealy(750p) */ }; -UCHAR XGI301TVDelayList[]= +unsigned char XGI301TVDelayList[] = { 0x22, /* ; 0 ExtNTSCDelay */ 0x22, /* ; 1 StNTSCDelay */ @@ -4035,7 +4008,7 @@ UCHAR XGI301TVDelayList[]= 0x22 /* B StYPbPrDealy(750p) */ }; -UCHAR XGI301TVDelayList2[]= +unsigned char XGI301TVDelayList2[] = { 0x22, /* ; 0 ExtNTSCDelay */ 0x22, /* ; 1 StNTSCDelay */ @@ -4052,7 +4025,7 @@ UCHAR XGI301TVDelayList2[]= }; -UCHAR TVAntiFlickList[]= +unsigned char TVAntiFlickList[] = {/* NTSCAntiFlicker */ 0x04, /* ; 0 Adaptive */ 0x00, /* ; 1 new anti-flicker ? */ @@ -4065,7 +4038,7 @@ UCHAR TVAntiFlickList[]= }; -UCHAR TVEdgeList[]= +unsigned char TVEdgeList[] = { 0x00, /* ; 0 NTSC No Edge enhance */ 0x04, /* ; 1 NTSC Adaptive Edge enhance */ @@ -4075,7 +4048,7 @@ UCHAR TVEdgeList[]= 0x00 /* ; 1 HiTV */ }; -ULONG TVPhaseList[]= +unsigned long TVPhaseList[] = { 0x08BAED21, /* ; 0 NTSC phase */ 0x00E3052A, /* ; 1 PAL phase */ 0x9B2EE421, /* ; 2 PAL-M phase */ @@ -4092,7 +4065,7 @@ ULONG TVPhaseList[]= 0xE00A831E /* ; D PAL-M 1024x768 */ }; -UCHAR NTSCYFilter1[]= +unsigned char NTSCYFilter1[] = { 0x00,0xF4,0x10,0x38 ,/* 0 : 320x text mode */ 0x00,0xF4,0x10,0x38 ,/* 1 : 360x text mode */ @@ -4103,7 +4076,7 @@ UCHAR NTSCYFilter1[]= 0xEB,0x15,0x25,0xF6 /* 6 : 800x gra. mode */ }; -UCHAR PALYFilter1[]= +unsigned char PALYFilter1[] = { 0x00,0xF4,0x10,0x38, /* 0 : 320x text mode */ 0x00,0xF4,0x10,0x38 ,/* 1 : 360x text mode */ @@ -4114,7 +4087,7 @@ UCHAR PALYFilter1[]= 0xFC,0xFB,0x14,0x2A /* 6 : 800x gra. mode */ }; -UCHAR PALMYFilter1[]= +unsigned char PALMYFilter1[] = { 0x00,0xF4,0x10,0x38, /* 0 : 320x text mode */ 0x00,0xF4,0x10,0x38, /* 1 : 360x text mode */ @@ -4126,7 +4099,7 @@ UCHAR PALMYFilter1[]= 0xFF,0xFF,0xFF,0xFF /* End of Table */ }; -UCHAR PALNYFilter1[]= +unsigned char PALNYFilter1[] = { 0x00,0xF4,0x10,0x38, /* 0 : 320x text mode */ 0x00,0xF4,0x10,0x38, /* 1 : 360x text mode */ @@ -4138,7 +4111,7 @@ UCHAR PALNYFilter1[]= 0xFF,0xFF,0xFF,0xFF /* End of Table */ }; -UCHAR NTSCYFilter2[]= +unsigned char NTSCYFilter2[] = { 0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46, /* 0 : 320x text mode */ 0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C, /* 1 : 360x text mode */ @@ -4150,7 +4123,7 @@ UCHAR NTSCYFilter2[]= 0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28 /* 7 : 1024xgra. mode */ }; -UCHAR PALYFilter2[]= +unsigned char PALYFilter2[] = { 0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46, /* 0 : 320x text mode */ 0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C, /* 1 : 360x text mode */ @@ -4162,7 +4135,7 @@ UCHAR PALYFilter2[]= 0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28 /* 7 : 1024xgra. mode */ }; -UCHAR PALMYFilter2[]= +unsigned char PALMYFilter2[] = { 0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46, /* 0 : 320x text mode */ 0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C, /* 1 : 360x text mode */ @@ -4174,7 +4147,7 @@ UCHAR PALMYFilter2[]= 0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28 /* 7 : 1024xgra. mode */ }; -UCHAR PALNYFilter2[]= +unsigned char PALNYFilter2[] = { 0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46, /* 0 : 320x text mode */ 0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C, /* 1 : 360x text mode */ @@ -4186,14 +4159,14 @@ UCHAR PALNYFilter2[]= 0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28 /* 7 : 1024xgra. mode */ }; -UCHAR XGI_NTSC1024AdjTime[]= +unsigned char XGI_NTSC1024AdjTime[] = { 0xa7,0x07,0xf2,0x6e,0x17,0x8b,0x73,0x53, 0x13,0x40,0x34,0xF4,0x63,0xBB,0xCC,0x7A, 0x58,0xe4,0x73,0xd0,0x13 }; -XGI301C_Tap4TimingStruct HiTVTap4Timing[]= +struct XGI301C_Tap4TimingStruct HiTVTap4Timing[] = { {0,{ 0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F, /* ; C0-C7 */ @@ -4208,7 +4181,7 @@ XGI301C_Tap4TimingStruct HiTVTap4Timing[]= } }; -XGI301C_Tap4TimingStruct EnlargeTap4Timing[]= +struct XGI301C_Tap4TimingStruct EnlargeTap4Timing[] = { {0,{ 0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F, /* ; C0-C7 */ @@ -4223,7 +4196,7 @@ XGI301C_Tap4TimingStruct EnlargeTap4Timing[]= } }; -XGI301C_Tap4TimingStruct NoScaleTap4Timing[]= +struct XGI301C_Tap4TimingStruct NoScaleTap4Timing[] = { {0,{ 0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F, /* ; C0-C7 */ @@ -4238,7 +4211,7 @@ XGI301C_Tap4TimingStruct NoScaleTap4Timing[]= } }; -XGI301C_Tap4TimingStruct PALTap4Timing[]= +struct XGI301C_Tap4TimingStruct PALTap4Timing[] = { {600, { 0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E, /* ; C0-C7 */ @@ -4276,7 +4249,7 @@ XGI301C_Tap4TimingStruct PALTap4Timing[]= } }; -XGI301C_Tap4TimingStruct NTSCTap4Timing[]= +struct XGI301C_Tap4TimingStruct NTSCTap4Timing[] = { {480, { 0x04,0x1A,0x04,0x7E,0x03,0x1A,0x06,0x7D, /* ; C0-C7 */ @@ -4314,7 +4287,7 @@ XGI301C_Tap4TimingStruct NTSCTap4Timing[]= } }; -XGI301C_Tap4TimingStruct YPbPr525pTap4Timing[]= +struct XGI301C_Tap4TimingStruct YPbPr525pTap4Timing[] = { {480, { 0x04,0x1A,0x04,0x7E,0x03,0x1A,0x06,0x7D, /* ; C0-C7 */ @@ -4352,7 +4325,7 @@ XGI301C_Tap4TimingStruct YPbPr525pTap4Timing[]= } }; -XGI301C_Tap4TimingStruct YPbPr525iTap4Timing[]= +struct XGI301C_Tap4TimingStruct YPbPr525iTap4Timing[] = { {480, { 0x04,0x1A,0x04,0x7E,0x03,0x1A,0x06,0x7D, /* ; C0-C7 */ @@ -4390,7 +4363,7 @@ XGI301C_Tap4TimingStruct YPbPr525iTap4Timing[]= } }; -XGI301C_Tap4TimingStruct YPbPr750pTap4Timing[]= +struct XGI301C_Tap4TimingStruct YPbPr750pTap4Timing[] = { {0xFFFF, { 0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E, /* ; C0-C7 */ diff --git a/drivers/staging/xgifb/vb_util.c b/drivers/staging/xgifb/vb_util.c index 87531b49b739..2c40368ceee2 100644 --- a/drivers/staging/xgifb/vb_util.c +++ b/drivers/staging/xgifb/vb_util.c @@ -1,54 +1,25 @@ -#include "osdef.h" #include "vb_def.h" #include "vgatypes.h" #include "vb_struct.h" -#ifdef LINUX_KERNEL #include "XGIfb.h" #include <asm/io.h> #include <linux/types.h> -#endif - -#ifdef TC -#include <stdio.h> -#include <string.h> -#include <conio.h> -#include <dos.h> -#endif - -#ifdef WIN2000 -#include <dderror.h> -#include <devioctl.h> -#include <miniport.h> -#include <ntddvdeo.h> -#include <video.h> - -#include "xgiv.h" -#include "dd_i2c.h" -#include "tools.h" -#endif - -#ifdef LINUX_XF86 -#include "xf86.h" -#include "xf86PciInfo.h" -#include "xgi.h" -#include "xgi_regs.h" -#endif - - - - -void XGINew_SetReg1( ULONG , USHORT , USHORT ) ; -void XGINew_SetReg2( ULONG , USHORT , USHORT ) ; -void XGINew_SetReg3( ULONG , USHORT ) ; -void XGINew_SetReg4( ULONG , ULONG ) ; -UCHAR XGINew_GetReg1( ULONG , USHORT) ; -UCHAR XGINew_GetReg2( ULONG ) ; -ULONG XGINew_GetReg3( ULONG ) ; -void XGINew_ClearDAC( PUCHAR ) ; -void XGINew_SetRegANDOR(ULONG Port,USHORT Index,USHORT DataAND,USHORT DataOR); -void XGINew_SetRegOR(ULONG Port,USHORT Index,USHORT DataOR); -void XGINew_SetRegAND(ULONG Port,USHORT Index,USHORT DataAND); + +void XGINew_SetReg1(unsigned long,unsigned short,unsigned short); +void XGINew_SetReg2(unsigned long,unsigned short,unsigned short); +void XGINew_SetReg3(unsigned long,unsigned short); +void XGINew_SetReg4(unsigned long,unsigned long); +unsigned char XGINew_GetReg1(unsigned long, unsigned short); +unsigned char XGINew_GetReg2(unsigned long); +unsigned long XGINew_GetReg3(unsigned long); +void XGINew_ClearDAC(unsigned char *); +void XGINew_SetRegANDOR(unsigned long Port,unsigned short Index, + unsigned short DataAND,unsigned short DataOR); +void XGINew_SetRegOR(unsigned long Port,unsigned short Index, + unsigned short DataOR); +void XGINew_SetRegAND(unsigned long Port,unsigned short Index, + unsigned short DataAND); /* --------------------------------------------------------------------- */ @@ -57,15 +28,10 @@ void XGINew_SetRegAND(ULONG Port,USHORT Index,USHORT DataAND); /* Output : */ /* Description : SR CRTC GR */ /* --------------------------------------------------------------------- */ -void XGINew_SetReg1( ULONG port , USHORT index , USHORT data ) +void XGINew_SetReg1( unsigned long port , unsigned short index , unsigned short data ) { -#ifdef LINUX_XF86 - OutPortByte( ( PUCHAR )(ULONG)port , index ) ; - OutPortByte( ( PUCHAR )(ULONG)port + 1 , data ) ; -#else - OutPortByte( port , index ) ; - OutPortByte( port + 1 , data ) ; -#endif + outb(index, port); + outb(data, port + 1); } @@ -75,9 +41,9 @@ void XGINew_SetReg1( ULONG port , USHORT index , USHORT data ) /* Output : */ /* Description : AR( 3C0 ) */ /* --------------------------------------------------------------------- */ -/*void XGINew_SetReg2( ULONG port , USHORT index , USHORT data ) +/*void XGINew_SetReg2( unsigned long port , unsigned short index , unsigned short data ) { - InPortByte( ( PUCHAR )port + 0x3da - 0x3c0 ) ; + InPortByte((P unsigned char )port + 0x3da - 0x3c0) ; OutPortByte( XGINew_P3c0 , index ) ; OutPortByte( XGINew_P3c0 , data ) ; OutPortByte( XGINew_P3c0 , 0x20 ) ; @@ -90,9 +56,9 @@ void XGINew_SetReg1( ULONG port , USHORT index , USHORT data ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetReg3( ULONG port , USHORT data ) +void XGINew_SetReg3( unsigned long port , unsigned short data ) { - OutPortByte( port , data ) ; + outb(data, port); } @@ -102,9 +68,9 @@ void XGINew_SetReg3( ULONG port , USHORT data ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetReg4( ULONG port , ULONG data ) +void XGINew_SetReg4( unsigned long port , unsigned long data ) { - OutPortLong( port , data ) ; + outl(data, port); } @@ -114,18 +80,12 @@ void XGINew_SetReg4( ULONG port , ULONG data ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -UCHAR XGINew_GetReg1( ULONG port , USHORT index ) +unsigned char XGINew_GetReg1(unsigned long port, unsigned short index) { - UCHAR data ; - -#ifdef LINUX_XF86 - OutPortByte( ( PUCHAR )(ULONG)port , index ) ; - data = InPortByte( ( PUCHAR )(ULONG)port + 1 ) ; -#else - OutPortByte( port , index ) ; - data = InPortByte( port + 1 ) ; -#endif + unsigned char data ; + outb(index, port); + data = inb(port + 1) ; return( data ) ; } @@ -136,11 +96,11 @@ UCHAR XGINew_GetReg1( ULONG port , USHORT index ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -UCHAR XGINew_GetReg2( ULONG port ) +unsigned char XGINew_GetReg2(unsigned long port) { - UCHAR data ; + unsigned char data ; - data = InPortByte( port ) ; + data = inb(port) ; return( data ) ; } @@ -152,11 +112,11 @@ UCHAR XGINew_GetReg2( ULONG port ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -ULONG XGINew_GetReg3( ULONG port ) +unsigned long XGINew_GetReg3( unsigned long port ) { - ULONG data ; + unsigned long data ; - data = InPortLong( port ) ; + data = inl(port) ; return( data ) ; } @@ -169,9 +129,9 @@ ULONG XGINew_GetReg3( ULONG port ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetRegANDOR( ULONG Port , USHORT Index , USHORT DataAND , USHORT DataOR ) +void XGINew_SetRegANDOR( unsigned long Port , unsigned short Index , unsigned short DataAND , unsigned short DataOR ) { - USHORT temp ; + unsigned short temp ; temp = XGINew_GetReg1( Port , Index ) ; /* XGINew_Part1Port index 02 */ temp = ( temp & ( DataAND ) ) | DataOR ; @@ -185,9 +145,9 @@ void XGINew_SetRegANDOR( ULONG Port , USHORT Index , USHORT DataAND , USHORT Dat /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetRegAND(ULONG Port,USHORT Index,USHORT DataAND) +void XGINew_SetRegAND(unsigned long Port,unsigned short Index,unsigned short DataAND) { - USHORT temp ; + unsigned short temp ; temp = XGINew_GetReg1( Port , Index ) ; /* XGINew_Part1Port index 02 */ temp &= DataAND ; @@ -201,9 +161,9 @@ void XGINew_SetRegAND(ULONG Port,USHORT Index,USHORT DataAND) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void XGINew_SetRegOR( ULONG Port , USHORT Index , USHORT DataOR ) +void XGINew_SetRegOR( unsigned long Port , unsigned short Index , unsigned short DataOR ) { - USHORT temp ; + unsigned short temp ; temp = XGINew_GetReg1( Port , Index ) ; /* XGINew_Part1Port index 02 */ temp |= DataOR ; @@ -219,29 +179,14 @@ void XGINew_SetRegOR( ULONG Port , USHORT Index , USHORT DataOR ) /* --------------------------------------------------------------------- */ void NewDelaySeconds( int seconds ) { -#ifdef WIN2000 - int j ; -#endif int i ; for( i = 0 ; i < seconds ; i++ ) { -#ifdef TC - delay( 1000 ) ; -#endif - -#ifdef WIN2000 - for ( j = 0 ; j < 20000 ; j++ ) - VideoPortStallExecution( 50 ) ; -#endif -#ifdef WINCE_HEADER -#endif -#ifdef LINUX_KERNEL -#endif } } @@ -252,7 +197,7 @@ void NewDelaySeconds( int seconds ) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void Newdebugcode( UCHAR code ) +void Newdebugcode(unsigned char code) { // OutPortByte ( 0x80 , code ) ; /* OutPortByte ( 0x300 , code ) ; */ diff --git a/drivers/staging/xgifb/vb_util.h b/drivers/staging/xgifb/vb_util.h index 91779d8cfdc6..156f6445c88d 100644 --- a/drivers/staging/xgifb/vb_util.h +++ b/drivers/staging/xgifb/vb_util.h @@ -1,15 +1,15 @@ #ifndef _VBUTIL_ #define _VBUTIL_ extern void NewDelaySeconds( int ); -extern void Newdebugcode( UCHAR ); -extern void XGINew_SetReg1(ULONG, USHORT, USHORT); -extern void XGINew_SetReg3(ULONG, USHORT); -extern UCHAR XGINew_GetReg1(ULONG, USHORT); -extern UCHAR XGINew_GetReg2(ULONG); -extern void XGINew_SetReg4(ULONG, ULONG); -extern ULONG XGINew_GetReg3(ULONG); -extern void XGINew_SetRegOR(ULONG Port,USHORT Index,USHORT DataOR); -extern void XGINew_SetRegAND(ULONG Port,USHORT Index,USHORT DataAND); -extern void XGINew_SetRegANDOR(ULONG Port,USHORT Index,USHORT DataAND,USHORT DataOR); +extern void Newdebugcode(unsigned char); +extern void XGINew_SetReg1(unsigned long, unsigned short, unsigned short); +extern void XGINew_SetReg3(unsigned long, unsigned short); +extern unsigned char XGINew_GetReg1(unsigned long, unsigned short); +extern unsigned char XGINew_GetReg2(unsigned long); +extern void XGINew_SetReg4(unsigned long, unsigned long); +extern unsigned long XGINew_GetReg3(unsigned long); +extern void XGINew_SetRegOR(unsigned long Port,unsigned short Index,unsigned short DataOR); +extern void XGINew_SetRegAND(unsigned long Port,unsigned short Index,unsigned short DataAND); +extern void XGINew_SetRegANDOR(unsigned long Port,unsigned short Index,unsigned short DataAND,unsigned short DataOR); #endif diff --git a/drivers/staging/xgifb/vgatypes.h b/drivers/staging/xgifb/vgatypes.h index 295ea860ae47..df839eeb5efd 100644 --- a/drivers/staging/xgifb/vgatypes.h +++ b/drivers/staging/xgifb/vgatypes.h @@ -2,136 +2,14 @@ #ifndef _VGATYPES_ #define _VGATYPES_ -#include "osdef.h" - -#ifdef LINUX_XF86 -#include "xf86Version.h" -#include "xf86Pci.h" -#endif - -#ifdef LINUX_KERNEL /* We don't want the X driver to depend on kernel source */ #include <linux/ioctl.h> -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#ifndef CHAR -typedef char CHAR; -#endif - -#ifndef SHORT -typedef short SHORT; -#endif - -#ifndef LONG -typedef long LONG; -#endif - -#ifndef UCHAR -typedef unsigned char UCHAR; -#endif - -#ifndef USHORT -typedef unsigned short USHORT; -#endif - -#ifndef ULONG -typedef unsigned long ULONG; -#endif - -#ifndef PUCHAR -typedef UCHAR *PUCHAR; -#endif - -#ifndef PUSHORT -typedef USHORT *PUSHORT; -#endif - -#ifndef PLONGU -typedef ULONG *PULONG; -#endif - -#ifndef VOID -typedef void VOID; -#endif - -#ifndef PVOID -typedef void *PVOID; -#endif - -#ifndef BOOLEAN -typedef UCHAR BOOLEAN; -#endif -/* -#ifndef bool -typedef UCHAR bool; -#endif -*/ -#ifdef LINUX_KERNEL -typedef unsigned long XGIIOADDRESS; -#endif - -#ifdef LINUX_XF86 -#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,0,0,0) -typedef unsigned char IOADDRESS; -typedef unsigned char XGIIOADDRESS; -#else -typedef IOADDRESS XGIIOADDRESS; -#endif -#endif #ifndef VBIOS_VER_MAX_LENGTH -#define VBIOS_VER_MAX_LENGTH 4 -#endif - -#ifndef WIN2000 - -#ifndef LINUX_KERNEL /* For the linux kernel, this is defined in xgifb.h */ -#ifndef XGI_CHIP_TYPE -typedef enum _XGI_CHIP_TYPE { - XGI_VGALegacy = 0, -#ifdef LINUX_XF86 - XGI_530, - XGI_OLD, -#endif - XGI_300, - XGI_630, - XGI_640, - XGI_315H, - XGI_315, - XGI_315PRO, - XGI_550, - XGI_650, - XGI_650M, - XGI_740, - XGI_330, - XGI_661, - XGI_660, - XGI_760, - XG40 = 32, - XG41, - XG42, - XG45, - XG20 = 48, - XG21, - XG27, - MAX_XGI_CHIP -} XGI_CHIP_TYPE; -#endif +#define VBIOS_VER_MAX_LENGTH 5 #endif #ifndef XGI_VB_CHIP_TYPE -typedef enum _XGI_VB_CHIP_TYPE { +enum XGI_VB_CHIP_TYPE { VB_CHIP_Legacy = 0, VB_CHIP_301, VB_CHIP_301B, @@ -143,11 +21,11 @@ typedef enum _XGI_VB_CHIP_TYPE { VB_CHIP_302ELV, VB_CHIP_UNKNOWN, /* other video bridge or no video bridge */ MAX_VB_CHIP -} XGI_VB_CHIP_TYPE; +}; #endif #ifndef XGI_LCD_TYPE -typedef enum _XGI_LCD_TYPE { +enum XGI_LCD_TYPE { LCD_INVALID = 0, LCD_320x480, /* FSTN, DSTN */ LCD_640x480, @@ -171,155 +49,90 @@ typedef enum _XGI_LCD_TYPE { LCD_2048x1536, LCD_CUSTOM, LCD_UNKNOWN -} XGI_LCD_TYPE; +}; #endif -#endif /* not WIN2000 */ - -#ifndef PXGI_DSReg -typedef struct _XGI_DSReg +struct XGI_DSReg { - UCHAR jIdx; - UCHAR jVal; -} XGI_DSReg, *PXGI_DSReg; -#endif - -#ifndef XGI_HW_DEVICE_INFO - -typedef struct _XGI_HW_DEVICE_INFO XGI_HW_DEVICE_INFO, *PXGI_HW_DEVICE_INFO; - -typedef BOOLEAN (*PXGI_QUERYSPACE) (PXGI_HW_DEVICE_INFO, ULONG, ULONG, ULONG *); + unsigned char jIdx; + unsigned char jVal; +}; -struct _XGI_HW_DEVICE_INFO +struct xgi_hw_device_info { - ULONG ulExternalChip; /* NO VB or other video bridge*/ + unsigned long ulExternalChip; /* NO VB or other video bridge*/ /* if ujVBChipID = VB_CHIP_UNKNOWN, */ -#ifdef LINUX_XF86 - PCITAG PciTag; /* PCI Tag */ -#endif - PUCHAR pjVirtualRomBase; /* ROM image */ + unsigned char *pjVirtualRomBase; /* ROM image */ - BOOLEAN UseROM; /* Use the ROM image if provided */ + unsigned char UseROM; /* Use the ROM image if provided */ - PVOID pDevice; + void *pDevice; - PUCHAR pjVideoMemoryAddress;/* base virtual memory address */ + unsigned char *pjVideoMemoryAddress;/* base virtual memory address */ /* of Linear VGA memory */ - ULONG ulVideoMemorySize; /* size, in bytes, of the memory on the board */ + unsigned long ulVideoMemorySize; /* size, in bytes, of the memory on the board */ - PUCHAR pjIOAddress; /* base I/O address of VGA ports (0x3B0) */ + unsigned char *pjIOAddress; /* base I/O address of VGA ports (0x3B0) */ - PUCHAR pjCustomizedROMImage; + unsigned char *pjCustomizedROMImage; - PUCHAR pj2ndVideoMemoryAddress; - ULONG ul2ndVideoMemorySize; + unsigned char *pj2ndVideoMemoryAddress; + unsigned long ul2ndVideoMemorySize; - PUCHAR pj2ndIOAddress; -/*#ifndef WIN2000 - XGIIOADDRESS pjIOAddress; // base I/O address of VGA ports (0x3B0) -#endif */ - UCHAR jChipType; /* Used to Identify Graphics Chip */ + unsigned char *pj2ndIOAddress; + unsigned char jChipType; /* Used to Identify Graphics Chip */ /* defined in the data structure type */ /* "XGI_CHIP_TYPE" */ - UCHAR jChipRevision; /* Used to Identify Graphics Chip Revision */ + unsigned char jChipRevision; /* Used to Identify Graphics Chip Revision */ - UCHAR ujVBChipID; /* the ID of video bridge */ + unsigned char ujVBChipID; /* the ID of video bridge */ /* defined in the data structure type */ /* "XGI_VB_CHIP_TYPE" */ - BOOLEAN bNewScratch; + unsigned char bNewScratch; - ULONG ulCRT2LCDType; /* defined in the data structure type */ + unsigned long ulCRT2LCDType; /* defined in the data structure type */ - ULONG usExternalChip; /* NO VB or other video bridge (other than */ + unsigned long usExternalChip; /* NO VB or other video bridge (other than */ /* video bridge) */ - BOOLEAN bIntegratedMMEnabled;/* supporting integration MM enable */ + unsigned char bIntegratedMMEnabled;/* supporting integration MM enable */ - BOOLEAN bSkipDramSizing; /* True: Skip video memory sizing. */ + unsigned char bSkipDramSizing; /* True: Skip video memory sizing. */ - BOOLEAN bSkipSense; + unsigned char bSkipSense; - BOOLEAN bIsPowerSaving; /* True: XGIInit() is invoked by power management, + unsigned char bIsPowerSaving; /* True: XGIInit() is invoked by power management, otherwise by 2nd adapter's initialzation */ - PXGI_DSReg pSR; /* restore SR registers in initial function. */ + struct XGI_DSReg *pSR; /* restore SR registers in initial function. */ /* end data :(idx, val) = (FF, FF). */ /* Note : restore SR registers if */ - /* bSkipDramSizing = TRUE */ + /* bSkipDramSizing = 1 */ - PXGI_DSReg pCR; /* restore CR registers in initial function. */ + struct XGI_DSReg *pCR; /* restore CR registers in initial function. */ /* end data :(idx, val) = (FF, FF) */ /* Note : restore cR registers if */ - /* bSkipDramSizing = TRUE */ -/* -#endif -*/ + /* bSkipDramSizing = 1 */ - PXGI_QUERYSPACE pQueryVGAConfigSpace; + unsigned char(*pQueryVGAConfigSpace)(struct xgi_hw_device_info *, + unsigned long, unsigned long, + unsigned long *); - PXGI_QUERYSPACE pQueryNorthBridgeSpace; + unsigned char(*pQueryNorthBridgeSpace)(struct xgi_hw_device_info *, + unsigned long, unsigned long, + unsigned long *); - UCHAR szVBIOSVer[VBIOS_VER_MAX_LENGTH]; + unsigned char szVBIOSVer[VBIOS_VER_MAX_LENGTH]; }; -#endif /* Addtional IOCTL for communication xgifb <> X driver */ /* If changing this, xgifb.h must also be changed (for xgifb) */ -#ifdef LINUX_XF86 /* We don't want the X driver to depend on the kernel source */ - -/* ioctl for identifying and giving some info (esp. memory heap start) */ -#define XGIFB_GET_INFO 0x80046ef8 /* Wow, what a terrible hack... */ - -/* Structure argument for XGIFB_GET_INFO ioctl */ -typedef struct _XGIFB_INFO xgifb_info, *pxgifb_info; - -struct _XGIFB_INFO { - CARD32 xgifb_id; /* for identifying xgifb */ -#ifndef XGIFB_ID -#define XGIFB_ID 0x53495346 /* Identify myself with 'XGIF' */ -#endif - CARD32 chip_id; /* PCI ID of detected chip */ - CARD32 memory; /* video memory in KB which xgifb manages */ - CARD32 heapstart; /* heap start (= xgifb "mem" argument) in KB */ - CARD8 fbvidmode; /* current xgifb mode */ - - CARD8 xgifb_version; - CARD8 xgifb_revision; - CARD8 xgifb_patchlevel; - - CARD8 xgifb_caps; /* xgifb's capabilities */ - - CARD32 xgifb_tqlen; /* turbo queue length (in KB) */ - - CARD32 xgifb_pcibus; /* The card's PCI ID */ - CARD32 xgifb_pcislot; - CARD32 xgifb_pcifunc; - - CARD8 xgifb_lcdpdc; - - CARD8 xgifb_lcda; - - CARD32 xgifb_vbflags; - CARD32 xgifb_currentvbflags; - - CARD32 xgifb_scalelcd; - CARD32 xgifb_specialtiming; - - CARD8 xgifb_haveemi; - CARD8 xgifb_emi30,xgifb_emi31,xgifb_emi32,xgifb_emi33; - CARD8 xgifb_haveemilcd; - - CARD8 xgifb_lcdpdca; - - CARD8 reserved[212]; /* for future use */ -}; -#endif #endif |