vesadb.c 10 KB

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