init.h 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654
  1. /* $XFree86$ */
  2. /* $XdotOrg$ */
  3. /*
  4. * Data and prototypes for init.c
  5. *
  6. * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
  7. *
  8. * If distributed as part of the Linux kernel, the following license terms
  9. * apply:
  10. *
  11. * * This program is free software; you can redistribute it and/or modify
  12. * * it under the terms of the GNU General Public License as published by
  13. * * the Free Software Foundation; either version 2 of the named License,
  14. * * or any later version.
  15. * *
  16. * * This program is distributed in the hope that it will be useful,
  17. * * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * * GNU General Public License for more details.
  20. * *
  21. * * You should have received a copy of the GNU General Public License
  22. * * along with this program; if not, write to the Free Software
  23. * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
  24. *
  25. * Otherwise, the following license terms apply:
  26. *
  27. * * Redistribution and use in source and binary forms, with or without
  28. * * modification, are permitted provided that the following conditions
  29. * * are met:
  30. * * 1) Redistributions of source code must retain the above copyright
  31. * * notice, this list of conditions and the following disclaimer.
  32. * * 2) Redistributions in binary form must reproduce the above copyright
  33. * * notice, this list of conditions and the following disclaimer in the
  34. * * documentation and/or other materials provided with the distribution.
  35. * * 3) The name of the author may not be used to endorse or promote products
  36. * * derived from this software without specific prior written permission.
  37. * *
  38. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  39. * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  40. * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  41. * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  42. * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  43. * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  44. * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  45. * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  46. * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  47. * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  48. *
  49. * Author: Thomas Winischhofer <thomas@winischhofer.net>
  50. *
  51. */
  52. #ifndef _INIT_H_
  53. #define _INIT_H_
  54. #include "osdef.h"
  55. #include "initdef.h"
  56. #ifdef SIS_XORG_XF86
  57. #include "sis.h"
  58. #define SIS_NEED_inSISREG
  59. #define SIS_NEED_inSISREGW
  60. #define SIS_NEED_inSISREGL
  61. #define SIS_NEED_outSISREG
  62. #define SIS_NEED_outSISREGW
  63. #define SIS_NEED_outSISREGL
  64. #include "sis_regs.h"
  65. #endif
  66. #ifdef SIS_LINUX_KERNEL
  67. #include "vgatypes.h"
  68. #include "vstruct.h"
  69. #ifdef SIS_CP
  70. #undef SIS_CP
  71. #endif
  72. #include <linux/types.h>
  73. #include <asm/io.h>
  74. #include <linux/fb.h>
  75. #include "sis.h"
  76. #include <video/sisfb.h>
  77. #endif
  78. /* Mode numbers */
  79. static const unsigned short ModeIndex_320x200[] = {0x59, 0x41, 0x00, 0x4f};
  80. static const unsigned short ModeIndex_320x240[] = {0x50, 0x56, 0x00, 0x53};
  81. static const unsigned short ModeIndex_320x240_FSTN[] = {0x5a, 0x5b, 0x00, 0x00}; /* FSTN */
  82. static const unsigned short ModeIndex_400x300[] = {0x51, 0x57, 0x00, 0x54};
  83. static const unsigned short ModeIndex_512x384[] = {0x52, 0x58, 0x00, 0x5c};
  84. static const unsigned short ModeIndex_640x400[] = {0x2f, 0x5d, 0x00, 0x5e};
  85. static const unsigned short ModeIndex_640x480[] = {0x2e, 0x44, 0x00, 0x62};
  86. static const unsigned short ModeIndex_720x480[] = {0x31, 0x33, 0x00, 0x35};
  87. static const unsigned short ModeIndex_720x576[] = {0x32, 0x34, 0x00, 0x36};
  88. static const unsigned short ModeIndex_768x576[] = {0x5f, 0x60, 0x00, 0x61};
  89. static const unsigned short ModeIndex_800x480[] = {0x70, 0x7a, 0x00, 0x76};
  90. static const unsigned short ModeIndex_800x600[] = {0x30, 0x47, 0x00, 0x63};
  91. static const unsigned short ModeIndex_848x480[] = {0x39, 0x3b, 0x00, 0x3e};
  92. static const unsigned short ModeIndex_856x480[] = {0x3f, 0x42, 0x00, 0x45};
  93. static const unsigned short ModeIndex_960x540[] = {0x1d, 0x1e, 0x00, 0x1f}; /* 315 series only */
  94. static const unsigned short ModeIndex_960x600[] = {0x20, 0x21, 0x00, 0x22}; /* 315 series only */
  95. static const unsigned short ModeIndex_1024x768[] = {0x38, 0x4a, 0x00, 0x64};
  96. static const unsigned short ModeIndex_1024x576[] = {0x71, 0x74, 0x00, 0x77};
  97. static const unsigned short ModeIndex_1024x600[] = {0x20, 0x21, 0x00, 0x22}; /* 300 series only */
  98. static const unsigned short ModeIndex_1280x1024[] = {0x3a, 0x4d, 0x00, 0x65};
  99. static const unsigned short ModeIndex_1280x960[] = {0x7c, 0x7d, 0x00, 0x7e};
  100. static const unsigned short ModeIndex_1152x768[] = {0x23, 0x24, 0x00, 0x25}; /* 300 series only */
  101. static const unsigned short ModeIndex_1152x864[] = {0x29, 0x2a, 0x00, 0x2b};
  102. static const unsigned short ModeIndex_300_1280x768[] = {0x55, 0x5a, 0x00, 0x5b};
  103. static const unsigned short ModeIndex_310_1280x768[] = {0x23, 0x24, 0x00, 0x25};
  104. static const unsigned short ModeIndex_1280x720[] = {0x79, 0x75, 0x00, 0x78};
  105. static const unsigned short ModeIndex_1280x800[] = {0x14, 0x15, 0x00, 0x16};
  106. static const unsigned short ModeIndex_1280x854[] = {0x1a, 0x1b, 0x00, 0x1c};
  107. static const unsigned short ModeIndex_1360x768[] = {0x48, 0x4b, 0x00, 0x4e};
  108. static const unsigned short ModeIndex_300_1360x1024[]= {0x67, 0x6f, 0x00, 0x72}; /* 300 series, BARCO only */
  109. static const unsigned short ModeIndex_1400x1050[] = {0x26, 0x27, 0x00, 0x28}; /* 315 series only */
  110. static const unsigned short ModeIndex_1680x1050[] = {0x17, 0x18, 0x00, 0x19}; /* 315 series only */
  111. static const unsigned short ModeIndex_1600x1200[] = {0x3c, 0x3d, 0x00, 0x66};
  112. static const unsigned short ModeIndex_1920x1080[] = {0x2c, 0x2d, 0x00, 0x73}; /* 315 series only */
  113. static const unsigned short ModeIndex_1920x1440[] = {0x68, 0x69, 0x00, 0x6b};
  114. static const unsigned short ModeIndex_300_2048x1536[]= {0x6c, 0x6d, 0x00, 0x00};
  115. static const unsigned short ModeIndex_310_2048x1536[]= {0x6c, 0x6d, 0x00, 0x6e};
  116. static const unsigned short SiS_DRAMType[17][5]={
  117. {0x0C,0x0A,0x02,0x40,0x39},
  118. {0x0D,0x0A,0x01,0x40,0x48},
  119. {0x0C,0x09,0x02,0x20,0x35},
  120. {0x0D,0x09,0x01,0x20,0x44},
  121. {0x0C,0x08,0x02,0x10,0x31},
  122. {0x0D,0x08,0x01,0x10,0x40},
  123. {0x0C,0x0A,0x01,0x20,0x34},
  124. {0x0C,0x09,0x01,0x08,0x32},
  125. {0x0B,0x08,0x02,0x08,0x21},
  126. {0x0C,0x08,0x01,0x08,0x30},
  127. {0x0A,0x08,0x02,0x04,0x11},
  128. {0x0B,0x0A,0x01,0x10,0x28},
  129. {0x09,0x08,0x02,0x02,0x01},
  130. {0x0B,0x09,0x01,0x08,0x24},
  131. {0x0B,0x08,0x01,0x04,0x20},
  132. {0x0A,0x08,0x01,0x02,0x10},
  133. {0x09,0x08,0x01,0x01,0x00}
  134. };
  135. static const unsigned short SiS_SDRDRAM_TYPE[13][5] =
  136. {
  137. { 2,12, 9,64,0x35},
  138. { 1,13, 9,64,0x44},
  139. { 2,12, 8,32,0x31},
  140. { 2,11, 9,32,0x25},
  141. { 1,12, 9,32,0x34},
  142. { 1,13, 8,32,0x40},
  143. { 2,11, 8,16,0x21},
  144. { 1,12, 8,16,0x30},
  145. { 1,11, 9,16,0x24},
  146. { 1,11, 8, 8,0x20},
  147. { 2, 9, 8, 4,0x01},
  148. { 1,10, 8, 4,0x10},
  149. { 1, 9, 8, 2,0x00}
  150. };
  151. static const unsigned short SiS_DDRDRAM_TYPE[4][5] =
  152. {
  153. { 2,12, 9,64,0x35},
  154. { 2,12, 8,32,0x31},
  155. { 2,11, 8,16,0x21},
  156. { 2, 9, 8, 4,0x01}
  157. };
  158. static const unsigned char SiS_MDA_DAC[] =
  159. {
  160. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  161. 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
  162. 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
  163. 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
  164. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  165. 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
  166. 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
  167. 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F
  168. };
  169. static const unsigned char SiS_CGA_DAC[] =
  170. {
  171. 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
  172. 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
  173. 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F,
  174. 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F,
  175. 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
  176. 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
  177. 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F,
  178. 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F
  179. };
  180. static const unsigned char SiS_EGA_DAC[] =
  181. {
  182. 0x00,0x10,0x04,0x14,0x01,0x11,0x05,0x15,
  183. 0x20,0x30,0x24,0x34,0x21,0x31,0x25,0x35,
  184. 0x08,0x18,0x0C,0x1C,0x09,0x19,0x0D,0x1D,
  185. 0x28,0x38,0x2C,0x3C,0x29,0x39,0x2D,0x3D,
  186. 0x02,0x12,0x06,0x16,0x03,0x13,0x07,0x17,
  187. 0x22,0x32,0x26,0x36,0x23,0x33,0x27,0x37,
  188. 0x0A,0x1A,0x0E,0x1E,0x0B,0x1B,0x0F,0x1F,
  189. 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F
  190. };
  191. static const unsigned char SiS_VGA_DAC[] =
  192. {
  193. 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
  194. 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F,
  195. 0x00,0x05,0x08,0x0B,0x0E,0x11,0x14,0x18,
  196. 0x1C,0x20,0x24,0x28,0x2D,0x32,0x38,0x3F,
  197. 0x00,0x10,0x1F,0x2F,0x3F,0x1F,0x27,0x2F,
  198. 0x37,0x3F,0x2D,0x31,0x36,0x3A,0x3F,0x00,
  199. 0x07,0x0E,0x15,0x1C,0x0E,0x11,0x15,0x18,
  200. 0x1C,0x14,0x16,0x18,0x1A,0x1C,0x00,0x04,
  201. 0x08,0x0C,0x10,0x08,0x0A,0x0C,0x0E,0x10,
  202. 0x0B,0x0C,0x0D,0x0F,0x10
  203. };
  204. static const struct SiS_St SiS_SModeIDTable[] =
  205. {
  206. {0x01,0x9208,0x01,0x00,0x00,0x00,0x01,0x00,0x40},
  207. {0x01,0x1210,0x14,0x01,0x01,0x00,0x01,0x00,0x40},
  208. {0x01,0x1010,0x17,0x02,0x02,0x00,0x01,0x01,0x40},
  209. {0x03,0x8208,0x03,0x00,0x00,0x00,0x01,0x02,0x40},
  210. {0x03,0x0210,0x16,0x01,0x01,0x00,0x01,0x02,0x40},
  211. {0x03,0x0010,0x18,0x02,0x02,0x00,0x01,0x03,0x40},
  212. {0x05,0x9209,0x05,0x00,0x00,0x00,0x00,0x04,0x40},
  213. {0x06,0x8209,0x06,0x00,0x00,0x00,0x00,0x05,0x40},
  214. {0x07,0x0000,0x07,0x03,0x03,0x00,0x01,0x03,0x40},
  215. {0x07,0x0000,0x19,0x02,0x02,0x00,0x01,0x03,0x40},
  216. {0x0d,0x920a,0x0d,0x00,0x00,0x00,0x00,0x04,0x40},
  217. {0x0e,0x820a,0x0e,0x00,0x00,0x00,0x00,0x05,0x40},
  218. {0x0f,0x0202,0x11,0x01,0x01,0x00,0x00,0x05,0x40},
  219. {0x10,0x0212,0x12,0x01,0x01,0x00,0x00,0x05,0x40},
  220. {0x11,0x0212,0x1a,0x04,0x04,0x00,0x00,0x05,0x40},
  221. {0x12,0x0212,0x1b,0x04,0x04,0x00,0x00,0x05,0x40},
  222. {0x13,0x021b,0x1c,0x00,0x00,0x00,0x00,0x04,0x40},
  223. {0x12,0x0010,0x18,0x02,0x02,0x00,0x00,0x05,0x40},
  224. {0x12,0x0210,0x18,0x01,0x01,0x00,0x00,0x05,0x40},
  225. {0xff,0x0000,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
  226. };
  227. static const struct SiS_StResInfo_S SiS_StResInfo[]=
  228. {
  229. { 640,400},
  230. { 640,350},
  231. { 720,400},
  232. { 720,350},
  233. { 640,480}
  234. };
  235. static const struct SiS_ModeResInfo_S SiS_ModeResInfo[] =
  236. {
  237. { 320, 200, 8, 8}, /* 0x00 */
  238. { 320, 240, 8, 8}, /* 0x01 */
  239. { 320, 400, 8, 8}, /* 0x02 */
  240. { 400, 300, 8, 8}, /* 0x03 */
  241. { 512, 384, 8, 8}, /* 0x04 */
  242. { 640, 400, 8,16}, /* 0x05 */
  243. { 640, 480, 8,16}, /* 0x06 */
  244. { 800, 600, 8,16}, /* 0x07 */
  245. { 1024, 768, 8,16}, /* 0x08 */
  246. { 1280,1024, 8,16}, /* 0x09 */
  247. { 1600,1200, 8,16}, /* 0x0a */
  248. { 1920,1440, 8,16}, /* 0x0b */
  249. { 2048,1536, 8,16}, /* 0x0c */
  250. { 720, 480, 8,16}, /* 0x0d */
  251. { 720, 576, 8,16}, /* 0x0e */
  252. { 1280, 960, 8,16}, /* 0x0f */
  253. { 800, 480, 8,16}, /* 0x10 */
  254. { 1024, 576, 8,16}, /* 0x11 */
  255. { 1280, 720, 8,16}, /* 0x12 */
  256. { 856, 480, 8,16}, /* 0x13 */
  257. { 1280, 768, 8,16}, /* 0x14 */
  258. { 1400,1050, 8,16}, /* 0x15 */
  259. { 1152, 864, 8,16}, /* 0x16 */
  260. { 848, 480, 8,16}, /* 0x17 */
  261. { 1360, 768, 8,16}, /* 0x18 */
  262. { 1024, 600, 8,16}, /* 0x19 */
  263. { 1152, 768, 8,16}, /* 0x1a */
  264. { 768, 576, 8,16}, /* 0x1b */
  265. { 1360,1024, 8,16}, /* 0x1c */
  266. { 1680,1050, 8,16}, /* 0x1d */
  267. { 1280, 800, 8,16}, /* 0x1e */
  268. { 1920,1080, 8,16}, /* 0x1f */
  269. { 960, 540, 8,16}, /* 0x20 */
  270. { 960, 600, 8,16}, /* 0x21 */
  271. { 1280, 854, 8,16} /* 0x22 */
  272. };
  273. #if defined(SIS300) || defined(SIS315H)
  274. static const struct SiS_StandTable_S SiS_StandTable[]=
  275. {
  276. /* 0x00: MD_0_200 */
  277. {
  278. 0x28,0x18,0x08,0x0800,
  279. {0x09,0x03,0x00,0x02},
  280. 0x63,
  281. {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
  282. 0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
  283. 0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
  284. 0xff},
  285. {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
  286. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
  287. 0x08,0x00,0x0f,0x00},
  288. {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
  289. 0xff}
  290. },
  291. /* 0x01: MD_1_200 */
  292. {
  293. 0x28,0x18,0x08,0x0800,
  294. {0x09,0x03,0x00,0x02},
  295. 0x63,
  296. {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
  297. 0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
  298. 0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
  299. 0xff},
  300. {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
  301. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
  302. 0x08,0x00,0x0f,0x00},
  303. {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
  304. 0xff}
  305. },
  306. /* 0x02: MD_2_200 */
  307. {
  308. 0x50,0x18,0x08,0x1000,
  309. {0x01,0x03,0x00,0x02},
  310. 0x63,
  311. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
  312. 0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
  313. 0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
  314. 0xff},
  315. {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
  316. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
  317. 0x08,0x00,0x0f,0x00},
  318. {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
  319. 0xff}
  320. },
  321. /* 0x03: MD_3_200 - mode 0x03 - 0 */
  322. {
  323. 0x50,0x18,0x08,0x1000,
  324. {0x01,0x03,0x00,0x02},
  325. 0x63,
  326. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
  327. 0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
  328. 0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
  329. 0xff},
  330. {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
  331. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
  332. 0x08,0x00,0x0f,0x00},
  333. {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
  334. 0xff}
  335. },
  336. /* 0x04: MD_4 */
  337. {
  338. 0x28,0x18,0x08,0x4000,
  339. {0x09,0x03,0x00,0x02},
  340. 0x63,
  341. {0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f, /* 0x2c is 2b for 300 */
  342. 0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
  343. 0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
  344. 0xff},
  345. {0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
  346. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
  347. 0x01,0x00,0x03,0x00},
  348. {0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
  349. 0xff}
  350. },
  351. /* 0x05: MD_5 */
  352. {
  353. 0x28,0x18,0x08,0x4000,
  354. {0x09,0x03,0x00,0x02},
  355. 0x63,
  356. {0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f, /* 0x2c is 2b for 300 */
  357. 0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
  358. 0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
  359. 0xff},
  360. {0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
  361. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
  362. 0x01,0x00,0x03,0x00},
  363. {0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
  364. 0xff}
  365. },
  366. /* 0x06: MD_6 */
  367. {
  368. 0x50,0x18,0x08,0x4000,
  369. {0x01,0x01,0x00,0x06},
  370. 0x63,
  371. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, /* 55,81 is 54,80 for 300 */
  372. 0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
  373. 0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xc2,
  374. 0xff},
  375. {0x00,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
  376. 0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
  377. 0x01,0x00,0x01,0x00},
  378. {0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x00,
  379. 0xff}
  380. },
  381. /* 0x07: MD_7 */
  382. {
  383. 0x50,0x18,0x0e,0x1000,
  384. {0x00,0x03,0x00,0x03},
  385. 0xa6,
  386. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
  387. 0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
  388. 0x83,0x85,0x5d,0x28,0x0d,0x63,0xba,0xa3,
  389. 0xff},
  390. {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
  391. 0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
  392. 0x0e,0x00,0x0f,0x08},
  393. {0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
  394. 0xff}
  395. },
  396. /* 0x08: MDA_DAC */
  397. {
  398. 0x00,0x00,0x00,0x0000,
  399. {0x00,0x00,0x00,0x15},
  400. 0x15,
  401. {0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
  402. 0x15,0x15,0x15,0x15,0x15,0x15,0x3f,0x3f,
  403. 0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x00,0x00,
  404. 0x00},
  405. {0x00,0x00,0x00,0x00,0x00,0x15,0x15,0x15,
  406. 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
  407. 0x15,0x15,0x15,0x15},
  408. {0x15,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
  409. 0x3f}
  410. },
  411. /* 0x09: CGA_DAC */
  412. {
  413. 0x00,0x10,0x04,0x0114,
  414. {0x11,0x09,0x15,0x00},
  415. 0x10,
  416. {0x04,0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,
  417. 0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x2a,0x3a,
  418. 0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x10,
  419. 0x04},
  420. {0x14,0x01,0x11,0x09,0x15,0x00,0x10,0x04,
  421. 0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,0x2e,
  422. 0x3e,0x2b,0x3b,0x2f},
  423. {0x3f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
  424. 0x3f}
  425. },
  426. /* 0x0a: EGA_DAC */
  427. {
  428. 0x00,0x10,0x04,0x0114,
  429. {0x11,0x05,0x15,0x20},
  430. 0x30,
  431. {0x24,0x34,0x21,0x31,0x25,0x35,0x08,0x18,
  432. 0x0c,0x1c,0x09,0x19,0x0d,0x1d,0x28,0x38,
  433. 0x2c,0x3c,0x29,0x39,0x2d,0x3d,0x02,0x12,
  434. 0x06},
  435. {0x16,0x03,0x13,0x07,0x17,0x22,0x32,0x26,
  436. 0x36,0x23,0x33,0x27,0x37,0x0a,0x1a,0x0e,
  437. 0x1e,0x0b,0x1b,0x0f},
  438. {0x1f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
  439. 0x3f}
  440. },
  441. /* 0x0b: VGA_DAC */
  442. {
  443. 0x00,0x10,0x04,0x0114,
  444. {0x11,0x09,0x15,0x2a},
  445. 0x3a,
  446. {0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x05,
  447. 0x08,0x0b,0x0e,0x11,0x14,0x18,0x1c,0x20,
  448. 0x24,0x28,0x2d,0x32,0x38,0x3f,0x00,0x10,
  449. 0x1f},
  450. {0x2f,0x3f,0x1f,0x27,0x2f,0x37,0x3f,0x2d,
  451. 0x31,0x36,0x3a,0x3f,0x00,0x07,0x0e,0x15,
  452. 0x1c,0x0e,0x11,0x15},
  453. {0x18,0x1c,0x14,0x16,0x18,0x1a,0x1c,0x00,
  454. 0x04}
  455. },
  456. /* 0x0c */
  457. {
  458. 0x08,0x0c,0x10,0x0a08,
  459. {0x0c,0x0e,0x10,0x0b},
  460. 0x0c,
  461. {0x0d,0x0f,0x10,0x10,0x01,0x08,0x00,0x00,
  462. 0x00,0x00,0x01,0x00,0x02,0x02,0x01,0x00,
  463. 0x04,0x04,0x01,0x00,0x05,0x02,0x05,0x00,
  464. 0x06},
  465. {0x01,0x06,0x05,0x06,0x00,0x08,0x01,0x08,
  466. 0x00,0x07,0x02,0x07,0x06,0x07,0x00,0x00,
  467. 0x00,0x00,0x00,0x00},
  468. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  469. 0x00}
  470. },
  471. /* 0x0d: MD_D */
  472. {
  473. 0x28,0x18,0x08,0x2000,
  474. {0x09,0x0f,0x00,0x06},
  475. 0x63,
  476. {0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f, /* 2c is 2b for 300 */
  477. 0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
  478. 0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xe3,
  479. 0xff},
  480. {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
  481. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
  482. 0x01,0x00,0x0f,0x00},
  483. {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
  484. 0xff}
  485. },
  486. /* 0x0e: MD_E */
  487. {
  488. 0x50,0x18,0x08,0x4000,
  489. {0x01,0x0f,0x00,0x06},
  490. 0x63,
  491. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, /* 55,81 is 54,80 for 300 */
  492. 0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
  493. 0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xe3,
  494. 0xff},
  495. {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
  496. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
  497. 0x01,0x00,0x0f,0x00},
  498. {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
  499. 0xff}
  500. },
  501. /* 0x0f: ExtVGATable - modes > 0x13 */
  502. {
  503. 0x00,0x00,0x00,0x0000,
  504. {0x01,0x0f,0x00,0x0e},
  505. 0x23,
  506. {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
  507. 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
  508. 0xea,0x8c,0xdf,0x28,0x40,0xe7,0x04,0xa3,
  509. 0xff},
  510. {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
  511. 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
  512. 0x01,0x00,0x00,0x00},
  513. {0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
  514. 0xff}
  515. },
  516. /* 0x10: ROM_SAVEPTR - totally different for 300 */
  517. {
  518. 0x9f,0x3b,0x00,0x00c0,
  519. {0x00,0x00,0x00,0x00},
  520. 0x00,
  521. {0x00,0x00,0x00,0x00,0x00,0x00,0xbb,0x3f,
  522. 0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
  523. 0x00,0x00,0x1a,0x00,0xac,0x3e,0x00,0xc0,
  524. 0x00},
  525. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  526. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  527. 0x00,0x00,0x00,0x00},
  528. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  529. 0x00}
  530. },
  531. /* 0x11: MD_F */
  532. {
  533. 0x50,0x18,0x0e,0x8000,
  534. {0x01,0x0f,0x00,0x06},
  535. 0xa2,
  536. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, /* 55,81 is 54,80 on 300 */
  537. 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
  538. 0x82,0x84,0x5d,0x28,0x0f,0x63,0xba,0xe3, /* 82,84 is 83,85 on 300 */
  539. 0xff},
  540. {0x00,0x08,0x00,0x00,0x18,0x18,0x00,0x00,
  541. 0x00,0x08,0x00,0x00,0x00,0x18,0x00,0x00,
  542. 0x0b,0x00,0x05,0x00},
  543. {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,
  544. 0xff}
  545. },
  546. /* 0x12: MD_10 */
  547. {
  548. 0x50,0x18,0x0e,0x8000,
  549. {0x01,0x0f,0x00,0x06},
  550. 0xa3,
  551. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, /* 55,81 is 54,80 on 300 */
  552. 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
  553. 0x82,0x84,0x5d,0x28,0x0f,0x63,0xba,0xe3, /* 82,84 is 83,85 on 300 */
  554. 0xff},
  555. {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
  556. 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
  557. 0x01,0x00,0x0f,0x00},
  558. {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
  559. 0xff}
  560. },
  561. /* 0x13: MD_0_350 */
  562. {
  563. 0x28,0x18,0x0e,0x0800,
  564. {0x09,0x03,0x00,0x02},
  565. 0xa3,
  566. {0x2d,0x27,0x28,0x90,0x2b,0xb1,0xbf,0x1f, /* b1 is a0 on 300 */
  567. 0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
  568. 0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
  569. 0xff},
  570. {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
  571. 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
  572. 0x08,0x00,0x0f,0x00},
  573. {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
  574. 0xff}
  575. },
  576. /* 0x14: MD_1_350 */
  577. {
  578. 0x28,0x18,0x0e,0x0800,
  579. {0x09,0x03,0x00,0x02},
  580. 0xa3,
  581. {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
  582. 0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
  583. 0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
  584. 0xff},
  585. {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
  586. 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
  587. 0x08,0x00,0x0f,0x00},
  588. {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
  589. 0xff}
  590. },
  591. /* 0x15: MD_2_350 */
  592. {
  593. 0x50,0x18,0x0e,0x1000,
  594. {0x01,0x03,0x00,0x02},
  595. 0xa3,
  596. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
  597. 0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
  598. 0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
  599. 0xff},
  600. {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
  601. 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
  602. 0x08,0x00,0x0f,0x00},
  603. {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
  604. 0xff}
  605. },
  606. /* 0x16: MD_3_350 - mode 0x03 - 1 */
  607. {
  608. 0x50,0x18,0x0e,0x1000,
  609. {0x01,0x03,0x00,0x02},
  610. 0xa3,
  611. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
  612. 0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
  613. 0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
  614. 0xff},
  615. {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
  616. 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
  617. 0x08,0x00,0x0f,0x00},
  618. {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
  619. 0xff}
  620. },
  621. /* 0x17: MD_0_1_400 */
  622. {
  623. 0x28,0x18,0x10,0x0800,
  624. {0x08,0x03,0x00,0x02},
  625. 0x67,
  626. {0x2d,0x27,0x28,0x90,0x2b,0xb1,0xbf,0x1f, /* b1 is a0 on 300 */
  627. 0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
  628. 0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
  629. 0xff},
  630. {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
  631. 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
  632. 0x0c,0x00,0x0f,0x08},
  633. {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
  634. 0xff}
  635. },
  636. /* 0x18: MD_2_3_400 - mode 0x03 - 2 */
  637. {
  638. 0x50,0x18,0x10,0x1000,
  639. {0x00,0x03,0x00,0x02},
  640. 0x67,
  641. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
  642. 0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
  643. 0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
  644. 0xff},
  645. {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
  646. 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
  647. 0x0c,0x00,0x0f,0x08},
  648. {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
  649. 0xff}
  650. },
  651. /* 0x19: MD_7_400 */
  652. {
  653. 0x50,0x18,0x10,0x1000,
  654. {0x00,0x03,0x00,0x02},
  655. 0x66,
  656. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
  657. 0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
  658. 0x9c,0x8e,0x8f,0x28,0x0f,0x96,0xb9,0xa3,
  659. 0xff},
  660. {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
  661. 0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
  662. 0x0e,0x00,0x0f,0x08},
  663. {0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
  664. 0xff}
  665. },
  666. /* 0x1a: MD_11 */
  667. {
  668. 0x50,0x1d,0x10,0xa000,
  669. {0x01,0x0f,0x00,0x06},
  670. 0xe3,
  671. {0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e, /* 55,81 is 54,80 on 300 */
  672. 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
  673. 0xe9,0x8b,0xdf,0x28,0x00,0xe7,0x04,0xc3, /* e9,8b is ea,8c on 300 */
  674. 0xff},
  675. {0x00,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
  676. 0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
  677. 0x01,0x00,0x0f,0x00},
  678. {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x01,
  679. 0xff}
  680. },
  681. /* 0x1b: ExtEGATable - Modes <= 0x02 */
  682. {
  683. 0x50,0x1d,0x10,0xa000,
  684. {0x01,0x0f,0x00,0x06},
  685. 0xe3,
  686. {0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e, /* 55,81 is 54,80 on 300 */
  687. 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
  688. 0xe9,0x8b,0xdf,0x28,0x00,0xe7,0x04,0xe3, /* e9,8b is ea,8c on 300 */
  689. 0xff},
  690. {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
  691. 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
  692. 0x01,0x00,0x0f,0x00},
  693. {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
  694. 0xff}
  695. },
  696. /* 0x1c: MD_13 */
  697. {
  698. 0x28,0x18,0x08,0x2000,
  699. {0x01,0x0f,0x00,0x0e},
  700. 0x63,
  701. {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, /* 55,81 is 54,80 on 300 */
  702. 0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,
  703. 0x9c,0x8e,0x8f,0x28,0x40,0x96,0xb9,0xa3,
  704. 0xff},
  705. {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
  706. 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
  707. 0x41,0x00,0x0f,0x00},
  708. {0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
  709. 0xff}
  710. }
  711. };
  712. #endif
  713. /**************************************************************/
  714. /* SIS VIDEO BRIDGE ----------------------------------------- */
  715. /**************************************************************/
  716. static const unsigned char SiS_SoftSetting = 0x30; /* RAM setting */
  717. static const unsigned char SiS_OutputSelect = 0x40;
  718. static const unsigned char SiS_NTSCTiming[] = {
  719. 0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c,
  720. 0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a,
  721. 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b,
  722. 0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17,
  723. 0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02,
  724. 0x03,0x0a,0x65,0x9d,0x08,0x92,0x8f,0x40,
  725. 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x50,
  726. 0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00
  727. };
  728. static const unsigned char SiS_PALTiming[] = {
  729. 0x19,0x52,0x35,0x6e,0x04,0x38,0x3d,0x70,
  730. 0x94,0x49,0x01,0x12,0x06,0x3e,0x35,0x6d,
  731. 0x06,0x14,0x3e,0x35,0x6d,0x00,0x45,0x2b,
  732. 0x70,0x50,0x00,0x9b,0x00,0xd9,0x5d,0x17,
  733. 0x7d,0x05,0x45,0x00,0x00,0xe8,0x00,0x02,
  734. 0x0d,0x00,0x68,0xb0,0x0b,0x92,0x8f,0x40,
  735. 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x63,
  736. 0x00,0x40,0x3e,0x00,0xe1,0x02,0x28,0x00
  737. };
  738. static const unsigned char SiS_HiTVExtTiming[] = {
  739. 0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
  740. 0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
  741. 0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
  742. 0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
  743. 0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
  744. 0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
  745. 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
  746. 0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
  747. };
  748. static const unsigned char SiS_HiTVSt1Timing[] = {
  749. 0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
  750. 0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
  751. 0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
  752. 0x65,0x90,0x7b,0xa8,0x03,0xf0,0x87,0x03,
  753. 0x11,0x15,0x11,0xcf,0x10,0x11,0xcf,0x10,
  754. 0x35,0x35,0x3b,0x69,0x1d,0x92,0x0f,0x40,
  755. 0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x86,
  756. 0xaf,0x5d,0x0e,0x00,0xfc,0xff,0x2d,0x00
  757. };
  758. static const unsigned char SiS_HiTVSt2Timing[] = {
  759. 0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
  760. 0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
  761. 0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
  762. 0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
  763. 0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
  764. 0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
  765. 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
  766. 0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
  767. };
  768. #if 0
  769. static const unsigned char SiS_HiTVTextTiming[] = {
  770. 0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
  771. 0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
  772. 0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
  773. 0x65,0x90,0xe7,0xbc,0x03,0x0c,0x97,0x03,
  774. 0x14,0x78,0x14,0x08,0x20,0x14,0x08,0x20,
  775. 0xc8,0xc8,0x3b,0xd2,0x26,0x92,0x0f,0x40,
  776. 0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x96,
  777. 0x72,0x5c,0x11,0x00,0xfc,0xff,0x32,0x00
  778. };
  779. #endif
  780. static const unsigned char SiS_HiTVGroup3Data[] = {
  781. 0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x5f,
  782. 0x05,0x21,0xb2,0xb2,0x55,0x77,0x2a,0xa6,
  783. 0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
  784. 0x8c,0x6e,0x60,0x2e,0x58,0x48,0x72,0x44,
  785. 0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
  786. 0x4f,0x7f,0x03,0xa8,0x7d,0x20,0x1a,0xa9,
  787. 0x14,0x05,0x03,0x7e,0x64,0x31,0x14,0x75,
  788. 0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
  789. };
  790. static const unsigned char SiS_HiTVGroup3Simu[] = {
  791. 0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x95,
  792. 0xdb,0x20,0xb8,0xb8,0x55,0x47,0x2a,0xa6,
  793. 0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
  794. 0x8c,0x6e,0x60,0x15,0x26,0xd3,0xe4,0x11,
  795. 0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
  796. 0x67,0x36,0x01,0x47,0x0e,0x10,0xbe,0xb4,
  797. 0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
  798. 0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
  799. };
  800. #if 0
  801. static const unsigned char SiS_HiTVGroup3Text[] = {
  802. 0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0xa7,
  803. 0xf5,0x20,0xce,0xce,0x55,0x47,0x2a,0xa6,
  804. 0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
  805. 0x8c,0x6e,0x60,0x18,0x2c,0x0c,0x20,0x22,
  806. 0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
  807. 0x93,0x3c,0x01,0x50,0x2f,0x10,0xf4,0xca,
  808. 0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
  809. 0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
  810. };
  811. #endif
  812. static const struct SiS_TVData SiS_StPALData[] =
  813. {
  814. { 1, 1, 864, 525,1270, 400, 100, 0, 760, 0,0xf4,0xff,0x1c,0x22},
  815. { 1, 1, 864, 525,1270, 350, 100, 0, 760, 0,0xf4,0xff,0x1c,0x22},
  816. { 1, 1, 864, 525,1270, 400, 0, 0, 720, 0,0xf1,0x04,0x1f,0x18},
  817. { 1, 1, 864, 525,1270, 350, 0, 0, 720, 0,0xf4,0x0b,0x1c,0x0a},
  818. { 1, 1, 864, 525,1270, 480, 50, 0, 760, 0,0xf4,0xff,0x1c,0x22},
  819. { 1, 1, 864, 525,1270, 600, 50, 0, 0,0x300,0xf4,0xff,0x1c,0x22}
  820. };
  821. static const struct SiS_TVData SiS_ExtPALData[] =
  822. {
  823. { 27, 10, 848, 448,1270, 530, 50, 0, 50, 0,0xf4,0xff,0x1c,0x22}, /* 640x400, 320x200 */
  824. { 108, 35, 848, 398,1270, 530, 50, 0, 50, 0,0xf4,0xff,0x1c,0x22},
  825. { 12, 5, 954, 448,1270, 530, 50, 0, 50, 0,0xf1,0x04,0x1f,0x18},
  826. { 9, 4, 960, 463,1644, 438, 50, 0, 50, 0,0xf4,0x0b,0x1c,0x0a},
  827. { 9, 4, 848, 528,1270, 530, 0, 0, 50, 0,0xf5,0xfb,0x1b,0x2a}, /* 640x480, 320x240 */
  828. { 36, 25,1060, 648,1270, 530, 438, 0, 438, 0,0xeb,0x05,0x25,0x16}, /* 800x600, 400x300 */
  829. { 3, 2,1080, 619,1270, 540, 438, 0, 438, 0,0xf3,0x00,0x1d,0x20}, /* 720x576 */
  830. { 1, 1,1170, 821,1270, 520, 686, 0, 686, 0,0xF3,0x00,0x1D,0x20}, /* 1024x768 */
  831. { 1, 1,1170, 821,1270, 520, 686, 0, 686, 0,0xF3,0x00,0x1D,0x20}, /* 1024x768 (for NTSC equ) */
  832. { 9, 4, 848, 528,1270, 530, 0, 0, 50, 0,0xf5,0xfb,0x1b,0x2a} /* 720x480 */
  833. };
  834. static const struct SiS_TVData SiS_StNTSCData[] =
  835. {
  836. { 1, 1, 858, 525,1270, 400, 50, 0, 760, 0,0xf1,0x04,0x1f,0x18},
  837. { 1, 1, 858, 525,1270, 350, 50, 0, 640, 0,0xf1,0x04,0x1f,0x18},
  838. { 1, 1, 858, 525,1270, 400, 0, 0, 720, 0,0xf1,0x04,0x1f,0x18},
  839. { 1, 1, 858, 525,1270, 350, 0, 0, 720, 0,0xf4,0x0b,0x1c,0x0a},
  840. { 1, 1, 858, 525,1270, 480, 0, 0, 760, 0,0xf1,0x04,0x1f,0x18}
  841. };
  842. static const struct SiS_TVData SiS_ExtNTSCData[] =
  843. {
  844. { 143, 65, 858, 443,1270, 440, 171, 0, 171, 0,0xf1,0x04,0x1f,0x18}, /* 640x400, 320x200 */
  845. { 88, 35, 858, 393,1270, 440, 171, 0, 171, 0,0xf1,0x04,0x1f,0x18},
  846. { 143, 70, 924, 443,1270, 440, 92, 0, 92, 0,0xf1,0x04,0x1f,0x18},
  847. { 143, 70, 924, 393,1270, 440, 92, 0, 92, 0,0xf4,0x0b,0x1c,0x0a},
  848. { 143, 76, 836, 523,1270, 440, 224, 0, 0, 0,0xf1,0x05,0x1f,0x16}, /* 640x480, 320x240 */
  849. { 143, 120,1056, 643,1270, 440, 0, 1, 0, 0,0xf4,0x10,0x1c,0x00}, /* 800x600, 400x300 */
  850. { 143, 76, 836, 523,1270, 440, 0, 1, 0, 0,0xee,0x0c,0x22,0x08}, /* 720x480 - BETTER (from 300 series) */
  851. { 1, 1,1100, 811,1412, 440, 0, 1, 0, 0,0xee,0x0c,0x22,0x08}, /* 1024x768 (525i) CORRECTED */
  852. #if 0 /* flimmert und ist unten abgeschnitten (NTSCHT, NTSC clock) */
  853. { 65, 64,1056, 791,1270, 480, 455, 0, 0, 0,0x00,0x00,0x00,0x00} /* 1024x768 (525p) */
  854. #endif
  855. #if 0
  856. { 1, 1,1100, 811,1412, 440, 0, 1, 0, 0,0x00,0x00,0x00,0x00} /* 1024x768 (525p) */
  857. #endif
  858. #if 0
  859. { 1, 1,1120, 821,1516, 420, 0, 1, 0, 0,0x00,0x00,0x00,0x00} /* 1024x768 (525p) */
  860. #endif
  861. #if 0
  862. { 1, 1, 938, 821,1516, 420, 0, 1, 0, 0,0x00,0x00,0x00,0x00} /* 1024x768 (525p) */
  863. #endif
  864. #if 0 /* zoom hin, unten abgeschnitten (NTSC2HT, NTSC1024 clock) */
  865. { 1, 1,1072, 791,1270, 480, 455, 0, 0, 0,0x00,0x00,0x00,0x00} /* 1024x768 (525p) */
  866. #endif
  867. #if 1 /* zu weit links (squeezed) (NTSC2HT, NTSC1024 clock) */
  868. { 1, 1,1100, 846,1270, 440, 455, 0, 0, 0,0x00,0x00,0x00,0x00} /* 1024x768 (525p) */
  869. #endif
  870. #if 0 /* zu weit links, rechts abgeschnitten (NTSC2HT, NTSC1024 clock) */
  871. { 1, 1,1100, 846,1412, 440, 455, 0, 0, 0,0x00,0x00,0x00,0x00} /* 1024x768 (525p) */
  872. #endif
  873. };
  874. static const struct SiS_TVData SiS_StHiTVData[] = /* Slave + TVSimu */
  875. {
  876. { 1, 1, 0x37c,0x233,0x2b2,0x320, 0, 0, 0, 0, 0, 0, 0, 0},
  877. { 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0, 0, 0, 0, 0},
  878. { 1, 1, 0x37c,0x233,0x2b2,0x320, 0, 0, 0, 0, 0, 0, 0, 0},
  879. { 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0, 0, 0, 0, 0},
  880. { 1, 1, 0x37c,0x233,0x2b2,0x3c0, 0, 0, 0, 0, 0, 0, 0, 0},
  881. { 8, 5, 0x41a,0x2ab,0x670,0x3c0,0x150, 1, 0, 0, 0, 0, 0, 0}
  882. };
  883. static const struct SiS_TVData SiS_St2HiTVData[] = /* Slave */
  884. {
  885. { 3, 1, 0x348,0x1e3,0x670,0x3c0,0x032, 0, 0, 0, 0, 0, 0, 0},
  886. { 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0, 0, 0, 0, 0},
  887. { 3, 1, 0x348,0x1e3,0x670,0x3c0,0x032, 0, 0, 0, 0, 0, 0, 0},
  888. { 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0, 0, 0, 0, 0},
  889. { 5, 2, 0x348,0x233,0x670,0x3c0,0x08d, 1, 0, 0, 0, 0, 0, 0},
  890. { 8, 5, 0x41a,0x2ab,0x670,0x3c0,0x17c, 1, 0, 0, 0, 0, 0, 0}
  891. };
  892. static const struct SiS_TVData SiS_ExtHiTVData[] =
  893. { /* all ok */
  894. { 6, 1, 0x348,0x233,0x660,0x3c0, 0, 0, 0, 0, 0, 0, 0, 0},
  895. { 3, 1, 0x3c0,0x233,0x660,0x3c0, 0, 0, 0, 0, 0, 0, 0, 0},
  896. { 6, 1, 0x348,0x233,0x660,0x3c0, 0, 0, 0, 0, 0, 0, 0, 0},
  897. { 3, 1, 0x3c0,0x233,0x660,0x3c0, 0, 0, 0, 0, 0, 0, 0, 0},
  898. { 5, 1, 0x348,0x233,0x670,0x3c0,0x166, 1, 0, 0, 0, 0, 0, 0}, /* 640x480 */
  899. { 16, 5, 0x41a,0x2ab,0x670,0x3c0,0x143, 1, 0, 0, 0, 0, 0, 0}, /* 800x600 */
  900. { 25, 12, 0x4ec,0x353,0x670,0x3c0,0x032, 0, 0, 0, 0, 0, 0, 0}, /* 1024x768 */
  901. { 5, 4, 0x627,0x464,0x670,0x3c0,0x128, 0, 0, 0, 0, 0, 0, 0}, /* 1280x1024 */
  902. { 4, 1, 0x41a,0x233,0x60c,0x3c0,0x143, 1, 0, 0, 0, 0, 0, 0}, /* 800x480 */
  903. { 5, 2, 0x578,0x293,0x670,0x3c0,0x032, 0, 0, 0, 0, 0, 0, 0}, /* 1024x576 */
  904. { 8, 5, 0x6d6,0x323,0x670,0x3c0,0x128, 0, 0, 0, 0, 0, 0, 0}, /* 1280x720 */
  905. { 8, 3, 0x4ec,0x353,0x670,0x3c0,0x032, 0, 0, 0, 0, 0, 0, 0}, /* 960x600 */
  906. };
  907. static const struct SiS_TVData SiS_St525pData[] =
  908. {
  909. { 1, 1, 0x6b4,0x20d,0x4f6,0x190, 50, 0, 0x2f8, 0, 0, 0, 0, 0},
  910. { 1, 1, 0x6b4,0x20d,0x4f6,0x15e, 50, 0, 0x280, 0, 0, 0, 0, 0},
  911. { 1, 1, 0x6b4,0x20d,0x4f6,0x190, 50, 0, 0x2f8, 0, 0, 0, 0, 0},
  912. { 1, 1, 0x6b4,0x20d,0x4f6,0x15e, 50, 0, 0x280, 0, 0, 0, 0, 0},
  913. { 1, 1, 0x6b4,0x20d,0x4f6,0x1e0, 0, 0, 0x2f8, 0, 0, 0, 0, 0}
  914. };
  915. static const struct SiS_TVData SiS_St750pData[] =
  916. {
  917. { 1, 1, 0x672,0x2ee,0x500,0x190, 50, 0, 0x2f8, 0, 0, 0, 0, 0},
  918. { 1, 1, 0x672,0x2ee,0x500,0x15e, 50, 0, 0x280, 0, 0, 0, 0, 0},
  919. { 1, 1, 0x672,0x2ee,0x500,0x190, 0, 0, 0x2d0, 0, 0, 0, 0, 0},
  920. { 1, 1, 0x672,0x2ee,0x500,0x15e, 0, 0, 0x2d0, 0, 0, 0, 0, 0},
  921. { 1, 1, 0x672,0x2ee,0x500,0x1e0, 0, 0, 0x2f8, 0, 0, 0, 0, 0}
  922. };
  923. static const struct SiS_TVData SiS_Ext750pData[] =
  924. { /* all ok */
  925. { 3, 1, 935, 470, 1130, 680, 50, 0, 0, 0, 0, 0, 0, 0}, /* 320x200/640x400 */
  926. { 24, 7, 935, 420, 1130, 680, 50, 0, 0, 0, 0, 0, 0, 0},
  927. { 3, 1, 935, 470, 1130, 680, 50, 0, 0, 0, 0, 0, 0, 0},
  928. { 24, 7, 935, 420, 1130, 680, 50, 0, 0, 0, 0, 0, 0, 0},
  929. { 2, 1, 1100, 590, 1130, 640, 50, 0, 0, 0, 0, 0, 0, 0}, /* 640x480 */
  930. { 3, 2, 1210, 690, 1130, 660, 50, 0, 0, 0, 0, 0, 0, 0}, /* 800x600 OK */
  931. { 2, 1, 1100, 562, 1130, 640, 0, 1, 0, 0, 0, 0, 0, 0}, /* 720x480 OK */
  932. { 1, 1, 1375, 878, 1130, 640, 638, 0, 0, 0, 0, 0, 0, 0}, /* 1024x768 OK */
  933. { 5, 3, 1100, 675, 1130, 640, 0, 1, 0, 0, 0, 0, 0, 0}, /* 720/768x576 OK */
  934. { 25, 24, 1496, 755, 1120, 680, 50, 0, 0, 0, 0, 0, 0, 0} /* 1280x720 OK */
  935. };
  936. static const struct SiS_LCDData SiS_LCD1280x720Data[] = /* 2.03.00 */
  937. {
  938. { 44, 15, 864, 430, 1408, 806 }, /* 640x400 */
  939. { 128, 35, 792, 385, 1408, 806 },
  940. { 44, 15, 864, 430, 1408, 806 },
  941. { 128, 35, 792, 385, 1408, 806 },
  942. { 22, 9, 864, 516, 1408, 806 }, /* 640x480 */
  943. { 8, 5, 1056, 655, 1408, 806 }, /* 800x600 */
  944. { 0, 0, 0, 0, 0, 0 }, /* 1024x768 */
  945. { 0, 0, 0, 0, 0, 0 }, /* 1280x1024 */
  946. { 0, 0, 0, 0, 0, 0 },
  947. { 0, 0, 0, 0, 0, 0 },
  948. { 1, 1, 1408, 806, 1408, 806 } /* 1280x720 */
  949. };
  950. /* About 1280x768: For TMDS, Panel_1280x768 will only be set if
  951. * the panel is a Fujitsu 7911 (VL-17WDX8) (with clock 81, 1688x802)
  952. * Other TMDS panels of this resolution will be treated as custom.
  953. * For LVDS, we know another type (_2).
  954. * (Note: 1280x768_3 is now special for SiS301/NetVista
  955. */
  956. static const struct SiS_LCDData SiS_StLCD1280x768_2Data[] = /* 2.03.00 */
  957. {
  958. { 64, 21, 858, 434, 1408, 806 }, /* 640x400 */
  959. { 32, 9, 858, 372, 1408, 806 },
  960. { 64, 21, 858, 434, 1408, 806 },
  961. { 32, 9, 858, 372, 1408, 806 },
  962. { 143, 68, 1024, 527, 1408, 806 }, /* 640x480 */
  963. { 64, 51, 1364, 663, 1408, 806 }, /* 800x600 */
  964. { 88, 81, 1296, 806, 1408, 806 }, /* 1024x768 */
  965. { 0, 0, 0, 0, 0, 0 },
  966. { 1, 1, 1408, 806, 1408, 806 }, /* 1280x768 */
  967. { 0, 0, 0, 0, 0, 0 },
  968. { 16, 15, 1600, 750, 1600, 806 } /* 1280x720 - from Ext */
  969. };
  970. static const struct SiS_LCDData SiS_ExtLCD1280x768_2Data[] = /* 2.03.00 */
  971. {
  972. { 16, 5, 960, 410, 1600, 806 }, /* 640x400 */
  973. { 64, 21, 1152, 364, 1600, 806 },
  974. { 16, 5, 960, 410, 1600, 806 },
  975. { 64, 21, 1152, 364, 1600, 806 },
  976. { 32, 13, 1040, 493, 1600, 806 }, /* 640x480 */
  977. { 16, 9, 1152, 618, 1600, 806 }, /* 800x600 */
  978. { 25, 21, 1344, 796, 1600, 806 }, /* 1024x768 */
  979. { 0, 0, 0, 0, 0, 0 },
  980. { 1, 1, 1600, 806, 1600, 806 }, /* 1280x768 */
  981. { 0, 0, 0, 0, 0, 0 },
  982. { 16, 15, 1600, 750, 1600, 806 } /* 1280x720 */
  983. };
  984. #if 0 /* Not used; _3 now reserved for NetVista (SiS301) */
  985. static const struct SiS_LCDData SiS_LCD1280x768_3Data[] =
  986. {
  987. { 64, 25, 1056, 422, 1664, 798 }, /* 640x400 */
  988. { 128, 39, 884, 396, 1408, 806 }, /* ,640 */
  989. { 64, 25, 1056, 422, 1664, 798 }, /* 640x400 */
  990. { 128, 39, 884, 396, 1408, 806 }, /* ,640 */
  991. { 32, 15, 1056, 513, 1408, 806 }, /* ,664 */ /* 640x480 */
  992. { 176, 125, 1280, 640, 1408, 806 }, /* ,768 */ /* 800x600 */
  993. { 64, 61, 1342, 806, 1408, 806 }, /* 1024x768 */
  994. { 0, 0, 0, 0, 0, 0 },
  995. { 1, 1, 1408, 806, 1408, 806 }, /* 1280x768 */
  996. { 0, 0, 0, 0, 0, 0 },
  997. { 16, 15, 1600, 750, 1600, 806 } /* 1280x720 from above */
  998. };
  999. #endif
  1000. static const struct SiS_LCDData SiS_LCD1280x800Data[] = /* 0.93.12a (TMDS) */
  1001. {
  1002. { 128, 51, 1122, 412, 1408, 816 }, /* 640x400 */
  1003. { 128, 49, 1232, 361, 1408, 816 },
  1004. { 128, 51, 1122, 412, 1408, 816 },
  1005. { 128, 49, 1232, 361, 1408, 816 },
  1006. { 8, 3, 880, 491, 1408, 816 }, /* 640x480 */
  1007. { 11, 6, 1024, 612, 1408, 816 }, /* 800x600 */
  1008. { 22, 21, 1400, 784, 1408, 816 }, /* 1024x768 */
  1009. { 0, 0, 0, 0, 0, 0 }, /* 1280x1024 */
  1010. { 1, 1, 1408, 816, 1408, 816 }, /* 1280x800 */
  1011. { 0, 0, 0, 0, 0, 0 }, /* 1280x768 (patch index) */
  1012. { 0, 0, 0, 0, 0, 0 } /* 1280x720 */
  1013. };
  1014. static const struct SiS_LCDData SiS_LCD1280x800_2Data[] = /* 2.03.00 (LVDS) */
  1015. {
  1016. { 97, 42, 1344, 409, 1552, 812 }, /* 640x400 */
  1017. { 97, 35, 1280, 358, 1552, 812 },
  1018. { 97, 42, 1344, 409, 1552, 812 },
  1019. { 97, 35, 1280, 358, 1552, 812 },
  1020. { 97, 39, 1040, 488, 1552, 812 }, /* 640x480 */
  1021. { 194, 105, 1120, 608, 1552, 812 }, /* 800x600 */
  1022. { 97, 84, 1400, 780, 1552, 812 }, /* 1024x768 */
  1023. { 0, 0, 0, 0, 0, 0 }, /* 1280x1024 */
  1024. { 1, 1, 1552, 812, 1552, 812 }, /* 1280x800 */
  1025. { 97, 96, 1600, 780, 1552, 812 }, /* 1280x768 - patch index */
  1026. { 97, 90, 1600, 730, 1552, 812 } /* 1280x720 */
  1027. };
  1028. #if 0
  1029. static const struct SiS_LCDData SiS_LCD1280x800_3Data[] = /* 2.02.05a (LVDS); m250 */
  1030. {
  1031. { 128, 51, 1122, 412, 1408, 816 }, /* 640x400 */
  1032. { 128, 49, 1232, 361, 1408, 816 },
  1033. { 128, 51, 1122, 412, 1408, 816 },
  1034. { 128, 49, 1232, 361, 1408, 816 },
  1035. { 8, 3, 880, 491, 1408, 816 }, /* 640x480 */
  1036. { 11, 6, 1024, 612, 1408, 816 }, /* 800x600 */
  1037. { 22, 21, 1400, 784, 1408, 816 }, /* 1024x768 */
  1038. { 0, 0, 0, 0, 0, 0 }, /* 1280x1024 */
  1039. { 1, 1, 1408, 816, 1408, 816 }, /* 1280x800 */
  1040. { 0, 0, 0, 0, 0, 0 }, /* 1280x768 - patch index */
  1041. { 0, 0, 0, 0, 0, 0 } /* 1280x720 */
  1042. };
  1043. #endif
  1044. static const struct SiS_LCDData SiS_LCD1280x854Data[] = /* 2.21.00CS (LVDS) */
  1045. {
  1046. { 56, 15, 936, 410, 1664, 861 }, /* 640x400 */
  1047. { 64, 25, 1586, 355, 1664, 861 },
  1048. { 56, 15, 936, 410, 1664, 861 },
  1049. { 64, 25, 1586, 355, 1664, 861 },
  1050. { 91, 45, 1464, 485, 1664, 861 }, /* 640x480 */
  1051. { 182, 75, 976, 605, 1664, 861 }, /* 800x600 */
  1052. { 91, 66, 1342, 774, 1664, 861 }, /* 1024x768 */
  1053. { 0, 0, 0, 0, 0, 0 }, /* 1280x1024 */
  1054. { 26, 25, 1708, 807, 1664, 861 }, /* 1280x800 */
  1055. { 13, 12, 1708, 774, 1664, 861 }, /* 1280x768 - patch index */
  1056. { 52, 45, 1708, 725, 1664, 861 }, /* 1280x720 */
  1057. { 0, 0, 0, 0, 0, 0 },
  1058. { 0, 0, 0, 0, 0, 0 },
  1059. { 1, 1, 1664, 861, 1664, 861 } /* 1280x854 */
  1060. };
  1061. static const struct SiS_LCDData SiS_LCD1280x960Data[] =
  1062. {
  1063. { 9, 2, 800, 500, 1800, 1000 },
  1064. { 9, 2, 800, 500, 1800, 1000 },
  1065. { 4, 1, 900, 500, 1800, 1000 },
  1066. { 4, 1, 900, 500, 1800, 1000 },
  1067. { 9, 2, 800, 500, 1800, 1000 },
  1068. { 30, 11, 1056, 625, 1800, 1000 },
  1069. { 5, 3, 1350, 800, 1800, 1000 },
  1070. { 1, 1, 1576, 1050, 1576, 1050 },
  1071. { 1, 1, 1800, 1000, 1800, 1000 },
  1072. { 0, 0, 0, 0, 0, 0 },
  1073. { 0, 0, 0, 0, 0, 0 },
  1074. { 0, 0, 0, 0, 0, 0 },
  1075. { 0, 0, 0, 0, 0, 0 },
  1076. { 0, 0, 0, 0, 0, 0 }
  1077. };
  1078. static const struct SiS_LCDData SiS_StLCD1400x1050Data[] =
  1079. {
  1080. { 211, 100, 2100, 408, 1688, 1066 },
  1081. { 211, 64, 1536, 358, 1688, 1066 },
  1082. { 211, 100, 2100, 408, 1688, 1066 },
  1083. { 211, 64, 1536, 358, 1688, 1066 },
  1084. { 211, 48, 840, 488, 1688, 1066 },
  1085. { 211, 72, 1008, 609, 1688, 1066 },
  1086. { 211, 128, 1400, 776, 1688, 1066 },
  1087. { 211, 205, 1680, 1041, 1688, 1066 },
  1088. { 1, 1, 1688, 1066, 1688, 1066 },
  1089. { 0, 0, 0, 0, 0, 0 },
  1090. { 0, 0, 0, 0, 0, 0 },
  1091. { 0, 0, 0, 0, 0, 0 },
  1092. { 0, 0, 0, 0, 0, 0 },
  1093. { 0, 0, 0, 0, 0, 0 }
  1094. };
  1095. static const struct SiS_LCDData SiS_ExtLCD1400x1050Data[] =
  1096. {
  1097. /* { 211, 60, 1260, 410, 1688, 1066 }, 640x400 (6330) */
  1098. { 211, 100, 2100, 408, 1688, 1066 }, /* 640x400 (6325) WORKS */
  1099. { 211, 64, 1536, 358, 1688, 1066 },
  1100. { 211, 100, 2100, 408, 1688, 1066 },
  1101. { 211, 64, 1536, 358, 1688, 1066 },
  1102. /* { 211, 80, 1400, 490, 1688, 1066 }, 640x480 (6330) */
  1103. { 211, 48, 840, 488, 1688, 1066 }, /* 640x480 (6325) WORKS */
  1104. /* { 211, 117, 1638, 613, 1688, 1066 }, 800x600 (6330) */
  1105. { 211, 72, 1008, 609, 1688, 1066 }, /* 800x600 (6325) WORKS */
  1106. { 211, 128, 1400, 776, 1688, 1066 }, /* 1024x768 */
  1107. { 211, 205, 1680, 1041, 1688, 1066 }, /* 1280x1024 - not used (always unscaled) */
  1108. { 1, 1, 1688, 1066, 1688, 1066 }, /* 1400x1050 */
  1109. { 0, 0, 0, 0, 0, 0 }, /* kludge */
  1110. { 211, 120, 1400, 730, 1688, 1066 }, /* 1280x720 */
  1111. { 0, 0, 0, 0, 0, 0 },
  1112. { 0, 0, 0, 0, 0, 0 },
  1113. { 0, 0, 0, 0, 0, 0 }
  1114. };
  1115. static const struct SiS_LCDData SiS_LCD1680x1050Data[] =
  1116. {
  1117. { 95, 24, 1260, 410, 1900, 1066 }, /* 0 640x400 */
  1118. { 10, 3, 1710, 362, 1900, 1066 },
  1119. { 95, 24, 1260, 410, 1900, 1066 },
  1120. { 10, 3, 1710, 362, 1900, 1066 },
  1121. { 95, 32, 1400, 490, 1900, 1066 }, /* 4 640x480 */
  1122. { 95, 42, 1470, 610, 1900, 1066 }, /* 5 800x600 */
  1123. { 95, 64, 1750, 784, 1900, 1066 }, /* 6 1024x768 */
  1124. { 95, 94, 1900, 1055, 1900, 1066 }, /* 7 1280x1024 */
  1125. { 41, 31, 1900, 806, 1900, 1066 }, /* 8 1280x768 */
  1126. { 95, 69, 1800, 817, 1900, 1066 }, /* 9 1280x800 patch index */
  1127. { 13, 9, 1900, 739, 1900, 1066 }, /* 10 1280x720 */
  1128. { 95, 94, 1880, 1066, 1900, 1066 }, /* 11 1400x1050 patch index */
  1129. { 1, 1, 1900, 1066, 1900, 1066 }, /* 12 1680x1050 */
  1130. { 0, 0, 0, 0, 0, 0 }
  1131. };
  1132. static const struct SiS_LCDData SiS_StLCD1600x1200Data[] =
  1133. {
  1134. {27, 4, 800, 500, 2160, 1250 },
  1135. {27, 4, 800, 500, 2160, 1250 },
  1136. { 6, 1, 900, 500, 2160, 1250 },
  1137. { 6, 1, 900, 500, 2160, 1250 },
  1138. {27, 1, 800, 500, 2160, 1250 },
  1139. { 4, 1,1080, 625, 2160, 1250 },
  1140. { 5, 2,1350, 800, 2160, 1250 },
  1141. {135,88,1600,1100, 2160, 1250 },
  1142. {72, 49,1680,1092, 2160, 1250 },
  1143. { 1, 1,2160,1250, 2160, 1250 },
  1144. { 0, 0, 0, 0, 0, 0 },
  1145. { 0, 0, 0, 0, 0, 0 },
  1146. { 0, 0, 0, 0, 0, 0 },
  1147. { 0, 0, 0, 0, 0, 0 }
  1148. };
  1149. static const struct SiS_LCDData SiS_ExtLCD1600x1200Data[] =
  1150. {
  1151. {72,11, 990, 422, 2160, 1250 }, /* 640x400 (6330) WORKS */
  1152. /* {27, 4, 800, 500, 2160, 1250 }, 640x400 (6235) */
  1153. {27, 4, 800, 500, 2160, 1250 },
  1154. { 6, 1, 900, 500, 2160, 1250 },
  1155. { 6, 1, 900, 500, 2160, 1250 },
  1156. {45, 8, 960, 505, 2160, 1250 }, /* 640x480 (6330) WORKS */
  1157. /* {27, 1, 800, 500, 2160, 1250 }, 640x480 (6325) */
  1158. { 4, 1,1080, 625, 2160, 1250 },
  1159. { 5, 2,1350, 800, 2160, 1250 },
  1160. {27,16,1500,1064, 2160, 1250 }, /* 1280x1024 */
  1161. {72,49,1680,1092, 2160, 1250 }, /* 1400x1050 (6330, was not supported on 6325) */
  1162. { 1, 1,2160,1250, 2160, 1250 },
  1163. { 0, 0, 0, 0, 0, 0 },
  1164. { 0, 0, 0, 0, 0, 0 },
  1165. { 0, 0, 0, 0, 0, 0 },
  1166. { 0, 0, 0, 0, 0, 0 }
  1167. };
  1168. static const struct SiS_LCDData SiS_NoScaleData[] =
  1169. {
  1170. { 1, 1, 800, 449, 800, 449 }, /* 0x00: 320x200, 640x400 */
  1171. { 1, 1, 800, 449, 800, 449 },
  1172. { 1, 1, 900, 449, 900, 449 },
  1173. { 1, 1, 900, 449, 900, 449 },
  1174. { 1, 1, 800, 525, 800, 525 }, /* 0x04: 320x240, 640x480 */
  1175. { 1, 1,1056, 628,1056, 628 }, /* 0x05: 400x300, 800x600 */
  1176. { 1, 1,1344, 806,1344, 806 }, /* 0x06: 512x384, 1024x768 */
  1177. { 1, 1,1688,1066,1688,1066 }, /* 0x07: 1280x1024 */
  1178. { 1, 1,1688, 802,1688, 802 }, /* 0x08: 1280x768: Fujitsu, TMDS only */
  1179. { 1, 1,2160,1250,2160,1250 }, /* 0x09: 1600x1200 */
  1180. { 1, 1,1800,1000,1800,1000 }, /* 0x0a: 1280x960 */
  1181. { 1, 1,1688,1066,1688,1066 }, /* 0x0b: 1400x1050 */
  1182. { 1, 1,1650, 750,1650, 750 }, /* 0x0c: 1280x720 (TMDS, projector) */
  1183. { 1, 1,1552, 812,1552, 812 }, /* 0x0d: 1280x800_2 (LVDS) (was: 1408,816/ 1656,841) */
  1184. { 1, 1,1900,1066,1900,1066 }, /* 0x0e: 1680x1050 (LVDS) */
  1185. { 1, 1,1660, 806,1660, 806 }, /* 0x0f: 1280x768_2 (LVDS) */
  1186. { 1, 1,1664, 798,1664, 798 }, /* 0x10: 1280x768_3 (NetVista SiS 301) - TODO */
  1187. { 1, 1,1688, 802,1688, 802 }, /* 0x11: 1280x768 (TMDS Fujitsu) */
  1188. { 1, 1,1408, 806,1408, 806 }, /* 0x12: 1280x720 (LVDS) */
  1189. { 1, 1, 896, 497, 896, 497 }, /* 0x13: 720x480 */
  1190. { 1, 1, 912, 597, 912, 597 }, /* 0x14: 720x576 */
  1191. { 1, 1, 912, 597, 912, 597 }, /* 0x15: 768x576 */
  1192. { 1, 1,1056, 497,1056, 497 }, /* 0x16: 848x480 */
  1193. { 1, 1,1064, 497,1064, 497 }, /* 0x17: 856x480 */
  1194. { 1, 1,1056, 497,1056, 497 }, /* 0x18: 800x480 */
  1195. { 1, 1,1328, 739,1328, 739 }, /* 0x19: 1024x576 */
  1196. { 1, 1,1680, 892,1680, 892 }, /* 0x1a: 1152x864 */
  1197. { 1, 1,1808, 808,1808, 808 }, /* 0x1b: 1360x768 */
  1198. { 1, 1,1104, 563,1104, 563 }, /* 0x1c: 960x540 */
  1199. { 1, 1,1120, 618,1120, 618 }, /* 0x1d: 960x600 */
  1200. { 1, 1,1408, 816,1408, 816 }, /* 0x1f: 1280x800 (TMDS special) */
  1201. { 1, 1,1760,1235,1760,1235 }, /* 0x20: 1600x1200 for LCDA */
  1202. { 1, 1,2048,1320,2048,1320 }, /* 0x21: 1600x1200 for non-SiS LVDS */
  1203. { 1, 1,1664, 861,1664, 861 } /* 0x22: 1280x854 */
  1204. };
  1205. /**************************************************************/
  1206. /* LVDS ----------------------------------------------------- */
  1207. /**************************************************************/
  1208. /* FSTN/DSTN 320x240, 2 variants */
  1209. static const struct SiS_LVDSData SiS_LVDS320x240Data_1[]=
  1210. {
  1211. { 848, 433, 400, 525},
  1212. { 848, 389, 400, 525},
  1213. { 848, 433, 400, 525},
  1214. { 848, 389, 400, 525},
  1215. { 848, 518, 400, 525},
  1216. {1056, 628, 400, 525},
  1217. { 400, 525, 400, 525} /* xSTN */
  1218. };
  1219. static const struct SiS_LVDSData SiS_LVDS320x240Data_2[]=
  1220. {
  1221. { 800, 445, 800, 525},
  1222. { 800, 395, 800, 525},
  1223. { 800, 445, 800, 525},
  1224. { 800, 395, 800, 525},
  1225. { 800, 525, 800, 525},
  1226. {1056, 628,1056, 628},
  1227. { 480, 525, 480, 525} /* xSTN */
  1228. };
  1229. static const struct SiS_LVDSData SiS_LVDS640x480Data_1[]=
  1230. {
  1231. { 800, 445, 800, 525}, /* 800, 449, 800, 449 */
  1232. { 800, 395, 800, 525},
  1233. { 800, 445, 800, 525},
  1234. { 800, 395, 800, 525},
  1235. { 800, 525, 800, 525}
  1236. };
  1237. static const struct SiS_LVDSData SiS_LVDS800x600Data_1[]=
  1238. {
  1239. { 848, 433,1060, 629},
  1240. { 848, 389,1060, 629},
  1241. { 848, 433,1060, 629},
  1242. { 848, 389,1060, 629},
  1243. { 848, 518,1060, 629},
  1244. {1056, 628,1056, 628}
  1245. };
  1246. static const struct SiS_LVDSData SiS_LVDS1024x600Data_1[] =
  1247. {
  1248. { 840, 604,1344, 800},
  1249. { 840, 560,1344, 800},
  1250. { 840, 604,1344, 800},
  1251. { 840, 560,1344, 800},
  1252. { 840, 689,1344, 800},
  1253. {1050, 800,1344, 800},
  1254. {1344, 800,1344, 800}
  1255. };
  1256. static const struct SiS_LVDSData SiS_LVDS1024x768Data_1[]=
  1257. {
  1258. { 840, 438,1344, 806},
  1259. { 840, 409,1344, 806},
  1260. { 840, 438,1344, 806},
  1261. { 840, 409,1344, 806},
  1262. { 840, 518,1344, 806}, /* 640x480 */
  1263. {1050, 638,1344, 806}, /* 800x600 */
  1264. {1344, 806,1344, 806}, /* 1024x768 */
  1265. };
  1266. static const struct SiS_LVDSData SiS_CHTVUNTSCData[]=
  1267. {
  1268. { 840, 600, 840, 600},
  1269. { 840, 600, 840, 600},
  1270. { 840, 600, 840, 600},
  1271. { 840, 600, 840, 600},
  1272. { 784, 600, 784, 600},
  1273. {1064, 750,1064, 750},
  1274. {1160, 945,1160, 945}
  1275. };
  1276. static const struct SiS_LVDSData SiS_CHTVONTSCData[]=
  1277. {
  1278. { 840, 525, 840, 525},
  1279. { 840, 525, 840, 525},
  1280. { 840, 525, 840, 525},
  1281. { 840, 525, 840, 525},
  1282. { 784, 525, 784, 525},
  1283. {1040, 700,1040, 700},
  1284. {1160, 840,1160, 840}
  1285. };
  1286. /* CRT1 CRTC data for slave modes */
  1287. static const struct SiS_LVDSCRT1Data SiS_LVDSCRT1320x240_1[] =
  1288. {
  1289. {{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f,
  1290. 0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
  1291. 0x00 }},
  1292. {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
  1293. 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
  1294. 0x00 }},
  1295. {{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f,
  1296. 0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
  1297. 0x00 }},
  1298. {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
  1299. 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
  1300. 0x00 }},
  1301. {{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e,
  1302. 0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
  1303. 0x00 }},
  1304. {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
  1305. 0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
  1306. 0x01 }},
  1307. {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
  1308. 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
  1309. 0x00 }}
  1310. };
  1311. static const struct SiS_LVDSCRT1Data SiS_LVDSCRT1320x240_2[] =
  1312. {
  1313. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1314. 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
  1315. 0x00}},
  1316. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1317. 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
  1318. 0x00}},
  1319. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1320. 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
  1321. 0x00}},
  1322. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1323. 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
  1324. 0x00}},
  1325. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1326. 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
  1327. 0x00}},
  1328. {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
  1329. 0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
  1330. 0x01}},
  1331. #if 0
  1332. {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
  1333. 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
  1334. 0x00}}
  1335. #endif
  1336. {{0x5f,0x4f,0x83,0x55,0x81,0x0b,0x3e,
  1337. 0xe9,0x8b,0xe8,0x0c,0x00,0x00,0x05,
  1338. 0x00}},
  1339. };
  1340. static const struct SiS_LVDSCRT1Data SiS_LVDSCRT1320x240_2_H[] =
  1341. {
  1342. {{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f,
  1343. 0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
  1344. 0x00}},
  1345. {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
  1346. 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
  1347. 0x00}},
  1348. {{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f,
  1349. 0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
  1350. 0x00}},
  1351. {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
  1352. 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
  1353. 0x00}},
  1354. {{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e,
  1355. 0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
  1356. 0x00}},
  1357. {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
  1358. 0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
  1359. 0x01}},
  1360. {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
  1361. 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
  1362. 0x00}}
  1363. };
  1364. static const struct SiS_LVDSCRT1Data SiS_LVDSCRT1320x240_3[] =
  1365. {
  1366. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1367. 0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
  1368. 0x00}},
  1369. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1370. 0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
  1371. 0x00}},
  1372. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1373. 0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
  1374. 0x00}},
  1375. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1376. 0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
  1377. 0x00}},
  1378. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1379. 0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
  1380. 0x00}},
  1381. {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
  1382. 0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
  1383. 0x01}},
  1384. {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
  1385. 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
  1386. 0x00}}
  1387. };
  1388. static const struct SiS_LVDSCRT1Data SiS_LVDSCRT1320x240_3_H[] =
  1389. {
  1390. {{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f,
  1391. 0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
  1392. 0x00}},
  1393. {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
  1394. 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
  1395. 0x00}},
  1396. {{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f,
  1397. 0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
  1398. 0x00}},
  1399. {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
  1400. 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
  1401. 0x00}},
  1402. {{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e,
  1403. 0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
  1404. 0x00}},
  1405. {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
  1406. 0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
  1407. 0x01}},
  1408. {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
  1409. 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
  1410. 0x00}}
  1411. };
  1412. static const struct SiS_LVDSCRT1Data SiS_LVDSCRT1640x480_1[] =
  1413. {
  1414. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1415. 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
  1416. 0x00}},
  1417. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1418. 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
  1419. 0x00}},
  1420. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1421. 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
  1422. 0x00}},
  1423. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1424. 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
  1425. 0x00}},
  1426. {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
  1427. 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
  1428. 0x00}},
  1429. {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
  1430. 0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
  1431. 0x01}}
  1432. };
  1433. static const struct SiS_LVDSCRT1Data SiS_LVDSCRT1640x480_1_H[] =
  1434. {
  1435. {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
  1436. 0x9c,0x8e,0x96,0xb9,0x00,0x00,0x00,
  1437. 0x00}},
  1438. {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
  1439. 0x83,0x85,0x63,0xba,0x00,0x00,0x00,
  1440. 0x00}},
  1441. {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
  1442. 0x9c,0x8e,0x96,0xb9,0x00,0x00,0x00,
  1443. 0x00}},
  1444. {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
  1445. 0x83,0x85,0x63,0xba,0x00,0x00,0x00,
  1446. 0x00}},
  1447. {{0x2d,0x28,0x90,0x2c,0x80,0x0b,0x3e,
  1448. 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
  1449. 0x00}}
  1450. };
  1451. bool SiSInitPtr(struct SiS_Private *SiS_Pr);
  1452. #ifdef SIS_XORG_XF86
  1453. unsigned short SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay,
  1454. int Depth, bool FSTN, int LCDwith, int LCDheight);
  1455. #endif
  1456. unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay,
  1457. int VDisplay, int Depth, bool FSTN,
  1458. unsigned short CustomT, int LCDwith, int LCDheight,
  1459. unsigned int VBFlags2);
  1460. unsigned short SiS_GetModeID_TV(int VGAEngine, unsigned int VBFlags, int HDisplay,
  1461. int VDisplay, int Depth, unsigned int VBFlags2);
  1462. unsigned short SiS_GetModeID_VGA2(int VGAEngine, unsigned int VBFlags, int HDisplay,
  1463. int VDisplay, int Depth, unsigned int VBFlags2);
  1464. void SiS_SetReg(SISIOADDRESS port, unsigned short index, unsigned short data);
  1465. void SiS_SetRegByte(SISIOADDRESS port, unsigned short data);
  1466. void SiS_SetRegShort(SISIOADDRESS port, unsigned short data);
  1467. void SiS_SetRegLong(SISIOADDRESS port, unsigned int data);
  1468. unsigned char SiS_GetReg(SISIOADDRESS port, unsigned short index);
  1469. unsigned char SiS_GetRegByte(SISIOADDRESS port);
  1470. unsigned short SiS_GetRegShort(SISIOADDRESS port);
  1471. unsigned int SiS_GetRegLong(SISIOADDRESS port);
  1472. void SiS_SetRegANDOR(SISIOADDRESS Port, unsigned short Index, unsigned short DataAND,
  1473. unsigned short DataOR);
  1474. void SiS_SetRegAND(SISIOADDRESS Port,unsigned short Index, unsigned short DataAND);
  1475. void SiS_SetRegOR(SISIOADDRESS Port,unsigned short Index, unsigned short DataOR);
  1476. void SiS_DisplayOn(struct SiS_Private *SiS_Pr);
  1477. void SiS_DisplayOff(struct SiS_Private *SiS_Pr);
  1478. void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr);
  1479. #ifndef SIS_LINUX_KERNEL
  1480. void SiSSetLVDSetc(struct SiS_Private *SiS_Pr);
  1481. #endif
  1482. void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable);
  1483. void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable);
  1484. unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  1485. unsigned short ModeIdIndex);
  1486. bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr);
  1487. #ifndef SIS_LINUX_KERNEL
  1488. void SiS_GetVBType(struct SiS_Private *SiS_Pr);
  1489. #endif
  1490. bool SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo,
  1491. unsigned short *ModeIdIndex);
  1492. unsigned short SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  1493. unsigned short ModeIdIndex);
  1494. unsigned short SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide);
  1495. unsigned short SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide);
  1496. unsigned short SiS_GetColorDepth(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  1497. unsigned short ModeIdIndex);
  1498. unsigned short SiS_GetOffset(struct SiS_Private *SiS_Pr,unsigned short ModeNo,
  1499. unsigned short ModeIdIndex, unsigned short RRTI);
  1500. #ifdef SIS300
  1501. void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *idx1,
  1502. unsigned short *idx2);
  1503. unsigned short SiS_GetFIFOThresholdB300(unsigned short idx1, unsigned short idx2);
  1504. unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index);
  1505. #endif
  1506. void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex);
  1507. #ifdef SIS_XORG_XF86
  1508. bool SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo,
  1509. bool dosetpitch);
  1510. bool SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
  1511. DisplayModePtr mode, bool IsCustom);
  1512. bool SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
  1513. DisplayModePtr mode, bool IsCustom);
  1514. bool SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
  1515. DisplayModePtr mode, bool IsCustom);
  1516. #endif
  1517. #ifdef SIS_LINUX_KERNEL
  1518. bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
  1519. #endif
  1520. void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth);
  1521. void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  1522. unsigned short ModeIdIndex);
  1523. #ifdef SIS_XORG_XF86
  1524. void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres,
  1525. int yres, DisplayModePtr current);
  1526. #endif
  1527. #ifdef SIS_LINUX_KERNEL
  1528. void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres,
  1529. int yres, struct fb_var_screeninfo *var, bool writeres);
  1530. #endif
  1531. /* From init301.c: */
  1532. extern void SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  1533. unsigned short ModeIdIndex, int chkcrt2mode);
  1534. extern void SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  1535. unsigned short ModeIdIndex);
  1536. extern void SiS_SetYPbPr(struct SiS_Private *SiS_Pr);
  1537. extern void SiS_SetTVMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  1538. unsigned short ModeIdIndex);
  1539. extern void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr);
  1540. extern void SiS_DisableBridge(struct SiS_Private *);
  1541. extern bool SiS_SetCRT2Group(struct SiS_Private *, unsigned short);
  1542. extern unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  1543. unsigned short ModeIdIndex);
  1544. extern void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr);
  1545. extern unsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  1546. unsigned short ModeIdIndex);
  1547. extern unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax);
  1548. extern unsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  1549. unsigned short ModeIdIndex, unsigned short RRTI);
  1550. extern bool SiS_IsVAMode(struct SiS_Private *);
  1551. extern bool SiS_IsDualEdge(struct SiS_Private *);
  1552. #ifdef SIS_XORG_XF86
  1553. /* From other modules: */
  1554. extern unsigned short SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
  1555. unsigned int VBFlags);
  1556. extern unsigned char SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, unsigned short offset,
  1557. unsigned char value);
  1558. extern unsigned char SiS_GetSetModeID(ScrnInfoPtr pScrn, unsigned char id);
  1559. extern unsigned short SiS_GetModeNumber(ScrnInfoPtr pScrn, DisplayModePtr mode,
  1560. unsigned int VBFlags);
  1561. #endif
  1562. #ifdef SIS_LINUX_KERNEL
  1563. #ifdef SIS300
  1564. extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg);
  1565. extern void sisfb_write_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg,
  1566. unsigned int val);
  1567. #endif
  1568. #ifdef SIS315H
  1569. extern void sisfb_write_nbridge_pci_byte(struct SiS_Private *SiS_Pr, int reg,
  1570. unsigned char val);
  1571. extern unsigned int sisfb_read_mio_pci_word(struct SiS_Private *SiS_Pr, int reg);
  1572. #endif
  1573. #endif
  1574. #endif