init.h 59 KB

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