⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sis_main.h

📁 该文件是rt_linux
💻 H
📖 第 1 页 / 共 3 页
字号:
	sync:           0,	vmode:          FB_VMODE_NONINTERLACED,	reserved:       {0, 0, 0, 0, 0, 0}};static struct {	u16 blue, green, red, pad;} sis_palette[256];#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34)static u32 pseudo_palette[17];#endifstatic union {#ifdef FBCON_HAS_CFB16	u16 cfb16[16];#endif#ifdef FBCON_HAS_CFB24	u32 cfb24[16];#endif#ifdef FBCON_HAS_CFB32	u32 cfb32[16];#endif} sis_fbcon_cmap;/* display status */static int sisfb_off = 0;static int sisfb_crt1off = 0;static int sisfb_forcecrt1 = -1;static int sisfb_inverse = 0;static int sisvga_enabled = 0;#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,23)static int currcon = 0;#endif/* global flags */static int sisfb_tvmode = 0;static int sisfb_mem = 0;static int sisfb_pdc = 0;static int enable_dstn = 0;static int sisfb_accel = -1;static int sisfb_ypan = -1;VGA_ENGINE sisvga_engine = UNKNOWN_VGA;/* TW: These are to adapted according to VGA_ENGINE type */static int sisfb_hwcursor_size = 0;static int sisfb_CRT2_write_enable = 0;int sisfb_crt2type  = -1;	/* TW: CRT2 type (for overriding autodetection) */int sisfb_tvplug    = -1;	/* PR: Tv plug type (for overriding autodetection) */int sisfb_queuemode = -1; 	/* TW: Use MMIO queue mode by default (310/325 series only) *//* data for sis components */struct video_info ivideo;/* TW: For ioctl SISFB_GET_INFO */sisfb_info sisfbinfo;/* TW: Hardware extension; contains data on hardware */HW_DEVICE_EXTENSION sishw_ext = {	NULL, NULL, FALSE, NULL, NULL,	0, 0, 0, 0, 0, 0, 0, 0, 0,	NULL, NULL, NULL, NULL,	{0, 0, 0, 0},	0};/* TW: SiS private structure */SiS_Private  SiS_Pr;/* card parameters */static unsigned long sisfb_mmio_size = 0;static u8            sisfb_caps = 0;typedef enum _SIS_CMDTYPE {	MMIO_CMD = 0,	AGP_CMD_QUEUE,	VM_CMD_QUEUE,} SIS_CMDTYPE;/* Supported SiS Chips list */static struct board {	u16 vendor, device;	const char *name;} sisdev_list[] = {	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_300,     "SIS 300"},	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_540_VGA, "SIS 540 VGA"},	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_630_VGA, "SIS 630/730 VGA"},	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315H,    "SIS 315H"},	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315,     "SIS 315"},	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315PRO,  "SIS 315PRO"},	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_550_VGA, "SIS 550 VGA"},	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, "SIS 650/M650/651/740 VGA"},	{0, 0, NULL}};#define MD_SIS300 1#define MD_SIS315 2/* mode table *//* NOT const - will be patched for 1280x960 mode number chaos reasons */struct _sisbios_mode {	char name[15];	u8 mode_no;	u16 vesa_mode_no_1;  /* "SiS defined" VESA mode number */	u16 vesa_mode_no_2;  /* Real VESA mode numbers */	u16 xres;	u16 yres;	u16 bpp;	u16 rate_idx;	u16 cols;	u16 rows;	u8  chipset;} sisbios_mode[] = {#define MODE_INDEX_NONE           0  /* TW: index for mode=none */	{"none",         0xFF, 0x0000, 0x0000,    0,    0,  0, 0,   0,  0, MD_SIS300|MD_SIS315},  /* TW: for mode "none" */	{"320x240x16",   0x56, 0x0000, 0x0000,  320,  240, 16, 1,  40, 15,           MD_SIS315},	{"320x480x8",    0x5A, 0x0000, 0x0000,  320,  480,  8, 1,  40, 30,           MD_SIS315},  /* TW: FSTN */	{"320x480x16",   0x5B, 0x0000, 0x0000,  320,  480, 16, 1,  40, 30,           MD_SIS315},  /* TW: FSTN */	{"640x480x8",    0x2E, 0x0101, 0x0101,  640,  480,  8, 1,  80, 30, MD_SIS300|MD_SIS315},	{"640x480x16",   0x44, 0x0111, 0x0111,  640,  480, 16, 1,  80, 30, MD_SIS300|MD_SIS315},	{"640x480x24",   0x62, 0x013a, 0x0112,  640,  480, 32, 1,  80, 30, MD_SIS300|MD_SIS315},  /* TW: That's for people who mix up color- and fb depth */	{"640x480x32",   0x62, 0x013a, 0x0112,  640,  480, 32, 1,  80, 30, MD_SIS300|MD_SIS315},	{"720x480x8",    0x31, 0x0000, 0x0000,  720,  480,  8, 1,  90, 30, MD_SIS300|MD_SIS315},	{"720x480x16",   0x33, 0x0000, 0x0000,  720,  480, 16, 1,  90, 30, MD_SIS300|MD_SIS315},	{"720x480x24",   0x35, 0x0000, 0x0000,  720,  480, 32, 1,  90, 30, MD_SIS300|MD_SIS315},	{"720x480x32",   0x35, 0x0000, 0x0000,  720,  480, 32, 1,  90, 30, MD_SIS300|MD_SIS315},	{"720x576x8",    0x32, 0x0000, 0x0000,  720,  576,  8, 1,  90, 36, MD_SIS300|MD_SIS315},	{"720x576x16",   0x34, 0x0000, 0x0000,  720,  576, 16, 1,  90, 36, MD_SIS300|MD_SIS315},	{"720x576x24",   0x36, 0x0000, 0x0000,  720,  576, 32, 1,  90, 36, MD_SIS300|MD_SIS315},	{"720x576x32",   0x36, 0x0000, 0x0000,  720,  576, 32, 1,  90, 36, MD_SIS300|MD_SIS315},	{"800x480x8",    0x70, 0x0000, 0x0000,  800,  480,  8, 1, 100, 30,           MD_SIS315},  /* TW: 310/325 series only */	{"800x480x16",   0x7a, 0x0000, 0x0000,  800,  480, 16, 1, 100, 30,           MD_SIS315},	{"800x480x24",   0x76, 0x0000, 0x0000,  800,  480, 32, 1, 100, 30,           MD_SIS315},	{"800x480x32",   0x76, 0x0000, 0x0000,  800,  480, 32, 1, 100, 30,           MD_SIS315},#define DEFAULT_MODE              20 /* TW: index for 800x600x8 */#define DEFAULT_LCDMODE           20 /* TW: index for 800x600x8 */#define DEFAULT_TVMODE            20 /* TW: index for 800x600x8 */	{"800x600x8",    0x30, 0x0103, 0x0103,  800,  600,  8, 2, 100, 37, MD_SIS300|MD_SIS315},	{"800x600x16",   0x47, 0x0114, 0x0114,  800,  600, 16, 2, 100, 37, MD_SIS300|MD_SIS315},	{"800x600x24",   0x63, 0x013b, 0x0115,  800,  600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},	{"800x600x32",   0x63, 0x013b, 0x0115,  800,  600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},	{"1024x576x8",   0x71, 0x0000, 0x0000, 1024,  576,  8, 1, 128, 36,           MD_SIS315},  /* TW: 310/325 series only */	{"1024x576x16",  0x74, 0x0000, 0x0000, 1024,  576, 16, 1, 128, 36,           MD_SIS315},	{"1024x576x24",  0x77, 0x0000, 0x0000, 1024,  576, 32, 1, 128, 36,           MD_SIS315},	{"1024x576x32",  0x77, 0x0000, 0x0000, 1024,  576, 32, 1, 128, 36,           MD_SIS315},	{"1024x600x8",   0x20, 0x0000, 0x0000, 1024,  600,  8, 1, 128, 37, MD_SIS300          },  /* TW: 300 series only */	{"1024x600x16",  0x21, 0x0000, 0x0000, 1024,  600, 16, 1, 128, 37, MD_SIS300          },	{"1024x600x24",  0x22, 0x0000, 0x0000, 1024,  600, 32, 1, 128, 37, MD_SIS300          },	{"1024x600x32",  0x22, 0x0000, 0x0000, 1024,  600, 32, 1, 128, 37, MD_SIS300          },	{"1024x768x8",   0x38, 0x0105, 0x0105, 1024,  768,  8, 2, 128, 48, MD_SIS300          },	{"1024x768x16",  0x4A, 0x0117, 0x0117, 1024,  768, 16, 2, 128, 48, MD_SIS300          },	{"1024x768x24",  0x64, 0x013c, 0x0118, 1024,  768, 32, 2, 128, 48, MD_SIS300          },	{"1024x768x32",  0x64, 0x013c, 0x0118, 1024,  768, 32, 2, 128, 48, MD_SIS300          },	{"1152x768x8",   0x23, 0x0000, 0x0000, 1152,  768,  8, 1, 144, 48, MD_SIS300          },  /* TW: 300 series only */	{"1152x768x16",  0x24, 0x0000, 0x0000, 1152,  768, 16, 1, 144, 48, MD_SIS300          },	{"1152x768x24",  0x25, 0x0000, 0x0000, 1152,  768, 32, 1, 144, 48, MD_SIS300          },	{"1152x768x32",  0x25, 0x0000, 0x0000, 1152,  768, 32, 1, 144, 48, MD_SIS300          },	{"1280x720x8",   0x79, 0x0000, 0x0000, 1280,  720,  8, 1, 160, 45,           MD_SIS315},  /* TW: 310/325 series only */	{"1280x720x16",  0x75, 0x0000, 0x0000, 1280,  720, 16, 1, 160, 45,           MD_SIS315},	{"1280x720x24",  0x78, 0x0000, 0x0000, 1280,  720, 32, 1, 160, 45,           MD_SIS315},	{"1280x720x32",  0x78, 0x0000, 0x0000, 1280,  720, 32, 1, 160, 45,           MD_SIS315},	{"1280x768x8",   0x23, 0x0000, 0x0000, 1280,  768,  8, 1, 160, 48,           MD_SIS315},  /* TW: 310/325 series only */	{"1280x768x16",  0x24, 0x0000, 0x0000, 1280,  768, 16, 1, 160, 48,           MD_SIS315},	{"1280x768x24",  0x25, 0x0000, 0x0000, 1280,  768, 32, 1, 160, 48,           MD_SIS315},	{"1280x768x32",  0x25, 0x0000, 0x0000, 1280,  768, 32, 1, 160, 48,           MD_SIS315},#define MODEINDEX_1280x960 48	{"1280x960x8",   0x7C, 0x0000, 0x0000, 1280,  960,  8, 1, 160, 60, MD_SIS300|MD_SIS315},  /* TW: Modenumbers being patched */	{"1280x960x16",  0x7D, 0x0000, 0x0000, 1280,  960, 16, 1, 160, 60, MD_SIS300|MD_SIS315},	{"1280x960x24",  0x7E, 0x0000, 0x0000, 1280,  960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},	{"1280x960x32",  0x7E, 0x0000, 0x0000, 1280,  960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},	{"1280x1024x8",  0x3A, 0x0107, 0x0107, 1280, 1024,  8, 2, 160, 64, MD_SIS300|MD_SIS315},	{"1280x1024x16", 0x4D, 0x011a, 0x011a, 1280, 1024, 16, 2, 160, 64, MD_SIS300|MD_SIS315},	{"1280x1024x24", 0x65, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},	{"1280x1024x32", 0x65, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},	{"1400x1050x8",  0x26, 0x0000, 0x0000, 1400, 1050,  8, 1, 175, 65,           MD_SIS315},  /* TW: 310/325 series only */	{"1400x1050x16", 0x27, 0x0000, 0x0000, 1400, 1050, 16, 1, 175, 65,           MD_SIS315},	{"1400x1050x24", 0x28, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65,           MD_SIS315},	{"1400x1050x32", 0x28, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65,           MD_SIS315},	{"1600x1200x8",  0x3C, 0x0130, 0x011c, 1600, 1200,  8, 1, 200, 75, MD_SIS300|MD_SIS315},	{"1600x1200x16", 0x3D, 0x0131, 0x011e, 1600, 1200, 16, 1, 200, 75, MD_SIS300|MD_SIS315},	{"1600x1200x24", 0x66, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},	{"1600x1200x32", 0x66, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},	{"1920x1440x8",  0x68, 0x013f, 0x0000, 1920, 1440,  8, 1, 240, 75, MD_SIS300|MD_SIS315},	{"1920x1440x16", 0x69, 0x0140, 0x0000, 1920, 1440, 16, 1, 240, 75, MD_SIS300|MD_SIS315},	{"1920x1440x24", 0x6B, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},	{"1920x1440x32", 0x6B, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},	{"2048x1536x8",  0x6c, 0x0000, 0x0000, 2048, 1536,  8, 1, 256, 96,           MD_SIS315},  /* TW: 310/325 series only */	{"2048x1536x16", 0x6d, 0x0000, 0x0000, 2048, 1536, 16, 1, 256, 96,           MD_SIS315},	{"2048x1536x24", 0x6e, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96,           MD_SIS315},	{"2048x1536x32", 0x6e, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96,           MD_SIS315},	{"\0", 0x00, 0, 0, 0, 0, 0, 0, 0}};/* mode-related variables */#ifdef MODULEint sisfb_mode_idx = MODE_INDEX_NONE;  /* Don't use a mode by default if we are a module */#elseint sisfb_mode_idx = -1;               /* Use a default mode if we are inside the kernel */#endifu8  sisfb_mode_no  = 0;u8  sisfb_rate_idx = 0;/* TW: CR36 evaluation */const USHORT sis300paneltype[] =    { LCD_UNKNOWN,   LCD_800x600,  LCD_1024x768,  LCD_1280x1024,      LCD_1280x960,  LCD_640x480,  LCD_1024x600,  LCD_1152x768,      LCD_320x480,   LCD_1024x768, LCD_1024x768,  LCD_1024x768,      LCD_1024x768,  LCD_1024x768, LCD_1024x768,  LCD_1024x768 };const USHORT sis310paneltype[] =    { LCD_UNKNOWN,   LCD_800x600,  LCD_1024x768,  LCD_1280x1024,      LCD_640x480,   LCD_1024x600, LCD_1152x864,  LCD_1280x960,      LCD_1152x768,  LCD_1400x1050,LCD_1280x768,  LCD_1600x1200,      LCD_320x480,   LCD_1024x768, LCD_1024x768,  LCD_1024x768 };static const struct _sis_crt2type {	char name[10];	int type_no;	int tvplug_no;} sis_crt2type[] = {	{"NONE", 	0, 		-1},	{"LCD",  	DISPTYPE_LCD, 	-1},	{"TV",   	DISPTYPE_TV, 	-1},	{"VGA",  	DISPTYPE_CRT2, 	-1},	{"SVIDEO", 	DISPTYPE_TV, 	TVPLUG_SVIDEO},	{"COMPOSITE", 	DISPTYPE_TV, 	TVPLUG_COMPOSITE},	{"SCART", 	DISPTYPE_TV, 	TVPLUG_SCART},	{"none", 	0, 		-1},	{"lcd",  	DISPTYPE_LCD, 	-1},	{"tv",   	DISPTYPE_TV, 	-1},	{"vga",  	DISPTYPE_CRT2, 	-1},	{"svideo", 	DISPTYPE_TV, 	TVPLUG_SVIDEO},	{"composite", 	DISPTYPE_TV, 	TVPLUG_COMPOSITE},	{"scart", 	DISPTYPE_TV, 	TVPLUG_SCART},	{"\0",  	-1, 		-1}};/* Queue mode selection for 310 series */static const struct _sis_queuemode {	char name[6];	int type_no;} sis_queuemode[] = {	{"AGP",  	AGP_CMD_QUEUE},	{"VRAM", 	VM_CMD_QUEUE},	{"MMIO", 	MMIO_CMD},	{"agp",  	AGP_CMD_QUEUE},	{"vram", 	VM_CMD_QUEUE},	{"mmio", 	MMIO_CMD},	{"\0",   	-1}};static const struct _sis_vrate {	u16 idx;	u16 xres;	u16 yres;	u16 refresh;} sisfb_vrate[] = {	{1,  640,  480, 60}, {2,  640,  480,  72}, {3, 640,   480,  75}, {4,  640, 480,  85},	{5,  640,  480,100}, {6,  640,  480, 120}, {7, 640,   480, 160}, {8,  640, 480, 200},	{1,  720,  480, 60},	{1,  720,  576, 58},	{1,  800,  480, 60}, {2,  800,  480,  75}, {3, 800,   480,  85},	{1,  800,  600, 56}, {2,  800,  600,  60}, {3, 800,   600,  72}, {4,  800, 600,  75},	{5,  800,  600, 85}, {6,  800,  600, 100}, {7, 800,   600, 120}, {8,  800, 600, 160},	{1, 1024,  768, 43}, {2, 1024,  768,  60}, {3, 1024,  768,  70}, {4, 1024, 768,  75},	{5, 1024,  768, 85}, {6, 1024,  768, 100}, {7, 1024,  768, 120},	{1, 1024,  576, 60}, {2, 1024,  576,  65}, {3, 1024,  576,  75},	{1, 1024,  600, 60},	{1, 1152,  768, 60},	{1, 1280,  720, 60}, {2, 1280,  720,  75}, {3, 1280,  720,  85},	{1, 1280,  768, 60},	{1, 1280, 1024, 43}, {2, 1280, 1024,  60}, {3, 1280, 1024,  75}, {4, 1280, 1024,  85},	{1, 1280,  960, 60},	{1, 1400, 1050, 60},	{1, 1600, 1200, 60}, {2, 1600, 1200,  65}, {3, 1600, 1200,  70}, {4, 1600, 1200,  75},	{5, 1600, 1200, 85}, {6, 1600, 1200, 100}, {7, 1600, 1200, 120},	/* TW: Clock values for 1920x1440 guessed (except for the first one) */	{1, 1920, 1440, 60}, {2, 1920, 1440,  70}, {3, 1920, 1440,  75}, {4, 1920, 1440,  85},	{5, 1920, 1440,100}, {6, 1920, 1440, 120},	/* TW: Clock values for 2048x1536 guessed */	{1, 2048, 1536, 60}, {2, 2048, 1536,  70}, {3, 2048, 1536,  75}, {4, 2048, 1536,  85},	{5, 2048, 1536,100},	{0, 0, 0, 0}};/* Offscreen layout */typedef struct _SIS_GLYINFO {	unsigned char ch;	int fontwidth;	int fontheight;	u8 gmask[72];	int ngmask;} SIS_GLYINFO;typedef struct _SIS_OH {	struct _SIS_OH *poh_next;	struct _SIS_OH *poh_prev;	unsigned long offset;	unsigned long size;} SIS_OH;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -