Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2651 lines
75 KiB

  1. /**************************************************************************\
  2. *
  3. * ************************
  4. * * MINIPORT SAMPLE CODE *
  5. * ************************
  6. *
  7. * Module Name:
  8. *
  9. * perm3dat.c
  10. *
  11. * Abstract:
  12. *
  13. * This module contains all the global data used by the Permedia3 driver.
  14. *
  15. * Environment:
  16. *
  17. * Kernel mode
  18. *
  19. *
  20. * Copyright (c) 1994-1999 3Dlabs Inc. Ltd. All rights reserved.
  21. * Copyright (c) 1995-2003 Microsoft Corporation. All Rights Reserved.
  22. *
  23. \***************************************************************************/
  24. #include "perm3.h"
  25. //
  26. // DATA STRUCTURES
  27. // ===============
  28. //
  29. #if defined(ALLOC_PRAGMA)
  30. #pragma data_seg("PAGEDATA")
  31. #endif
  32. //
  33. // RangeStart RangeLength
  34. // | | RangeInIoSpace
  35. // | | | RangeVisible
  36. // +-----+-----+ | | | RangeShareable
  37. // | | | | | | RangePassive
  38. // v v v v v v v
  39. VIDEO_ACCESS_RANGE Perm3LegacyResourceList[] =
  40. {
  41. {0x000C0000, 0x00000000, 0x00010000, 0, 0, 0, 0}, // ROM location
  42. {0x000A0000, 0x00000000, 0x00020000, 0, 0, 1, 0}, // Frame buffer
  43. {0x000003B0, 0x00000000, 0x0000000B, 1, 1, 1, 0}, // VGA regs
  44. {0x000003C0, 0x00000000, 0x0000001F, 1, 1, 1, 0}, // VGA regs
  45. };
  46. ULONG Perm3LegacyResourceEntries = sizeof Perm3LegacyResourceList / sizeof Perm3LegacyResourceList[0];
  47. //
  48. // Video mode table - Lists the information about each individual mode.
  49. //
  50. // Note that any new modes should be added here and to the appropriate
  51. // PERM3_VIDEO_FREQUENCIES tables.
  52. //
  53. PERM3_VIDEO_MODES Perm3Modes[] = {
  54. { // 320x200x8bpp
  55. 0x0201, // 'Contiguous' Int 10 mode number (for high-colour)
  56. 0x0201, // 'Noncontiguous' Int 10 mode number
  57. 320, // 'Contiguous' screen stride
  58. {
  59. sizeof(VIDEO_MODE_INFORMATION), // Size of the mode informtion structure
  60. 0, // Mode index used in setting the mode
  61. // (filled in later)
  62. 320, // X Resolution, in pixels
  63. 200, // Y Resolution, in pixels
  64. 320, // 'Noncontiguous' screen stride,
  65. // in bytes (distance between the
  66. // start point of two consecutive
  67. // scan lines, in bytes)
  68. 1, // Number of video memory planes
  69. 8, // Number of bits per plane
  70. 1, // Screen Frequency, in Hertz ('1'
  71. // means use hardware default)
  72. 320, // Horizontal size of screen in millimeters
  73. 240, // Vertical size of screen in millimeters
  74. 8, // Number Red pixels in DAC
  75. 8, // Number Green pixels in DAC
  76. 8, // Number Blue pixels in DAC
  77. 0x00000000, // Mask for Red Pixels in non-palette modes
  78. 0x00000000, // Mask for Green Pixels in non-palette modes
  79. 0x00000000, // Mask for Blue Pixels in non-palette modes
  80. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  81. VIDEO_MODE_MANAGED_PALETTE, // Mode description flags.
  82. 0, // Video Memory Bitmap Width (filled
  83. // in later)
  84. 0 // Video Memory Bitmap Height (filled
  85. // in later)
  86. },
  87. },
  88. { // 320x240x8bpp
  89. 0x0201, // 'Contiguous' Int 10 mode number (for high-colour)
  90. 0x0201, // 'Noncontiguous' Int 10 mode number
  91. 320, // 'Contiguous' screen stride
  92. {
  93. sizeof(VIDEO_MODE_INFORMATION), // Size of the mode informtion structure
  94. 0, // Mode index used in setting the mode
  95. // (filled in later)
  96. 320, // X Resolution, in pixels
  97. 240, // Y Resolution, in pixels
  98. 320, // 'Noncontiguous' screen stride,
  99. // in bytes (distance between the
  100. // start point of two consecutive
  101. // scan lines, in bytes)
  102. 1, // Number of video memory planes
  103. 8, // Number of bits per plane
  104. 1, // Screen Frequency, in Hertz ('1'
  105. // means use hardware default)
  106. 320, // Horizontal size of screen in millimeters
  107. 240, // Vertical size of screen in millimeters
  108. 8, // Number Red pixels in DAC
  109. 8, // Number Green pixels in DAC
  110. 8, // Number Blue pixels in DAC
  111. 0x00000000, // Mask for Red Pixels in non-palette modes
  112. 0x00000000, // Mask for Green Pixels in non-palette modes
  113. 0x00000000, // Mask for Blue Pixels in non-palette modes
  114. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  115. VIDEO_MODE_MANAGED_PALETTE, // Mode description flags.
  116. 0, // Video Memory Bitmap Width (filled
  117. // in later)
  118. 0 // Video Memory Bitmap Height (filled
  119. // in later)
  120. },
  121. },
  122. { // 512x384x8bpp
  123. 0x0201, // 'Contiguous' Int 10 mode number (for high-colour)
  124. 0x0201, // 'Noncontiguous' Int 10 mode number
  125. 512, // 'Contiguous' screen stride
  126. {
  127. sizeof(VIDEO_MODE_INFORMATION), // Size of the mode informtion structure
  128. 0, // Mode index used in setting the mode
  129. // (filled in later)
  130. 512, // X Resolution, in pixels
  131. 384, // Y Resolution, in pixels
  132. 512, // 'Noncontiguous' screen stride,
  133. // in bytes (distance between the
  134. // start point of two consecutive
  135. // scan lines, in bytes)
  136. 1, // Number of video memory planes
  137. 8, // Number of bits per plane
  138. 1, // Screen Frequency, in Hertz ('1'
  139. // means use hardware default)
  140. 320, // Horizontal size of screen in millimeters
  141. 240, // Vertical size of screen in millimeters
  142. 8, // Number Red pixels in DAC
  143. 8, // Number Green pixels in DAC
  144. 8, // Number Blue pixels in DAC
  145. 0x00000000, // Mask for Red Pixels in non-palette modes
  146. 0x00000000, // Mask for Green Pixels in non-palette modes
  147. 0x00000000, // Mask for Blue Pixels in non-palette modes
  148. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  149. VIDEO_MODE_MANAGED_PALETTE, // Mode description flags.
  150. 0, // Video Memory Bitmap Width (filled
  151. // in later)
  152. 0 // Video Memory Bitmap Height (filled
  153. // in later)
  154. },
  155. },
  156. { // 640x400x8bpp
  157. 0x0201, // 'Contiguous' Int 10 mode number (for high-colour)
  158. 0x0201, // 'Noncontiguous' Int 10 mode number
  159. 640, // 'Contiguous' screen stride
  160. {
  161. sizeof(VIDEO_MODE_INFORMATION), // Size of the mode informtion structure
  162. 0, // Mode index used in setting the mode
  163. // (filled in later)
  164. 640, // X Resolution, in pixels
  165. 400, // Y Resolution, in pixels
  166. 640, // 'Noncontiguous' screen stride,
  167. // in bytes (distance between the
  168. // start point of two consecutive
  169. // scan lines, in bytes)
  170. 1, // Number of video memory planes
  171. 8, // Number of bits per plane
  172. 1, // Screen Frequency, in Hertz ('1'
  173. // means use hardware default)
  174. 320, // Horizontal size of screen in millimeters
  175. 240, // Vertical size of screen in millimeters
  176. 8, // Number Red pixels in DAC
  177. 8, // Number Green pixels in DAC
  178. 8, // Number Blue pixels in DAC
  179. 0x00000000, // Mask for Red Pixels in non-palette modes
  180. 0x00000000, // Mask for Green Pixels in non-palette modes
  181. 0x00000000, // Mask for Blue Pixels in non-palette modes
  182. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  183. VIDEO_MODE_MANAGED_PALETTE, // Mode description flags.
  184. 0, // Video Memory Bitmap Width (filled
  185. // in later)
  186. 0 // Video Memory Bitmap Height (filled
  187. // in later)
  188. },
  189. },
  190. { // 640x480x8bpp
  191. 0x0201, // 'Contiguous' Int 10 mode number (for high-colour)
  192. 0x0201, // 'Noncontiguous' Int 10 mode number
  193. 640, // 'Contiguous' screen stride
  194. {
  195. sizeof(VIDEO_MODE_INFORMATION), // Size of the mode informtion structure
  196. 0, // Mode index used in setting the mode
  197. // (filled in later)
  198. 640, // X Resolution, in pixels
  199. 480, // Y Resolution, in pixels
  200. 640, // 'Noncontiguous' screen stride,
  201. // in bytes (distance between the
  202. // start point of two consecutive
  203. // scan lines, in bytes)
  204. 1, // Number of video memory planes
  205. 8, // Number of bits per plane
  206. 1, // Screen Frequency, in Hertz ('1'
  207. // means use hardware default)
  208. 320, // Horizontal size of screen in millimeters
  209. 240, // Vertical size of screen in millimeters
  210. 8, // Number Red pixels in DAC
  211. 8, // Number Green pixels in DAC
  212. 8, // Number Blue pixels in DAC
  213. 0x00000000, // Mask for Red Pixels in non-palette modes
  214. 0x00000000, // Mask for Green Pixels in non-palette modes
  215. 0x00000000, // Mask for Blue Pixels in non-palette modes
  216. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  217. VIDEO_MODE_MANAGED_PALETTE, // Mode description flags.
  218. 0, // Video Memory Bitmap Width (filled
  219. // in later)
  220. 0 // Video Memory Bitmap Height (filled
  221. // in later)
  222. },
  223. },
  224. { // 800x600x8bpp
  225. 0x0103,
  226. 0x0203,
  227. 800,
  228. {
  229. sizeof(VIDEO_MODE_INFORMATION),
  230. 0,
  231. 800,
  232. 600,
  233. 800,
  234. 1,
  235. 8,
  236. 1,
  237. 320,
  238. 240,
  239. 8,
  240. 8,
  241. 8,
  242. 0x00000000,
  243. 0x00000000,
  244. 0x00000000,
  245. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  246. VIDEO_MODE_MANAGED_PALETTE,
  247. }
  248. },
  249. { // 1024x768x8bpp
  250. 0x0205,
  251. 0x0205,
  252. 1024,
  253. {
  254. sizeof(VIDEO_MODE_INFORMATION),
  255. 0,
  256. 1024,
  257. 768,
  258. 1024,
  259. 1,
  260. 8,
  261. 1,
  262. 320,
  263. 240,
  264. 8,
  265. 8,
  266. 8,
  267. 0x00000000,
  268. 0x00000000,
  269. 0x00000000,
  270. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  271. VIDEO_MODE_MANAGED_PALETTE,
  272. }
  273. },
  274. { // 1152x864x8bpp
  275. 0x0207,
  276. 0x0207,
  277. 1152,
  278. {
  279. sizeof(VIDEO_MODE_INFORMATION),
  280. 0,
  281. 1152,
  282. 864,
  283. 1152,
  284. 1,
  285. 8,
  286. 1,
  287. 320,
  288. 240,
  289. 8,
  290. 8,
  291. 8,
  292. 0x00000000,
  293. 0x00000000,
  294. 0x00000000,
  295. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  296. VIDEO_MODE_MANAGED_PALETTE,
  297. }
  298. },
  299. { // 1280x800x8bpp
  300. 0x0207,
  301. 0x0207,
  302. 1280,
  303. {
  304. sizeof(VIDEO_MODE_INFORMATION),
  305. 0,
  306. 1280,
  307. 800,
  308. 1280,
  309. 1,
  310. 8,
  311. 1,
  312. 320,
  313. 240,
  314. 8,
  315. 8,
  316. 8,
  317. 0x00000000,
  318. 0x00000000,
  319. 0x00000000,
  320. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  321. VIDEO_MODE_MANAGED_PALETTE,
  322. }
  323. },
  324. { // 1280x960x8bpp
  325. 0x0207,
  326. 0x0207,
  327. 1280,
  328. {
  329. sizeof(VIDEO_MODE_INFORMATION),
  330. 0,
  331. 1280,
  332. 960,
  333. 1280,
  334. 1,
  335. 8,
  336. 1,
  337. 320,
  338. 240,
  339. 8,
  340. 8,
  341. 8,
  342. 0x00000000,
  343. 0x00000000,
  344. 0x00000000,
  345. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  346. VIDEO_MODE_MANAGED_PALETTE,
  347. }
  348. },
  349. { // 1280x1024x8bpp
  350. 0x0107,
  351. 0x0107,
  352. 1280,
  353. {
  354. sizeof(VIDEO_MODE_INFORMATION),
  355. 0,
  356. 1280,
  357. 1024,
  358. 1280,
  359. 1,
  360. 8,
  361. 1,
  362. 320,
  363. 240,
  364. 8,
  365. 8,
  366. 8,
  367. 0x00000000,
  368. 0x00000000,
  369. 0x00000000,
  370. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  371. VIDEO_MODE_MANAGED_PALETTE,
  372. }
  373. },
  374. { // 1600x1000x8bpp
  375. 0x0120,
  376. 0x0120,
  377. 1600,
  378. {
  379. sizeof(VIDEO_MODE_INFORMATION),
  380. 0,
  381. 1600,
  382. 1000,
  383. 1600,
  384. 1,
  385. 8,
  386. 1,
  387. 320,
  388. 240,
  389. 8,
  390. 8,
  391. 8,
  392. 0x00000000,
  393. 0x00000000,
  394. 0x00000000,
  395. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  396. VIDEO_MODE_MANAGED_PALETTE,
  397. }
  398. },
  399. { // 1600x1024x8bpp
  400. 0x0120,
  401. 0x0120,
  402. 1600,
  403. {
  404. sizeof(VIDEO_MODE_INFORMATION),
  405. 0,
  406. 1600,
  407. 1024,
  408. 1600,
  409. 1,
  410. 8,
  411. 1,
  412. 320,
  413. 240,
  414. 8,
  415. 8,
  416. 8,
  417. 0x00000000,
  418. 0x00000000,
  419. 0x00000000,
  420. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  421. VIDEO_MODE_MANAGED_PALETTE,
  422. }
  423. },
  424. { // 1600x1200x8bpp
  425. 0x0120,
  426. 0x0120,
  427. 1600,
  428. {
  429. sizeof(VIDEO_MODE_INFORMATION),
  430. 0,
  431. 1600,
  432. 1200,
  433. 1600,
  434. 1,
  435. 8,
  436. 1,
  437. 320,
  438. 240,
  439. 8,
  440. 8,
  441. 8,
  442. 0x00000000,
  443. 0x00000000,
  444. 0x00000000,
  445. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  446. VIDEO_MODE_MANAGED_PALETTE,
  447. }
  448. },
  449. { // 1920x1080x8bpp
  450. 0x0120,
  451. 0x0120,
  452. 1920,
  453. {
  454. sizeof(VIDEO_MODE_INFORMATION),
  455. 0,
  456. 1920,
  457. 1080,
  458. 1920,
  459. 1,
  460. 8,
  461. 1,
  462. 320,
  463. 240,
  464. 8,
  465. 8,
  466. 8,
  467. 0x00000000,
  468. 0x00000000,
  469. 0x00000000,
  470. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  471. VIDEO_MODE_MANAGED_PALETTE,
  472. }
  473. },
  474. { // 1920x1200x8bpp
  475. 0x0120,
  476. 0x0120,
  477. 1920,
  478. {
  479. sizeof(VIDEO_MODE_INFORMATION),
  480. 0,
  481. 1920,
  482. 1200,
  483. 1920,
  484. 1,
  485. 8,
  486. 1,
  487. 320,
  488. 240,
  489. 8,
  490. 8,
  491. 8,
  492. 0x00000000,
  493. 0x00000000,
  494. 0x00000000,
  495. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS | VIDEO_MODE_PALETTE_DRIVEN |
  496. VIDEO_MODE_MANAGED_PALETTE,
  497. }
  498. },
  499. { // 320x200x16bpp
  500. 0x0111,
  501. 0x0211,
  502. 640,
  503. {
  504. sizeof(VIDEO_MODE_INFORMATION),
  505. 0,
  506. 320,
  507. 200,
  508. 640,
  509. 1,
  510. 16,
  511. 1,
  512. 320,
  513. 240,
  514. 8,
  515. 8,
  516. 8,
  517. 0x0000f800, // BGR 5:6:5
  518. 0x000007e0,
  519. 0x0000001f,
  520. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  521. }
  522. },
  523. { // 320x240x16bpp
  524. 0x0111,
  525. 0x0211,
  526. 640,
  527. {
  528. sizeof(VIDEO_MODE_INFORMATION),
  529. 0,
  530. 320,
  531. 240,
  532. 640,
  533. 1,
  534. 16,
  535. 1,
  536. 320,
  537. 240,
  538. 8,
  539. 8,
  540. 8,
  541. 0x0000f800, // BGR 5:6:5
  542. 0x000007e0,
  543. 0x0000001f,
  544. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  545. }
  546. },
  547. { // 512x384x16bpp
  548. 0x0111,
  549. 0x0211,
  550. 1024,
  551. {
  552. sizeof(VIDEO_MODE_INFORMATION),
  553. 0,
  554. 512,
  555. 384,
  556. 1024,
  557. 1,
  558. 16,
  559. 1,
  560. 320,
  561. 240,
  562. 8,
  563. 8,
  564. 8,
  565. 0x0000f800, // BGR 5:6:5
  566. 0x000007e0,
  567. 0x0000001f,
  568. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  569. }
  570. },
  571. { // 640x400x16bpp
  572. 0x0111,
  573. 0x0211,
  574. 1280,
  575. {
  576. sizeof(VIDEO_MODE_INFORMATION),
  577. 0,
  578. 640,
  579. 400,
  580. 1280,
  581. 1,
  582. 16,
  583. 1,
  584. 320,
  585. 240,
  586. 8,
  587. 8,
  588. 8,
  589. 0x0000f800, // BGR 5:6:5
  590. 0x000007e0,
  591. 0x0000001f,
  592. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  593. }
  594. },
  595. { // 640x480x16bpp
  596. 0x0111,
  597. 0x0211,
  598. 1280,
  599. {
  600. sizeof(VIDEO_MODE_INFORMATION),
  601. 0,
  602. 640,
  603. 480,
  604. 1280,
  605. 1,
  606. 16,
  607. 1,
  608. 320,
  609. 240,
  610. 8,
  611. 8,
  612. 8,
  613. 0x0000f800, // BGR 5:6:5
  614. 0x000007e0,
  615. 0x0000001f,
  616. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  617. }
  618. },
  619. { // 800x600x16bpp
  620. 0x0114,
  621. 0x0214,
  622. 1600,
  623. {
  624. sizeof(VIDEO_MODE_INFORMATION),
  625. 0,
  626. 800,
  627. 600,
  628. 1600,
  629. 1,
  630. 16,
  631. 1,
  632. 320,
  633. 240,
  634. 8,
  635. 8,
  636. 8,
  637. 0x0000f800, // BGR 5:6:5
  638. 0x000007e0,
  639. 0x0000001f,
  640. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  641. }
  642. },
  643. { // 1024x768x16bpp
  644. 0x0117,
  645. 0x0117,
  646. 2048,
  647. {
  648. sizeof(VIDEO_MODE_INFORMATION),
  649. 0,
  650. 1024,
  651. 768,
  652. 2048,
  653. 1,
  654. 16,
  655. 1,
  656. 320,
  657. 240,
  658. 8,
  659. 8,
  660. 8,
  661. 0x0000f800, // BGR 5:6:5
  662. 0x000007e0,
  663. 0x0000001f,
  664. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  665. }
  666. },
  667. { // 1152x864x16bpp
  668. 0x0118,
  669. 0x0222,
  670. 2304,
  671. {
  672. sizeof(VIDEO_MODE_INFORMATION),
  673. 0,
  674. 1152,
  675. 864,
  676. 2304,
  677. 1,
  678. 16,
  679. 1,
  680. 320,
  681. 240,
  682. 8,
  683. 8,
  684. 8,
  685. 0x0000f800, // BGR 5:6:5
  686. 0x000007e0,
  687. 0x0000001f,
  688. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  689. }
  690. },
  691. { // 1280x800x16bpp
  692. 0x011A,
  693. 0x021A,
  694. 2560,
  695. {
  696. sizeof(VIDEO_MODE_INFORMATION),
  697. 0,
  698. 1280,
  699. 800,
  700. 2560,
  701. 1,
  702. 16,
  703. 1,
  704. 320,
  705. 240,
  706. 8,
  707. 8,
  708. 8,
  709. 0x0000f800, // BGR 5:6:5
  710. 0x000007e0,
  711. 0x0000001f,
  712. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  713. }
  714. },
  715. { // 1280x960x16bpp
  716. 0x011A,
  717. 0x021A,
  718. 2560,
  719. {
  720. sizeof(VIDEO_MODE_INFORMATION),
  721. 0,
  722. 1280,
  723. 960,
  724. 2560,
  725. 1,
  726. 16,
  727. 1,
  728. 320,
  729. 240,
  730. 8,
  731. 8,
  732. 8,
  733. 0x0000f800, // BGR 5:6:5
  734. 0x000007e0,
  735. 0x0000001f,
  736. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  737. }
  738. },
  739. { // 1280x1024x16bpp
  740. 0x011A,
  741. 0x021A,
  742. 2560,
  743. {
  744. sizeof(VIDEO_MODE_INFORMATION),
  745. 0,
  746. 1280,
  747. 1024,
  748. 2560,
  749. 1,
  750. 16,
  751. 1,
  752. 320,
  753. 240,
  754. 8,
  755. 8,
  756. 8,
  757. 0x0000f800, // BGR 5:6:5
  758. 0x000007e0,
  759. 0x0000001f,
  760. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  761. }
  762. },
  763. { // 1600x1000x16bpp
  764. 0x0121,
  765. 0x0121,
  766. 3200,
  767. {
  768. sizeof(VIDEO_MODE_INFORMATION),
  769. 0,
  770. 1600,
  771. 1000,
  772. 3200,
  773. 1,
  774. 16,
  775. 1,
  776. 320,
  777. 240,
  778. 8,
  779. 8,
  780. 8,
  781. 0x0000f800, // BGR 5:6:5
  782. 0x000007e0,
  783. 0x0000001f,
  784. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  785. }
  786. },
  787. { // 1600x1024x16bpp
  788. 0x0121,
  789. 0x0121,
  790. 3200,
  791. {
  792. sizeof(VIDEO_MODE_INFORMATION),
  793. 0,
  794. 1600,
  795. 1024,
  796. 3200,
  797. 1,
  798. 16,
  799. 1,
  800. 320,
  801. 240,
  802. 8,
  803. 8,
  804. 8,
  805. 0x0000f800, // BGR 5:6:5
  806. 0x000007e0,
  807. 0x0000001f,
  808. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  809. }
  810. },
  811. { // 1600x1200x16bpp
  812. 0x0121,
  813. 0x0121,
  814. 3200,
  815. {
  816. sizeof(VIDEO_MODE_INFORMATION),
  817. 0,
  818. 1600,
  819. 1200,
  820. 3200,
  821. 1,
  822. 16,
  823. 1,
  824. 320,
  825. 240,
  826. 8,
  827. 8,
  828. 8,
  829. 0x0000f800, // BGR 5:6:5
  830. 0x000007e0,
  831. 0x0000001f,
  832. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  833. }
  834. },
  835. { // 1920x1080x16bpp
  836. 0x0121,
  837. 0x0121,
  838. 3840,
  839. {
  840. sizeof(VIDEO_MODE_INFORMATION),
  841. 0,
  842. 1920,
  843. 1080,
  844. 3840,
  845. 1,
  846. 16,
  847. 1,
  848. 320,
  849. 240,
  850. 8,
  851. 8,
  852. 8,
  853. 0x0000f800, // BGR 5:6:5
  854. 0x000007e0,
  855. 0x0000001f,
  856. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  857. }
  858. },
  859. { // 1920x1200x16bpp
  860. 0x0121,
  861. 0x0121,
  862. 3840,
  863. {
  864. sizeof(VIDEO_MODE_INFORMATION),
  865. 0,
  866. 1920,
  867. 1200,
  868. 3840,
  869. 1,
  870. 16,
  871. 1,
  872. 320,
  873. 240,
  874. 8,
  875. 8,
  876. 8,
  877. 0x0000f800, // BGR 5:6:5
  878. 0x000007e0,
  879. 0x0000001f,
  880. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  881. }
  882. },
  883. { // 320x200x15bpp
  884. 0x0111,
  885. 0x0211,
  886. 640,
  887. {
  888. sizeof(VIDEO_MODE_INFORMATION),
  889. 0,
  890. 320,
  891. 200,
  892. 640,
  893. 1,
  894. 15,
  895. 1,
  896. 320,
  897. 240,
  898. 8,
  899. 8,
  900. 8,
  901. 0x00007c00, // BGR 5:5:5
  902. 0x000003e0,
  903. 0x0000001f,
  904. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  905. }
  906. },
  907. { // 320x240x15bpp
  908. 0x0111,
  909. 0x0211,
  910. 640,
  911. {
  912. sizeof(VIDEO_MODE_INFORMATION),
  913. 0,
  914. 320,
  915. 240,
  916. 640,
  917. 1,
  918. 15,
  919. 1,
  920. 320,
  921. 240,
  922. 8,
  923. 8,
  924. 8,
  925. 0x00007c00, // BGR 5:5:5
  926. 0x000003e0,
  927. 0x0000001f,
  928. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  929. }
  930. },
  931. { // 512x384x15bpp
  932. 0x0111,
  933. 0x0211,
  934. 1024,
  935. {
  936. sizeof(VIDEO_MODE_INFORMATION),
  937. 0,
  938. 512,
  939. 384,
  940. 1024,
  941. 1,
  942. 15,
  943. 1,
  944. 320,
  945. 240,
  946. 8,
  947. 8,
  948. 8,
  949. 0x00007c00, // BGR 5:5:5
  950. 0x000003e0,
  951. 0x0000001f,
  952. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  953. }
  954. },
  955. { // 640x400x15bpp
  956. 0x0111,
  957. 0x0211,
  958. 1280,
  959. {
  960. sizeof(VIDEO_MODE_INFORMATION),
  961. 0,
  962. 640,
  963. 400,
  964. 1280,
  965. 1,
  966. 15,
  967. 1,
  968. 320,
  969. 240,
  970. 8,
  971. 8,
  972. 8,
  973. 0x00007c00, // BGR 5:5:5
  974. 0x000003e0,
  975. 0x0000001f,
  976. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  977. }
  978. },
  979. { // 640x480x15bpp
  980. 0x0111,
  981. 0x0211,
  982. 1280,
  983. {
  984. sizeof(VIDEO_MODE_INFORMATION),
  985. 0,
  986. 640,
  987. 480,
  988. 1280,
  989. 1,
  990. 15,
  991. 1,
  992. 320,
  993. 240,
  994. 8,
  995. 8,
  996. 8,
  997. 0x00007c00, // BGR 5:5:5
  998. 0x000003e0,
  999. 0x0000001f,
  1000. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1001. }
  1002. },
  1003. { // 800x600x15bpp
  1004. 0x0114,
  1005. 0x0214,
  1006. 1600,
  1007. {
  1008. sizeof(VIDEO_MODE_INFORMATION),
  1009. 0,
  1010. 800,
  1011. 600,
  1012. 1600,
  1013. 1,
  1014. 15,
  1015. 1,
  1016. 320,
  1017. 240,
  1018. 8,
  1019. 8,
  1020. 8,
  1021. 0x00007c00, // BGR 5:5:5
  1022. 0x000003e0,
  1023. 0x0000001f,
  1024. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1025. }
  1026. },
  1027. { // 1024x768x15bpp
  1028. 0x0117,
  1029. 0x0117,
  1030. 2048,
  1031. {
  1032. sizeof(VIDEO_MODE_INFORMATION),
  1033. 0,
  1034. 1024,
  1035. 768,
  1036. 2048,
  1037. 1,
  1038. 15,
  1039. 1,
  1040. 320,
  1041. 240,
  1042. 8,
  1043. 8,
  1044. 8,
  1045. 0x00007c00, // BGR 5:5:5
  1046. 0x000003e0,
  1047. 0x0000001f,
  1048. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1049. }
  1050. },
  1051. { // 1152x864x15bpp
  1052. 0x0118,
  1053. 0x0222,
  1054. 2304,
  1055. {
  1056. sizeof(VIDEO_MODE_INFORMATION),
  1057. 0,
  1058. 1152,
  1059. 864,
  1060. 2304,
  1061. 1,
  1062. 15,
  1063. 1,
  1064. 320,
  1065. 240,
  1066. 8,
  1067. 8,
  1068. 8,
  1069. 0x00007c00, // BGR 5:5:5
  1070. 0x000003e0,
  1071. 0x0000001f,
  1072. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1073. }
  1074. },
  1075. { // 1280x800x15bpp
  1076. 0x011A,
  1077. 0x021A,
  1078. 2560,
  1079. {
  1080. sizeof(VIDEO_MODE_INFORMATION),
  1081. 0,
  1082. 1280,
  1083. 800,
  1084. 2560,
  1085. 1,
  1086. 15,
  1087. 1,
  1088. 320,
  1089. 240,
  1090. 8,
  1091. 8,
  1092. 8,
  1093. 0x00007c00, // BGR 5:5:5
  1094. 0x000003e0,
  1095. 0x0000001f,
  1096. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1097. }
  1098. },
  1099. { // 1280x960x15bpp
  1100. 0x011A,
  1101. 0x021A,
  1102. 2560,
  1103. {
  1104. sizeof(VIDEO_MODE_INFORMATION),
  1105. 0,
  1106. 1280,
  1107. 960,
  1108. 2560,
  1109. 1,
  1110. 15,
  1111. 1,
  1112. 320,
  1113. 240,
  1114. 8,
  1115. 8,
  1116. 8,
  1117. 0x00007c00, // BGR 5:5:5
  1118. 0x000003e0,
  1119. 0x0000001f,
  1120. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1121. }
  1122. },
  1123. { // 1280x1024x15bpp
  1124. 0x011A,
  1125. 0x021A,
  1126. 2560,
  1127. {
  1128. sizeof(VIDEO_MODE_INFORMATION),
  1129. 0,
  1130. 1280,
  1131. 1024,
  1132. 2560,
  1133. 1,
  1134. 15,
  1135. 1,
  1136. 320,
  1137. 240,
  1138. 8,
  1139. 8,
  1140. 8,
  1141. 0x00007c00, // BGR 5:5:5
  1142. 0x000003e0,
  1143. 0x0000001f,
  1144. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1145. }
  1146. },
  1147. { // 1600x1000x15bpp
  1148. 0x0121,
  1149. 0x0121,
  1150. 3200,
  1151. {
  1152. sizeof(VIDEO_MODE_INFORMATION),
  1153. 0,
  1154. 1600,
  1155. 1000,
  1156. 3200,
  1157. 1,
  1158. 15,
  1159. 1,
  1160. 320,
  1161. 240,
  1162. 8,
  1163. 8,
  1164. 8,
  1165. 0x00007c00, // BGR 5:5:5
  1166. 0x000003e0,
  1167. 0x0000001f,
  1168. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1169. }
  1170. },
  1171. { // 1600x1024x15bpp
  1172. 0x0121,
  1173. 0x0121,
  1174. 3200,
  1175. {
  1176. sizeof(VIDEO_MODE_INFORMATION),
  1177. 0,
  1178. 1600,
  1179. 1024,
  1180. 3200,
  1181. 1,
  1182. 15,
  1183. 1,
  1184. 320,
  1185. 240,
  1186. 8,
  1187. 8,
  1188. 8,
  1189. 0x00007c00, // BGR 5:5:5
  1190. 0x000003e0,
  1191. 0x0000001f,
  1192. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1193. }
  1194. },
  1195. { // 1600x1200x15bpp
  1196. 0x0121,
  1197. 0x0121,
  1198. 3200,
  1199. {
  1200. sizeof(VIDEO_MODE_INFORMATION),
  1201. 0,
  1202. 1600,
  1203. 1200,
  1204. 3200,
  1205. 1,
  1206. 15,
  1207. 1,
  1208. 320,
  1209. 240,
  1210. 8,
  1211. 8,
  1212. 8,
  1213. 0x00007c00, // BGR 5:5:5
  1214. 0x000003e0,
  1215. 0x0000001f,
  1216. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1217. }
  1218. },
  1219. { // 1920x1080x15bpp
  1220. 0x0121,
  1221. 0x0121,
  1222. 3840,
  1223. {
  1224. sizeof(VIDEO_MODE_INFORMATION),
  1225. 0,
  1226. 1920,
  1227. 1080,
  1228. 3840,
  1229. 1,
  1230. 15,
  1231. 1,
  1232. 320,
  1233. 240,
  1234. 8,
  1235. 8,
  1236. 8,
  1237. 0x00007c00, // BGR 5:5:5
  1238. 0x000003e0,
  1239. 0x0000001f,
  1240. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1241. }
  1242. },
  1243. { // 1920x1200x15bpp
  1244. 0x0121,
  1245. 0x0121,
  1246. 3840,
  1247. {
  1248. sizeof(VIDEO_MODE_INFORMATION),
  1249. 0,
  1250. 1920,
  1251. 1200,
  1252. 3840,
  1253. 1,
  1254. 15,
  1255. 1,
  1256. 320,
  1257. 240,
  1258. 8,
  1259. 8,
  1260. 8,
  1261. 0x00007c00, // BGR 5:5:5
  1262. 0x000003e0,
  1263. 0x0000001f,
  1264. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1265. }
  1266. },
  1267. { // 640x480x12bpp
  1268. 0x0112,
  1269. 0x0220,
  1270. 2560,
  1271. {
  1272. sizeof(VIDEO_MODE_INFORMATION),
  1273. 0,
  1274. 640,
  1275. 480,
  1276. 2560,
  1277. 1,
  1278. 12,
  1279. 1,
  1280. 320,
  1281. 240,
  1282. 8,
  1283. 8,
  1284. 8,
  1285. 0x000f0000, // BGR 4:4:4
  1286. 0x00000f00,
  1287. 0x0000000f,
  1288. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1289. }
  1290. },
  1291. { // 800x600x12bpp
  1292. 0x0115,
  1293. 0x0221,
  1294. 3200,
  1295. {
  1296. sizeof(VIDEO_MODE_INFORMATION),
  1297. 0,
  1298. 800,
  1299. 600,
  1300. 3200,
  1301. 1,
  1302. 12,
  1303. 1,
  1304. 320,
  1305. 240,
  1306. 8,
  1307. 8,
  1308. 8,
  1309. 0x000f0000, // BGR 4:4:4
  1310. 0x00000f00,
  1311. 0x0000000f,
  1312. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1313. }
  1314. },
  1315. { // 1024x768x12bpp
  1316. 0x0118,
  1317. 0x0222,
  1318. 4096,
  1319. {
  1320. sizeof(VIDEO_MODE_INFORMATION),
  1321. 0,
  1322. 1024,
  1323. 768,
  1324. 4096,
  1325. 1,
  1326. 12,
  1327. 1,
  1328. 320,
  1329. 240,
  1330. 8,
  1331. 8,
  1332. 8,
  1333. 0x000f0000, // BGR 4:4:4
  1334. 0x00000f00,
  1335. 0x0000000f,
  1336. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1337. }
  1338. },
  1339. { // 1152x864x12bpp
  1340. 0x0118,
  1341. 0x0222,
  1342. 4608,
  1343. {
  1344. sizeof(VIDEO_MODE_INFORMATION),
  1345. 0,
  1346. 1152,
  1347. 864,
  1348. 4608,
  1349. 1,
  1350. 12,
  1351. 1,
  1352. 320,
  1353. 240,
  1354. 8,
  1355. 8,
  1356. 8,
  1357. 0x000f0000, // BGR 4:4:4
  1358. 0x00000f00,
  1359. 0x0000000f,
  1360. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1361. }
  1362. },
  1363. { // 1280x960x12bpp
  1364. 0x011B,
  1365. 0x011B,
  1366. 5120,
  1367. {
  1368. sizeof(VIDEO_MODE_INFORMATION),
  1369. 0,
  1370. 1280,
  1371. 960,
  1372. 5120,
  1373. 1,
  1374. 12,
  1375. 1,
  1376. 320,
  1377. 240,
  1378. 8,
  1379. 8,
  1380. 8,
  1381. 0x000f0000, // BGR 4:4:4
  1382. 0x00000f00,
  1383. 0x0000000f,
  1384. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1385. }
  1386. },
  1387. { // 1280x1024x12bpp
  1388. 0x011B,
  1389. 0x011B,
  1390. 5120,
  1391. {
  1392. sizeof(VIDEO_MODE_INFORMATION),
  1393. 0,
  1394. 1280,
  1395. 1024,
  1396. 5120,
  1397. 1,
  1398. 12,
  1399. 1,
  1400. 320,
  1401. 240,
  1402. 8,
  1403. 8,
  1404. 8,
  1405. 0x000f0000, // BGR 4:4:4
  1406. 0x00000f00,
  1407. 0x0000000f,
  1408. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1409. }
  1410. },
  1411. { // 1600x1200x12bpp
  1412. 0x0122,
  1413. 0x0122,
  1414. 6400,
  1415. {
  1416. sizeof(VIDEO_MODE_INFORMATION),
  1417. 0,
  1418. 1600,
  1419. 1200,
  1420. 6400,
  1421. 1,
  1422. 12,
  1423. 1,
  1424. 320,
  1425. 240,
  1426. 8,
  1427. 8,
  1428. 8,
  1429. 0x000f0000, // BGR 4:4:4
  1430. 0x00000f00,
  1431. 0x0000000f,
  1432. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1433. }
  1434. },
  1435. { // 1920x1080x12bpp
  1436. 0x0122,
  1437. 0x0122,
  1438. 7680,
  1439. {
  1440. sizeof(VIDEO_MODE_INFORMATION),
  1441. 0,
  1442. 1920,
  1443. 1080,
  1444. 7680,
  1445. 1,
  1446. 12,
  1447. 1,
  1448. 320,
  1449. 240,
  1450. 8,
  1451. 8,
  1452. 8,
  1453. 0x000f0000, // BGR 4:4:4
  1454. 0x00000f00,
  1455. 0x0000000f,
  1456. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1457. }
  1458. },
  1459. { // 320x200x32bpp
  1460. 0x0112,
  1461. 0x0220,
  1462. 1280,
  1463. {
  1464. sizeof(VIDEO_MODE_INFORMATION),
  1465. 0,
  1466. 320,
  1467. 200,
  1468. 1280,
  1469. 1,
  1470. 32,
  1471. 1,
  1472. 320,
  1473. 240,
  1474. 8,
  1475. 8,
  1476. 8,
  1477. 0x00ff0000, // BGR 8:8:8
  1478. 0x0000ff00,
  1479. 0x000000ff,
  1480. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1481. }
  1482. },
  1483. { // 320x240x32bpp
  1484. 0x0112,
  1485. 0x0220,
  1486. 1280,
  1487. {
  1488. sizeof(VIDEO_MODE_INFORMATION),
  1489. 0,
  1490. 320,
  1491. 240,
  1492. 1280,
  1493. 1,
  1494. 32,
  1495. 1,
  1496. 320,
  1497. 240,
  1498. 8,
  1499. 8,
  1500. 8,
  1501. 0x00ff0000, // BGR 8:8:8
  1502. 0x0000ff00,
  1503. 0x000000ff,
  1504. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1505. }
  1506. },
  1507. { // 512x384x32bpp
  1508. 0x0112,
  1509. 0x0220,
  1510. 2048,
  1511. {
  1512. sizeof(VIDEO_MODE_INFORMATION),
  1513. 0,
  1514. 512,
  1515. 384,
  1516. 2048,
  1517. 1,
  1518. 32,
  1519. 1,
  1520. 320,
  1521. 240,
  1522. 8,
  1523. 8,
  1524. 8,
  1525. 0x00ff0000, // BGR 8:8:8
  1526. 0x0000ff00,
  1527. 0x000000ff,
  1528. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1529. }
  1530. },
  1531. { // 640x400x32bpp
  1532. 0x0112,
  1533. 0x0220,
  1534. 2560,
  1535. {
  1536. sizeof(VIDEO_MODE_INFORMATION),
  1537. 0,
  1538. 640,
  1539. 400,
  1540. 2560,
  1541. 1,
  1542. 32,
  1543. 1,
  1544. 320,
  1545. 240,
  1546. 8,
  1547. 8,
  1548. 8,
  1549. 0x00ff0000, // BGR 8:8:8
  1550. 0x0000ff00,
  1551. 0x000000ff,
  1552. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1553. }
  1554. },
  1555. { // 640x480x32bpp
  1556. 0x0112,
  1557. 0x0220,
  1558. 2560,
  1559. {
  1560. sizeof(VIDEO_MODE_INFORMATION),
  1561. 0,
  1562. 640,
  1563. 480,
  1564. 2560,
  1565. 1,
  1566. 32,
  1567. 1,
  1568. 320,
  1569. 240,
  1570. 8,
  1571. 8,
  1572. 8,
  1573. 0x00ff0000, // BGR 8:8:8
  1574. 0x0000ff00,
  1575. 0x000000ff,
  1576. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1577. }
  1578. },
  1579. { // 800x600x32bpp
  1580. 0x0115,
  1581. 0x0221,
  1582. 3200,
  1583. {
  1584. sizeof(VIDEO_MODE_INFORMATION),
  1585. 0,
  1586. 800,
  1587. 600,
  1588. 3200,
  1589. 1,
  1590. 32,
  1591. 1,
  1592. 320,
  1593. 240,
  1594. 8,
  1595. 8,
  1596. 8,
  1597. 0x00ff0000, // BGR 8:8:8
  1598. 0x0000ff00,
  1599. 0x000000ff,
  1600. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1601. }
  1602. },
  1603. { // 1024x768x32bpp
  1604. 0x0118,
  1605. 0x0222,
  1606. 4096,
  1607. {
  1608. sizeof(VIDEO_MODE_INFORMATION),
  1609. 0,
  1610. 1024,
  1611. 768,
  1612. 4096,
  1613. 1,
  1614. 32,
  1615. 1,
  1616. 320,
  1617. 240,
  1618. 8,
  1619. 8,
  1620. 8,
  1621. 0x00ff0000, // BGR 8:8:8
  1622. 0x0000ff00,
  1623. 0x000000ff,
  1624. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1625. }
  1626. },
  1627. { // 1152x864x32bpp
  1628. 0x0118,
  1629. 0x0222,
  1630. 4608,
  1631. {
  1632. sizeof(VIDEO_MODE_INFORMATION),
  1633. 0,
  1634. 1152,
  1635. 864,
  1636. 4608,
  1637. 1,
  1638. 32,
  1639. 1,
  1640. 320,
  1641. 240,
  1642. 8,
  1643. 8,
  1644. 8,
  1645. 0x00ff0000, // BGR 8:8:8
  1646. 0x0000ff00,
  1647. 0x000000ff,
  1648. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1649. }
  1650. },
  1651. { // 1280x800x32bpp
  1652. 0x011B,
  1653. 0x011B,
  1654. 5120,
  1655. {
  1656. sizeof(VIDEO_MODE_INFORMATION),
  1657. 0,
  1658. 1280,
  1659. 800,
  1660. 5120,
  1661. 1,
  1662. 32,
  1663. 1,
  1664. 320,
  1665. 240,
  1666. 8,
  1667. 8,
  1668. 8,
  1669. 0x00ff0000, // BGR 8:8:8
  1670. 0x0000ff00,
  1671. 0x000000ff,
  1672. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1673. }
  1674. },
  1675. { // 1280x960x32bpp
  1676. 0x011B,
  1677. 0x011B,
  1678. 5120,
  1679. {
  1680. sizeof(VIDEO_MODE_INFORMATION),
  1681. 0,
  1682. 1280,
  1683. 960,
  1684. 5120,
  1685. 1,
  1686. 32,
  1687. 1,
  1688. 320,
  1689. 240,
  1690. 8,
  1691. 8,
  1692. 8,
  1693. 0x00ff0000, // BGR 8:8:8
  1694. 0x0000ff00,
  1695. 0x000000ff,
  1696. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1697. }
  1698. },
  1699. { // 1280x1024x32bpp
  1700. 0x011B,
  1701. 0x011B,
  1702. 5120,
  1703. {
  1704. sizeof(VIDEO_MODE_INFORMATION),
  1705. 0,
  1706. 1280,
  1707. 1024,
  1708. 5120,
  1709. 1,
  1710. 32,
  1711. 1,
  1712. 320,
  1713. 240,
  1714. 8,
  1715. 8,
  1716. 8,
  1717. 0x00ff0000, // BGR 8:8:8
  1718. 0x0000ff00,
  1719. 0x000000ff,
  1720. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1721. }
  1722. },
  1723. { // 1600x1000x32bpp
  1724. 0x0122,
  1725. 0x0122,
  1726. 6400,
  1727. {
  1728. sizeof(VIDEO_MODE_INFORMATION),
  1729. 0,
  1730. 1600,
  1731. 1000,
  1732. 6400,
  1733. 1,
  1734. 32,
  1735. 1,
  1736. 320,
  1737. 240,
  1738. 8,
  1739. 8,
  1740. 8,
  1741. 0x00ff0000, // BGR 8:8:8
  1742. 0x0000ff00,
  1743. 0x000000ff,
  1744. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1745. }
  1746. },
  1747. { // 1600x1024x32bpp
  1748. 0x0122,
  1749. 0x0122,
  1750. 6400,
  1751. {
  1752. sizeof(VIDEO_MODE_INFORMATION),
  1753. 0,
  1754. 1600,
  1755. 1024,
  1756. 6400,
  1757. 1,
  1758. 32,
  1759. 1,
  1760. 320,
  1761. 240,
  1762. 8,
  1763. 8,
  1764. 8,
  1765. 0x00ff0000, // BGR 8:8:8
  1766. 0x0000ff00,
  1767. 0x000000ff,
  1768. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1769. }
  1770. },
  1771. { // 1600x1200x32bpp
  1772. 0x0122,
  1773. 0x0122,
  1774. 6400,
  1775. {
  1776. sizeof(VIDEO_MODE_INFORMATION),
  1777. 0,
  1778. 1600,
  1779. 1200,
  1780. 6400,
  1781. 1,
  1782. 32,
  1783. 1,
  1784. 320,
  1785. 240,
  1786. 8,
  1787. 8,
  1788. 8,
  1789. 0x00ff0000, // BGR 8:8:8
  1790. 0x0000ff00,
  1791. 0x000000ff,
  1792. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1793. }
  1794. },
  1795. { // 1920x1080x32bpp
  1796. 0x0122,
  1797. 0x0122,
  1798. 7680,
  1799. {
  1800. sizeof(VIDEO_MODE_INFORMATION),
  1801. 0,
  1802. 1920,
  1803. 1080,
  1804. 7680,
  1805. 1,
  1806. 32,
  1807. 1,
  1808. 320,
  1809. 240,
  1810. 8,
  1811. 8,
  1812. 8,
  1813. 0x00ff0000, // BGR 8:8:8
  1814. 0x0000ff00,
  1815. 0x000000ff,
  1816. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1817. }
  1818. },
  1819. { // 1920x1200x32bpp
  1820. 0x0122,
  1821. 0x0122,
  1822. 7680,
  1823. {
  1824. sizeof(VIDEO_MODE_INFORMATION),
  1825. 0,
  1826. 1920,
  1827. 1200,
  1828. 7680,
  1829. 1,
  1830. 32,
  1831. 1,
  1832. 320,
  1833. 240,
  1834. 8,
  1835. 8,
  1836. 8,
  1837. 0x00ff0000, // BGR 8:8:8
  1838. 0x0000ff00,
  1839. 0x000000ff,
  1840. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS,
  1841. }
  1842. },
  1843. { // 640x480x24bpp
  1844. 0, // 'Contiguous' Int 10 mode number (for high-colour) (UNUSED)
  1845. 0, // 'Noncontiguous' Int 10 mode number (UNUSED)
  1846. 1920, // 'Contiguous' screen stride (640 by 3 bytes/pixel)
  1847. {
  1848. sizeof(VIDEO_MODE_INFORMATION), // Size of the mode informtion structure
  1849. 0, // Mode index used in setting the mode
  1850. // (filled in later)
  1851. 640, // X Resolution, in pixels
  1852. 480, // Y Resolution, in pixels
  1853. 1920, // 'Noncontiguous' screen stride,
  1854. // in bytes (distance between the
  1855. // start point of two consecutive
  1856. // scan lines, in bytes)
  1857. 1, // Number of video memory planes
  1858. 24, // Number of bits per plane
  1859. 1, // Screen Frequency, in Hertz ('1'
  1860. // means use hardware default)
  1861. 320, // Horizontal size of screen in millimeters
  1862. 240, // Vertical size of screen in millimeters
  1863. 8, // Number Red pixels in DAC
  1864. 8, // Number Green pixels in DAC
  1865. 8, // Number Blue pixels in DAC
  1866. 0x00ff0000, // Mask for Red Pixels in non-palette modes
  1867. 0x0000ff00, // Mask for Green Pixels in non-palette modes
  1868. 0x000000ff, // Mask for Blue Pixels in non-palette modes
  1869. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS, // Mode description flags.
  1870. },
  1871. },
  1872. { // 800x600x24bpp
  1873. 0, // 'Contiguous' Int 10 mode number (for high-colour) (UNUSED)
  1874. 0, // 'Noncontiguous' Int 10 mode number (UNUSED)
  1875. 2400, // 'Contiguous' screen stride (800 by 3 bytes/pixel)
  1876. {
  1877. sizeof(VIDEO_MODE_INFORMATION), // Size of the mode informtion structure
  1878. 0, // Mode index used in setting the mode
  1879. // (filled in later)
  1880. 800, // X Resolution, in pixels
  1881. 600, // Y Resolution, in pixels
  1882. 2400, // 'Noncontiguous' screen stride,
  1883. // in bytes (distance between the
  1884. // start point of two consecutive
  1885. // scan lines, in bytes)
  1886. 1, // Number of video memory planes
  1887. 24, // Number of bits per plane
  1888. 1, // Screen Frequency, in Hertz ('1'
  1889. // means use hardware default)
  1890. 320, // Horizontal size of screen in millimeters
  1891. 240, // Vertical size of screen in millimeters
  1892. 8, // Number Red pixels in DAC
  1893. 8, // Number Green pixels in DAC
  1894. 8, // Number Blue pixels in DAC
  1895. 0x00ff0000, // Mask for Red Pixels in non-palette modes
  1896. 0x0000ff00, // Mask for Green Pixels in non-palette modes
  1897. 0x000000ff, // Mask for Blue Pixels in non-palette modes
  1898. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS, // Mode description flags.
  1899. },
  1900. },
  1901. { // 1024x768x24bpp
  1902. 0, // 'Contiguous' Int 10 mode number (for high-colour) (UNUSED)
  1903. 0, // 'Noncontiguous' Int 10 mode number (UNUSED)
  1904. 3072, // 'Contiguous' screen stride (1024 by 3 bytes/pixel)
  1905. {
  1906. sizeof(VIDEO_MODE_INFORMATION), // Size of the mode informtion structure
  1907. 0, // Mode index used in setting the mode
  1908. // (filled in later)
  1909. 1024, // X Resolution, in pixels
  1910. 768, // Y Resolution, in pixels
  1911. 3072, // 'Noncontiguous' screen stride,
  1912. // in bytes (distance between the
  1913. // start point of two consecutive
  1914. // scan lines, in bytes)
  1915. 1, // Number of video memory planes
  1916. 24, // Number of bits per plane
  1917. 1, // Screen Frequency, in Hertz ('1'
  1918. // means use hardware default)
  1919. 320, // Horizontal size of screen in millimeters
  1920. 240, // Vertical size of screen in millimeters
  1921. 8, // Number Red pixels in DAC
  1922. 8, // Number Green pixels in DAC
  1923. 8, // Number Blue pixels in DAC
  1924. 0x00ff0000, // Mask for Red Pixels in non-palette modes
  1925. 0x0000ff00, // Mask for Green Pixels in non-palette modes
  1926. 0x000000ff, // Mask for Blue Pixels in non-palette modes
  1927. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS, // Mode description flags.
  1928. },
  1929. },
  1930. { // 1152x864x24bpp
  1931. 0, // 'Contiguous' Int 10 mode number (for high-colour) (UNUSED)
  1932. 0, // 'Noncontiguous' Int 10 mode number (UNUSED)
  1933. 3456, // 'Contiguous' screen stride (1152 by 3 bytes/pixel)
  1934. {
  1935. sizeof(VIDEO_MODE_INFORMATION), // Size of the mode informtion structure
  1936. 0, // Mode index used in setting the mode
  1937. // (filled in later)
  1938. 1152, // X Resolution, in pixels
  1939. 864, // Y Resolution, in pixels
  1940. 3072, // 'Noncontiguous' screen stride,
  1941. // in bytes (distance between the
  1942. // start point of two consecutive
  1943. // scan lines, in bytes)
  1944. 1, // Number of video memory planes
  1945. 24, // Number of bits per plane
  1946. 1, // Screen Frequency, in Hertz ('1'
  1947. // means use hardware default)
  1948. 320, // Horizontal size of screen in millimeters
  1949. 240, // Vertical size of screen in millimeters
  1950. 8, // Number Red pixels in DAC
  1951. 8, // Number Green pixels in DAC
  1952. 8, // Number Blue pixels in DAC
  1953. 0x00ff0000, // Mask for Red Pixels in non-palette modes
  1954. 0x0000ff00, // Mask for Green Pixels in non-palette modes
  1955. 0x000000ff, // Mask for Blue Pixels in non-palette modes
  1956. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS, // Mode description flags.
  1957. },
  1958. },
  1959. { // 1280x1024x24bpp
  1960. 0, // 'Contiguous' Int 10 mode number (for high-colour) (UNUSED)
  1961. 0, // 'Noncontiguous' Int 10 mode number (UNUSED)
  1962. 3840, // 'Contiguous' screen stride (1280 by 3 bytes/pixel)
  1963. {
  1964. sizeof(VIDEO_MODE_INFORMATION), // Size of the mode informtion structure
  1965. 0, // Mode index used in setting the mode
  1966. // (filled in later)
  1967. 3840, // X Resolution, in pixels
  1968. 1280, // Y Resolution, in pixels
  1969. 1024, // 'Noncontiguous' screen stride,
  1970. // in bytes (distance between the
  1971. // start point of two consecutive
  1972. // scan lines, in bytes)
  1973. 1, // Number of video memory planes
  1974. 24, // Number of bits per plane
  1975. 1, // Screen Frequency, in Hertz ('1'
  1976. // means use hardware default)
  1977. 320, // Horizontal size of screen in millimeters
  1978. 240, // Vertical size of screen in millimeters
  1979. 8, // Number Red pixels in DAC
  1980. 8, // Number Green pixels in DAC
  1981. 8, // Number Blue pixels in DAC
  1982. 0x00ff0000, // Mask for Red Pixels in non-palette modes
  1983. 0x0000ff00, // Mask for Green Pixels in non-palette modes
  1984. 0x000000ff, // Mask for Blue Pixels in non-palette modes
  1985. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS, // Mode description flags.
  1986. },
  1987. },
  1988. { // 1600x1200x24bpp
  1989. 0, // 'Contiguous' Int 10 mode number (for high-colour) (UNUSED)
  1990. 0, // 'Noncontiguous' Int 10 mode number (UNUSED)
  1991. 4800, // 'Contiguous' screen stride (1600 by 3 bytes/pixel)
  1992. {
  1993. sizeof(VIDEO_MODE_INFORMATION), // Size of the mode informtion structure
  1994. 0, // Mode index used in setting the mode
  1995. // (filled in later)
  1996. 1600, // X Resolution, in pixels
  1997. 1280, // Y Resolution, in pixels
  1998. 4800, // 'Noncontiguous' screen stride,
  1999. // in bytes (distance between the
  2000. // start point of two consecutive
  2001. // scan lines, in bytes)
  2002. 1, // Number of video memory planes
  2003. 24, // Number of bits per plane
  2004. 1, // Screen Frequency, in Hertz ('1'
  2005. // means use hardware default)
  2006. 320, // Horizontal size of screen in millimeters
  2007. 240, // Vertical size of screen in millimeters
  2008. 8, // Number Red pixels in DAC
  2009. 8, // Number Green pixels in DAC
  2010. 8, // Number Blue pixels in DAC
  2011. 0x00ff0000, // Mask for Red Pixels in non-palette modes
  2012. 0x0000ff00, // Mask for Green Pixels in non-palette modes
  2013. 0x000000ff, // Mask for Blue Pixels in non-palette modes
  2014. VIDEO_MODE_COLOR | VIDEO_MODE_GRAPHICS, // Mode description flags.
  2015. },
  2016. },
  2017. };
  2018. const ULONG NumPerm3VideoModes = sizeof(Perm3Modes) / sizeof(Perm3Modes[0]);
  2019. ULONG Perm3DepthList [] = { 8, 15, 16, 24, 32 };
  2020. #define Perm3DepthCnt (sizeof(Perm3DepthList) / sizeof(Perm3DepthList[0]))
  2021. /*+++
  2022. Data format is:
  2023. Horizontal total time (chars)
  2024. Horizontal right border + front porch (chars)
  2025. Horizontal sync time (chars)
  2026. Horizontal back porch + left border (chars)
  2027. Horizontal sync polarity
  2028. Vertical total time (lines)
  2029. Vertical bottom border + front porch (lines)
  2030. Vertical sync time (lines)
  2031. Vertical back porch + top border (lines)
  2032. Vertical sync polarity
  2033. Pixel clock
  2034. ---*/
  2035. #define NEG 0
  2036. #define POS 1
  2037. //
  2038. // This is our hybrid of DMTF modes and GTF modes which we call the 'VESA'
  2039. // mode list:
  2040. //
  2041. TIMING_INFO VESA_LIST[] =
  2042. {
  2043. // The first entry in the list must be 640x480x60 as this is the mode Windows
  2044. // defaults to when it has somehow been set to an invalid or non-existant mode.
  2045. {{ 640, 480, 60}, { 100, 2, 12, 6, NEG, 525,10, 2, 33, NEG, 251750}}, // DMTF
  2046. // Don't bother for now.
  2047. // {{ 640, 480, 72}, { 104, 3, 5, 16, NEG, 520, 9, 3, 28, NEG, 315000}}, // DMTF
  2048. {{ 640, 480, 75}, { 105, 2, 8, 15, NEG, 500, 1, 3, 16, NEG, 315000}}, // DMTF
  2049. {{ 640, 480, 85}, { 104, 7, 7, 10, NEG, 509, 1, 3, 25, NEG, 360000}}, // DMTF
  2050. {{ 640, 480,100}, { 106, 5, 8, 13, NEG, 509, 1, 3, 25, NEG, 431630}}, // GTF
  2051. // <--320 x 400--> <--320 x 200--> <320x400/2>
  2052. // 320x200x60 has an fH of 25kHz which is too slow for most monitors
  2053. // {{ 320, 200, 60}, { 48, 0, 4, 4, NEG, 208, 1, 3, 4, POS, 47810}}, // GTF (hybrid of 320 x 400)
  2054. {{ 320, 200, 75}, { 50, 1, 4, 5, NEG, 210, 1, 3, 6, POS, 62700}}, // GTF (hybrid of 320 x 400)
  2055. // {{ 320, 200, 85}, { 52, 2, 4, 6, NEG, 211, 1, 3, 7, POS, 74435}}, // GTF (hybrid of 320 x 400)
  2056. // {{ 320, 200,100}, { 52, 2, 4, 6, NEG, 213, 1, 3, 9, POS, 88190}}, // GTF (hybrid of 320 x 400)
  2057. // {{ 320, 240, 60}, { 50, 1, 4, 5, NEG, 249, 1, 3, 5, POS, 59640}}, // GTF (hybrid of 320 x 480)
  2058. {{ 320, 240, 75}, { 52, 2, 4, 6, NEG, 251, 1, 3, 7, POS, 78310}}, // GTF (hybrid of 320 x 480)
  2059. // {{ 320, 240, 85}, { 52, 2, 4, 6, NEG, 253, 1, 3, 9, POS, 89285}}, // GTF (hybrid of 320 x 480)
  2060. // {{ 320, 240,100}, { 52, 2, 4, 6, NEG, 255, 1, 3, 11, POS, 105870}}, // GTF (hybrid of 320 x 480)
  2061. // DX does not work as these require a screen stride.
  2062. // {{ 400, 300, 60}, { 64, 2, 5, 7, NEG, 311, 1, 3, 7, POS, 86580}}, // GTF (hybrid of 400 x 600)
  2063. // {{ 400, 300, 75}, { 66, 3, 5, 8, NEG, 314, 1, 3, 10, POS, 113040}}, // GTF (hybrid of 400 x 600)
  2064. // {{ 400, 300, 85}, { 66, 3, 5, 8, NEG, 316, 1, 3, 12, POS, 133230}}, // GTF (hybrid of 400 x 600)
  2065. // {{ 400, 300,100}, { 66, 3, 5, 8, NEG, 319, 1, 3, 15, POS, 158220}}, // GTF (hybrid of 400 x 600)
  2066. // 512x384x60 has an fH of 24kHz which is too slow for most monitors
  2067. // {{ 512, 384, 60}, { 78, 1, 6, 7, NEG, 398, 1, 3, 10, POS, 149010}}, // GTF
  2068. {{ 512, 384, 75}, { 80, 2, 6, 8, NEG, 402, 1, 3, 14, POS, 192960}}, // GTF
  2069. // {{ 512, 384, 85}, { 82, 2, 7, 9, NEG, 404, 1, 3, 16, POS, 225270}}, // GTF
  2070. // {{ 512, 384,100}, { 82, 2, 7, 9, NEG, 407, 1, 3, 19, POS, 266990}}, // GTF
  2071. // Don't bother for now.
  2072. // {{ 640, 350, 85}, { 104, 4, 8, 12, POS, 445,32, 3, 60, NEG, 315000}}, // DMTF
  2073. // {{ 640, 400, 60}, { 98, 1, 8, 9, NEG, 415, 1, 3, 11, POS, 195220}}, // GTF
  2074. {{ 640, 400, 75}, { 100, 2, 8, 10, NEG, 418, 1, 3, 14, POS, 250800}}, // GTF
  2075. // {{ 640, 400, 85}, { 104, 4, 8, 12, NEG, 445, 1, 3, 41, POS, 315000}}, // DMTF
  2076. // {{ 640, 400,100}, { 104, 4, 8, 12, NEG, 424, 1, 3, 20, POS, 352770}}, // GTF
  2077. // DX does not work as this requires a screen stride.
  2078. // {{ 720, 400, 85}, { 104, 4, 8, 12, NEG, 446, 1, 3, 42, POS, 355000}}, // DMTF
  2079. // Don't bother for now.
  2080. // {{ 800, 600, 56}, { 128, 3, 9, 16, POS, 625, 1, 2, 22, POS, 360000}}, // DMTF
  2081. {{ 800, 600, 60}, { 132, 5, 16, 11, POS, 628, 1, 4, 23, POS, 400000}}, // DMTF
  2082. // {{ 800, 600, 72}, { 130, 7, 15, 8, POS, 666,37, 6, 23, POS, 500000}}, // DMTF
  2083. {{ 800, 600, 75}, { 132, 2, 10, 20, POS, 625, 1, 3, 21, POS, 495000}}, // DMTF
  2084. {{ 800, 600, 85}, { 131, 4, 8, 19, POS, 631, 1, 3, 27, POS, 562500}}, // DMTF
  2085. {{ 800, 600,100}, { 134, 6, 11, 17, NEG, 636, 1, 3, 32, POS, 681790}}, // GTF
  2086. // DX does not work as these require a screen stride.
  2087. // {{ 856, 480, 60}, { 133, 2, 11, 13, NEG, 497, 1, 3, 13, POS, 317280}}, // GTF
  2088. // {{ 856, 480, 75}, { 137, 4, 11, 15, NEG, 502, 1, 3, 18, POS, 412640}}, // GTF
  2089. // {{ 856, 480, 85}, { 139, 5, 11, 16, NEG, 505, 1, 3, 21, POS, 477330}}, // GTF
  2090. // {{ 856, 480,100}, { 141, 6, 11, 17, NEG, 509, 1, 3, 25, POS, 574150}}, // GTF
  2091. {{1024, 768, 60}, { 168, 3, 17, 20, NEG, 806, 3, 6, 29, NEG, 650000}}, // DMTF
  2092. // Don't bother for now.
  2093. // {{1024, 768, 70}, { 166, 3, 17, 18, NEG, 806, 3, 6, 29, NEG, 750000}}, // DMTF
  2094. {{1024, 768, 75}, { 164, 2, 12, 22, POS, 800, 1, 3, 28, POS, 787500}}, // DMTF
  2095. {{1024, 768, 85}, { 172, 6, 12, 26, POS, 808, 1, 3, 36, POS, 945000}}, // DMTF
  2096. {{1024, 768,100}, { 174, 9, 14, 23, NEG, 814, 1, 3, 42, POS, 1133090}}, // GTF
  2097. {{1024, 768,120}, { 176, 10, 14, 24, NEG, 823, 1, 3, 51, POS, 1390540}}, // GTF
  2098. {{1152, 864, 60}, { 190, 8, 15, 23, NEG, 895, 1, 3, 27, POS, 816240}}, // GTF
  2099. {{1152, 864, 75}, { 200, 8, 16, 32, POS, 900, 1, 3, 32, POS, 1080000}}, // DMTF
  2100. {{1152, 864, 85}, { 194, 9, 16, 25, NEG, 907, 1, 3, 39, POS, 1196510}}, // GTF
  2101. {{1152, 864,100}, { 196, 10, 16, 26, NEG, 915, 1, 3, 47, POS, 1434720}}, // GTF
  2102. {{1152, 864,120}, { 198, 11, 16, 27, NEG, 926, 1, 3, 58, POS, 1760140}}, // GTF
  2103. {{1280, 960, 60}, { 225, 12, 14, 39, POS, 1000, 1, 3, 36, POS, 1080000}}, // DMTF
  2104. {{1280, 960, 75}, { 216, 11, 17, 28, NEG, 1002, 1, 3, 38, POS, 1298590}}, // GTF
  2105. {{1280, 960, 85}, { 216, 8, 20, 28, POS, 1011, 1, 3, 47, POS, 1485000}}, // DMTF
  2106. {{1280, 960,100}, { 220, 12, 18, 30, NEG, 1017, 1, 3, 53, POS, 1789920}}, // GTF
  2107. {{1280, 960,120}, { 220, 12, 18, 30, NEG, 1029, 1, 3, 65, POS, 2173250}}, // GTF
  2108. {{1280,1024, 60}, { 211, 6, 14, 31, POS, 1066, 1, 3, 38, POS, 1080000}}, // DMTF
  2109. {{1280,1024, 75}, { 211, 2, 18, 31, POS, 1066, 1, 3, 38, POS, 1350000}}, // DMTF
  2110. {{1280,1024, 85}, { 216, 8, 20, 28, POS, 1072, 1, 3, 44, POS, 1575000}}, // DMTF
  2111. {{1280,1024,100}, { 220, 12, 18, 30, NEG, 1085, 1, 3, 57, POS, 1909600}}, // GTF
  2112. {{1280,1024,120}, { 222, 13, 18, 31, NEG, 1097, 1, 3, 69, POS, 2337930}}, // GTF
  2113. {{1600,1200, 60}, { 270, 8, 24, 38, POS, 1250, 1, 3, 46, POS, 1620000}}, // DMTF
  2114. // Don't bother for now.
  2115. // {{1600,1200, 65}, { 270, 8, 24, 38, POS, 1250, 1, 3, 46, POS, 1755000}}, // DMTF
  2116. // {{1600,1200, 70}, { 270, 8, 24, 38, POS, 1250, 1, 3, 46, POS, 1890000}}, // DMTF
  2117. {{1600,1200, 75}, { 270, 8, 24, 38, POS, 1250, 1, 3, 46, POS, 2025000}}, // DMTF
  2118. {{1600,1200, 85}, { 270, 8, 24, 38, POS, 1250, 1, 3, 46, POS, 2295000}}, // DMTF
  2119. {{1600,1200,100}, { 276, 16, 22, 38, NEG, 1271, 1, 3, 67, POS, 2806370}}, // GTF
  2120. {{1920,1080, 60}, { 322, 15, 26, 41, NEG, 1118, 1, 3, 34, POS, 1727980}}, // GTF
  2121. {{1920,1080, 75}, { 326, 17, 26, 43, NEG, 1128, 1, 3, 44, POS, 2206370}}, // GTF
  2122. {{1920,1080, 85}, { 328, 18, 26, 44, NEG, 1134, 1, 3, 50, POS, 2529270}}, // GTF
  2123. {{1920,1080,100}, { 330, 19, 26, 45, NEG, 1144, 1, 3, 60, POS, 3020160}}, // GTF
  2124. {{1920,1200, 60}, { 324, 16, 26, 42, NEG, 1242, 1, 3, 38, POS, 1931560}}, // GTF
  2125. {{1920,1200, 75}, { 328, 18, 26, 44, NEG, 1253, 1, 3, 49, POS, 2465900}}, // GTF
  2126. {{1920,1200, 85}, { 330, 19, 26, 45, NEG, 1260, 1, 3, 56, POS, 2827440}}, // GTF
  2127. {{1920,1200,100}, { 332, 19, 27, 46, NEG, 1271, 1, 3, 67, POS, 3375780}}, // GTF
  2128. };
  2129. TIMING_INFO SGIDFP_LIST[] =
  2130. {
  2131. {{1600,1024, 60}, { 302, 30, 24, 48, POS, 1067, 3, 3, 37, POS, 1069100}},
  2132. };
  2133. #undef NEG
  2134. #undef POS
  2135. #define VESA_COUNT (sizeof(VESA_LIST) / sizeof(VESA_LIST[0]))
  2136. #define SGIDFP_COUNT (sizeof(SGIDFP_LIST) / sizeof(SGIDFP_LIST[0]))
  2137. #if defined(ALLOC_PRAGMA)
  2138. #pragma data_seg()
  2139. #endif
  2140. //
  2141. // THE CODE
  2142. // ========
  2143. //
  2144. #if defined(ALLOC_PRAGMA)
  2145. #pragma alloc_text(PAGE,GetVideoTiming)
  2146. #pragma alloc_text(PAGE,CopyMonitorTimings)
  2147. #pragma alloc_text(PAGE,GrowTimingList)
  2148. #pragma alloc_text(PAGE,testExtendRanges)
  2149. #pragma alloc_text(PAGE,BuildFrequencyList)
  2150. #pragma alloc_text(PAGE,BuildFrequencyListForSGIDFP)
  2151. #pragma alloc_text(PAGE,BuildFrequencyListFromVESA)
  2152. #endif // ALLOC_PRAGMA
  2153. BOOLEAN
  2154. GetVideoTiming(
  2155. PHW_DEVICE_EXTENSION hwDeviceExtension,
  2156. ULONG xRes,
  2157. ULONG yRes,
  2158. ULONG Freq,
  2159. ULONG Depth,
  2160. VESA_TIMING_STANDARD *VESATimings
  2161. )
  2162. /*+++
  2163. Routine Description:
  2164. Given a width, height and frequency this function will return a
  2165. VESA timing information.
  2166. The information is extracted from the VESA_LIST.
  2167. ---*/
  2168. {
  2169. TIMING_INFO *list = hwDeviceExtension->monitorInfo.timingList;
  2170. ULONG count = hwDeviceExtension->monitorInfo.timingNum;
  2171. ULONG i;
  2172. BOOLEAN retVal;
  2173. retVal = FALSE;
  2174. //
  2175. // Loop through the table looking for a match
  2176. //
  2177. for( i = 0; !retVal && (i < count); i++ ) {
  2178. //
  2179. // Comparewidth, height and frequency
  2180. //
  2181. if( list[i].basic.width == xRes &&
  2182. list[i].basic.height == yRes &&
  2183. list[i].basic.refresh == Freq ) {
  2184. //
  2185. // We got a match
  2186. //
  2187. *VESATimings = list[i].vesa;
  2188. retVal = TRUE;
  2189. }
  2190. }
  2191. //
  2192. // Fix up pixel clock, just in case it hasn't been set
  2193. //
  2194. if (retVal && VESATimings->pClk == 0) {
  2195. VideoDebugPrint((0, "Perm3: Pixel clock is zero - recalculating!"));
  2196. VESATimings->pClk =
  2197. (8 * VESATimings->HTot * VESATimings->VTot * Freq) / 100;
  2198. }
  2199. return retVal;
  2200. }
  2201. BOOLEAN
  2202. CopyMonitorTimings(
  2203. PVOID HwDeviceExtension,
  2204. MONITOR_INFO *srcMI,
  2205. MONITOR_INFO *mi
  2206. )
  2207. {
  2208. ULONG i, j, k;
  2209. VP_STATUS status;
  2210. if( mi->timingList ) {
  2211. VideoPortReleaseBuffer(HwDeviceExtension, mi->timingList);
  2212. mi->timingList = NULL;
  2213. }
  2214. if( mi->frequencyTable ) {
  2215. VideoPortReleaseBuffer(HwDeviceExtension, mi->frequencyTable);
  2216. mi->frequencyTable = NULL;
  2217. }
  2218. *mi = *srcMI;
  2219. status = VideoPortAllocateBuffer(HwDeviceExtension,
  2220. sizeof(*mi->timingList ) * (mi->timingNum + 1),
  2221. &(mi->timingList));
  2222. if (status != NO_ERROR) {
  2223. return FALSE;
  2224. }
  2225. status = VideoPortAllocateBuffer(HwDeviceExtension,
  2226. sizeof(*mi->frequencyTable) *
  2227. (mi->timingNum + 1) * Perm3DepthCnt,
  2228. &(mi->frequencyTable));
  2229. if (status != NO_ERROR) {
  2230. VideoPortReleaseBuffer(HwDeviceExtension, mi->timingList);
  2231. mi->timingList = NULL;
  2232. return FALSE;
  2233. }
  2234. VideoPortZeroMemory(mi->frequencyTable,
  2235. sizeof(*mi->frequencyTable) * (mi->timingNum + 1) * Perm3DepthCnt );
  2236. mi->timingMax = mi->timingNum;
  2237. for( i = k = 0; i < mi->timingNum; i++ ) {
  2238. mi->timingList[i] = srcMI->timingList[i];
  2239. for( j = 0; j < Perm3DepthCnt; j++, k++ ) {
  2240. mi->frequencyTable[k].BitsPerPel = Perm3DepthList[j];
  2241. mi->frequencyTable[k].ScreenWidth = mi->timingList[i].basic.width;
  2242. mi->frequencyTable[k].ScreenHeight = mi->timingList[i].basic.height;
  2243. mi->frequencyTable[k].ScreenFrequency = mi->timingList[i].basic.refresh;
  2244. mi->frequencyTable[k].PixelClock = mi->timingList[i].vesa.pClk;
  2245. }
  2246. }
  2247. //
  2248. // Ensure the lists are terminted
  2249. //
  2250. mi->frequencyTable[k].BitsPerPel = 0;
  2251. mi->timingList[i].basic.width = 0;
  2252. return TRUE;
  2253. }
  2254. BOOLEAN
  2255. GrowTimingList(
  2256. PVOID HwDeviceExtension,
  2257. MONITOR_INFO *mi
  2258. )
  2259. {
  2260. ULONG newSize = mi->timingNum + 100;
  2261. TIMING_INFO *newList;
  2262. VP_STATUS status;
  2263. status = VideoPortAllocateBuffer(HwDeviceExtension,
  2264. sizeof(*newList) * newSize,
  2265. &(newList));
  2266. if (status != NO_ERROR) {
  2267. return FALSE;
  2268. }
  2269. VideoPortZeroMemory( newList, sizeof(*newList) * newSize );
  2270. VideoPortMoveMemory( newList, mi->timingList, sizeof(*newList) * mi->timingNum );
  2271. if( mi->timingList )
  2272. VideoPortReleaseBuffer( HwDeviceExtension, mi->timingList );
  2273. mi->timingList = newList;
  2274. mi->timingMax = newSize;
  2275. return TRUE;
  2276. }
  2277. VOID
  2278. testExtendRanges(
  2279. MONITOR_INFO *mi,
  2280. TIMING_INFO *ti,
  2281. FREQUENCIES *freq
  2282. )
  2283. {
  2284. if( mi->flags & MI_FLAGS_FUDGED_VH ) {
  2285. if( freq->fH > mi->fhMax )
  2286. mi->fhMax = freq->fH;
  2287. if( freq->fH < mi->fhMin )
  2288. mi->fhMin = freq->fH;
  2289. if( freq->fV > mi->fvMax )
  2290. mi->fvMax = freq->fV;
  2291. if( freq->fV < mi->fvMin )
  2292. mi->fvMin = freq->fV;
  2293. }
  2294. if( mi->flags & MI_FLAGS_FUDGED_PCLK ) {
  2295. if( freq->pClk < mi->pClkMin ) {
  2296. mi->pClkMin = freq->pClk;
  2297. }
  2298. if( freq->pClk > mi->pClkMax ) {
  2299. mi->pClkMax = freq->pClk;
  2300. }
  2301. }
  2302. if( mi->flags & MI_FLAGS_FUDGED_XY ) {
  2303. if( ti->basic.width < mi->xMin ) {
  2304. mi->xMin = ti->basic.width;
  2305. }
  2306. if( ti->basic.width > mi->xMax ) {
  2307. mi->xMax = ti->basic.width;
  2308. }
  2309. if( ti->basic.height < mi->yMin ) {
  2310. mi->yMin = ti->basic.height;
  2311. }
  2312. if( ti->basic.height > mi->yMax ) {
  2313. mi->yMax = ti->basic.height;
  2314. }
  2315. }
  2316. }
  2317. BOOLEAN
  2318. BuildFrequencyList(
  2319. PHW_DEVICE_EXTENSION hwDeviceExtension,
  2320. MONITOR_INFO *mi
  2321. )
  2322. {
  2323. MONITOR_INFO newMI;
  2324. ULONG i, j, k;
  2325. BOOLEAN bRet = FALSE;
  2326. BOOLEAN bRet1;
  2327. UCHAR EdidBuffer[256];
  2328. VideoPortZeroMemory(&newMI, sizeof(newMI));
  2329. newMI.flags = mi->flags;
  2330. newMI.flags |= ( MI_FLAGS_FUDGED_VH |
  2331. MI_FLAGS_FUDGED_PCLK |
  2332. MI_FLAGS_FUDGED_XY);
  2333. newMI.fhMin = 0xFFFFFFFF;
  2334. newMI.fhMax = 0;
  2335. newMI.fvMin = 0xFFFFFFFF;
  2336. newMI.fvMax = 0;
  2337. newMI.pClkMin = 0xFFFFFFFF;
  2338. newMI.pClkMax = 0;
  2339. newMI.xMin = 0xFFFFFFFF;
  2340. newMI.xMax = 0;
  2341. newMI.yMin = 0xFFFFFFFF;
  2342. newMI.yMax = 0;
  2343. if ((hwDeviceExtension->deviceInfo.SubsystemId ==
  2344. SUBDEVICEID_P3_VX1_1600SW) &&
  2345. GetDFPEdid(hwDeviceExtension, EdidBuffer, sizeof(EdidBuffer))) {
  2346. bRet1 = BuildFrequencyListForSGIDFP(&newMI,
  2347. hwDeviceExtension);
  2348. } else {
  2349. bRet1 = BuildFrequencyListFromVESA(&newMI,
  2350. hwDeviceExtension);
  2351. }
  2352. if (bRet1) {
  2353. //
  2354. // Copy the lists about:
  2355. //
  2356. if(CopyMonitorTimings((PVOID)hwDeviceExtension, &newMI, mi))
  2357. bRet = TRUE;
  2358. }
  2359. if(newMI.timingList) {
  2360. VideoPortReleaseBuffer((PVOID)hwDeviceExtension, newMI.timingList);
  2361. newMI.timingList = NULL;
  2362. }
  2363. return bRet;
  2364. }
  2365. BOOLEAN
  2366. BuildFrequencyListFromVESA(
  2367. MONITOR_INFO *mi,
  2368. PHW_DEVICE_EXTENSION hwDeviceExtension
  2369. )
  2370. {
  2371. ULONG realCount = VESA_COUNT;
  2372. TIMING_INFO *realList = VESA_LIST;
  2373. TIMING_INFO *ti;
  2374. FREQUENCIES freq;
  2375. //
  2376. // loop through the list of resolutions
  2377. //
  2378. for( mi->timingNum = 0; mi->timingNum < realCount; mi->timingNum++ ) {
  2379. if( mi->timingNum >= mi->timingMax ) {
  2380. if(!GrowTimingList((PVOID)hwDeviceExtension, mi)) {
  2381. return FALSE;
  2382. }
  2383. }
  2384. ti = &mi->timingList[mi->timingNum];
  2385. *ti = realList[mi->timingNum];
  2386. if( !ti->vesa.pClk ) {
  2387. ti->vesa.pClk = ((ti->vesa.HTot * ti->vesa.VTot * 8) / 100) * ti->basic.refresh;
  2388. }
  2389. freq.pClk = ti->vesa.pClk;
  2390. freq.fH = (freq.pClk * 100) / (ti->vesa.HTot * 8);
  2391. freq.fV = (freq.pClk * 100) / (ti->vesa.HTot * ti->vesa.VTot * 8);
  2392. testExtendRanges( mi, ti, &freq );
  2393. }
  2394. return TRUE;
  2395. }
  2396. BOOLEAN
  2397. BuildFrequencyListForSGIDFP(
  2398. MONITOR_INFO *mi,
  2399. PHW_DEVICE_EXTENSION hwDeviceExtension
  2400. )
  2401. {
  2402. ULONG realCount = SGIDFP_COUNT;
  2403. TIMING_INFO *realList = SGIDFP_LIST;
  2404. TIMING_INFO *ti;
  2405. FREQUENCIES freq;
  2406. //
  2407. // Loop through the list of resolutions
  2408. //
  2409. for( mi->timingNum = 0; mi->timingNum < realCount; mi->timingNum++ ) {
  2410. if( mi->timingNum >= mi->timingMax ) {
  2411. if(!GrowTimingList((PVOID)hwDeviceExtension, mi)) {
  2412. return FALSE;
  2413. }
  2414. }
  2415. ti = &mi->timingList[mi->timingNum];
  2416. *ti = realList[mi->timingNum];
  2417. if( !ti->vesa.pClk ) {
  2418. ti->vesa.pClk = ((ti->vesa.HTot * ti->vesa.VTot * 8) / 100) * ti->basic.refresh;
  2419. }
  2420. freq.pClk = ti->vesa.pClk;
  2421. freq.fH = (freq.pClk * 100) / (ti->vesa.HTot * 8);
  2422. freq.fV = (freq.pClk * 100) / (ti->vesa.HTot * ti->vesa.VTot * 8);
  2423. testExtendRanges( mi, ti, &freq );
  2424. }
  2425. return TRUE;
  2426. }