📄 sis_main.h
字号:
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, 50}, { 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, 1280, 1024, 43}, { 2, 1280, 1024, 60}, { 3, 1280, 1024, 75}, { 4, 1280, 1024, 85}, { 1, 1600, 1200, 60}, { 2, 1600, 1200, 65}, { 3, 1600, 1200, 70}, { 4, 1600, 1200, 75}, { 5, 1600, 1200, 85}, { 1, 1920, 1440, 60}, { 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;typedef struct _SIS_OHALLOC { struct _SIS_OHALLOC *poha_next; SIS_OH aoh[1];} SIS_OHALLOC;typedef struct _SIS_HEAP { SIS_OH oh_free; SIS_OH oh_used; SIS_OH *poh_freelist; SIS_OHALLOC *poha_chain; unsigned long max_freesize;} SIS_HEAP;static unsigned long sisfb_hwcursor_vbase;static unsigned long sisfb_heap_start;static unsigned long sisfb_heap_end;static unsigned long sisfb_heap_size;static SIS_HEAP sisfb_heap;// Eden Chenstatic struct _sis_TV_filter { u8 filter[9][4];} sis_TV_filter[] = { { { { 0x00, 0x00, 0x00, 0x40}, /* NTSCFilter_0 */ { 0x00, 0xE0, 0x10, 0x60}, { 0x00, 0xEE, 0x10, 0x44}, { 0x00, 0xF4, 0x10, 0x38}, { 0xF8, 0xF4, 0x18, 0x38}, { 0xFC, 0xFB, 0x14, 0x2A}, { 0x00, 0x00, 0x10, 0x20}, { 0x00, 0x04, 0x10, 0x18}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* NTSCFilter_1 */ { 0x00, 0xE0, 0x10, 0x60}, { 0x00, 0xEE, 0x10, 0x44}, { 0x00, 0xF4, 0x10, 0x38}, { 0xF8, 0xF4, 0x18, 0x38}, { 0xFC, 0xFB, 0x14, 0x2A}, { 0x00, 0x00, 0x10, 0x20}, { 0x00, 0x04, 0x10, 0x18}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* NTSCFilter_2 */ { 0xF5, 0xEE, 0x1B, 0x44}, { 0xF8, 0xF4, 0x18, 0x38}, { 0xEB, 0x04, 0x25, 0x18}, { 0xF1, 0x05, 0x1F, 0x16}, { 0xF6, 0x06, 0x1A, 0x14}, { 0xFA, 0x06, 0x16, 0x14}, { 0x00, 0x04, 0x10, 0x18}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* NTSCFilter_3 */ { 0xF1, 0x04, 0x1F, 0x18}, { 0xEE, 0x0D, 0x22, 0x06}, { 0xF7, 0x06, 0x19, 0x14}, { 0xF4, 0x0B, 0x1C, 0x0A}, { 0xFA, 0x07, 0x16, 0x12}, { 0xF9, 0x0A, 0x17, 0x0C}, { 0x00, 0x07, 0x10, 0x12}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* NTSCFilter_4 */ { 0x00, 0xE0, 0x10, 0x60}, { 0x00, 0xEE, 0x10, 0x44}, { 0x00, 0xF4, 0x10, 0x38}, { 0xF8, 0xF4, 0x18, 0x38}, { 0xFC, 0xFB, 0x14, 0x2A}, { 0x00, 0x00, 0x10, 0x20}, { 0x00, 0x04, 0x10, 0x18}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* NTSCFilter_5 */ { 0xF5, 0xEE, 0x1B, 0x44}, { 0xF8, 0xF4, 0x18, 0x38}, { 0xEB, 0x04, 0x25, 0x18}, { 0xF1, 0x05, 0x1F, 0x16}, { 0xF6, 0x06, 0x1A, 0x14}, { 0xFA, 0x06, 0x16, 0x14}, { 0x00, 0x04, 0x10, 0x18}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* NTSCFilter_6 */ { 0xEB, 0x04, 0x25, 0x18}, { 0xE7, 0x0E, 0x29, 0x04}, { 0xEE, 0x0C, 0x22, 0x08}, { 0xF6, 0x0B, 0x1A, 0x0A}, { 0xF9, 0x0A, 0x17, 0x0C}, { 0xFC, 0x0A, 0x14, 0x0C}, { 0x00, 0x08, 0x10, 0x10}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* NTSCFilter_7 */ { 0xEC, 0x02, 0x24, 0x1C}, { 0xF2, 0x04, 0x1E, 0x18}, { 0xEB, 0x15, 0x25, 0xF6}, { 0xF4, 0x10, 0x1C, 0x00}, { 0xF8, 0x0F, 0x18, 0x02}, { 0x00, 0x04, 0x10, 0x18}, { 0x01, 0x06, 0x0F, 0x14}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* PALFilter_0 */ { 0x00, 0xE0, 0x10, 0x60}, { 0x00, 0xEE, 0x10, 0x44}, { 0x00, 0xF4, 0x10, 0x38}, { 0xF8, 0xF4, 0x18, 0x38}, { 0xFC, 0xFB, 0x14, 0x2A}, { 0x00, 0x00, 0x10, 0x20}, { 0x00, 0x04, 0x10, 0x18}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* PALFilter_1 */ { 0x00, 0xE0, 0x10, 0x60}, { 0x00, 0xEE, 0x10, 0x44}, { 0x00, 0xF4, 0x10, 0x38}, { 0xF8, 0xF4, 0x18, 0x38}, { 0xFC, 0xFB, 0x14, 0x2A}, { 0x00, 0x00, 0x10, 0x20}, { 0x00, 0x04, 0x10, 0x18}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* PALFilter_2 */ { 0xF5, 0xEE, 0x1B, 0x44}, { 0xF8, 0xF4, 0x18, 0x38}, { 0xF1, 0xF7, 0x01, 0x32}, { 0xF5, 0xFB, 0x1B, 0x2A}, { 0xF9, 0xFF, 0x17, 0x22}, { 0xFB, 0x01, 0x15, 0x1E}, { 0x00, 0x04, 0x10, 0x18}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* PALFilter_3 */ { 0xF5, 0xFB, 0x1B, 0x2A}, { 0xEE, 0xFE, 0x22, 0x24}, { 0xF3, 0x00, 0x1D, 0x20}, { 0xF9, 0x03, 0x17, 0x1A}, { 0xFB, 0x02, 0x14, 0x1E}, { 0xFB, 0x04, 0x15, 0x18}, { 0x00, 0x06, 0x10, 0x14}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* PALFilter_4 */ { 0x00, 0xE0, 0x10, 0x60}, { 0x00, 0xEE, 0x10, 0x44}, { 0x00, 0xF4, 0x10, 0x38}, { 0xF8, 0xF4, 0x18, 0x38}, { 0xFC, 0xFB, 0x14, 0x2A}, { 0x00, 0x00, 0x10, 0x20}, { 0x00, 0x04, 0x10, 0x18}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* PALFilter_5 */ { 0xF5, 0xEE, 0x1B, 0x44}, { 0xF8, 0xF4, 0x18, 0x38}, { 0xF1, 0xF7, 0x1F, 0x32}, { 0xF5, 0xFB, 0x1B, 0x2A}, { 0xF9, 0xFF, 0x17, 0x22}, { 0xFB, 0x01, 0x15, 0x1E}, { 0x00, 0x04, 0x10, 0x18}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* PALFilter_6 */ { 0xF5, 0xEE, 0x1B, 0x2A}, { 0xEE, 0xFE, 0x22, 0x24}, { 0xF3, 0x00, 0x1D, 0x20}, { 0xF9, 0x03, 0x17, 0x1A}, { 0xFB, 0x02, 0x14, 0x1E}, { 0xFB, 0x04, 0x15, 0x18}, { 0x00, 0x06, 0x10, 0x14}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, { { { 0x00, 0x00, 0x00, 0x40}, /* PALFilter_7 */ { 0xF5, 0xEE, 0x1B, 0x44}, { 0xF8, 0xF4, 0x18, 0x38}, { 0xFC, 0xFB, 0x14, 0x2A}, { 0xEB, 0x05, 0x25, 0x16}, { 0xF1, 0x05, 0x1F, 0x16}, { 0xFA, 0x07, 0x16, 0x12}, { 0x00, 0x07, 0x10, 0x12}, { 0xFF, 0xFF, 0xFF, 0xFF}}}};static int filter = -1;static unsigned char filter_tb;//~Eden Chen/* ---------------------- Routine Prototype ------------------------- *//* Interface used by the world */int sisfb_setup (char *options);static int sisfb_get_fix (struct fb_fix_screeninfo *fix, int con, struct fb_info *info);static int sisfb_get_var (struct fb_var_screeninfo *var, int con, struct fb_info *info);static int sisfb_set_var (struct fb_var_screeninfo *var, int con, struct fb_info *info);static int sisfb_get_cmap (struct fb_cmap *cmap, int kspc, int con, struct fb_info *info);static int sisfb_set_cmap (struct fb_cmap *cmap, int kspc, int con, struct fb_info *info);static int sisfb_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg, int con, struct fb_info *info);/* Interface to the low level console driver */int sisfb_init (void);static int sisfb_update_var (int con, struct fb_info *info);static int sisfb_switch (int con, struct fb_info *info);static void sisfb_blank (int blank, struct fb_info *info);/* hardware access routines */void sisfb_set_reg1 (u16 port, u16 index, u16 data);void sisfb_set_reg3 (u16 port, u16 data);void sisfb_set_reg4 (u16 port, unsigned long data);u8 sisfb_get_reg1 (u16 port, u16 index);u8 sisfb_get_reg2 (u16 port);u32 sisfb_get_reg3 (u16 port);// Eden Chen//void sisfb_clear_DAC(u16 port);//void sisfb_clear_buffer(PHW_DEVICE_EXTENSION psishw_ext);// ~Eden Chen/* Internal routines */static void sisfb_search_mode (const char *name);static void sisfb_validate_mode (void);static u8 sisfb_search_refresh_rate (unsigned int rate);static int sis_getcolreg (unsigned regno, unsigned *red, unsigned *green, unsigned *blue, unsigned *transp, struct fb_info *fb_info);static int sis_setcolreg (unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fb_info);static int sisfb_do_set_var (struct fb_var_screeninfo *var, int isactive, struct fb_info *info);static void sisfb_set_disp (int con, struct fb_var_screeninfo *var);static void sisfb_do_install_cmap (int con, struct fb_info *info);/* Chip-dependent Routines */#ifdef CONFIG_FB_SIS_300static int sisfb_get_dram_size_300 (void);//extern BOOLEAN SiSInit300(PHW_DEVICE_EXTENSION HwDeviceExtension);static void sisfb_detect_VB_connect_300 (void);static void sisfb_get_VB_type_300 (void);static int sisfb_has_VB_300 (void);//extern BOOLEAN SiSSetMode(PHW_DEVICE_EXTENSION HwDeviceExtension,USHORT ModeNo);#endif#ifdef CONFIG_FB_SIS_315static int sisfb_get_dram_size_315 (void);//extern BOOLEAN SiSInit310(PHW_DEVICE_EXTENSION HwDeviceExtension);static void sisfb_detect_VB_connect_315 (void);static void sisfb_get_VB_type_315 (void);//extern BOOLEAN SiSSetMode310(PHW_DEVICE_EXTENSION HwDeviceExtension, USHORT ModeNo);#endif/* SetMode routines */// Eden Chenextern BOOLEAN SiSSetMode (PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo);extern BOOLEAN SiSInit (PSIS_HW_DEVICE_INFO HwDeviceExtension);// ~Eden Chenstatic void sisfb_pre_setmode (void);static void sisfb_post_setmode (void);static void sisfb_crtc_to_var (struct fb_var_screeninfo *var);/* Export functions */static void sis_get_glyph (SIS_GLYINFO * gly);void sis_dispinfo (struct ap_data *rec);void sis_malloc (struct sis_memreq *req);void sis_free (unsigned long base);/* heap routines */static int sisfb_heap_init (void);static SIS_OH *sisfb_poh_new_node (void);static SIS_OH *sisfb_poh_allocate (unsigned long size);static void sisfb_delete_node (SIS_OH * poh);static void sisfb_insert_node (SIS_OH * pohList, SIS_OH * poh);static SIS_OH *sisfb_poh_free (unsigned long base);static void sisfb_free_node (SIS_OH * poh);/* routines to access PCI configuration space */BOOLEAN sisfb_query_VGA_config_space (PSIS_HW_DEVICE_INFO psishw_ext, unsigned long offset, unsigned long set, unsigned long *value);BOOLEAN sisfb_query_north_bridge_space (PSIS_HW_DEVICE_INFO psishw_ext, unsigned long offset, unsigned long set, unsigned long *value);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -