vesadb.c 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. /* this file was automatically generated from vesa.txt */
  10. #include <u.h>
  11. #include <libc.h>
  12. #include <bio.h>
  13. #include "pci.h"
  14. #include "vga.h"
  15. /*
  16. * VESA Monitor Timing Standard mode definitions as per
  17. * VESA and Industry Standards and Guidelines for Computer
  18. * Display Monitor Timing, Version 1.0, Revision 0.8, 17 September 1998.
  19. *
  20. * See /public/doc/vesa/dmtv1r08.pdf.
  21. *
  22. * This might go back into vgadb at some point. It's here mainly
  23. * so that people don't change it, and so that we can run without vgadb.
  24. */
  25. static Mode vesa640x480x60 = {
  26. .name = "640x480@60Hz",
  27. .x = 640,
  28. .y = 480,
  29. .ht = 800,
  30. .shb = 648,
  31. .ehb = 648+144,
  32. .shs = 656,
  33. .ehs = 656+96,
  34. .vt = 525,
  35. .vrs = 490,
  36. .vre = 490+2,
  37. .vbs = 488,
  38. .vbe = 488+29,
  39. .frequency = 25175000,
  40. .hsync = '-',
  41. .vsync = '-',
  42. .interlace = '\0',
  43. };
  44. static Mode vesa640x480x72 = {
  45. .name = "640x480@72Hz",
  46. .x = 640,
  47. .y = 480,
  48. .ht = 832,
  49. .shb = 648,
  50. .ehb = 648+176,
  51. .shs = 664,
  52. .ehs = 664+40,
  53. .vt = 520,
  54. .vrs = 489,
  55. .vre = 489+3,
  56. .vbs = 488,
  57. .vbe = 488+24,
  58. .frequency = 31500000,
  59. .hsync = '-',
  60. .vsync = '-',
  61. .interlace = '\0',
  62. };
  63. static Mode vesa640x480x75 = {
  64. .name = "640x480@75Hz",
  65. .x = 640,
  66. .y = 480,
  67. .ht = 840,
  68. .shb = 640,
  69. .ehb = 640+200,
  70. .shs = 656,
  71. .ehs = 656+64,
  72. .vt = 500,
  73. .vrs = 481,
  74. .vre = 481+3,
  75. .vbs = 480,
  76. .vbe = 480+20,
  77. .frequency = 31500000,
  78. .hsync = '-',
  79. .vsync = '-',
  80. .interlace = '\0',
  81. };
  82. static Mode vesa640x480x85 = {
  83. .name = "640x480@85Hz",
  84. .x = 640,
  85. .y = 480,
  86. .ht = 832,
  87. .shb = 640,
  88. .ehb = 640+192,
  89. .shs = 696,
  90. .ehs = 696+56,
  91. .vt = 509,
  92. .vrs = 481,
  93. .vre = 481+3,
  94. .vbs = 480,
  95. .vbe = 480+29,
  96. .frequency = 36000000,
  97. .hsync = '-',
  98. .vsync = '-',
  99. .interlace = '\0',
  100. };
  101. static Mode vesa800x600x56 = {
  102. .name = "800x600@56Hz",
  103. .x = 800,
  104. .y = 600,
  105. .ht = 1024,
  106. .shb = 800,
  107. .ehb = 800+224,
  108. .shs = 824,
  109. .ehs = 824+72,
  110. .vt = 625,
  111. .vrs = 601,
  112. .vre = 601+2,
  113. .vbs = 600,
  114. .vbe = 600+25,
  115. .frequency = 36000000,
  116. .hsync = '+',
  117. .vsync = '+',
  118. .interlace = '\0',
  119. };
  120. static Mode vesa800x600x60 = {
  121. .name = "800x600@60Hz",
  122. .x = 800,
  123. .y = 600,
  124. .ht = 1056,
  125. .shb = 800,
  126. .ehb = 800+256,
  127. .shs = 840,
  128. .ehs = 840+128,
  129. .vt = 628,
  130. .vrs = 601,
  131. .vre = 601+4,
  132. .vbs = 600,
  133. .vbe = 600+28,
  134. .frequency = 40000000,
  135. .hsync = '+',
  136. .vsync = '+',
  137. .interlace = '\0',
  138. };
  139. static Mode vesa800x600x72 = {
  140. .name = "800x600@72Hz",
  141. .x = 800,
  142. .y = 600,
  143. .ht = 1040,
  144. .shb = 800,
  145. .ehb = 800+240,
  146. .shs = 856,
  147. .ehs = 856+120,
  148. .vt = 666,
  149. .vrs = 637,
  150. .vre = 637+6,
  151. .vbs = 600,
  152. .vbe = 600+66,
  153. .frequency = 50000000,
  154. .hsync = '+',
  155. .vsync = '+',
  156. .interlace = '\0',
  157. };
  158. static Mode vesa800x600x75 = {
  159. .name = "800x600@75Hz",
  160. .x = 800,
  161. .y = 600,
  162. .ht = 1056,
  163. .shb = 800,
  164. .ehb = 800+256,
  165. .shs = 816,
  166. .ehs = 816+80,
  167. .vt = 625,
  168. .vrs = 601,
  169. .vre = 601+3,
  170. .vbs = 600,
  171. .vbe = 600+25,
  172. .frequency = 49500000,
  173. .hsync = '+',
  174. .vsync = '+',
  175. .interlace = '\0',
  176. };
  177. static Mode vesa800x600x85 = {
  178. .name = "800x600@85Hz",
  179. .x = 800,
  180. .y = 600,
  181. .ht = 1048,
  182. .shb = 800,
  183. .ehb = 800+248,
  184. .shs = 832,
  185. .ehs = 832+64,
  186. .vt = 631,
  187. .vrs = 601,
  188. .vre = 601+3,
  189. .vbs = 600,
  190. .vbe = 600+31,
  191. .frequency = 56250000,
  192. .hsync = '+',
  193. .vsync = '+',
  194. .interlace = '\0',
  195. };
  196. static Mode vesa1024x768x60 = {
  197. .name = "1024x768@60Hz",
  198. .x = 1024,
  199. .y = 768,
  200. .ht = 1344,
  201. .shb = 1024,
  202. .ehb = 1024+320,
  203. .shs = 1048,
  204. .ehs = 1048+136,
  205. .vt = 806,
  206. .vrs = 771,
  207. .vre = 771+6,
  208. .vbs = 768,
  209. .vbe = 768+38,
  210. .frequency = 65000000,
  211. .hsync = '-',
  212. .vsync = '-',
  213. .interlace = '\0',
  214. };
  215. static Mode vesa1024x768x70 = {
  216. .name = "1024x768@70Hz",
  217. .x = 1024,
  218. .y = 768,
  219. .ht = 1328,
  220. .shb = 1024,
  221. .ehb = 1024+304,
  222. .shs = 1048,
  223. .ehs = 1048+136,
  224. .vt = 806,
  225. .vrs = 771,
  226. .vre = 771+6,
  227. .vbs = 768,
  228. .vbe = 768+38,
  229. .frequency = 75000000,
  230. .hsync = '-',
  231. .vsync = '-',
  232. .interlace = '\0',
  233. };
  234. static Mode vesa1024x768x75 = {
  235. .name = "1024x768@75Hz",
  236. .x = 1024,
  237. .y = 768,
  238. .ht = 1312,
  239. .shb = 1024,
  240. .ehb = 1024+288,
  241. .shs = 1040,
  242. .ehs = 1040+96,
  243. .vt = 800,
  244. .vrs = 769,
  245. .vre = 769+3,
  246. .vbs = 768,
  247. .vbe = 768+32,
  248. .frequency = 78750000,
  249. .hsync = '+',
  250. .vsync = '+',
  251. .interlace = '\0',
  252. };
  253. static Mode vesa1024x768x85 = {
  254. .name = "1024x768@85Hz",
  255. .x = 1024,
  256. .y = 768,
  257. .ht = 1376,
  258. .shb = 1024,
  259. .ehb = 1024+352,
  260. .shs = 1072,
  261. .ehs = 1072+96,
  262. .vt = 808,
  263. .vrs = 769,
  264. .vre = 769+3,
  265. .vbs = 768,
  266. .vbe = 768+40,
  267. .frequency = 94500000,
  268. .hsync = '+',
  269. .vsync = '+',
  270. .interlace = '\0',
  271. };
  272. static Mode vesa1152x864x75 = {
  273. .name = "1152x864@75Hz",
  274. .x = 1152,
  275. .y = 864,
  276. .ht = 1600,
  277. .shb = 1152,
  278. .ehb = 1152+448,
  279. .shs = 1216,
  280. .ehs = 1216+128,
  281. .vt = 900,
  282. .vrs = 865,
  283. .vre = 865+3,
  284. .vbs = 864,
  285. .vbe = 864+36,
  286. .frequency = 108000000,
  287. .hsync = '+',
  288. .vsync = '+',
  289. .interlace = '\0',
  290. };
  291. static Mode vesa1280x960x60 = {
  292. .name = "1280x960@60Hz",
  293. .x = 1280,
  294. .y = 960,
  295. .ht = 1800,
  296. .shb = 1280,
  297. .ehb = 1280+520,
  298. .shs = 1376,
  299. .ehs = 1376+112,
  300. .vt = 1000,
  301. .vrs = 961,
  302. .vre = 961+3,
  303. .vbs = 960,
  304. .vbe = 960+40,
  305. .frequency = 108000000,
  306. .hsync = '+',
  307. .vsync = '+',
  308. .interlace = '\0',
  309. };
  310. static Mode vesa1280x960x85 = {
  311. .name = "1280x960@85Hz",
  312. .x = 1280,
  313. .y = 960,
  314. .ht = 1728,
  315. .shb = 1280,
  316. .ehb = 1280+448,
  317. .shs = 1344,
  318. .ehs = 1344+160,
  319. .vt = 1011,
  320. .vrs = 961,
  321. .vre = 961+3,
  322. .vbs = 960,
  323. .vbe = 960+51,
  324. .frequency = 148500000,
  325. .hsync = '+',
  326. .vsync = '+',
  327. .interlace = '\0',
  328. };
  329. static Mode vesa1280x1024x60 = {
  330. .name = "1280x1024@60Hz",
  331. .x = 1280,
  332. .y = 1024,
  333. .ht = 1688,
  334. .shb = 1280,
  335. .ehb = 1280+408,
  336. .shs = 1328,
  337. .ehs = 1328+112,
  338. .vt = 1066,
  339. .vrs = 1025,
  340. .vre = 1025+3,
  341. .vbs = 1024,
  342. .vbe = 1024+42,
  343. .frequency = 108000000,
  344. .hsync = '+',
  345. .vsync = '+',
  346. .interlace = '\0',
  347. };
  348. static Mode vesa1280x1024x75 = {
  349. .name = "1280x1024@75Hz",
  350. .x = 1280,
  351. .y = 1024,
  352. .ht = 1688,
  353. .shb = 1280,
  354. .ehb = 1280+408,
  355. .shs = 1296,
  356. .ehs = 1296+144,
  357. .vt = 1066,
  358. .vrs = 1025,
  359. .vre = 1025+3,
  360. .vbs = 1024,
  361. .vbe = 1024+42,
  362. .frequency = 135000000,
  363. .hsync = '+',
  364. .vsync = '+',
  365. .interlace = '\0',
  366. };
  367. static Mode vesa1280x1024x85 = {
  368. .name = "1280x1024@85Hz",
  369. .x = 1280,
  370. .y = 1024,
  371. .ht = 1728,
  372. .shb = 1280,
  373. .ehb = 1280+448,
  374. .shs = 1344,
  375. .ehs = 1344+160,
  376. .vt = 1072,
  377. .vrs = 1025,
  378. .vre = 1025+3,
  379. .vbs = 1024,
  380. .vbe = 1024+48,
  381. .frequency = 157500000,
  382. .hsync = '+',
  383. .vsync = '+',
  384. .interlace = '\0',
  385. };
  386. static Mode vesa1600x1200x60 = {
  387. .name = "1600x1200@60Hz",
  388. .x = 1600,
  389. .y = 1200,
  390. .ht = 2160,
  391. .shb = 1600,
  392. .ehb = 1600+560,
  393. .shs = 1664,
  394. .ehs = 1664+192,
  395. .vt = 1250,
  396. .vrs = 1201,
  397. .vre = 1201+3,
  398. .vbs = 1200,
  399. .vbe = 1200+50,
  400. .frequency = 162000000,
  401. .hsync = '+',
  402. .vsync = '+',
  403. .interlace = '\0',
  404. };
  405. static Mode vesa1600x1200x65 = {
  406. .name = "1600x1200@65Hz",
  407. .x = 1600,
  408. .y = 1200,
  409. .ht = 2160,
  410. .shb = 1600,
  411. .ehb = 1600+560,
  412. .shs = 1664,
  413. .ehs = 1664+192,
  414. .vt = 1250,
  415. .vrs = 1201,
  416. .vre = 1201+3,
  417. .vbs = 1200,
  418. .vbe = 1200+50,
  419. .frequency = 175500000,
  420. .hsync = '+',
  421. .vsync = '+',
  422. .interlace = '\0',
  423. };
  424. static Mode vesa1600x1200x70 = {
  425. .name = "1600x1200@70Hz",
  426. .x = 1600,
  427. .y = 1200,
  428. .ht = 2160,
  429. .shb = 1600,
  430. .ehb = 1600+560,
  431. .shs = 1664,
  432. .ehs = 1664+192,
  433. .vt = 1250,
  434. .vrs = 1201,
  435. .vre = 1201+3,
  436. .vbs = 1200,
  437. .vbe = 1200+50,
  438. .frequency = 189000000,
  439. .hsync = '+',
  440. .vsync = '+',
  441. .interlace = '\0',
  442. };
  443. static Mode vesa1600x1200x75 = {
  444. .name = "1600x1200@75Hz",
  445. .x = 1600,
  446. .y = 1200,
  447. .ht = 2160,
  448. .shb = 1600,
  449. .ehb = 1600+560,
  450. .shs = 1664,
  451. .ehs = 1664+192,
  452. .vt = 1250,
  453. .vrs = 1201,
  454. .vre = 1201+3,
  455. .vbs = 1200,
  456. .vbe = 1200+50,
  457. .frequency = 202500000,
  458. .hsync = '+',
  459. .vsync = '+',
  460. .interlace = '\0',
  461. };
  462. static Mode vesa1600x1200x85 = {
  463. .name = "1600x1200@85Hz",
  464. .x = 1600,
  465. .y = 1200,
  466. .ht = 2160,
  467. .shb = 1600,
  468. .ehb = 1600+560,
  469. .shs = 1664,
  470. .ehs = 1664+192,
  471. .vt = 1250,
  472. .vrs = 1201,
  473. .vre = 1201+3,
  474. .vbs = 1200,
  475. .vbe = 1200+50,
  476. .frequency = 229500000,
  477. .hsync = '+',
  478. .vsync = '+',
  479. .interlace = '\0',
  480. };
  481. static Mode vesa1792x1344x60 = {
  482. .name = "1792x1344@60Hz",
  483. .x = 1792,
  484. .y = 1344,
  485. .ht = 2448,
  486. .shb = 1792,
  487. .ehb = 1792+656,
  488. .shs = 1920,
  489. .ehs = 1920+200,
  490. .vt = 1394,
  491. .vrs = 1345,
  492. .vre = 1345+3,
  493. .vbs = 1344,
  494. .vbe = 1344+50,
  495. .frequency = 204750000,
  496. .hsync = '-',
  497. .vsync = '+',
  498. .interlace = '\0',
  499. };
  500. static Mode vesa1792x1344x75 = {
  501. .name = "1792x1344@75Hz",
  502. .x = 1792,
  503. .y = 1344,
  504. .ht = 2456,
  505. .shb = 1792,
  506. .ehb = 1792+664,
  507. .shs = 1888,
  508. .ehs = 1888+216,
  509. .vt = 1417,
  510. .vrs = 1345,
  511. .vre = 1345+3,
  512. .vbs = 1344,
  513. .vbe = 1344+73,
  514. .frequency = 261000000,
  515. .hsync = '-',
  516. .vsync = '+',
  517. .interlace = '\0',
  518. };
  519. static Mode vesa1856x1392x60 = {
  520. .name = "1856x1392@60Hz",
  521. .x = 1856,
  522. .y = 1392,
  523. .ht = 2528,
  524. .shb = 1856,
  525. .ehb = 1856+672,
  526. .shs = 1952,
  527. .ehs = 1952+224,
  528. .vt = 1439,
  529. .vrs = 1393,
  530. .vre = 1393+3,
  531. .vbs = 1392,
  532. .vbe = 1392+47,
  533. .frequency = 218250000,
  534. .hsync = '-',
  535. .vsync = '+',
  536. .interlace = '\0',
  537. };
  538. static Mode vesa1856x1392x75 = {
  539. .name = "1856x1392@75Hz",
  540. .x = 1856,
  541. .y = 1392,
  542. .ht = 2560,
  543. .shb = 1856,
  544. .ehb = 1856+704,
  545. .shs = 1984,
  546. .ehs = 1984+224,
  547. .vt = 1500,
  548. .vrs = 1393,
  549. .vre = 1393+3,
  550. .vbs = 1392,
  551. .vbe = 1392+108,
  552. .frequency = 288000000,
  553. .hsync = '-',
  554. .vsync = '+',
  555. .interlace = '\0',
  556. };
  557. static Mode vesa1920x1440x60 = {
  558. .name = "1920x1440@60Hz",
  559. .x = 1920,
  560. .y = 1440,
  561. .ht = 2600,
  562. .shb = 1920,
  563. .ehb = 1920+680,
  564. .shs = 2048,
  565. .ehs = 2048+208,
  566. .vt = 1500,
  567. .vrs = 1441,
  568. .vre = 1441+3,
  569. .vbs = 1440,
  570. .vbe = 1440+60,
  571. .frequency = 234000000,
  572. .hsync = '-',
  573. .vsync = '+',
  574. .interlace = '\0',
  575. };
  576. static Mode vesa1920x1440x75 = {
  577. .name = "1920x1440@75Hz",
  578. .x = 1920,
  579. .y = 1440,
  580. .ht = 2640,
  581. .shb = 1920,
  582. .ehb = 1920+720,
  583. .shs = 2064,
  584. .ehs = 2064+224,
  585. .vt = 1500,
  586. .vrs = 1441,
  587. .vre = 1441+3,
  588. .vbs = 1440,
  589. .vbe = 1440+60,
  590. .frequency = 297000000,
  591. .hsync = '-',
  592. .vsync = '+',
  593. .interlace = '\0',
  594. };
  595. Mode *vesamodes[] = {
  596. &vesa640x480x60,
  597. &vesa640x480x72,
  598. &vesa640x480x75,
  599. &vesa640x480x85,
  600. &vesa800x600x56,
  601. &vesa800x600x60,
  602. &vesa800x600x72,
  603. &vesa800x600x75,
  604. &vesa800x600x85,
  605. &vesa1024x768x60,
  606. &vesa1024x768x70,
  607. &vesa1024x768x75,
  608. &vesa1024x768x85,
  609. &vesa1152x864x75,
  610. &vesa1280x960x60,
  611. &vesa1280x960x85,
  612. &vesa1280x1024x60,
  613. &vesa1280x1024x75,
  614. &vesa1280x1024x85,
  615. &vesa1600x1200x60,
  616. &vesa1600x1200x65,
  617. &vesa1600x1200x70,
  618. &vesa1600x1200x75,
  619. &vesa1600x1200x85,
  620. &vesa1792x1344x60,
  621. &vesa1792x1344x75,
  622. &vesa1856x1392x60,
  623. &vesa1856x1392x75,
  624. &vesa1920x1440x60,
  625. &vesa1920x1440x75,
  626. 0
  627. };