vesadb.c 10 KB

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