init.h 59 KB

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