diff options
Diffstat (limited to 'drivers/video/sis/sis_main.h')
| -rw-r--r-- | drivers/video/sis/sis_main.h | 602 |
1 files changed, 244 insertions, 358 deletions
diff --git a/drivers/video/sis/sis_main.h b/drivers/video/sis/sis_main.h index a6678a7aff35..445bcbba03ae 100644 --- a/drivers/video/sis/sis_main.h +++ b/drivers/video/sis/sis_main.h | |||
| @@ -1,9 +1,10 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * SiS 300/305/540/630(S)/730(S) | 2 | * SiS 300/305/540/630(S)/730(S), |
| 3 | * SiS 315(H/PRO)/55x/(M)65x/(M)661(F/M)X/740/741(GX)/330/(M)760 | 3 | * SiS 315[E|PRO]/550/[M]65x/[M]66x[F|M|G]X/[M]74x[GX]/330/[M]76x[GX], |
| 4 | * XGI V3XT/V5/V8, Z7 | ||
| 4 | * frame buffer driver for Linux kernels >=2.4.14 and >=2.6.3 | 5 | * frame buffer driver for Linux kernels >=2.4.14 and >=2.6.3 |
| 5 | * | 6 | * |
| 6 | * Copyright (C) 2001-2004 Thomas Winischhofer, Vienna, Austria. | 7 | * Copyright (C) 2001-2005 Thomas Winischhofer, Vienna, Austria. |
| 7 | * | 8 | * |
| 8 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
| @@ -23,13 +24,9 @@ | |||
| 23 | #ifndef _SISFB_MAIN | 24 | #ifndef _SISFB_MAIN |
| 24 | #define _SISFB_MAIN | 25 | #define _SISFB_MAIN |
| 25 | 26 | ||
| 26 | #include <linux/spinlock.h> | ||
| 27 | |||
| 28 | #include "vstruct.h" | 27 | #include "vstruct.h" |
| 29 | #include "sis.h" | 28 | #include "sis.h" |
| 30 | 29 | ||
| 31 | #define MODE_INDEX_NONE 0 /* index for mode=none */ | ||
| 32 | |||
| 33 | /* Fbcon stuff */ | 30 | /* Fbcon stuff */ |
| 34 | static struct fb_var_screeninfo my_default_var = { | 31 | static struct fb_var_screeninfo my_default_var = { |
| 35 | .xres = 0, | 32 | .xres = 0, |
| @@ -60,6 +57,8 @@ static struct fb_var_screeninfo my_default_var = { | |||
| 60 | .vmode = FB_VMODE_NONINTERLACED, | 57 | .vmode = FB_VMODE_NONINTERLACED, |
| 61 | }; | 58 | }; |
| 62 | 59 | ||
| 60 | #define MODE_INDEX_NONE 0 /* index for mode=none */ | ||
| 61 | |||
| 63 | /* Boot-time parameters */ | 62 | /* Boot-time parameters */ |
| 64 | static int sisfb_off = 0; | 63 | static int sisfb_off = 0; |
| 65 | static int sisfb_parm_mem = 0; | 64 | static int sisfb_parm_mem = 0; |
| @@ -93,7 +92,6 @@ static int sisfb_tvplug = -1; /* Tv plug type (for overriding autodetection) */ | |||
| 93 | static int sisfb_tvstd = -1; | 92 | static int sisfb_tvstd = -1; |
| 94 | static int sisfb_tvxposoffset = 0; | 93 | static int sisfb_tvxposoffset = 0; |
| 95 | static int sisfb_tvyposoffset = 0; | 94 | static int sisfb_tvyposoffset = 0; |
| 96 | static int sisfb_filter = -1; | ||
| 97 | static int sisfb_nocrt2rate = 0; | 95 | static int sisfb_nocrt2rate = 0; |
| 98 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) | 96 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) |
| 99 | static int sisfb_inverse = 0; | 97 | static int sisfb_inverse = 0; |
| @@ -106,12 +104,12 @@ static int sisfb_videoram = 0; | |||
| 106 | 104 | ||
| 107 | /* List of supported chips */ | 105 | /* List of supported chips */ |
| 108 | static struct sisfb_chip_info { | 106 | static struct sisfb_chip_info { |
| 109 | int chip; | 107 | int chip; |
| 110 | int vgaengine; | 108 | int vgaengine; |
| 111 | int mni; | 109 | int mni; |
| 112 | int hwcursor_size; | 110 | int hwcursor_size; |
| 113 | int CRT2_write_enable; | 111 | int CRT2_write_enable; |
| 114 | const char *chip_name; | 112 | const char *chip_name; |
| 115 | } sisfb_chip_info[] __devinitdata = { | 113 | } sisfb_chip_info[] __devinitdata = { |
| 116 | { SIS_300, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 300/305" }, | 114 | { SIS_300, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 300/305" }, |
| 117 | { SIS_540, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 540" }, | 115 | { SIS_540, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 540" }, |
| @@ -123,6 +121,8 @@ static struct sisfb_chip_info { | |||
| 123 | { SIS_650, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 650" }, | 121 | { SIS_650, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 650" }, |
| 124 | { SIS_330, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 330" }, | 122 | { SIS_330, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 330" }, |
| 125 | { SIS_660, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 660" }, | 123 | { SIS_660, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 660" }, |
| 124 | { XGI_20, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "XGI Z7" }, | ||
| 125 | { XGI_40, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "XGI V3XT/V5/V8" }, | ||
| 126 | }; | 126 | }; |
| 127 | 127 | ||
| 128 | static struct pci_device_id __devinitdata sisfb_pci_table[] = { | 128 | static struct pci_device_id __devinitdata sisfb_pci_table[] = { |
| @@ -139,6 +139,8 @@ static struct pci_device_id __devinitdata sisfb_pci_table[] = { | |||
| 139 | { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7}, | 139 | { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7}, |
| 140 | { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_330, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8}, | 140 | { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_330, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8}, |
| 141 | { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_660_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9}, | 141 | { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_660_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9}, |
| 142 | { PCI_VENDOR_ID_XGI,PCI_DEVICE_ID_XGI_20, PCI_ANY_ID, PCI_ANY_ID, 0, 0,10}, | ||
| 143 | { PCI_VENDOR_ID_XGI,PCI_DEVICE_ID_XGI_40, PCI_ANY_ID, PCI_ANY_ID, 0, 0,11}, | ||
| 142 | #endif | 144 | #endif |
| 143 | { 0 } | 145 | { 0 } |
| 144 | }; | 146 | }; |
| @@ -147,13 +149,12 @@ MODULE_DEVICE_TABLE(pci, sisfb_pci_table); | |||
| 147 | 149 | ||
| 148 | static struct sis_video_info *card_list = NULL; | 150 | static struct sis_video_info *card_list = NULL; |
| 149 | 151 | ||
| 150 | /* TODO: This is not handled card-wise because the DRM | 152 | /* The memory heap is now handled card-wise, by using |
| 151 | does not refer to a unique fb when calling sis_alloc | 153 | sis_malloc_new/sis_free_new. However, the DRM does |
| 152 | or sis_free. Therefore, this is handled globally for | 154 | not do this yet. Until it does, we keep a "global" |
| 153 | now (hoping that nobody is crazy enough to run two | 155 | heap which is actually the first card's one. |
| 154 | SiS cards at the same time). | ||
| 155 | */ | 156 | */ |
| 156 | static SIS_HEAP sisfb_heap; | 157 | static struct SIS_HEAP *sisfb_heap; |
| 157 | 158 | ||
| 158 | #define MD_SIS300 1 | 159 | #define MD_SIS300 1 |
| 159 | #define MD_SIS315 2 | 160 | #define MD_SIS315 2 |
| @@ -181,8 +182,10 @@ static const struct _sisbios_mode { | |||
| 181 | {"320x240x16", {0x56,0x56}, 0x0135, 0x0000, 320, 240, 16, 1, 40, 15, MD_SIS300|MD_SIS315}, | 182 | {"320x240x16", {0x56,0x56}, 0x0135, 0x0000, 320, 240, 16, 1, 40, 15, MD_SIS300|MD_SIS315}, |
| 182 | {"320x240x24", {0x53,0x53}, 0x0000, 0x0000, 320, 240, 32, 1, 40, 15, MD_SIS300|MD_SIS315}, | 183 | {"320x240x24", {0x53,0x53}, 0x0000, 0x0000, 320, 240, 32, 1, 40, 15, MD_SIS300|MD_SIS315}, |
| 183 | {"320x240x32", {0x53,0x53}, 0x0000, 0x0000, 320, 240, 32, 1, 40, 15, MD_SIS300|MD_SIS315}, | 184 | {"320x240x32", {0x53,0x53}, 0x0000, 0x0000, 320, 240, 32, 1, 40, 15, MD_SIS300|MD_SIS315}, |
| 184 | {"320x240x8", {0x5a,0x5a}, 0x0132, 0x0000, 320, 480, 8, 1, 40, 30, MD_SIS315}, /* FSTN */ | 185 | #define MODE_FSTN_8 9 |
| 185 | /*10*/ {"320x240x16", {0x5b,0x5b}, 0x0135, 0x0000, 320, 480, 16, 1, 40, 30, MD_SIS315}, /* FSTN */ | 186 | #define MODE_FSTN_16 10 |
| 187 | {"320x240x8", {0x5a,0x5a}, 0x0132, 0x0000, 320, 240, 8, 1, 40, 15, MD_SIS315}, /* FSTN */ | ||
| 188 | /*10*/ {"320x240x16", {0x5b,0x5b}, 0x0135, 0x0000, 320, 240, 16, 1, 40, 15, MD_SIS315}, /* FSTN */ | ||
| 186 | {"400x300x8", {0x51,0x51}, 0x0133, 0x0000, 400, 300, 8, 1, 50, 18, MD_SIS300|MD_SIS315}, | 189 | {"400x300x8", {0x51,0x51}, 0x0133, 0x0000, 400, 300, 8, 1, 50, 18, MD_SIS300|MD_SIS315}, |
| 187 | {"400x300x16", {0x57,0x57}, 0x0136, 0x0000, 400, 300, 16, 1, 50, 18, MD_SIS300|MD_SIS315}, | 190 | {"400x300x16", {0x57,0x57}, 0x0136, 0x0000, 400, 300, 16, 1, 50, 18, MD_SIS300|MD_SIS315}, |
| 188 | {"400x300x24", {0x54,0x54}, 0x0000, 0x0000, 400, 300, 32, 1, 50, 18, MD_SIS300|MD_SIS315}, | 191 | {"400x300x24", {0x54,0x54}, 0x0000, 0x0000, 400, 300, 32, 1, 50, 18, MD_SIS300|MD_SIS315}, |
| @@ -215,18 +218,20 @@ static const struct _sisbios_mode { | |||
| 215 | /*40*/ {"800x480x16", {0x7a,0x7a}, 0x0000, 0x0000, 800, 480, 16, 1, 100, 30, MD_SIS300|MD_SIS315}, | 218 | /*40*/ {"800x480x16", {0x7a,0x7a}, 0x0000, 0x0000, 800, 480, 16, 1, 100, 30, MD_SIS300|MD_SIS315}, |
| 216 | {"800x480x24", {0x76,0x76}, 0x0000, 0x0000, 800, 480, 32, 1, 100, 30, MD_SIS300|MD_SIS315}, | 219 | {"800x480x24", {0x76,0x76}, 0x0000, 0x0000, 800, 480, 32, 1, 100, 30, MD_SIS300|MD_SIS315}, |
| 217 | {"800x480x32", {0x76,0x76}, 0x0000, 0x0000, 800, 480, 32, 1, 100, 30, MD_SIS300|MD_SIS315}, | 220 | {"800x480x32", {0x76,0x76}, 0x0000, 0x0000, 800, 480, 32, 1, 100, 30, MD_SIS300|MD_SIS315}, |
| 218 | #define DEFAULT_MODE 43 /* index for 800x600x8 */ | 221 | #define DEFAULT_MODE 43 /* index for 800x600x8 */ |
| 219 | #define DEFAULT_LCDMODE 43 /* index for 800x600x8 */ | 222 | #define DEFAULT_LCDMODE 43 /* index for 800x600x8 */ |
| 220 | #define DEFAULT_TVMODE 43 /* index for 800x600x8 */ | 223 | #define DEFAULT_TVMODE 43 /* index for 800x600x8 */ |
| 221 | {"800x600x8", {0x30,0x30}, 0x0103, 0x0103, 800, 600, 8, 2, 100, 37, MD_SIS300|MD_SIS315}, | 224 | {"800x600x8", {0x30,0x30}, 0x0103, 0x0103, 800, 600, 8, 2, 100, 37, MD_SIS300|MD_SIS315}, |
| 222 | {"800x600x16", {0x47,0x47}, 0x0114, 0x0114, 800, 600, 16, 2, 100, 37, MD_SIS300|MD_SIS315}, | 225 | {"800x600x16", {0x47,0x47}, 0x0114, 0x0114, 800, 600, 16, 2, 100, 37, MD_SIS300|MD_SIS315}, |
| 223 | {"800x600x24", {0x63,0x63}, 0x013b, 0x0115, 800, 600, 32, 2, 100, 37, MD_SIS300|MD_SIS315}, | 226 | {"800x600x24", {0x63,0x63}, 0x013b, 0x0115, 800, 600, 32, 2, 100, 37, MD_SIS300|MD_SIS315}, |
| 224 | {"800x600x32", {0x63,0x63}, 0x013b, 0x0115, 800, 600, 32, 2, 100, 37, MD_SIS300|MD_SIS315}, | 227 | {"800x600x32", {0x63,0x63}, 0x013b, 0x0115, 800, 600, 32, 2, 100, 37, MD_SIS300|MD_SIS315}, |
| 225 | {"848x480x8", {0x39,0x39}, 0x0000, 0x0000, 848, 480, 8, 2, 106, 30, MD_SIS300|MD_SIS315}, | 228 | {"848x480x8", {0x39,0x39}, 0x0000, 0x0000, 848, 480, 8, 2, 106, 30, MD_SIS300|MD_SIS315}, |
| 229 | #define DEFAULT_MODE_848 48 | ||
| 226 | {"848x480x16", {0x3b,0x3b}, 0x0000, 0x0000, 848, 480, 16, 2, 106, 30, MD_SIS300|MD_SIS315}, | 230 | {"848x480x16", {0x3b,0x3b}, 0x0000, 0x0000, 848, 480, 16, 2, 106, 30, MD_SIS300|MD_SIS315}, |
| 227 | {"848x480x24", {0x3e,0x3e}, 0x0000, 0x0000, 848, 480, 32, 2, 106, 30, MD_SIS300|MD_SIS315}, | 231 | {"848x480x24", {0x3e,0x3e}, 0x0000, 0x0000, 848, 480, 32, 2, 106, 30, MD_SIS300|MD_SIS315}, |
| 228 | /*50*/ {"848x480x32", {0x3e,0x3e}, 0x0000, 0x0000, 848, 480, 32, 2, 106, 30, MD_SIS300|MD_SIS315}, | 232 | /*50*/ {"848x480x32", {0x3e,0x3e}, 0x0000, 0x0000, 848, 480, 32, 2, 106, 30, MD_SIS300|MD_SIS315}, |
| 229 | {"856x480x8", {0x3f,0x3f}, 0x0000, 0x0000, 856, 480, 8, 2, 107, 30, MD_SIS300|MD_SIS315}, | 233 | {"856x480x8", {0x3f,0x3f}, 0x0000, 0x0000, 856, 480, 8, 2, 107, 30, MD_SIS300|MD_SIS315}, |
| 234 | #define DEFAULT_MODE_856 52 | ||
| 230 | {"856x480x16", {0x42,0x42}, 0x0000, 0x0000, 856, 480, 16, 2, 107, 30, MD_SIS300|MD_SIS315}, | 235 | {"856x480x16", {0x42,0x42}, 0x0000, 0x0000, 856, 480, 16, 2, 107, 30, MD_SIS300|MD_SIS315}, |
| 231 | {"856x480x24", {0x45,0x45}, 0x0000, 0x0000, 856, 480, 32, 2, 107, 30, MD_SIS300|MD_SIS315}, | 236 | {"856x480x24", {0x45,0x45}, 0x0000, 0x0000, 856, 480, 32, 2, 107, 30, MD_SIS300|MD_SIS315}, |
| 232 | {"856x480x32", {0x45,0x45}, 0x0000, 0x0000, 856, 480, 32, 2, 107, 30, MD_SIS300|MD_SIS315}, | 237 | {"856x480x32", {0x45,0x45}, 0x0000, 0x0000, 856, 480, 32, 2, 107, 30, MD_SIS300|MD_SIS315}, |
| @@ -270,42 +275,47 @@ static const struct _sisbios_mode { | |||
| 270 | {"1280x800x16", {0x15,0x15}, 0x0000, 0x0000, 1280, 800, 16, 1, 160, 50, MD_SIS315}, | 275 | {"1280x800x16", {0x15,0x15}, 0x0000, 0x0000, 1280, 800, 16, 1, 160, 50, MD_SIS315}, |
| 271 | {"1280x800x24", {0x16,0x16}, 0x0000, 0x0000, 1280, 800, 32, 1, 160, 50, MD_SIS315}, | 276 | {"1280x800x24", {0x16,0x16}, 0x0000, 0x0000, 1280, 800, 32, 1, 160, 50, MD_SIS315}, |
| 272 | {"1280x800x32", {0x16,0x16}, 0x0000, 0x0000, 1280, 800, 32, 1, 160, 50, MD_SIS315}, | 277 | {"1280x800x32", {0x16,0x16}, 0x0000, 0x0000, 1280, 800, 32, 1, 160, 50, MD_SIS315}, |
| 278 | {"1280x854x8", {0x14,0x14}, 0x0000, 0x0000, 1280, 854, 8, 1, 160, 53, MD_SIS315}, | ||
| 279 | {"1280x854x16", {0x15,0x15}, 0x0000, 0x0000, 1280, 854, 16, 1, 160, 53, MD_SIS315}, | ||
| 280 | {"1280x854x24", {0x16,0x16}, 0x0000, 0x0000, 1280, 854, 32, 1, 160, 53, MD_SIS315}, | ||
| 281 | {"1280x854x32", {0x16,0x16}, 0x0000, 0x0000, 1280, 854, 32, 1, 160, 53, MD_SIS315}, | ||
| 273 | {"1280x960x8", {0x7c,0x7c}, 0x0000, 0x0000, 1280, 960, 8, 1, 160, 60, MD_SIS300|MD_SIS315}, | 282 | {"1280x960x8", {0x7c,0x7c}, 0x0000, 0x0000, 1280, 960, 8, 1, 160, 60, MD_SIS300|MD_SIS315}, |
| 274 | {"1280x960x16", {0x7d,0x7d}, 0x0000, 0x0000, 1280, 960, 16, 1, 160, 60, MD_SIS300|MD_SIS315}, | 283 | /*100*/ {"1280x960x16", {0x7d,0x7d}, 0x0000, 0x0000, 1280, 960, 16, 1, 160, 60, MD_SIS300|MD_SIS315}, |
| 275 | {"1280x960x24", {0x7e,0x7e}, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315}, | 284 | {"1280x960x24", {0x7e,0x7e}, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315}, |
| 276 | {"1280x960x32", {0x7e,0x7e}, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315}, | 285 | {"1280x960x32", {0x7e,0x7e}, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315}, |
| 277 | {"1280x1024x8", {0x3a,0x3a}, 0x0107, 0x0107, 1280, 1024, 8, 2, 160, 64, MD_SIS300|MD_SIS315}, | 286 | {"1280x1024x8", {0x3a,0x3a}, 0x0107, 0x0107, 1280, 1024, 8, 2, 160, 64, MD_SIS300|MD_SIS315}, |
| 278 | /*100*/ {"1280x1024x16", {0x4d,0x4d}, 0x011a, 0x011a, 1280, 1024, 16, 2, 160, 64, MD_SIS300|MD_SIS315}, | 287 | {"1280x1024x16", {0x4d,0x4d}, 0x011a, 0x011a, 1280, 1024, 16, 2, 160, 64, MD_SIS300|MD_SIS315}, |
| 279 | {"1280x1024x24", {0x65,0x65}, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315}, | 288 | {"1280x1024x24", {0x65,0x65}, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315}, |
| 280 | {"1280x1024x32", {0x65,0x65}, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315}, | 289 | {"1280x1024x32", {0x65,0x65}, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315}, |
| 281 | {"1360x768x8", {0x48,0x48}, 0x0000, 0x0000, 1360, 768, 8, 1, 170, 48, MD_SIS300|MD_SIS315}, | 290 | {"1360x768x8", {0x48,0x48}, 0x0000, 0x0000, 1360, 768, 8, 1, 170, 48, MD_SIS300|MD_SIS315}, |
| 282 | {"1360x768x16", {0x4b,0x4b}, 0x0000, 0x0000, 1360, 768, 16, 1, 170, 48, MD_SIS300|MD_SIS315}, | 291 | {"1360x768x16", {0x4b,0x4b}, 0x0000, 0x0000, 1360, 768, 16, 1, 170, 48, MD_SIS300|MD_SIS315}, |
| 283 | {"1360x768x24", {0x4e,0x4e}, 0x0000, 0x0000, 1360, 768, 32, 1, 170, 48, MD_SIS300|MD_SIS315}, | 292 | {"1360x768x24", {0x4e,0x4e}, 0x0000, 0x0000, 1360, 768, 32, 1, 170, 48, MD_SIS300|MD_SIS315}, |
| 284 | {"1360x768x32", {0x4e,0x4e}, 0x0000, 0x0000, 1360, 768, 32, 1, 170, 48, MD_SIS300|MD_SIS315}, | 293 | /*110*/ {"1360x768x32", {0x4e,0x4e}, 0x0000, 0x0000, 1360, 768, 32, 1, 170, 48, MD_SIS300|MD_SIS315}, |
| 285 | {"1360x1024x8", {0x67,0x67}, 0x0000, 0x0000, 1360, 1024, 8, 1, 170, 64, MD_SIS300 }, | 294 | {"1360x1024x8", {0x67,0x67}, 0x0000, 0x0000, 1360, 1024, 8, 1, 170, 64, MD_SIS300 }, |
| 295 | #define DEFAULT_MODE_1360 112 | ||
| 286 | {"1360x1024x16", {0x6f,0x6f}, 0x0000, 0x0000, 1360, 1024, 16, 1, 170, 64, MD_SIS300 }, | 296 | {"1360x1024x16", {0x6f,0x6f}, 0x0000, 0x0000, 1360, 1024, 16, 1, 170, 64, MD_SIS300 }, |
| 287 | {"1360x1024x24", {0x72,0x72}, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300 }, | 297 | {"1360x1024x24", {0x72,0x72}, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300 }, |
| 288 | /*110*/ {"1360x1024x32", {0x72,0x72}, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300 }, | 298 | {"1360x1024x32", {0x72,0x72}, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300 }, |
| 289 | {"1400x1050x8", {0x26,0x26}, 0x0000, 0x0000, 1400, 1050, 8, 1, 175, 65, MD_SIS315}, | 299 | {"1400x1050x8", {0x26,0x26}, 0x0000, 0x0000, 1400, 1050, 8, 1, 175, 65, MD_SIS315}, |
| 290 | {"1400x1050x16", {0x27,0x27}, 0x0000, 0x0000, 1400, 1050, 16, 1, 175, 65, MD_SIS315}, | 300 | {"1400x1050x16", {0x27,0x27}, 0x0000, 0x0000, 1400, 1050, 16, 1, 175, 65, MD_SIS315}, |
| 291 | {"1400x1050x24", {0x28,0x28}, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65, MD_SIS315}, | 301 | {"1400x1050x24", {0x28,0x28}, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65, MD_SIS315}, |
| 292 | {"1400x1050x32", {0x28,0x28}, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65, MD_SIS315}, | 302 | {"1400x1050x32", {0x28,0x28}, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65, MD_SIS315}, |
| 293 | {"1600x1200x8", {0x3c,0x3c}, 0x0130, 0x011c, 1600, 1200, 8, 1, 200, 75, MD_SIS300|MD_SIS315}, | 303 | {"1600x1200x8", {0x3c,0x3c}, 0x0130, 0x011c, 1600, 1200, 8, 1, 200, 75, MD_SIS300|MD_SIS315}, |
| 294 | {"1600x1200x16", {0x3d,0x3d}, 0x0131, 0x011e, 1600, 1200, 16, 1, 200, 75, MD_SIS300|MD_SIS315}, | 304 | /*120*/ {"1600x1200x16", {0x3d,0x3d}, 0x0131, 0x011e, 1600, 1200, 16, 1, 200, 75, MD_SIS300|MD_SIS315}, |
| 295 | {"1600x1200x24", {0x66,0x66}, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315}, | 305 | {"1600x1200x24", {0x66,0x66}, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315}, |
| 296 | {"1600x1200x32", {0x66,0x66}, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315}, | 306 | {"1600x1200x32", {0x66,0x66}, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315}, |
| 297 | {"1680x1050x8", {0x17,0x17}, 0x0000, 0x0000, 1680, 1050, 8, 1, 210, 65, MD_SIS315}, | 307 | {"1680x1050x8", {0x17,0x17}, 0x0000, 0x0000, 1680, 1050, 8, 1, 210, 65, MD_SIS315}, |
| 298 | /*120*/ {"1680x1050x16", {0x18,0x18}, 0x0000, 0x0000, 1680, 1050, 16, 1, 210, 65, MD_SIS315}, | 308 | {"1680x1050x16", {0x18,0x18}, 0x0000, 0x0000, 1680, 1050, 16, 1, 210, 65, MD_SIS315}, |
| 299 | {"1680x1050x24", {0x19,0x19}, 0x0000, 0x0000, 1680, 1050, 32, 1, 210, 65, MD_SIS315}, | 309 | {"1680x1050x24", {0x19,0x19}, 0x0000, 0x0000, 1680, 1050, 32, 1, 210, 65, MD_SIS315}, |
| 300 | {"1680x1050x32", {0x19,0x19}, 0x0000, 0x0000, 1680, 1050, 32, 1, 210, 65, MD_SIS315}, | 310 | {"1680x1050x32", {0x19,0x19}, 0x0000, 0x0000, 1680, 1050, 32, 1, 210, 65, MD_SIS315}, |
| 301 | {"1920x1080x8", {0x2c,0x2c}, 0x0000, 0x0000, 1920, 1080, 8, 1, 240, 67, MD_SIS315}, | 311 | {"1920x1080x8", {0x2c,0x2c}, 0x0000, 0x0000, 1920, 1080, 8, 1, 240, 67, MD_SIS315}, |
| 302 | {"1920x1080x16", {0x2d,0x2d}, 0x0000, 0x0000, 1920, 1080, 16, 1, 240, 67, MD_SIS315}, | 312 | {"1920x1080x16", {0x2d,0x2d}, 0x0000, 0x0000, 1920, 1080, 16, 1, 240, 67, MD_SIS315}, |
| 303 | {"1920x1080x24", {0x73,0x73}, 0x0000, 0x0000, 1920, 1080, 32, 1, 240, 67, MD_SIS315}, | 313 | {"1920x1080x24", {0x73,0x73}, 0x0000, 0x0000, 1920, 1080, 32, 1, 240, 67, MD_SIS315}, |
| 304 | {"1920x1080x32", {0x73,0x73}, 0x0000, 0x0000, 1920, 1080, 32, 1, 240, 67, MD_SIS315}, | 314 | /*130*/ {"1920x1080x32", {0x73,0x73}, 0x0000, 0x0000, 1920, 1080, 32, 1, 240, 67, MD_SIS315}, |
| 305 | {"1920x1440x8", {0x68,0x68}, 0x013f, 0x0000, 1920, 1440, 8, 1, 240, 75, MD_SIS300|MD_SIS315}, | 315 | {"1920x1440x8", {0x68,0x68}, 0x013f, 0x0000, 1920, 1440, 8, 1, 240, 75, MD_SIS300|MD_SIS315}, |
| 306 | {"1920x1440x16", {0x69,0x69}, 0x0140, 0x0000, 1920, 1440, 16, 1, 240, 75, MD_SIS300|MD_SIS315}, | 316 | {"1920x1440x16", {0x69,0x69}, 0x0140, 0x0000, 1920, 1440, 16, 1, 240, 75, MD_SIS300|MD_SIS315}, |
| 307 | {"1920x1440x24", {0x6b,0x6b}, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315}, | 317 | {"1920x1440x24", {0x6b,0x6b}, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315}, |
| 308 | /*130*/ {"1920x1440x32", {0x6b,0x6b}, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315}, | 318 | {"1920x1440x32", {0x6b,0x6b}, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315}, |
| 309 | {"2048x1536x8", {0x6c,0x6c}, 0x0000, 0x0000, 2048, 1536, 8, 1, 256, 96, MD_SIS315}, | 319 | {"2048x1536x8", {0x6c,0x6c}, 0x0000, 0x0000, 2048, 1536, 8, 1, 256, 96, MD_SIS315}, |
| 310 | {"2048x1536x16", {0x6d,0x6d}, 0x0000, 0x0000, 2048, 1536, 16, 1, 256, 96, MD_SIS315}, | 320 | {"2048x1536x16", {0x6d,0x6d}, 0x0000, 0x0000, 2048, 1536, 16, 1, 256, 96, MD_SIS315}, |
| 311 | {"2048x1536x24", {0x6e,0x6e}, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96, MD_SIS315}, | 321 | {"2048x1536x24", {0x6e,0x6e}, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96, MD_SIS315}, |
| @@ -313,13 +323,13 @@ static const struct _sisbios_mode { | |||
| 313 | {"\0", {0x00,0x00}, 0, 0, 0, 0, 0, 0, 0} | 323 | {"\0", {0x00,0x00}, 0, 0, 0, 0, 0, 0, 0} |
| 314 | }; | 324 | }; |
| 315 | 325 | ||
| 316 | #define SIS_LCD_NUMBER 17 | 326 | #define SIS_LCD_NUMBER 18 |
| 317 | static const struct _sis_lcd_data { | 327 | static struct _sis_lcd_data { |
| 318 | u32 lcdtype; | 328 | u32 lcdtype; |
| 319 | u16 xres; | 329 | u16 xres; |
| 320 | u16 yres; | 330 | u16 yres; |
| 321 | u8 default_mode_idx; | 331 | u8 default_mode_idx; |
| 322 | } sis_lcd_data[] = { | 332 | } sis_lcd_data[] __devinitdata = { |
| 323 | { LCD_640x480, 640, 480, 23 }, | 333 | { LCD_640x480, 640, 480, 23 }, |
| 324 | { LCD_800x600, 800, 600, 43 }, | 334 | { LCD_800x600, 800, 600, 43 }, |
| 325 | { LCD_1024x600, 1024, 600, 67 }, | 335 | { LCD_1024x600, 1024, 600, 67 }, |
| @@ -329,34 +339,38 @@ static const struct _sis_lcd_data { | |||
| 329 | { LCD_1280x720, 1280, 720, 83 }, | 339 | { LCD_1280x720, 1280, 720, 83 }, |
| 330 | { LCD_1280x768, 1280, 768, 87 }, | 340 | { LCD_1280x768, 1280, 768, 87 }, |
| 331 | { LCD_1280x800, 1280, 800, 91 }, | 341 | { LCD_1280x800, 1280, 800, 91 }, |
| 332 | { LCD_1280x960, 1280, 960, 95 }, | 342 | { LCD_1280x854, 1280, 854, 95 }, |
| 333 | { LCD_1280x1024, 1280, 1024, 99 }, | 343 | { LCD_1280x960, 1280, 960, 99 }, |
| 334 | { LCD_1400x1050, 1400, 1050, 111 }, | 344 | { LCD_1280x1024, 1280, 1024, 103 }, |
| 335 | { LCD_1680x1050, 1680, 1050, 119 }, | 345 | { LCD_1400x1050, 1400, 1050, 115 }, |
| 336 | { LCD_1600x1200, 1600, 1200, 115 }, | 346 | { LCD_1680x1050, 1680, 1050, 123 }, |
| 337 | { LCD_640x480_2, 640, 480, 23 }, | 347 | { LCD_1600x1200, 1600, 1200, 119 }, |
| 338 | { LCD_640x480_3, 640, 480, 23 }, | 348 | { LCD_320x240_2, 320, 240, 9 }, |
| 339 | { LCD_320x480, 320, 480, 9 }, | 349 | { LCD_320x240_3, 320, 240, 9 }, |
| 350 | { LCD_320x240, 320, 240, 9 }, | ||
| 340 | }; | 351 | }; |
| 341 | 352 | ||
| 342 | /* CR36 evaluation */ | 353 | /* CR36 evaluation */ |
| 343 | static const USHORT sis300paneltype[] = | 354 | static unsigned short sis300paneltype[] __devinitdata = { |
| 344 | { LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, | 355 | LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, |
| 345 | LCD_1280x960, LCD_640x480, LCD_1024x600, LCD_1152x768, | 356 | LCD_1280x960, LCD_640x480, LCD_1024x600, LCD_1152x768, |
| 346 | LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, | 357 | LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, |
| 347 | LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN }; | 358 | LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN |
| 348 | 359 | }; | |
| 349 | static const USHORT sis310paneltype[] = | 360 | |
| 350 | { LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, | 361 | static unsigned short sis310paneltype[] __devinitdata = { |
| 351 | LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960, | 362 | LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, |
| 352 | LCD_1152x768, LCD_1400x1050, LCD_1280x768, LCD_1600x1200, | 363 | LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960, |
| 353 | LCD_640x480_2, LCD_640x480_3, LCD_UNKNOWN, LCD_UNKNOWN }; | 364 | LCD_1152x768, LCD_1400x1050, LCD_1280x768, LCD_1600x1200, |
| 354 | 365 | LCD_320x240_2, LCD_320x240_3, LCD_UNKNOWN, LCD_UNKNOWN | |
| 355 | static const USHORT sis661paneltype[] = | 366 | }; |
| 356 | { LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, | 367 | |
| 357 | LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960, | 368 | static unsigned short sis661paneltype[] __devinitdata = { |
| 358 | LCD_1152x768, LCD_1400x1050, LCD_1280x768, LCD_1600x1200, | 369 | LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, |
| 359 | LCD_1280x800, LCD_1680x1050, LCD_1280x720, LCD_UNKNOWN }; | 370 | LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960, |
| 371 | LCD_1280x854, LCD_1400x1050, LCD_1280x768, LCD_1600x1200, | ||
| 372 | LCD_1280x800, LCD_1680x1050, LCD_1280x720, LCD_UNKNOWN | ||
| 373 | }; | ||
| 360 | 374 | ||
| 361 | #define FL_550_DSTN 0x01 | 375 | #define FL_550_DSTN 0x01 |
| 362 | #define FL_550_FSTN 0x02 | 376 | #define FL_550_FSTN 0x02 |
| @@ -413,7 +427,6 @@ static const struct _sis_vrate { | |||
| 413 | } sisfb_vrate[] = { | 427 | } sisfb_vrate[] = { |
| 414 | {1, 320, 200, 70, TRUE}, | 428 | {1, 320, 200, 70, TRUE}, |
| 415 | {1, 320, 240, 60, TRUE}, | 429 | {1, 320, 240, 60, TRUE}, |
| 416 | {1, 320, 480, 60, TRUE}, | ||
| 417 | {1, 400, 300, 60, TRUE}, | 430 | {1, 400, 300, 60, TRUE}, |
| 418 | {1, 512, 384, 60, TRUE}, | 431 | {1, 512, 384, 60, TRUE}, |
| 419 | {1, 640, 400, 72, TRUE}, | 432 | {1, 640, 400, 72, TRUE}, |
| @@ -437,10 +450,11 @@ static const struct _sis_vrate { | |||
| 437 | {4, 1024, 768, 75, FALSE}, {5, 1024, 768, 85, TRUE}, {6, 1024, 768, 100, TRUE}, | 450 | {4, 1024, 768, 75, FALSE}, {5, 1024, 768, 85, TRUE}, {6, 1024, 768, 100, TRUE}, |
| 438 | {7, 1024, 768, 120, TRUE}, | 451 | {7, 1024, 768, 120, TRUE}, |
| 439 | {1, 1152, 768, 60, TRUE}, | 452 | {1, 1152, 768, 60, TRUE}, |
| 440 | {1, 1152, 864, 60, TRUE}, {1, 1152, 864, 75, TRUE}, {2, 1152, 864, 84, TRUE}, | 453 | {1, 1152, 864, 60, TRUE}, {2, 1152, 864, 75, TRUE}, {3, 1152, 864, 84, TRUE}, |
| 441 | {1, 1280, 720, 60, TRUE}, {2, 1280, 720, 75, TRUE}, {3, 1280, 720, 85, TRUE}, | 454 | {1, 1280, 720, 60, TRUE}, {2, 1280, 720, 75, TRUE}, {3, 1280, 720, 85, TRUE}, |
| 442 | {1, 1280, 768, 60, TRUE}, | 455 | {1, 1280, 768, 60, TRUE}, |
| 443 | {1, 1280, 800, 60, TRUE}, | 456 | {1, 1280, 800, 60, TRUE}, |
| 457 | {1, 1280, 854, 60, TRUE}, | ||
| 444 | {1, 1280, 960, 60, TRUE}, {2, 1280, 960, 85, TRUE}, | 458 | {1, 1280, 960, 60, TRUE}, {2, 1280, 960, 85, TRUE}, |
| 445 | {1, 1280, 1024, 43, TRUE}, {2, 1280, 1024, 60, TRUE}, {3, 1280, 1024, 75, TRUE}, | 459 | {1, 1280, 1024, 43, TRUE}, {2, 1280, 1024, 60, TRUE}, {3, 1280, 1024, 75, TRUE}, |
| 446 | {4, 1280, 1024, 85, TRUE}, | 460 | {4, 1280, 1024, 85, TRUE}, |
| @@ -459,12 +473,12 @@ static const struct _sis_vrate { | |||
| 459 | {0, 0, 0, 0, FALSE} | 473 | {0, 0, 0, 0, FALSE} |
| 460 | }; | 474 | }; |
| 461 | 475 | ||
| 462 | static const struct _sisfbddcsmodes { | 476 | static struct _sisfbddcsmodes { |
| 463 | u32 mask; | 477 | u32 mask; |
| 464 | u16 h; | 478 | u16 h; |
| 465 | u16 v; | 479 | u16 v; |
| 466 | u32 d; | 480 | u32 d; |
| 467 | } sisfb_ddcsmodes[] = { | 481 | } sisfb_ddcsmodes[] __devinitdata = { |
| 468 | { 0x10000, 67, 75, 108000}, | 482 | { 0x10000, 67, 75, 108000}, |
| 469 | { 0x08000, 48, 72, 50000}, | 483 | { 0x08000, 48, 72, 50000}, |
| 470 | { 0x04000, 46, 75, 49500}, | 484 | { 0x04000, 46, 75, 49500}, |
| @@ -480,49 +494,49 @@ static const struct _sisfbddcsmodes { | |||
| 480 | { 0x00001, 38, 60, 40000} | 494 | { 0x00001, 38, 60, 40000} |
| 481 | }; | 495 | }; |
| 482 | 496 | ||
| 483 | static const struct _sisfbddcfmodes { | 497 | static struct _sisfbddcfmodes { |
| 484 | u16 x; | 498 | u16 x; |
| 485 | u16 y; | 499 | u16 y; |
| 486 | u16 v; | 500 | u16 v; |
| 487 | u16 h; | 501 | u16 h; |
| 488 | u32 d; | 502 | u32 d; |
| 489 | } sisfb_ddcfmodes[] = { | 503 | } sisfb_ddcfmodes[] __devinitdata = { |
| 490 | { 1280, 1024, 85, 92, 157500}, | 504 | { 1280, 1024, 85, 92, 157500}, |
| 491 | { 1600, 1200, 60, 75, 162000}, | 505 | { 1600, 1200, 60, 75, 162000}, |
| 492 | { 1600, 1200, 65, 82, 175500}, | 506 | { 1600, 1200, 65, 82, 175500}, |
| 493 | { 1600, 1200, 70, 88, 189000}, | 507 | { 1600, 1200, 70, 88, 189000}, |
| 494 | { 1600, 1200, 75, 94, 202500}, | 508 | { 1600, 1200, 75, 94, 202500}, |
| 495 | { 1600, 1200, 85, 107,229500}, | 509 | { 1600, 1200, 85, 107,229500}, |
| 496 | { 1920, 1440, 60, 90, 234000}, | 510 | { 1920, 1440, 60, 90, 234000}, |
| 497 | { 1920, 1440, 75, 113,297000} | 511 | { 1920, 1440, 75, 113,297000} |
| 498 | }; | 512 | }; |
| 499 | 513 | ||
| 500 | #ifdef CONFIG_FB_SIS_300 | 514 | #ifdef CONFIG_FB_SIS_300 |
| 501 | static struct _chswtable { | 515 | static struct _chswtable { |
| 502 | u16 subsysVendor; | 516 | u16 subsysVendor; |
| 503 | u16 subsysCard; | 517 | u16 subsysCard; |
| 504 | char *vendorName; | 518 | char *vendorName; |
| 505 | char *cardName; | 519 | char *cardName; |
| 506 | } mychswtable[] __devinitdata = { | 520 | } mychswtable[] __devinitdata = { |
| 507 | { 0x1631, 0x1002, "Mitachi", "0x1002" }, | 521 | { 0x1631, 0x1002, "Mitachi", "0x1002" }, |
| 508 | { 0x1071, 0x7521, "Mitac" , "7521P" }, | 522 | { 0x1071, 0x7521, "Mitac" , "7521P" }, |
| 509 | { 0, 0, "" , "" } | 523 | { 0, 0, "" , "" } |
| 510 | }; | 524 | }; |
| 511 | #endif | 525 | #endif |
| 512 | 526 | ||
| 513 | static struct _customttable { | 527 | static struct _customttable { |
| 514 | u16 chipID; | 528 | u16 chipID; |
| 515 | char *biosversion; | 529 | char *biosversion; |
| 516 | char *biosdate; | 530 | char *biosdate; |
| 517 | u32 bioschksum; | 531 | u32 bioschksum; |
| 518 | u16 biosFootprintAddr[5]; | 532 | u16 biosFootprintAddr[5]; |
| 519 | u8 biosFootprintData[5]; | 533 | u8 biosFootprintData[5]; |
| 520 | u16 pcisubsysvendor; | 534 | u16 pcisubsysvendor; |
| 521 | u16 pcisubsyscard; | 535 | u16 pcisubsyscard; |
| 522 | char *vendorName; | 536 | char *vendorName; |
| 523 | char *cardName; | 537 | char *cardName; |
| 524 | u32 SpecialID; | 538 | u32 SpecialID; |
| 525 | char *optionName; | 539 | char *optionName; |
| 526 | } mycustomttable[] __devinitdata = { | 540 | } mycustomttable[] __devinitdata = { |
| 527 | { SIS_630, "2.00.07", "09/27/2002-13:38:25", | 541 | { SIS_630, "2.00.07", "09/27/2002-13:38:25", |
| 528 | 0x3240A8, | 542 | 0x3240A8, |
| @@ -643,6 +657,13 @@ static struct _customttable { | |||
| 643 | 0, 0, | 657 | 0, 0, |
| 644 | "Generic", "LVDS/Parallel 848x480", CUT_PANEL848, "PANEL848x480" | 658 | "Generic", "LVDS/Parallel 848x480", CUT_PANEL848, "PANEL848x480" |
| 645 | }, | 659 | }, |
| 660 | { 4322, "", "", /* never autodetected */ | ||
| 661 | 0, | ||
| 662 | { 0, 0, 0, 0, 0 }, | ||
| 663 | { 0, 0, 0, 0, 0 }, | ||
| 664 | 0, 0, | ||
| 665 | "Generic", "LVDS/Parallel 856x480", CUT_PANEL856, "PANEL856x480" | ||
| 666 | }, | ||
| 646 | { 0, "", "", | 667 | { 0, "", "", |
| 647 | 0, | 668 | 0, |
| 648 | { 0, 0, 0, 0 }, | 669 | { 0, 0, 0, 0 }, |
| @@ -652,155 +673,6 @@ static struct _customttable { | |||
| 652 | } | 673 | } |
| 653 | }; | 674 | }; |
| 654 | 675 | ||
| 655 | static const struct _sis_TV_filter { | ||
| 656 | u8 filter[9][4]; | ||
| 657 | } sis_TV_filter[] = { | ||
| 658 | { {{0x00,0x00,0x00,0x40}, /* NTSCFilter_0 */ | ||
| 659 | {0x00,0xE0,0x10,0x60}, | ||
| 660 | {0x00,0xEE,0x10,0x44}, | ||
| 661 | {0x00,0xF4,0x10,0x38}, | ||
| 662 | {0xF8,0xF4,0x18,0x38}, | ||
| 663 | {0xFC,0xFB,0x14,0x2A}, | ||
| 664 | {0x00,0x00,0x10,0x20}, | ||
| 665 | {0x00,0x04,0x10,0x18}, | ||
| 666 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 667 | { {{0x00,0x00,0x00,0x40}, /* NTSCFilter_1 */ | ||
| 668 | {0x00,0xE0,0x10,0x60}, | ||
| 669 | {0x00,0xEE,0x10,0x44}, | ||
| 670 | {0x00,0xF4,0x10,0x38}, | ||
| 671 | {0xF8,0xF4,0x18,0x38}, | ||
| 672 | {0xFC,0xFB,0x14,0x2A}, | ||
| 673 | {0x00,0x00,0x10,0x20}, | ||
| 674 | {0x00,0x04,0x10,0x18}, | ||
| 675 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 676 | { {{0x00,0x00,0x00,0x40}, /* NTSCFilter_2 */ | ||
| 677 | {0xF5,0xEE,0x1B,0x44}, | ||
| 678 | {0xF8,0xF4,0x18,0x38}, | ||
| 679 | {0xEB,0x04,0x25,0x18}, | ||
| 680 | {0xF1,0x05,0x1F,0x16}, | ||
| 681 | {0xF6,0x06,0x1A,0x14}, | ||
| 682 | {0xFA,0x06,0x16,0x14}, | ||
| 683 | {0x00,0x04,0x10,0x18}, | ||
| 684 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 685 | { {{0x00,0x00,0x00,0x40}, /* NTSCFilter_3 */ | ||
| 686 | {0xF1,0x04,0x1F,0x18}, | ||
| 687 | {0xEE,0x0D,0x22,0x06}, | ||
| 688 | {0xF7,0x06,0x19,0x14}, | ||
| 689 | {0xF4,0x0B,0x1C,0x0A}, | ||
| 690 | {0xFA,0x07,0x16,0x12}, | ||
| 691 | {0xF9,0x0A,0x17,0x0C}, | ||
| 692 | {0x00,0x07,0x10,0x12}, | ||
| 693 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 694 | { {{0x00,0x00,0x00,0x40}, /* NTSCFilter_4 - 320 */ | ||
| 695 | {0x00,0xE0,0x10,0x60}, | ||
| 696 | {0x00,0xEE,0x10,0x44}, | ||
| 697 | {0x00,0xF4,0x10,0x38}, | ||
| 698 | {0xF8,0xF4,0x18,0x38}, | ||
| 699 | {0xFC,0xFB,0x14,0x2A}, | ||
| 700 | {0x00,0x00,0x10,0x20}, | ||
| 701 | {0x00,0x04,0x10,0x18}, | ||
| 702 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 703 | { {{0x00,0x00,0x00,0x40}, /* NTSCFilter_5 - 640 */ | ||
| 704 | {0xF5,0xEE,0x1B,0x44}, | ||
| 705 | {0xF8,0xF4,0x18,0x38}, | ||
| 706 | {0xEB,0x04,0x25,0x18}, | ||
| 707 | {0xF1,0x05,0x1F,0x16}, | ||
| 708 | {0xF6,0x06,0x1A,0x14}, | ||
| 709 | {0xFA,0x06,0x16,0x14}, | ||
| 710 | {0x00,0x04,0x10,0x18}, | ||
| 711 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 712 | { {{0x00,0x00,0x00,0x40}, /* NTSCFilter_6 - 720 */ | ||
| 713 | {0xEB,0x04,0x25,0x18}, | ||
| 714 | {0xE7,0x0E,0x29,0x04}, | ||
| 715 | {0xEE,0x0C,0x22,0x08}, | ||
| 716 | {0xF6,0x0B,0x1A,0x0A}, | ||
| 717 | {0xF9,0x0A,0x17,0x0C}, | ||
| 718 | {0xFC,0x0A,0x14,0x0C}, | ||
| 719 | {0x00,0x08,0x10,0x10}, | ||
| 720 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 721 | { {{0x00,0x00,0x00,0x40}, /* NTSCFilter_7 - 800 */ | ||
| 722 | {0xEC,0x02,0x24,0x1C}, | ||
| 723 | {0xF2,0x04,0x1E,0x18}, | ||
| 724 | {0xEB,0x15,0x25,0xF6}, | ||
| 725 | {0xF4,0x10,0x1C,0x00}, | ||
| 726 | {0xF8,0x0F,0x18,0x02}, | ||
| 727 | {0x00,0x04,0x10,0x18}, | ||
| 728 | {0x01,0x06,0x0F,0x14}, | ||
| 729 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 730 | { {{0x00,0x00,0x00,0x40}, /* PALFilter_0 */ | ||
| 731 | {0x00,0xE0,0x10,0x60}, | ||
| 732 | {0x00,0xEE,0x10,0x44}, | ||
| 733 | {0x00,0xF4,0x10,0x38}, | ||
| 734 | {0xF8,0xF4,0x18,0x38}, | ||
| 735 | {0xFC,0xFB,0x14,0x2A}, | ||
| 736 | {0x00,0x00,0x10,0x20}, | ||
| 737 | {0x00,0x04,0x10,0x18}, | ||
| 738 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 739 | { {{0x00,0x00,0x00,0x40}, /* PALFilter_1 */ | ||
| 740 | {0x00,0xE0,0x10,0x60}, | ||
| 741 | {0x00,0xEE,0x10,0x44}, | ||
| 742 | {0x00,0xF4,0x10,0x38}, | ||
| 743 | {0xF8,0xF4,0x18,0x38}, | ||
| 744 | {0xFC,0xFB,0x14,0x2A}, | ||
| 745 | {0x00,0x00,0x10,0x20}, | ||
| 746 | {0x00,0x04,0x10,0x18}, | ||
| 747 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 748 | { {{0x00,0x00,0x00,0x40}, /* PALFilter_2 */ | ||
| 749 | {0xF5,0xEE,0x1B,0x44}, | ||
| 750 | {0xF8,0xF4,0x18,0x38}, | ||
| 751 | {0xF1,0xF7,0x01,0x32}, | ||
| 752 | {0xF5,0xFB,0x1B,0x2A}, | ||
| 753 | {0xF9,0xFF,0x17,0x22}, | ||
| 754 | {0xFB,0x01,0x15,0x1E}, | ||
| 755 | {0x00,0x04,0x10,0x18}, | ||
| 756 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 757 | { {{0x00,0x00,0x00,0x40}, /* PALFilter_3 */ | ||
| 758 | {0xF5,0xFB,0x1B,0x2A}, | ||
| 759 | {0xEE,0xFE,0x22,0x24}, | ||
| 760 | {0xF3,0x00,0x1D,0x20}, | ||
| 761 | {0xF9,0x03,0x17,0x1A}, | ||
| 762 | {0xFB,0x02,0x14,0x1E}, | ||
| 763 | {0xFB,0x04,0x15,0x18}, | ||
| 764 | {0x00,0x06,0x10,0x14}, | ||
| 765 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 766 | { {{0x00,0x00,0x00,0x40}, /* PALFilter_4 - 320 */ | ||
| 767 | {0x00,0xE0,0x10,0x60}, | ||
| 768 | {0x00,0xEE,0x10,0x44}, | ||
| 769 | {0x00,0xF4,0x10,0x38}, | ||
| 770 | {0xF8,0xF4,0x18,0x38}, | ||
| 771 | {0xFC,0xFB,0x14,0x2A}, | ||
| 772 | {0x00,0x00,0x10,0x20}, | ||
| 773 | {0x00,0x04,0x10,0x18}, | ||
| 774 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 775 | { {{0x00,0x00,0x00,0x40}, /* PALFilter_5 - 640 */ | ||
| 776 | {0xF5,0xEE,0x1B,0x44}, | ||
| 777 | {0xF8,0xF4,0x18,0x38}, | ||
| 778 | {0xF1,0xF7,0x1F,0x32}, | ||
| 779 | {0xF5,0xFB,0x1B,0x2A}, | ||
| 780 | {0xF9,0xFF,0x17,0x22}, | ||
| 781 | {0xFB,0x01,0x15,0x1E}, | ||
| 782 | {0x00,0x04,0x10,0x18}, | ||
| 783 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 784 | { {{0x00,0x00,0x00,0x40}, /* PALFilter_6 - 720 */ | ||
| 785 | {0xF5,0xEE,0x1B,0x2A}, | ||
| 786 | {0xEE,0xFE,0x22,0x24}, | ||
| 787 | {0xF3,0x00,0x1D,0x20}, | ||
| 788 | {0xF9,0x03,0x17,0x1A}, | ||
| 789 | {0xFB,0x02,0x14,0x1E}, | ||
| 790 | {0xFB,0x04,0x15,0x18}, | ||
| 791 | {0x00,0x06,0x10,0x14}, | ||
| 792 | {0xFF,0xFF,0xFF,0xFF} }}, | ||
| 793 | { {{0x00,0x00,0x00,0x40}, /* PALFilter_7 - 800 */ | ||
| 794 | {0xF5,0xEE,0x1B,0x44}, | ||
| 795 | {0xF8,0xF4,0x18,0x38}, | ||
| 796 | {0xFC,0xFB,0x14,0x2A}, | ||
| 797 | {0xEB,0x05,0x25,0x16}, | ||
| 798 | {0xF1,0x05,0x1F,0x16}, | ||
| 799 | {0xFA,0x07,0x16,0x12}, | ||
| 800 | {0x00,0x07,0x10,0x12}, | ||
| 801 | {0xFF,0xFF,0xFF,0xFF} }} | ||
| 802 | }; | ||
| 803 | |||
| 804 | /* ---------------------- Prototypes ------------------------- */ | 676 | /* ---------------------- Prototypes ------------------------- */ |
| 805 | 677 | ||
| 806 | /* Interface used by the world */ | 678 | /* Interface used by the world */ |
| @@ -811,145 +683,159 @@ SISINITSTATIC int sisfb_setup(char *options); | |||
| 811 | /* Interface to the low level console driver */ | 683 | /* Interface to the low level console driver */ |
| 812 | SISINITSTATIC int sisfb_init(void); | 684 | SISINITSTATIC int sisfb_init(void); |
| 813 | 685 | ||
| 814 | |||
| 815 | /* fbdev routines */ | 686 | /* fbdev routines */ |
| 816 | static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, | 687 | static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, |
| 817 | struct fb_info *info); | 688 | struct fb_info *info); |
| 818 | 689 | ||
| 819 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) | 690 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) |
| 820 | static int sisfb_get_fix(struct fb_fix_screeninfo *fix, | 691 | static int sisfb_get_fix(struct fb_fix_screeninfo *fix, |
| 821 | int con, | 692 | int con, |
| 822 | struct fb_info *info); | 693 | struct fb_info *info); |
| 823 | static int sisfb_get_var(struct fb_var_screeninfo *var, | 694 | static int sisfb_get_var(struct fb_var_screeninfo *var, |
| 824 | int con, | 695 | int con, |
| 825 | struct fb_info *info); | 696 | struct fb_info *info); |
| 826 | static int sisfb_set_var(struct fb_var_screeninfo *var, | 697 | static int sisfb_set_var(struct fb_var_screeninfo *var, |
| 827 | int con, | 698 | int con, |
| 828 | struct fb_info *info); | 699 | struct fb_info *info); |
| 829 | static void sisfb_crtc_to_var(struct sis_video_info *ivideo, | 700 | static void sisfb_crtc_to_var(struct sis_video_info *ivideo, |
| 830 | struct fb_var_screeninfo *var); | 701 | struct fb_var_screeninfo *var); |
| 831 | static int sisfb_get_cmap(struct fb_cmap *cmap, | 702 | static int sisfb_get_cmap(struct fb_cmap *cmap, |
| 832 | int kspc, | 703 | int kspc, |
| 833 | int con, | 704 | int con, |
| 834 | struct fb_info *info); | 705 | struct fb_info *info); |
| 835 | static int sisfb_set_cmap(struct fb_cmap *cmap, | 706 | static int sisfb_set_cmap(struct fb_cmap *cmap, |
| 836 | int kspc, | 707 | int kspc, |
| 837 | int con, | 708 | int con, |
| 838 | struct fb_info *info); | 709 | struct fb_info *info); |
| 839 | static int sisfb_update_var(int con, | 710 | static int sisfb_update_var(int con, |
| 840 | struct fb_info *info); | 711 | struct fb_info *info); |
| 841 | static int sisfb_switch(int con, | 712 | static int sisfb_switch(int con, |
| 842 | struct fb_info *info); | 713 | struct fb_info *info); |
| 843 | static void sisfb_blank(int blank, | 714 | static void sisfb_blank(int blank, |
| 844 | struct fb_info *info); | 715 | struct fb_info *info); |
| 845 | static void sisfb_set_disp(int con, | 716 | static void sisfb_set_disp(int con, |
| 846 | struct fb_var_screeninfo *var, | 717 | struct fb_var_screeninfo *var, |
| 847 | struct fb_info *info); | 718 | struct fb_info *info); |
| 848 | static int sis_getcolreg(unsigned regno, unsigned *red, unsigned *green, | 719 | static int sis_getcolreg(unsigned regno, unsigned *red, unsigned *green, |
| 849 | unsigned *blue, unsigned *transp, | 720 | unsigned *blue, unsigned *transp, |
| 850 | struct fb_info *fb_info); | 721 | struct fb_info *fb_info); |
| 851 | static void sisfb_do_install_cmap(int con, | 722 | static void sisfb_do_install_cmap(int con, |
| 852 | struct fb_info *info); | 723 | struct fb_info *info); |
| 853 | static int sisfb_ioctl(struct inode *inode, struct file *file, | 724 | static int sisfb_ioctl(struct inode *inode, struct file *file, |
| 854 | unsigned int cmd, unsigned long arg, int con, | 725 | unsigned int cmd, unsigned long arg, int con, |
| 855 | struct fb_info *info); | 726 | struct fb_info *info); |
| 856 | #endif | 727 | #endif |
| 857 | 728 | ||
| 858 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) | 729 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) |
| 859 | static int sisfb_ioctl(struct inode *inode, struct file *file, | 730 | static int sisfb_ioctl(struct inode *inode, struct file *file, |
| 860 | unsigned int cmd, unsigned long arg, | 731 | unsigned int cmd, unsigned long arg, |
| 861 | struct fb_info *info); | 732 | struct fb_info *info); |
| 862 | static int sisfb_set_par(struct fb_info *info); | 733 | static int sisfb_set_par(struct fb_info *info); |
| 863 | static int sisfb_blank(int blank, | 734 | static int sisfb_blank(int blank, |
| 864 | struct fb_info *info); | 735 | struct fb_info *info); |
| 865 | extern void fbcon_sis_fillrect(struct fb_info *info, | 736 | extern void fbcon_sis_fillrect(struct fb_info *info, |
| 866 | const struct fb_fillrect *rect); | 737 | const struct fb_fillrect *rect); |
| 867 | extern void fbcon_sis_copyarea(struct fb_info *info, | 738 | extern void fbcon_sis_copyarea(struct fb_info *info, |
| 868 | const struct fb_copyarea *area); | 739 | const struct fb_copyarea *area); |
| 869 | extern int fbcon_sis_sync(struct fb_info *info); | 740 | extern int fbcon_sis_sync(struct fb_info *info); |
| 870 | #endif | 741 | #endif |
| 871 | 742 | ||
| 872 | /* Internal 2D accelerator functions */ | 743 | /* Internal 2D accelerator functions */ |
| 873 | extern int sisfb_initaccel(struct sis_video_info *ivideo); | 744 | extern int sisfb_initaccel(struct sis_video_info *ivideo); |
| 874 | extern void sisfb_syncaccel(struct sis_video_info *ivideo); | 745 | extern void sisfb_syncaccel(struct sis_video_info *ivideo); |
| 875 | 746 | ||
| 876 | /* Internal general routines */ | 747 | /* Internal general routines */ |
| 877 | static void sisfb_search_mode(char *name, BOOLEAN quiet); | 748 | static void sisfb_search_mode(char *name, BOOLEAN quiet); |
| 878 | static int sisfb_validate_mode(struct sis_video_info *ivideo, int modeindex, u32 vbflags); | 749 | static int sisfb_validate_mode(struct sis_video_info *ivideo, int modeindex, u32 vbflags); |
| 879 | static u8 sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate, | 750 | static u8 sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate, |
| 880 | int index); | 751 | int index); |
| 881 | static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green, | 752 | static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green, |
| 882 | unsigned blue, unsigned transp, | 753 | unsigned blue, unsigned transp, |
| 883 | struct fb_info *fb_info); | 754 | struct fb_info *fb_info); |
| 884 | static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive, | 755 | static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive, |
| 885 | struct fb_info *info); | 756 | struct fb_info *info); |
| 886 | static void sisfb_pre_setmode(struct sis_video_info *ivideo); | 757 | static void sisfb_pre_setmode(struct sis_video_info *ivideo); |
| 887 | static void sisfb_post_setmode(struct sis_video_info *ivideo); | 758 | static void sisfb_post_setmode(struct sis_video_info *ivideo); |
| 888 | static BOOLEAN sisfb_CheckVBRetrace(struct sis_video_info *ivideo); | 759 | static BOOLEAN sisfb_CheckVBRetrace(struct sis_video_info *ivideo); |
| 889 | static BOOLEAN sisfbcheckvretracecrt2(struct sis_video_info *ivideo); | 760 | static BOOLEAN sisfbcheckvretracecrt2(struct sis_video_info *ivideo); |
| 890 | static BOOLEAN sisfbcheckvretracecrt1(struct sis_video_info *ivideo); | 761 | static BOOLEAN sisfbcheckvretracecrt1(struct sis_video_info *ivideo); |
| 891 | static BOOLEAN sisfb_bridgeisslave(struct sis_video_info *ivideo); | 762 | static BOOLEAN sisfb_bridgeisslave(struct sis_video_info *ivideo); |
| 892 | static void sisfb_detect_VB_connect(struct sis_video_info *ivideo); | 763 | static void sisfb_detect_VB_connect(struct sis_video_info *ivideo); |
| 893 | static void sisfb_get_VB_type(struct sis_video_info *ivideo); | 764 | static void sisfb_get_VB_type(struct sis_video_info *ivideo); |
| 894 | static void sisfb_set_TVxposoffset(struct sis_video_info *ivideo, int val); | 765 | static void sisfb_set_TVxposoffset(struct sis_video_info *ivideo, int val); |
| 895 | static void sisfb_set_TVyposoffset(struct sis_video_info *ivideo, int val); | 766 | static void sisfb_set_TVyposoffset(struct sis_video_info *ivideo, int val); |
| 767 | #ifdef CONFIG_FB_SIS_300 | ||
| 768 | unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); | ||
| 769 | void sisfb_write_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg, unsigned int val); | ||
| 770 | unsigned int sisfb_read_lpc_pci_dword(struct SiS_Private *SiS_Pr, int reg); | ||
| 771 | #endif | ||
| 772 | #ifdef CONFIG_FB_SIS_315 | ||
| 773 | void sisfb_write_nbridge_pci_byte(struct SiS_Private *SiS_Pr, int reg, unsigned char val); | ||
| 774 | unsigned int sisfb_read_mio_pci_word(struct SiS_Private *SiS_Pr, int reg); | ||
| 775 | #endif | ||
| 896 | 776 | ||
| 897 | /* SiS-specific exported functions */ | 777 | /* SiS-specific exported functions */ |
| 898 | void sis_malloc(struct sis_memreq *req); | 778 | void sis_malloc(struct sis_memreq *req); |
| 899 | void sis_free(u32 base); | 779 | void sis_malloc_new(struct pci_dev *pdev, struct sis_memreq *req); |
| 780 | void sis_free(u32 base); | ||
| 781 | void sis_free_new(struct pci_dev *pdev, u32 base); | ||
| 900 | 782 | ||
| 901 | /* Internal heap routines */ | 783 | /* Internal heap routines */ |
| 902 | static int sisfb_heap_init(struct sis_video_info *ivideo); | 784 | static int sisfb_heap_init(struct sis_video_info *ivideo); |
| 903 | static SIS_OH *sisfb_poh_new_node(void); | 785 | static struct SIS_OH * sisfb_poh_new_node(struct SIS_HEAP *memheap); |
| 904 | static SIS_OH *sisfb_poh_allocate(u32 size); | 786 | static struct SIS_OH * sisfb_poh_allocate(struct SIS_HEAP *memheap, u32 size); |
| 905 | static void sisfb_delete_node(SIS_OH *poh); | 787 | static void sisfb_delete_node(struct SIS_OH *poh); |
| 906 | static void sisfb_insert_node(SIS_OH *pohList, SIS_OH *poh); | 788 | static void sisfb_insert_node(struct SIS_OH *pohList, struct SIS_OH *poh); |
| 907 | static SIS_OH *sisfb_poh_free(u32 base); | 789 | static struct SIS_OH * sisfb_poh_free(struct SIS_HEAP *memheap, u32 base); |
| 908 | static void sisfb_free_node(SIS_OH *poh); | 790 | static void sisfb_free_node(struct SIS_HEAP *memheap, struct SIS_OH *poh); |
| 909 | |||
| 910 | /* Sensing routines */ | ||
| 911 | static void SiS_Sense30x(struct sis_video_info *ivideo); | ||
| 912 | static void SiS_SenseCh(struct sis_video_info *ivideo); | ||
| 913 | 791 | ||
| 914 | /* Routines from init.c/init301.c */ | 792 | /* Routines from init.c/init301.c */ |
| 915 | extern USHORT SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, | 793 | extern unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, |
| 916 | BOOLEAN FSTN, USHORT CustomT, int LCDwith, int LCDheight); | 794 | int VDisplay, int Depth, BOOLEAN FSTN, unsigned short CustomT, |
| 917 | extern USHORT SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth); | 795 | int LCDwith, int LCDheight, unsigned int VBFlags2); |
| 918 | extern USHORT SiS_GetModeID_VGA2(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth); | 796 | extern unsigned short SiS_GetModeID_TV(int VGAEngine, unsigned int VBFlags, int HDisplay, |
| 919 | 797 | int VDisplay, int Depth, unsigned int VBFlags2); | |
| 920 | extern void SiSRegInit(SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr); | 798 | extern unsigned short SiS_GetModeID_VGA2(int VGAEngine, unsigned int VBFlags, int HDisplay, |
| 921 | extern BOOLEAN SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo, USHORT ModeNo); | 799 | int VDisplay, int Depth, unsigned int VBFlags2); |
| 922 | extern void SiS_SetEnableDstn(SiS_Private *SiS_Pr, int enable); | 800 | extern void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr); |
| 923 | extern void SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable); | 801 | extern BOOLEAN SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); |
| 924 | 802 | extern void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable); | |
| 925 | extern BOOLEAN SiSDetermineROMLayout661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo); | 803 | extern void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable); |
| 926 | 804 | ||
| 927 | extern BOOLEAN sisfb_gettotalfrommode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceExtension, | 805 | extern BOOLEAN SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); |
| 928 | unsigned char modeno, int *htotal, int *vtotal, unsigned char rateindex); | 806 | |
| 807 | extern BOOLEAN sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno, | ||
| 808 | int *htotal, int *vtotal, unsigned char rateindex); | ||
| 929 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) | 809 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) |
| 930 | extern int sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr, | 810 | extern int sisfb_mode_rate_to_dclock(struct SiS_Private *SiS_Pr, |
| 931 | PSIS_HW_INFO HwDeviceExtension, | 811 | unsigned char modeno, unsigned char rateindex); |
| 932 | unsigned char modeno, unsigned char rateindex); | 812 | extern int sisfb_mode_rate_to_ddata(struct SiS_Private *SiS_Pr, unsigned char modeno, |
| 933 | extern int sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceExtension, | 813 | unsigned char rateindex, struct fb_var_screeninfo *var); |
| 934 | unsigned char modeno, unsigned char rateindex, | 814 | #endif |
| 935 | struct fb_var_screeninfo *var); | 815 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) |
| 816 | extern void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, | ||
| 817 | int yres, struct fb_var_screeninfo *var, BOOLEAN writeres); | ||
| 936 | #endif | 818 | #endif |
| 937 | 819 | ||
| 938 | /* Chrontel TV, DDC and DPMS functions */ | 820 | /* Chrontel TV, DDC and DPMS functions */ |
| 939 | extern USHORT SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempbx); | 821 | extern unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short reg); |
| 940 | extern void SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempbx); | 822 | extern void SiS_SetCH700x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); |
| 941 | extern USHORT SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempbx); | 823 | extern unsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg); |
| 942 | extern void SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempbx); | 824 | extern void SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); |
| 943 | extern void SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh); | 825 | extern void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, |
| 944 | extern void SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime); | 826 | unsigned char myor, unsigned char myand); |
| 945 | extern void SiS_SetChrontelGPIO(SiS_Private *SiS_Pr, USHORT myvbinfo); | 827 | extern void SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime); |
| 946 | extern USHORT SiS_HandleDDC(SiS_Private *SiS_Pr, ULONG VBFlags, int VGAEngine, | 828 | extern void SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo); |
| 947 | USHORT adaptnum, USHORT DDCdatatype, unsigned char *buffer); | 829 | extern unsigned short SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, |
| 948 | extern USHORT SiS_ReadDDC1Bit(SiS_Private *SiS_Pr); | 830 | unsigned short adaptnum, unsigned short DDCdatatype, unsigned char *buffer, |
| 949 | extern void SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo); | 831 | unsigned int VBFlags2); |
| 950 | extern void SiS_Chrontel701xBLOff(SiS_Private *SiS_Pr); | 832 | extern unsigned short SiS_ReadDDC1Bit(struct SiS_Private *SiS_Pr); |
| 951 | extern void SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo); | 833 | #ifdef CONFIG_FB_SIS_315 |
| 952 | extern void SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo); | 834 | extern void SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr); |
| 835 | extern void SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr); | ||
| 836 | #endif | ||
| 837 | extern void SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr); | ||
| 838 | extern void SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr); | ||
| 953 | #endif | 839 | #endif |
| 954 | 840 | ||
| 955 | 841 | ||
