Source code of Windows XP (NT5)
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.

1323 lines
48 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1990-1993 Microsoft Corporation
  3. Module Name:
  4. ddvdeo.h
  5. Abstract:
  6. This is the include file that defines all constants and types for
  7. accessing the Video device.
  8. Author:
  9. Andre Vachon (andreva) 21-Jan-1992
  10. Revision History:
  11. --*/
  12. //
  13. // VideoIoControlFile InputBuffer/OutputBuffer record structures for
  14. // this device.
  15. //
  16. //
  17. // Name used to create the miniport logical device names
  18. //
  19. #define VIDEO_DEVICE_NAME "DISPLAY%d"
  20. #define WVIDEO_DEVICE_NAME L"DISPLAY%d"
  21. //
  22. // The first set of IOCTLs are handle by the port driver and never seen
  23. // by the miniport.
  24. //
  25. #define IOCTL_VIDEO_ENABLE_VDM \
  26. CTL_CODE(FILE_DEVICE_VIDEO, 0x00, METHOD_BUFFERED, FILE_ANY_ACCESS)
  27. #define IOCTL_VIDEO_DISABLE_VDM \
  28. CTL_CODE(FILE_DEVICE_VIDEO, 0x01, METHOD_BUFFERED, FILE_ANY_ACCESS)
  29. #define IOCTL_VIDEO_REGISTER_VDM \
  30. CTL_CODE(FILE_DEVICE_VIDEO, 0x02, METHOD_BUFFERED, FILE_ANY_ACCESS)
  31. //
  32. // All these IOCTL's must be both handled by the port and miniport since
  33. // they require processing by both parties.
  34. //
  35. #define IOCTL_VIDEO_SAVE_HARDWARE_STATE \
  36. CTL_CODE(FILE_DEVICE_VIDEO, 0x80, METHOD_BUFFERED, FILE_ANY_ACCESS)
  37. #define IOCTL_VIDEO_RESTORE_HARDWARE_STATE \
  38. CTL_CODE(FILE_DEVICE_VIDEO, 0x81, METHOD_BUFFERED, FILE_ANY_ACCESS)
  39. //
  40. // All these IOCTL's are public and must/can be handled by the miniport
  41. // driver
  42. //
  43. #define IOCTL_VIDEO_QUERY_AVAIL_MODES \
  44. CTL_CODE(FILE_DEVICE_VIDEO, 0x100, METHOD_BUFFERED, FILE_ANY_ACCESS)
  45. #define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES \
  46. CTL_CODE(FILE_DEVICE_VIDEO, 0x101, METHOD_BUFFERED, FILE_ANY_ACCESS)
  47. #define IOCTL_VIDEO_QUERY_CURRENT_MODE \
  48. CTL_CODE(FILE_DEVICE_VIDEO, 0x102, METHOD_BUFFERED, FILE_ANY_ACCESS)
  49. #define IOCTL_VIDEO_SET_CURRENT_MODE \
  50. CTL_CODE(FILE_DEVICE_VIDEO, 0x103, METHOD_BUFFERED, FILE_ANY_ACCESS)
  51. #define IOCTL_VIDEO_RESET_DEVICE \
  52. CTL_CODE(FILE_DEVICE_VIDEO, 0x104, METHOD_BUFFERED, FILE_ANY_ACCESS)
  53. #define IOCTL_VIDEO_LOAD_AND_SET_FONT \
  54. CTL_CODE(FILE_DEVICE_VIDEO, 0x105, METHOD_BUFFERED, FILE_ANY_ACCESS)
  55. #define IOCTL_VIDEO_SET_PALETTE_REGISTERS \
  56. CTL_CODE(FILE_DEVICE_VIDEO, 0x106, METHOD_BUFFERED, FILE_ANY_ACCESS)
  57. #define IOCTL_VIDEO_SET_COLOR_REGISTERS \
  58. CTL_CODE(FILE_DEVICE_VIDEO, 0x107, METHOD_BUFFERED, FILE_ANY_ACCESS)
  59. #define IOCTL_VIDEO_ENABLE_CURSOR \
  60. CTL_CODE(FILE_DEVICE_VIDEO, 0x108, METHOD_BUFFERED, FILE_ANY_ACCESS)
  61. #define IOCTL_VIDEO_DISABLE_CURSOR \
  62. CTL_CODE(FILE_DEVICE_VIDEO, 0x109, METHOD_BUFFERED, FILE_ANY_ACCESS)
  63. #define IOCTL_VIDEO_SET_CURSOR_ATTR \
  64. CTL_CODE(FILE_DEVICE_VIDEO, 0x10a, METHOD_BUFFERED, FILE_ANY_ACCESS)
  65. #define IOCTL_VIDEO_QUERY_CURSOR_ATTR \
  66. CTL_CODE(FILE_DEVICE_VIDEO, 0x10b, METHOD_BUFFERED, FILE_ANY_ACCESS)
  67. #define IOCTL_VIDEO_SET_CURSOR_POSITION \
  68. CTL_CODE(FILE_DEVICE_VIDEO, 0x10c, METHOD_BUFFERED, FILE_ANY_ACCESS)
  69. #define IOCTL_VIDEO_QUERY_CURSOR_POSITION \
  70. CTL_CODE(FILE_DEVICE_VIDEO, 0x10d, METHOD_BUFFERED, FILE_ANY_ACCESS)
  71. #define IOCTL_VIDEO_ENABLE_POINTER \
  72. CTL_CODE(FILE_DEVICE_VIDEO, 0x10e, METHOD_BUFFERED, FILE_ANY_ACCESS)
  73. #define IOCTL_VIDEO_DISABLE_POINTER \
  74. CTL_CODE(FILE_DEVICE_VIDEO, 0x10f, METHOD_BUFFERED, FILE_ANY_ACCESS)
  75. #define IOCTL_VIDEO_SET_POINTER_ATTR \
  76. CTL_CODE(FILE_DEVICE_VIDEO, 0x110, METHOD_BUFFERED, FILE_ANY_ACCESS)
  77. #define IOCTL_VIDEO_QUERY_POINTER_ATTR \
  78. CTL_CODE(FILE_DEVICE_VIDEO, 0x111, METHOD_BUFFERED, FILE_ANY_ACCESS)
  79. #define IOCTL_VIDEO_SET_POINTER_POSITION \
  80. CTL_CODE(FILE_DEVICE_VIDEO, 0x112, METHOD_BUFFERED, FILE_ANY_ACCESS)
  81. #define IOCTL_VIDEO_QUERY_POINTER_POSITION \
  82. CTL_CODE(FILE_DEVICE_VIDEO, 0x113, METHOD_BUFFERED, FILE_ANY_ACCESS)
  83. #define IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES \
  84. CTL_CODE(FILE_DEVICE_VIDEO, 0x114, METHOD_BUFFERED, FILE_ANY_ACCESS)
  85. #define IOCTL_VIDEO_GET_BANK_SELECT_CODE \
  86. CTL_CODE(FILE_DEVICE_VIDEO, 0x115, METHOD_BUFFERED, FILE_ANY_ACCESS)
  87. #define IOCTL_VIDEO_MAP_VIDEO_MEMORY \
  88. CTL_CODE(FILE_DEVICE_VIDEO, 0x116, METHOD_BUFFERED, FILE_ANY_ACCESS)
  89. #define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY \
  90. CTL_CODE(FILE_DEVICE_VIDEO, 0x117, METHOD_BUFFERED, FILE_ANY_ACCESS)
  91. #define IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES \
  92. CTL_CODE(FILE_DEVICE_VIDEO, 0x118, METHOD_BUFFERED, FILE_ANY_ACCESS)
  93. #define IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES \
  94. CTL_CODE(FILE_DEVICE_VIDEO, 0x119, METHOD_BUFFERED, FILE_ANY_ACCESS)
  95. #define IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES \
  96. CTL_CODE(FILE_DEVICE_VIDEO, 0x11a, METHOD_BUFFERED, FILE_ANY_ACCESS)
  97. //
  98. // New IOCTLs defined for product 1.0A
  99. //
  100. #define IOCTL_VIDEO_SET_POWER_MANAGEMENT \
  101. CTL_CODE(FILE_DEVICE_VIDEO, 0x11b, METHOD_BUFFERED, FILE_ANY_ACCESS)
  102. #define IOCTL_VIDEO_GET_POWER_MANAGEMENT \
  103. CTL_CODE(FILE_DEVICE_VIDEO, 0x11c, METHOD_BUFFERED, FILE_ANY_ACCESS)
  104. #define IOCTL_VIDEO_SHARE_VIDEO_MEMORY \
  105. CTL_CODE(FILE_DEVICE_VIDEO, 0x11d, METHOD_BUFFERED, FILE_ANY_ACCESS)
  106. #define IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY \
  107. CTL_CODE(FILE_DEVICE_VIDEO, 0x11e, METHOD_BUFFERED, FILE_ANY_ACCESS)
  108. //
  109. // Many of the video ICOTLs are modal. When ever the palette is set, or the
  110. // cursor is set or queried, it is done for the current mode.
  111. //
  112. // Modal specifies that the operation is only valid within a mode. Once a
  113. // set mode operation is performed, the state associated to the modal IOCTL
  114. // has been destroyed or reinitialized.
  115. // Non-modal IOCTLs have their state preserved across set-mode operations.
  116. //
  117. // Optional IOCTLs are IOCTLs the miniport can optionally support. If the
  118. // miniport does not support the IOCTL, it should return the appropriate
  119. // error status.
  120. // Required IOCTLs must be implemented in a miniport in order for the system
  121. // to system properly.
  122. //
  123. // IOCTL_VIDEO_ENABLE_VDM Non-Modal Private(1)
  124. // IOCTL_VIDEO_DISABLE_VDM Non-Modal Private(1)
  125. // IOCTL_VIDEO_REGISTER_VDM Non-Modal Private(1)
  126. //
  127. // IOCTL_VIDEO_SAVE_HARDWARE_STATE Non-Modal Required(2)
  128. // IOCTL_VIDEO_RESTORE_HARDWARE_STATE Non-Modal Required(2)
  129. //
  130. // IOCTL_VIDEO_QUERY_AVAIL_MODES Non-Modal Required
  131. // IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES Non-Modal Required
  132. // IOCTL_VIDEO_QUERY_CURRENT_MODE Modal Required
  133. // IOCTL_VIDEO_SET_CURRENT_MODE Non-Modal Required
  134. // IOCTL_VIDEO_RESET_DEVICE Non-Modal Required
  135. //
  136. // IOCTL_VIDEO_LOAD_AND_SET_FONT Modal Required(2)
  137. //
  138. // IOCTL_VIDEO_SET_PALETTE_REGISTERS Modal Required(2)
  139. // IOCTL_VIDEO_SET_COLOR_REGISTERS Modal Required(3)
  140. //
  141. // IOCTL_VIDEO_ENABLE_CURSOR Modal Required(2)
  142. // IOCTL_VIDEO_DISABLE_CURSOR Modal Required(2)
  143. // IOCTL_VIDEO_SET_CURSOR_ATTR Modal Required(2)
  144. // IOCTL_VIDEO_QUERY_CURSOR_ATTR Modal Required(2)
  145. // IOCTL_VIDEO_SET_CURSOR_POSITION Modal Required(2)
  146. // IOCTL_VIDEO_QUERY_CURSOR_POSITION Modal Required(2)
  147. //
  148. // IOCTL_VIDEO_ENABLE_POINTER Modal Optional
  149. // IOCTL_VIDEO_DISABLE_POINTER Modal Optional
  150. // IOCTL_VIDEO_SET_POINTER_ATTR Modal Optional
  151. // IOCTL_VIDEO_QUERY_POINTER_ATTR Modal Optional
  152. // IOCTL_VIDEO_SET_POINTER_POSITION Modal Optional
  153. // IOCTL_VIDEO_QUERY_POINTER_POSITION Modal Optional
  154. // IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES Non-Modal Optional
  155. //
  156. // IOCTL_VIDEO_GET_BANK_SELECT_CODE Modal Required(2)
  157. //
  158. // IOCTL_VIDEO_MAP_VIDEO_MEMORY Special(4) Required
  159. // IOCTL_VIDEO_UNMAP_VIDEO_MEMORY Non-Modal Required
  160. // IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES Non-Modal Optional
  161. // IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES Non-Modal Optional
  162. //
  163. // IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES Non-Modal Optional
  164. //
  165. // IOCTL_VIDEO_SET_POWER_MANAGEMENT Non-Modal Optional
  166. // IOCTL_VIDEO_GET_POWER_MANAGEMENT Non-Modal Optional
  167. //
  168. // (1) Private means the IOCTL is completely implemeted within the port driver
  169. // and the miniport does not need to support it.
  170. //
  171. // (2) These Required functions are for "Vga Compatible" miniports. They are
  172. // Optional for other, non vga-compatible (i.e frame buffers) drivers.
  173. // VGA compatible means here that the miniport implements all the VGA
  174. // functionality and that the VgaCompatible flag for the miniport in the
  175. // registry parameters is turned on.
  176. //
  177. // (3) This IOCTL is required if the device has a color lookup table (also
  178. // commonly called palette) the PALETTE IOCTL is used for VGA while the
  179. // COLOR IOCTL is the more general IOCTL that is called by the display
  180. // driver or application to set the colors in the devices internal
  181. // lookup table
  182. //
  183. // (4) This IOCTL is both modal and non-modal. It should map all of video
  184. // memory in the caller's address space. A set mode MUST NOT cause the
  185. // video memory to change location - in this sense it is non-modal.
  186. // However, this IOCTL returns the location size of the frame buffer within
  187. // video memory, and the frame buffer size and location may vary from mode
  188. // to mode - so that information is modal.
  189. //
  190. //
  191. // Any IOCTL that returns information should return in the status block the
  192. // size of the data returned.
  193. // If the output buffer was too small, an error should be returned.
  194. //
  195. //
  196. //
  197. //
  198. //
  199. // IOCTL_VIDEO_ENABLE_VDM
  200. // IOCTL_VIDEO_DISABLE_VDM
  201. // IOCTL_VIDEO_REGISTER_VDM
  202. //
  203. // These IOCTLs are used to enable or disable a VDM's access to the video
  204. // hardware. This call will cause the real video frame buffer to be mapped
  205. // into the VDM's address space and get the video validator connected to the
  206. // V86 emulator for direct video register access.
  207. //
  208. // Information used by this function is passed using the following structure:
  209. //
  210. typedef struct _VIDEO_VDM {
  211. HANDLE ProcessHandle;
  212. } VIDEO_VDM, *PVIDEO_VDM;
  213. //
  214. //ProcessHandle - Handle to the process for which this request must be
  215. // performed. This is required because the console calls the miniport on
  216. // the behalf of the VDM process; we are not performing this request in
  217. // the context of the current caller.
  218. //
  219. typedef struct _VIDEO_REGISTER_VDM {
  220. ULONG MinimumStateSize;
  221. } VIDEO_REGISTER_VDM, *PVIDEO_REGISTER_VDM;
  222. //
  223. //MinimumStateSize - Output value determining the minimum size required to
  224. // store the video hardware state when performing SAVE_HARDWARE_SATE or
  225. // RESTORE_HARDWARE_STATE Ioctls.
  226. //
  227. //
  228. // Second set of structures
  229. //
  230. //
  231. // These IOCTLs are used by the VDM and the console to communicate state
  232. // changes between the VDM and the kernel video driver.
  233. //
  234. // IOCTL_VIDEO_SAVE_HARDWARE_STATE -
  235. // IOCTL_VIDEO_RESTORE_HARDWARE_STATE -
  236. //
  237. //
  238. // This structure is at the start of the block used when saving or restoring
  239. // the state of the video hardware using ConsoleHardwareState().
  240. // the ULONG are offset to the location of the rest of the data. That data
  241. // is stored within the same memory block pointed to by the
  242. // VIDEO_HARDWARE_STATE structure, right after this header.
  243. //
  244. // Information used by this function is passed using the following structure:
  245. //
  246. typedef struct _VIDEO_HARDWARE_STATE_HEADER {
  247. ULONG Length;
  248. UCHAR PortValue[0x30];
  249. ULONG AttribIndexDataState;
  250. ULONG BasicSequencerOffset;
  251. ULONG BasicCrtContOffset;
  252. ULONG BasicGraphContOffset;
  253. ULONG BasicAttribContOffset;
  254. ULONG BasicDacOffset;
  255. ULONG BasicLatchesOffset;
  256. ULONG ExtendedSequencerOffset;
  257. ULONG ExtendedCrtContOffset;
  258. ULONG ExtendedGraphContOffset;
  259. ULONG ExtendedAttribContOffset;
  260. ULONG ExtendedDacOffset;
  261. ULONG ExtendedValidatorStateOffset;
  262. ULONG ExtendedMiscDataOffset;
  263. ULONG PlaneLength;
  264. ULONG Plane1Offset;
  265. ULONG Plane2Offset;
  266. ULONG Plane3Offset;
  267. ULONG Plane4Offset;
  268. ULONG VGAStateFlags;
  269. ULONG DIBOffset;
  270. ULONG DIBBitsPerPixel;
  271. ULONG DIBXResolution;
  272. ULONG DIBYResolution;
  273. ULONG DIBXlatOffset;
  274. ULONG DIBXlatLength;
  275. } VIDEO_HARDWARE_STATE_HEADER, *PVIDEO_HARDWARE_STATE_HEADER;
  276. //
  277. // defines for VGAStateFlags
  278. //
  279. #define VIDEO_STATE_NON_STANDARD_VGA 0x00000001
  280. #define VIDEO_STATE_UNEMULATED_VGA_STATE 0x00000002
  281. #define VIDEO_STATE_PACKED_CHAIN4_MODE 0x00000004
  282. typedef struct _VIDEO_HARDWARE_STATE {
  283. PVIDEO_HARDWARE_STATE_HEADER StateHeader;
  284. ULONG StateLength;
  285. } VIDEO_HARDWARE_STATE, *PVIDEO_HARDWARE_STATE;
  286. //
  287. //Length - Length of the basic structure. Used for versioning purposes. The
  288. // length field should be initialized to be equal to
  289. // sizeof(VIDEO_HARDWARE_STATE_HEADER).
  290. //
  291. //PortValue - Array of entries containing the data values for port 3B0 through
  292. // 3DF.
  293. //
  294. //AttribIndexDataState - State of the attribute index register.
  295. //
  296. //BasicSequencerOffset - Offset, in bytes, from the beginning of the structure,
  297. // to an array of fields containing the register values for the basic
  298. // sequencer register set of the VGA.
  299. //
  300. //BasicCrtContOffset - Offset, in bytes, from the beginning of the structure,
  301. // to an array of fields containing the register values for the basic
  302. // CRT register set of the VGA.
  303. //
  304. //BasicGraphContOffset - Offset, in bytes, from the beginning of the structure,
  305. // to an array of fields containing the register values for the basic
  306. // graphics controller register set of the VGA.
  307. //
  308. //BasicAttribContOffset - Offset, in bytes, from the beginning of the structure,
  309. // to an array of fields containing the register values for the basic
  310. // attribute controller register set of the VGA.
  311. //
  312. //BasicDacOffset - Offset, in bytes, from the beginning of the structure,
  313. // to an array of fields containing the register values for the basic
  314. // DAC registers of the VGA.
  315. //
  316. //BasicLatchesOffset - Offset, in bytes, from the beginning of the structure,
  317. // to an array of fields containing the register values for the basic
  318. // latches of the VGA.
  319. //
  320. //ExtendedSequencerOffset - Offset, in bytes, from the beginning of the structure,
  321. // to an array of fields containing the registers values for the extended
  322. // sequencer register set of the VGA.
  323. //
  324. //ExtendedCrtContOffset - Offset, in bytes, from the beginning of the structure,
  325. // to an array of fields containing the registers values for the extended
  326. // CRT register set of the VGA.
  327. //
  328. //ExtendedGraphContOffset - Offset, in bytes, from the beginning of the structure,
  329. // to an array of fields containing the registers values for the extended
  330. // graphics controller register set of the VGA.
  331. //
  332. //ExtendedAttribContOffset - Offset, in bytes, from the beginning of the structure,
  333. // to an array of fields containing the registers values for the extended
  334. // attribute controller register set of the VGA.
  335. //
  336. //ExtendedDacOffset - Offset, in bytes, from the beginning of the structure,
  337. // to an array of fields containing the registers values for the extended
  338. // DAC registers of the VGA.
  339. //
  340. //ExtendedValidatorStateOffset - Offset, in bytes, from the beginning of the
  341. // structure, to an area reserved for the miniport to put the unemulated
  342. // save state that the miniport uses to perform instruction validation for
  343. // DOS apps.
  344. //
  345. //ExtendedMiscDataOffset - Offset, in bytes, from the beginning of the structure,
  346. // to an area reserved for the use of the miniport.
  347. //
  348. //PlaneLength - Length of each of the following plane (if present)
  349. //
  350. //Plane1Offset - Offset, in bytes, from the beginning of the structure, to an
  351. // array of fields containing the data of the first plane of video memory.
  352. //
  353. //Plane2Offset - Offset, in bytes, from the beginning of the structure, to an
  354. // array of fields containing the data of the second plane of video memory.
  355. //
  356. //Plane3Offset - Offset, in bytes, from the beginning of the structure, to an
  357. // array of fields containing the data of the third plane of video memory.
  358. //
  359. //Plane4Offset - Offset, in bytes, from the beginning of the structure, to an
  360. // array of fields containing the data of the fourth plane of video memory.
  361. //
  362. //VGAStateFlags - Flags used for the interpretation of the VGA state.
  363. // VIDEO_STATE_NON_STANDARD_VGA is set when the set of registers the VGA
  364. // returns is not the basic set (all super vga's are not standard).
  365. // The VDM should not emulate the saved state unless a specific VDD
  366. // has been written for the device.
  367. // VIDEO_STATE_UNEMULATED_VGA_STATE specified the miniport has stored
  368. // informaiton in the ExtendedValidatorState field and the miniport
  369. // should treat this as a frozen state, whatever the registers say.
  370. // VIDEO_STATE_PACKED_CHAIN4_MODE indicates that in mode 13 (320x200x256).
  371. // the data is stored in a packed pixel format in the plane, as
  372. // opposed to the standard VGA format where the data is interleaved
  373. // at every four bytes, and on every 16K boundary, offset by one
  374. // extra byte.
  375. //
  376. //DIBOffset - Offset to the location of the DIB in the allocated data
  377. // structure. If NULL, no translation is available.
  378. //
  379. //DIBBitsPerPixel - Format of the DIB.
  380. //
  381. //DIBXResolution - Width of the DIB in pixels.
  382. //
  383. //DIBYResolution - Height of the DIB in pixels.
  384. //
  385. //DIBXlatOffset - Offset to the location of the translation vector
  386. // from DIB pixel values to 32-bit RGB (1 byte red, 1 byte green, 1 byte
  387. // blue, 1 byte empty). Maximum length 256. If NULL, the standard
  388. // VGA palette stored in this structure should be used.
  389. //
  390. //DIBXlatLength - Length of the RGB translation vector at DIBXlatOffset.
  391. //
  392. // For each of the offset fields, if an offset value is NULL, then there is
  393. // no data for that offset.
  394. // The length of a data area is:
  395. // 1) the specific length given to it : plane length (planes) or XResolution *
  396. // Yresolution * BitsPerPel (DIB)
  397. // 2) otherwise, the length = next_non-null_offset_value -
  398. // current_offset_value
  399. //
  400. //
  401. //StateHeader - Pointer to the VIDEO_HARDWARE_STATE_HEADER structure.
  402. //
  403. //StateLength - Size of the VIDEO_HARDWARE_STATE_HEADER structure.
  404. //
  405. //
  406. // IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES - Returns number of different modes
  407. // available on the controller.
  408. //
  409. // Information used by this function is passed using the following structure:
  410. //
  411. typedef struct _VIDEO_NUM_MODES {
  412. ULONG NumModes;
  413. ULONG ModeInformationLength;
  414. } VIDEO_NUM_MODES, *PVIDEO_NUM_MODES;
  415. //
  416. //NumModes - Returns the number of modes supported by the kernel driver.
  417. //
  418. //ModeInformationLength - Length of the VIDEO_MODE_INFORMATION structure
  419. // for the IOCTL_VIDEO QUERY_AVAILABLE_MODES IOCTL.
  420. //
  421. // IOCTL_VIDEO_SET_CURRENT_MODE - Is used to set the mode of the controller.
  422. //
  423. // Information used by this function is passed using the following structure:
  424. //
  425. typedef struct _VIDEO_MODE {
  426. ULONG RequestedMode;
  427. } VIDEO_MODE, *PVIDEO_MODE;
  428. #define VIDEO_MODE_NO_ZERO_MEMORY 0x80000000 // High order bit of the mode
  429. // determines if the set mode
  430. // should (0) or should not (1)
  431. // cause the video memory to be
  432. // zeroed out simultaneously to
  433. // the set mode operation.
  434. #define VIDEO_MODE_MAP_MEM_LINEAR 0x40000000 // Miniports which support this
  435. // flag will set a linear mode
  436. // if possible when this flag
  437. // is set. Note: Some miniports
  438. // may return a linear mode even
  439. // if this flag is not set.
  440. //
  441. //RequestedMode - Indicates in which mode the adapter should be initialized.
  442. //
  443. //
  444. // IOCTL_VIDEO_RESET_DEVICE - Is used to reset the mode of the adapter when GDI
  445. // gives up control of the device to allow a VDM to
  446. // access the hardware. x86 only.
  447. // The default mode should be whatever is the
  448. // default mode when the machine is booted
  449. //
  450. // No information is needed fo this function.
  451. //
  452. //
  453. // IOCTL_VIDEO_QUERY_AVAIL_MODES - Returns information about each available
  454. // mode on the controller.
  455. //
  456. // IOCTL_VIDEO_QUERY_CURRENT_MODE - Returns the information for the current
  457. // controller mode.
  458. //
  459. // Information used by this function is passed using the following structure:
  460. //
  461. // NOTE This structure is matched exactly with the DISP_MODE structure
  462. // in winddi.h - every change to this structure MUST be made to the
  463. // structure in winddi.h.
  464. //
  465. typedef struct _VIDEO_MODE_INFORMATION {
  466. ULONG Length;
  467. ULONG ModeIndex;
  468. ULONG VisScreenWidth;
  469. ULONG VisScreenHeight;
  470. ULONG ScreenStride;
  471. ULONG NumberOfPlanes;
  472. ULONG BitsPerPlane;
  473. ULONG Frequency;
  474. ULONG XMillimeter;
  475. ULONG YMillimeter;
  476. ULONG NumberRedBits;
  477. ULONG NumberGreenBits;
  478. ULONG NumberBlueBits;
  479. ULONG RedMask;
  480. ULONG GreenMask;
  481. ULONG BlueMask;
  482. ULONG AttributeFlags;
  483. ULONG VideoMemoryBitmapWidth;
  484. ULONG VideoMemoryBitmapHeight;
  485. ULONG DriverSpecificAttributeFlags;
  486. } VIDEO_MODE_INFORMATION, *PVIDEO_MODE_INFORMATION;
  487. //
  488. // Bit definitions for Attribute Flags
  489. //
  490. #define VIDEO_MODE_COLOR 0x0001 // 0 = Mono-compatible, 1 = Color
  491. #define VIDEO_MODE_GRAPHICS 0x0002 // 0 = Text mode, 1 = Graphics
  492. #define VIDEO_MODE_PALETTE_DRIVEN 0x0004 // 0 = Colors are direct
  493. // 1 = Colors are index to a palette
  494. #define VIDEO_MODE_MANAGED_PALETTE 0x0008 // 0 = Palette is fixed (must be
  495. // queried from miniport
  496. // 1 = Palette is settable.
  497. #define VIDEO_MODE_INTERLACED 0x0010 // 1 = Mode is interlaced
  498. // 0 = non-interlaced
  499. #define VIDEO_MODE_NO_OFF_SCREEN 0x0020 // 1 = Offscreen memory CAN NOT be
  500. // used to store information.
  501. // 0 = Offscreen memory is available
  502. #define VIDEO_MODE_NO_64_BIT_ACCESS 0x0040 // 1 = 64 bit memory writes to frame
  503. // buffer are not handled properly.
  504. // 0 = 64 bit memory writes to frame
  505. // buffer are handled properly.
  506. //
  507. //Length - Length of the structure in bytes. Also used to do verisioning.
  508. //
  509. //ModeIndex - Number used to set this mode when calling the miniport driver.
  510. //
  511. //VisScreenWidth - Number of visible horizontal pixels on a scan line
  512. //
  513. //VisScreenHeight - Number of visible lines (or scan lines)
  514. //
  515. //ScreenStride - Delta, in *BYTES*, between the start of two scan lines.
  516. //
  517. // NOTE: the width and height are in pixels, but the stride is in bytes !!!
  518. //
  519. //NumberOfPlanes - Number of separate planes combined by the device.
  520. //
  521. //BitsPerPlane - Number of bits per pixel on a plane.
  522. //
  523. //Frequency - Screen Frequency, in Hertz.
  524. //
  525. //XMillimeter - Size of the horizontal active region on the output device,
  526. // in millimeters.
  527. //
  528. //YMillimeter - Size of the vertical active region on the output device,
  529. // in millimeters.
  530. //
  531. //NumberRedBits - Number of bits in the red DAC.
  532. //
  533. //NumberGreenBits - Number of bits in the green DAC.
  534. //
  535. //NumberBlueBits - Number of bits in the blue DAC.
  536. //
  537. //RedMask - Red color Mask for device with direct color modes. Bits turned
  538. // on indicate the bit is of color Red.
  539. //
  540. //GreenMask - Green color Mask for device with direct color modes. Bits
  541. // turned on indicate the bit is of color Green.
  542. //
  543. //BlueMask - Blue color Mask for device with direct color modes. Bits
  544. // turned on indicate the bit is of color Blue.
  545. //
  546. //AttributeFlags. Flags indicating certain behavior for the device.
  547. //
  548. //VideoMemoryBitmapWidth - Width of the video memory bitmap.
  549. // VisScreenWidth <= VideoMemoryBitmapWidth <= ScreenStride
  550. //
  551. //VideoMemoryBitmapHeight - Height of the video memory bitmap.
  552. // VisScreenHeight <= VideoMemoryBitmapHeight = VideoRamLength / ScreenStride
  553. //
  554. //DriverSpecificAttributeFlags - Flags indicating certain behavior for the
  555. // device that are private to the miniport\display driver.
  556. //
  557. //
  558. // IOCTL_VIDEO_LOAD_AND_SET_FONT - Is used to load a user-defined font.
  559. //
  560. // Information used by this function is passed using the following structure:
  561. //
  562. typedef struct _VIDEO_LOAD_FONT_INFORMATION {
  563. USHORT WidthInPixels;
  564. USHORT HeightInPixels;
  565. ULONG FontSize;
  566. UCHAR Font[1];
  567. } VIDEO_LOAD_FONT_INFORMATION, *PVIDEO_LOAD_FONT_INFORMATION;
  568. //
  569. //WidthInPixels - Width of the characters in the font, in pixels.
  570. //
  571. //HeigthInPixels - Heigth of the characters in the font, in pixels.
  572. //
  573. //FontSize - Size of the font buffer being passed in, in bytes.
  574. //
  575. //Font - Start of the font buffer.
  576. //
  577. //
  578. // IOCTL_VIDEO_SET_PALETTE_REGISTERS - Takes buffer containing
  579. // VIDEO_PALETTE_DATA where Colors[]
  580. // specifies the array containing the
  581. // color values for the palette registers.
  582. //
  583. // Information used by this function is passed using the following structure:
  584. //
  585. // NOTE: This should only be used by the VGA type drivers
  586. //
  587. typedef struct _VIDEO_PALETTE_DATA {
  588. USHORT NumEntries;
  589. USHORT FirstEntry;
  590. USHORT Colors[1];
  591. } VIDEO_PALETTE_DATA, *PVIDEO_PALETTE_DATA;
  592. //
  593. //NumEntries - Number of entries in the array of color values.
  594. //
  595. //FirstEntry - Location in the device palette to which the first entry in the
  596. // list of colors should be copied to. The other entries in the color list
  597. // should be copied sequentially, from this starting point into the device's
  598. // palette.
  599. //
  600. //Colors - Array of color entries to copy into the device's color palette.
  601. //
  602. //
  603. // IOCTL_VIDEO_SET_COLOR_REGISTERS - Takes buffer containing VIDEO_CLUT.
  604. //
  605. // Information used by this function is passed using the following structure:
  606. //
  607. typedef struct _VIDEO_CLUTDATA {
  608. UCHAR Red;
  609. UCHAR Green;
  610. UCHAR Blue;
  611. UCHAR Unused;
  612. } VIDEO_CLUTDATA, *PVIDEO_CLUTDATA;
  613. //
  614. //Red - Bits to be put in the Red portion of the color registers.
  615. //
  616. //Green - Bits to be put in the Green portion of the color registers.
  617. //
  618. //Blue - Bits to be put in the Blue portion of the color registers.
  619. //
  620. typedef struct {
  621. USHORT NumEntries;
  622. USHORT FirstEntry;
  623. union {
  624. VIDEO_CLUTDATA RgbArray;
  625. ULONG RgbLong;
  626. } LookupTable[1];
  627. } VIDEO_CLUT, *PVIDEO_CLUT;
  628. //
  629. //NumEntries - Number of entries in the LookupTable of color values.
  630. //
  631. //FirstEntry - Location in the device palette to which the first entry in the
  632. // LookupTable of colors should be copied to. The other entries in the
  633. // LookupTable should be copied sequentially, from this starting point into
  634. // the device's palette.
  635. //
  636. //LookupTable - Array of color entries to copy into the device's color
  637. // registers/palette. The color entries can be accessed as a genric 32 bit
  638. // value or as Red/Green/Blue/Unused fields.
  639. //
  640. //
  641. // NOTE: Cursor vs. Pointer:
  642. // A cursor is a rectangular set of pixels which are used to indicate the
  643. // location of input coming from the keyboard.
  644. //
  645. // A pointer is the set of pixels that are used to paint the shape
  646. // associated with the mouse.
  647. //
  648. //
  649. // IOCTL_VIDEO_QUERY_CURSOR_POSITION - Returns the location of the cursor on
  650. // the screen.
  651. //
  652. // IOCTL_VIDEO_SET_CURSOR_POSITION - Is used to set the location of the
  653. // cursor on the screen.
  654. //
  655. // Information used by this function is passed using the following structure:
  656. //
  657. typedef struct _VIDEO_CURSOR_POSITION {
  658. SHORT Column;
  659. SHORT Row;
  660. } VIDEO_CURSOR_POSITION, *PVIDEO_CURSOR_POSITION;
  661. //
  662. //Column - Column on which the cursor is located from the top left, in pixels.
  663. //
  664. //Row - Row on which the cusor is located from the top left, in pixels.
  665. //
  666. //
  667. // IOCTL_VIDEO_QUERY_CURSOR_ATTR - Returns all attributes of the cursor.
  668. //
  669. // IOCTL_VIDEO_SET_CURSOR_ATTR - Is used to set the attributes of the cursor.
  670. //
  671. // Information used by this function is passed using the following structure:
  672. //
  673. //
  674. // For the VGA:
  675. // TopScanLine will be stored in the height when an IOCTL is made
  676. // BottomScanLine will be stored in the width when an IOCTL is made
  677. //
  678. typedef struct _VIDEO_CURSOR_ATTRIBUTES {
  679. USHORT Width;
  680. USHORT Height;
  681. SHORT Column;
  682. SHORT Row;
  683. UCHAR Rate;
  684. UCHAR Enable;
  685. } VIDEO_CURSOR_ATTRIBUTES, *PVIDEO_CURSOR_ATTRIBUTES;
  686. //
  687. //Width - Width of the cursor, in pixels.
  688. //
  689. //Height - Height of the cursor, in scans.
  690. //
  691. //Column - Column on which the cursor is located from the top left, in pixels.
  692. //
  693. //Row - Row on which the cusor is located from the top left, in pixels.
  694. //
  695. //Rate - Rate at which the cursor whould flash.
  696. //
  697. //Enable - Non-zero to display cursor, 0 not to display.
  698. //
  699. //
  700. // IOCTL_VIDEO_QUERY_POINTER_POSITION - Returns the location of the pointer
  701. // on the screen
  702. //
  703. // IOCTL_VIDEO_SET_POINTER_POSITION - Is used to set the location of the
  704. // pointer on the screen.
  705. //
  706. // Information used by this function is passed using the following structure:
  707. //
  708. typedef struct _VIDEO_POINTER_POSITION {
  709. SHORT Column;
  710. SHORT Row;
  711. } VIDEO_POINTER_POSITION, *PVIDEO_POINTER_POSITION;
  712. //
  713. //Column - Column on which the cursor is located from the top left, in pixels.
  714. //
  715. //Row - Row on which the cusor is located from the top left, in pixels.
  716. //
  717. //
  718. // IOCTL_VIDEO_QUERY_POINTER_ATTR - Returns all attributes of the pointer.
  719. //
  720. // IOCTL_VIDEO_SET_POINTER_ATTR - Is used to set the attributes of the
  721. // pointer.
  722. //
  723. // Information used by this function is passed using the following structure:
  724. //
  725. typedef struct _VIDEO_POINTER_ATTRIBUTES {
  726. ULONG Flags;
  727. ULONG Width;
  728. ULONG Height;
  729. ULONG WidthInBytes;
  730. ULONG Enable;
  731. SHORT Column;
  732. SHORT Row;
  733. UCHAR Pixels[1];
  734. } VIDEO_POINTER_ATTRIBUTES, *PVIDEO_POINTER_ATTRIBUTES;
  735. //
  736. //Flags - color or mono pointer, same as for query pointer capabilities.
  737. //
  738. //Width - Width of the pointer, in pixels.
  739. //
  740. //Height - Height of the pointer, in scans.
  741. //
  742. //WidthInBytes - Width of the pointer, in bytes.
  743. //
  744. //Enable - Non-zero to display pointer, 0 not to display.
  745. //
  746. //Column - Column on which the cursor is located from the top left, in pixels.
  747. //
  748. //Row - Row on which the cusor is located from the top left, in pixels.
  749. //
  750. //Pixels - Start of pointer data, in device-compatible DIB format.
  751. // (Mask data is always in 1-bpp DIB format.)
  752. //
  753. //
  754. // IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES - Returns capabilities of miniport
  755. // hardware cursor
  756. //
  757. typedef struct _VIDEO_POINTER_CAPABILITIES {
  758. ULONG Flags;
  759. ULONG MaxWidth;
  760. ULONG MaxHeight;
  761. ULONG HWPtrBitmapStart;
  762. ULONG HWPtrBitmapEnd;
  763. } VIDEO_POINTER_CAPABILITIES, *PVIDEO_POINTER_CAPABILITIES;
  764. //
  765. // Flag bit definitions
  766. //
  767. #define VIDEO_MODE_ASYNC_POINTER 0x01 // 1 if the cursor can be updated
  768. // asynchronously to drawing operations.
  769. #define VIDEO_MODE_MONO_POINTER 0x02 // 1 if a monochrome hardware pointer
  770. // is supported.
  771. #define VIDEO_MODE_COLOR_POINTER 0x04 // 1 if a color hardware pointer is
  772. // supported.
  773. #define VIDEO_MODE_ANIMATE_START 0x08 // The pointer being passed down has
  774. #define VIDEO_MODE_ANIMATE_UPDATE 0x10 // the same hotspot as the previous
  775. // pointer
  776. //
  777. //MaxWidth - Widest pointer bitmap the miniport should be requested to load
  778. // for either monochrome or color pointer.
  779. //
  780. //MaxHeight - widest pointer bitmap the miniport should be requested to load
  781. // for either monochrome color pointer handled.
  782. //
  783. //HWPtrBitmapStart = first offset in bitmap of memory used to store hardware
  784. // pointer bitmap, in CPU-addressable units (-1 if not applicable). For
  785. // planar modes (like VGA mode 12h), this is a planar offset; for linear
  786. // modes (like VGA mode 13h), this is a linear offset. The CPU-addressable
  787. // translation in HC planar mode is assumed to be linearaddress/4,
  788. // because there are four planes at each address.
  789. //
  790. //HWPtrBitmapEnd = last offset in bitmap of memory used to store hardware
  791. // pointer bitmap (-1 if not applicable).
  792. //
  793. // Note: Miniport has options to reject any call to set a pointer.
  794. //
  795. //
  796. // IOCTL_VIDEO_GET_BANK_SELECT_CODE - Called by the Windows display driver
  797. // to get a block of executable code used
  798. // to perform bank-switching in high
  799. // resolution SVGA drivers.
  800. //
  801. // Gets information needed to implement banking control for a selected mode.
  802. //
  803. // Information used by this function is passed using the following structures:
  804. //
  805. //
  806. // The input from the caller in the input buffer is a VIDEO_MODE structure, as
  807. // described under IOCTL_VIDEO_SET_CURRENT_MODE.
  808. //
  809. // RequestedMode - mode index for which banking information is desired.
  810. //
  811. //
  812. // Returned in output buffer.
  813. //
  814. typedef struct _VIDEO_BANK_SELECT {
  815. ULONG Length;
  816. ULONG Size;
  817. ULONG BankingFlags;
  818. ULONG BankingType;
  819. ULONG PlanarHCBankingType;
  820. ULONG BitmapWidthInBytes;
  821. ULONG BitmapSize;
  822. ULONG Granularity;
  823. ULONG PlanarHCGranularity;
  824. ULONG CodeOffset;
  825. ULONG PlanarHCBankCodeOffset;
  826. ULONG PlanarHCEnableCodeOffset;
  827. ULONG PlanarHCDisableCodeOffset;
  828. } VIDEO_BANK_SELECT, *PVIDEO_BANK_SELECT;
  829. //
  830. // Stored in the BankType and PlanarHCBankintType fields
  831. //
  832. typedef enum _VIDEO_BANK_TYPE {
  833. VideoNotBanked = 0,
  834. VideoBanked1RW,
  835. VideoBanked1R1W,
  836. VideoBanked2RW,
  837. NumVideoBankTypes
  838. } VIDEO_BANK_TYPE, *PVIDEO_BANK_TYPE;
  839. //
  840. // Defines for BankingFlags.
  841. //
  842. #define PLANAR_HC 0x00000001
  843. //
  844. //Note: planar high-color ("planar HC") mode is a special 8-bpp-and-up
  845. // CPU addressing mode in which four bytes can be accessed at
  846. // once by using the VGA's planar hardware. This mode is enabled
  847. // by turning off the Chain4 bit (bit 3 in Sequence Controller
  848. // register 4), so it is also known as non-Chain4 mode. Planar HC
  849. // mode can greatly accelerate operations such as solid fills,
  850. // some pattern fills, and some blits.
  851. //
  852. //Note: the term "CPU-addressable bytes" means offsets measured
  853. // in bytes as accessed by the CPU. In 16-color modes, this
  854. // merely means "measured in bytes" rather than "measured in
  855. // pixels," where each byte contains 8 pixels, as usual.
  856. // In normal high-color modes, "CPU-addressable bytes"
  857. // is exactly what you'd expect; it's the number of pixels in 256
  858. // color modes, pixels*2 in 16-bpp modes, and so on. However, in
  859. // planar HC modes, there are four display memory bytes at every CPU-
  860. // addressable byte, because four planes are at each address, so
  861. // in 256 color modes the number of CPU-addressable bytes is
  862. // pixels/4, in 16-bpp modes CPU-addressable bytes = pixels/2, and
  863. // so on. Basically, "CPU-addressable bytes" just means the
  864. // offsets the CPU needs to address banks properly in the
  865. // specified mode.
  866. //
  867. //Note: the start address must be set to 0 (displayed pixels must
  868. // start at offset 0 in display memory), and the banking windows
  869. // must fit within the 64K area starting at A000:0; no 128K
  870. // mappings, please, because there may be a monochrome adapter
  871. // in the system.
  872. //
  873. //Length - Length of the basic structure. Used for versioning by checking the
  874. // Length of the struct is at least as large as the value given by sizeof().
  875. //
  876. //Size - number of bytes required to hold all banking information for
  877. // this mode, including the VIDEO_BANK_SELECT structure and all
  878. // bank-switch code. This is the size of the buffer that
  879. // VgaGetBankSelectCode requires in order properly to return info.
  880. //
  881. //BankingFlags - indicate the type of banking supported in this mode.
  882. // PLANAR_HC - if set, indicates that planar high-color (HC) mode
  883. // (non-Chain4 8-, 15-, 16-, 24-, and 32-bpp) is supported.
  884. // If this bit is set, the following fields must be filled in:
  885. // PlanarHCGranularity, pPlanarHCBankCode,
  886. // pPlanarHCEnableCode, pPlanarHCDisableCode.
  887. // This bit is ignored by the 16-color driver, as are the
  888. // associated fields.
  889. //
  890. //BankingType - These are the banking types supported by the adapter
  891. // when it is ina standard mode.
  892. //
  893. // VideoNotBanked - this mode does not support or require banking.
  894. // VideoBanked1RW - this mode supports a single RW (readable and
  895. // writable) banking window. The window is assumed to be
  896. // 64K in size.
  897. // VideoBanked1R1W - this mode supports a single window, but the
  898. // window can be mapped to different areas of display memory
  899. // for reads and for writes. The window is assumed to be
  900. // 64K in size.
  901. // VideoBanked2RW - this mode supports two independently mappable
  902. // banking windows, each RW. Each window is assumed to be
  903. // 32K in size. The second window is assumed
  904. // to start immediately after the end of the first, at
  905. // A000:8000.
  906. //
  907. //PlanarHCBankingType - These are the banking types supported by the
  908. // adapter when it is in a PLANAR HC mode.
  909. //
  910. // See BankingType for defintions of each banking type.
  911. //
  912. //
  913. //BitmapWidthInBytes - distance from start of one scan line to start
  914. // of next, counted in CPU-addressable bytes (not pixels). The
  915. // CPU-addressable distance from one scan line to the next is
  916. // assumed to be BitmapWidthInBytes/4 in planar HC modes, because
  917. // there are four planes at each address.
  918. //
  919. //BitmapSize - size of display memory in CPU-addressable bytes (for
  920. // example, 256K on a 1 Mb SVGA in 16-color mode, because there
  921. // are four bytes at each address). The CPU-addressable bitmap
  922. // size is assumed to be BitmapSize/4 in planar HC modes, because
  923. // there are four planes at each address.
  924. //
  925. //Granularity - granularity with which display memory may be mapped
  926. // into a banking window. (That is, resolution with which the
  927. // display memory address mapped to the start of a window may be
  928. // set; anywhere from 1K to 64K, depending on the adapter. If
  929. // Granularity < window size (either 64K or 32K), then adjacent
  930. // banks can overlap, and broken rasters can always be avoided.
  931. // If Granularity == window size, then banks are disjoint, and
  932. // display memory is basically segmented into banks.) Granularity
  933. // is measured in CPU-addressable bytes.
  934. //
  935. //PlanarHCGranularity - granularity with which display memory may be
  936. // mapped into a banking window in planar HC mode.
  937. // PlanarHCGranularity is measured in CPU-addressable bytes, and
  938. // is typically but not always Granularity/4. Ignored in
  939. // 16-color modes.
  940. //
  941. //CodeOffset - base of the code section in the structure.
  942. //
  943. //PlanarHCBankCodeOffset - offset from Code of executable code
  944. // that performs planar HC mode bank switching. Ignored in
  945. // 16-color modes.
  946. //
  947. //PlanarHCEnableCodeOffset - offset from Code of executable code
  948. // that enables planar HC mode. Ignored in 16-color modes.
  949. //
  950. //PlanarHCDisableCodeOffset - offset from Code of executable code
  951. // that disables planar HC mode. Ignored in 16-color modes.
  952. //
  953. //Specification for bank switch code at Code:
  954. // Executes requested bank mappings.
  955. //
  956. // Input:
  957. // EAX = bank number to which to map window #0
  958. // EDX = bank number to which to map window #1
  959. // interpreted according to BankingType as follows:
  960. // VideoBanked1RW - the single window is mapped to bank EAX,
  961. // EBX is ignored.
  962. // VideoBanked1RW - the read window is mapped to bank EAX,
  963. // the write window is mapped to bank EBX
  964. // VideoBanked1R1W - the window at A000:0 is mapped to bank EAX,
  965. // the window at A800:0 is mapped to bank EBX
  966. //
  967. // Output: none
  968. //
  969. // Note: the definition of "bank n" is the bank that starts at
  970. // display memory offset Granularity*n. In other words,
  971. // banks are assumed to start every Granularity CPU-addressable
  972. // bytes, and are numbered from 0 to number of banks-1.
  973. //
  974. //Specification for planar HC executable code:
  975. // ***To be filled in when we get to planar HC modes***
  976. //
  977. //
  978. // IOCTL_VIDEO_MAP_VIDEO_MEMORY - Maps the frame buffer into the callers
  979. // address space.
  980. // IOCTL_VIDEO_UNMAP_VIDEO_MEMORY - Unmaps the frame buffer from the callers
  981. // address space.
  982. //
  983. // Information used by this function is passed using the following structure:
  984. //
  985. typedef struct _VIDEO_MEMORY {
  986. PVOID RequestedVirtualAddress;
  987. } VIDEO_MEMORY, *PVIDEO_MEMORY;
  988. //
  989. //RequestedVirtualAddress - For MAP: Requested virtual address for the video
  990. // memory. This value is optional. If zero is specified, the operating
  991. // system will choose an appropriate location. For UNMAP: Virtual Address
  992. // of the base of video memory. The size is implicit since it can not
  993. // change (you can not add video memory dynamically!).
  994. //
  995. // IOCTL_VIDEO_SHARE_VIDEO_MEMORY - Maps the frame buffer to another process'
  996. // address space. This IOCTL is initally
  997. // defined to support DCI.
  998. // IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY - Unmaps a previously shared buffer.
  999. //
  1000. // Note: for the MAP_VIDEO_MEMORY_IOCTL, the process handle is passed in
  1001. // the VirtualAddress filed, while for this IOCTL the handle is explicit.
  1002. //
  1003. typedef struct _VIDEO_SHARE_MEMORY {
  1004. HANDLE ProcessHandle;
  1005. ULONG ViewOffset;
  1006. ULONG ViewSize;
  1007. PVOID RequestedVirtualAddress;
  1008. } VIDEO_SHARE_MEMORY, *PVIDEO_SHARE_MEMORY;
  1009. typedef struct _VIDEO_SHARE_MEMORY_INFORMATION {
  1010. ULONG SharedViewOffset;
  1011. ULONG SharedViewSize;
  1012. PVOID VirtualAddress;
  1013. } VIDEO_SHARE_MEMORY_INFORMATION, *PVIDEO_SHARE_MEMORY_INFORMATION;
  1014. //
  1015. // IOCTL_VIDEO_MAP_VIDEO_MEMORY - Returns the virtual address and size of
  1016. // the frame buffer and video memory in the
  1017. // caller's address space.
  1018. // This IOCTL must be called after a call
  1019. // to the MAP IOCTL has been made.
  1020. //
  1021. typedef struct _VIDEO_MEMORY_INFORMATION {
  1022. PVOID VideoRamBase;
  1023. ULONG VideoRamLength;
  1024. PVOID FrameBufferBase;
  1025. ULONG FrameBufferLength;
  1026. } VIDEO_MEMORY_INFORMATION, *PVIDEO_MEMORY_INFORMATION;
  1027. //
  1028. //VideoRamBase - Virtual address of the Video RAM in the callers address space
  1029. // (only valid if the memory is mapped.
  1030. //
  1031. //VideoRamLength - Linear length of the Video RAM in the caller's virtual
  1032. // address space (memory accessible through a bank switch mechanism is not
  1033. // described by this value).
  1034. // This value must be equal to VideoMemoryBitmapHeight * ScreenStride
  1035. //
  1036. //FrameBufferBase - Virtual address of the Frame Buffer in the caller's
  1037. // address space. The Frame buffer is the actively displayed part of Video
  1038. // Ram.
  1039. //
  1040. //FrameBufferLength - Linear length of the Frame Buffer in the caller's
  1041. // virtual address space (memory accessible through a bank switch mechanism
  1042. // is not described by this value).
  1043. // This value must be equal to VisScreenWidth * ScreenStride
  1044. //
  1045. //
  1046. // IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES - Returns the access range used to
  1047. // program the hardware directly.
  1048. // An array of these is returned if
  1049. // multiple ranges exist.
  1050. //
  1051. // IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES - Frees up the access ranges that were
  1052. // allocated by the QUERY_ACCESS_RANGES
  1053. // call.
  1054. //
  1055. // Information used by this function is passed using the following structure:
  1056. //
  1057. typedef struct _VIDEO_PUBLIC_ACCESS_RANGES {
  1058. ULONG InIoSpace;
  1059. ULONG MappedInIoSpace;
  1060. PVOID VirtualAddress;
  1061. } VIDEO_PUBLIC_ACCESS_RANGES, *PVIDEO_PUBLIC_ACCESS_RANGES;
  1062. //
  1063. //InIoSpace - Indicates if the hardware registers or ports are in IO space
  1064. // or in memory space.
  1065. //
  1066. //MappedInIoSpace - Indicates if under the current platform the registers or
  1067. // ports are mapped in IO Space or memory space.
  1068. //
  1069. //VirtualAddress - Location of the registers or IO ports as mapped under the
  1070. // current architecture.
  1071. //
  1072. //
  1073. // IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES - Returns the color information
  1074. // found in the monitors VDDPs
  1075. // description file.
  1076. //
  1077. // NOTE: This structure must be filled out completely. A subset of the
  1078. // values can not be returned.
  1079. //
  1080. typedef struct _VIDEO_COLOR_CAPABILITIES {
  1081. ULONG Length;
  1082. ULONG AttributeFlags;
  1083. LONG RedPhosphoreDecay;
  1084. LONG GreenPhosphoreDecay;
  1085. LONG BluePhosphoreDecay;
  1086. LONG WhiteChromaticity_x;
  1087. LONG WhiteChromaticity_y;
  1088. LONG WhiteChromaticity_Y;
  1089. LONG RedChromaticity_x;
  1090. LONG RedChromaticity_y;
  1091. LONG GreenChromaticity_x;
  1092. LONG GreenChromaticity_y;
  1093. LONG BlueChromaticity_x;
  1094. LONG BlueChromaticity_y;
  1095. LONG WhiteGamma;
  1096. LONG RedGamma;
  1097. LONG GreenGamma;
  1098. LONG BlueGamma;
  1099. } VIDEO_COLOR_CAPABILITIES, *PVIDEO_COLOR_CAPABILITIES;
  1100. //
  1101. // Flag Bit definitions
  1102. //
  1103. #define VIDEO_DEVICE_COLOR 0x1 // Is this device support color (1)
  1104. // or monochrome only
  1105. #define VIDEO_OPTIONAL_GAMMET_TABLE 0x2 // Indicates that a gammet table can
  1106. // be queried/set for the device
  1107. // use other IOCTLs for that purpose.
  1108. //
  1109. //Length - Length of the basic structure. Used for versioning by checking the
  1110. // Length of the struct is at least as large as the value given by sizeof().
  1111. //
  1112. //AttributesFlag - List of falgs determining some of the properties of the
  1113. // device.
  1114. //
  1115. //See the VDDP documentation for the details on the various fields
  1116. //
  1117. //RedPhosphoreDecay
  1118. //GreenPhosphoreDecay
  1119. //BluePhosphoreDecay -
  1120. //
  1121. //WhiteChromaticity_x
  1122. //WhiteChromaticity_y
  1123. //WhiteChromaticity_Y -
  1124. //
  1125. //RedChromaticity_x
  1126. //RedChromaticity_y
  1127. //GreenChromaticity_x
  1128. //GreenChromaticity_y
  1129. //BlueChromaticity_x
  1130. //BlueChromaticity_y -
  1131. //
  1132. //WhiteGamma -
  1133. //
  1134. //RedGamma
  1135. //GreenGamma
  1136. //BlueGamma -
  1137. //
  1138. //All values returned in this structure are integers.
  1139. //The values returned must be floating point values * 10,000; i.e:
  1140. //a gamma of 2.34 would be returned as 23400.
  1141. //
  1142. //
  1143. // IOCTL_VIDEO_SET_POWER_MANAGEMENT - Tells the device to change the power
  1144. // consumption level of the device to the
  1145. // new state.
  1146. // IOCTL_VIDEO_GET_POWER_MANAGEMENT - Return the current power consumption
  1147. // level of the device.
  1148. //
  1149. // NOTE:
  1150. // This IOCTL is based on the VESA DPMS proposal.
  1151. // Changes to the DPMS standard will be refelcted in this IOCTL.
  1152. //
  1153. typedef enum _VIDEO_POWER_STATE {
  1154. VideoPowerOn = 1,
  1155. VideoPowerStandBy,
  1156. VideoPowerSuspend,
  1157. VideoPowerOff
  1158. } VIDEO_POWER_STATE, *PVIDEO_POWER_STATE;
  1159. typedef struct _VIDEO_POWER_MANAGEMENT {
  1160. ULONG Length;
  1161. ULONG DPMSVersion;
  1162. ULONG PowerState;
  1163. } VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT;
  1164. //
  1165. //Length - Length of the structure in bytes. Also used to do verisioning.
  1166. //
  1167. //DPMSVersion - Version of the DPMS standard supported by the device.
  1168. // Only used in the "GET" IOCTL.
  1169. //
  1170. //PowerState - One of the power states listed in VIDEO_POWER_STATE.
  1171. //
  1172. //
  1173. // Note:
  1174. // Once the power has been turned off to the device, all other IOCTLs made
  1175. // to the miniport will be intercepted by the port driver and will return
  1176. // failiure, until the power on the device has been turned back on.
  1177. //
  1178.