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.

806 lines
22 KiB

  1. /****************************************************************************
  2. *****************************************************************************
  3. *
  4. * ******************************************
  5. * * Copyright (c) 1995, Cirrus Logic, Inc. *
  6. * * All Rights Reserved *
  7. * ******************************************
  8. *
  9. * PROJECT: Laguna I (CL-GD5462) -
  10. *
  11. * FILE: cirrus.h
  12. *
  13. * AUTHOR: Benny Ng
  14. *
  15. * DESCRIPTION:
  16. * This module contains the definitions for the Cirrus
  17. * Logic Laguna NT miniport driver. (kernel mode only)
  18. * Based on the S3 miniport from NT DDK.
  19. *
  20. * Copyright (c) 1995, 1996 Cirrus Logic, Inc.
  21. *
  22. * MODULES:
  23. *
  24. * REVISION HISTORY:
  25. * 5/30/95 Benny Ng Initial version
  26. *
  27. * $Log: X:/log/laguna/nt35/miniport/cl546x/CIRRUS.H $
  28. *
  29. * Rev 1.46 Apr 20 1998 10:48:56 frido
  30. * Oops. I missed a semi colon.
  31. *
  32. * Rev 1.45 Apr 20 1998 10:47:02 frido
  33. * PDR#11350. Added CLResetHw prototype.
  34. *
  35. * Rev 1.44 Mar 25 1998 10:17:14 frido
  36. * Added CLGetMonitorSyncPolarity function declaration.
  37. *
  38. * Rev 1.43 Mar 25 1998 10:08:40 frido
  39. * Added dwPolarity field to HW_DEVICE_EXTENSION structure.
  40. *
  41. * Rev 1.42 Feb 24 1998 15:10:38 frido
  42. * Added GetDDCInformation for NT 5.0.
  43. *
  44. * Rev 1.41 Feb 18 1998 14:16:28 frido
  45. * PDR#11209. Added status to ReadByte.
  46. *
  47. * Rev 1.40 Jan 22 1998 11:10:18 frido
  48. * Added dwFBMTTRReg variable for Write Combining on i386.
  49. *
  50. * Rev 1.39 Jan 07 1998 10:55:52 frido
  51. * Added fLowRes field.
  52. *
  53. * Rev 1.38 Nov 03 1997 16:46:20 phyang
  54. * Added data and function declarations for USB Fix and better EDID support.
  55. *
  56. * Rev 1.37 Oct 23 1997 15:50:42 phyang
  57. * Moved globals for DDC filter function to HW_DEVICE_EXTENSION.
  58. *
  59. * Rev 1.36 23 Oct 1997 11:18:04 noelv
  60. *
  61. * Added globals for DDC filter function.
  62. *
  63. * Rev 1.35 04 Sep 1997 11:35:04 bennyn
  64. * Extended the register space from 8000h to A000h
  65. *
  66. * Rev 1.34 28 Aug 1997 17:13:08 noelv
  67. * Added Setmode prototype.
  68. *
  69. * Rev 1.33 20 Aug 1997 09:31:36 bennyn
  70. *
  71. * Added automatically detects PnP monitor support
  72. *
  73. * Rev 1.32 13 Aug 1997 11:22:14 noelv
  74. * Added [5465AD] setcion to MODE.INI
  75. *
  76. * Rev 1.31 01 Aug 1997 16:29:56 noelv
  77. * Removed BIOS and VGA from IOCTL_VIDEO_RESET_DEVICE
  78. *
  79. * Rev 1.30 23 Jul 1997 09:12:00 bennyn
  80. *
  81. * Added BIOSVersion into HwDeviceExtension structure
  82. *
  83. * Rev 1.29 21 Jul 1997 13:51:10 bennyn
  84. *
  85. * Added EDID data into HwDeviceExtension structure
  86. *
  87. * Rev 1.28 20 Jun 1997 13:44:02 bennyn
  88. *
  89. * Added power manager data to HW Extension structure
  90. *
  91. * Rev 1.27 30 Apr 1997 16:42:04 noelv
  92. * Moved global SystemIoBusNumber into the device extension, where it belongs.
  93. *
  94. * Rev 1.26 24 Apr 1997 10:09:22 SueS
  95. * Added prototype for CLEnablePCIConfigMMIO.
  96. *
  97. * Rev 1.25 23 Apr 1997 06:58:42 SueS
  98. * Added PCI slot number to HW_DEVICE_EXTENSION structure. Added function
  99. * prototypes for some kernel calls.
  100. *
  101. * Rev 1.24 22 Apr 1997 11:02:02 noelv
  102. *
  103. * Added forward compatible chip ids.
  104. *
  105. * Rev 1.23 04 Apr 1997 14:46:44 noelv
  106. * Removed VL access ranges. REarranged VGA access ranges.
  107. * Changed call to SetMode() to include the new parameter.
  108. *
  109. * Rev 1.22 28 Feb 1997 11:20:44 SueS
  110. * Added structures and defines used in HalGetAdapter call.
  111. *
  112. * Rev 1.21 21 Feb 1997 14:41:32 noelv
  113. * Oops. I swapped the frame buffer and register address spaces by accident.
  114. *
  115. * Rev 1.20 21 Feb 1997 12:53:24 noelv
  116. * AGP and 5465 4meg support
  117. *
  118. * Rev 1.19 21 Jan 1997 11:29:48 noelv
  119. * Added LG_NONE
  120. *
  121. * Rev 1.18 14 Jan 1997 12:31:42 noelv
  122. * Split MODE.INI by chip type
  123. *
  124. * Rev 1.17 14 Nov 1996 15:27:00 noelv
  125. *
  126. * Removed warning for HalAllocCommonBuffer
  127. *
  128. * Rev 1.16 13 Nov 1996 15:24:14 SueS
  129. * Added new include file for use with log file option.
  130. *
  131. * Rev 1.15 13 Nov 1996 08:17:48 noelv
  132. *
  133. * Cleaned up support for 5464 register set.
  134. *
  135. * Rev 1.14 07 Nov 1996 09:40:26 bennyn
  136. * Added device ID for BD and 5465
  137. *
  138. * Rev 1.13 23 Oct 1996 15:59:34 noelv
  139. * Added bus mastering stuff.
  140. *
  141. * Rev 1.12 21 Aug 1996 10:11:46 noelv
  142. * Added defines for chip ids
  143. *
  144. * Rev 1.11 20 Aug 1996 11:26:40 noelv
  145. * Bugfix release from Frido 8-19-96
  146. *
  147. * Rev 1.1 15 Aug 1996 12:45:28 frido
  148. * Added #include 'type.h".
  149. * Added prototype for SetMode() function.
  150. *
  151. * Rev 1.0 14 Aug 1996 17:12:10 frido
  152. * Initial revision.
  153. *
  154. * Rev 1.10 17 Jul 1996 09:42:20 noelv
  155. * Fixed location of STATUS register.
  156. *
  157. * Rev 1.9 15 Jul 1996 17:18:24 noelv
  158. * Added wait for idle before mode switch
  159. *
  160. * Rev 1.8 19 Jun 1996 11:04:10 noelv
  161. * New mode switch code.
  162. *
  163. * Rev 1.7 13 May 1996 14:52:54 bennyn
  164. *
  165. * Added 5464 support
  166. *
  167. * Rev 1.6 10 Apr 1996 17:58:06 bennyn
  168. * Conditional turn of HD_BRST_EN
  169. *
  170. * Rev 1.5 02 Mar 1996 12:30:46 noelv
  171. * Miniport now patches the ModeTable with information read from the BIOS
  172. *
  173. * Rev 1.4 07 Dec 1995 16:33:10 noelv
  174. * Changed MAX_SLOTS to 32
  175. *
  176. * Rev 1.3 18 Sep 1995 10:02:26 bennyn
  177. *
  178. * Rev 1.2 23 Aug 1995 14:45:26 bennyn
  179. *
  180. * Rev 1.1 17 Aug 1995 08:18:08 BENNYN
  181. *
  182. *
  183. * Rev 1.0 24 Jul 1995 13:22:54 NOELV
  184. * Initial revision.
  185. *
  186. ****************************************************************************
  187. ****************************************************************************/
  188. /*----------------------------- INCLUDES ----------------------------------*/
  189. #include <dderror.h>
  190. #include <devioctl.h>
  191. #include <miniport.h>
  192. #include <ntddvdeo.h>
  193. #include <video.h>
  194. #include "logfile.h"
  195. #include "type.h"
  196. #include "clioctl.h"
  197. /*----------------------------- DEFINES -----------------------------------*/
  198. //
  199. // Vendor and Device ID definitions
  200. //
  201. #define VENDOR_ID 0x1013 // Vender Id for Cirrus Logic
  202. #define CL_GD5462 0x00D0 // 5462
  203. #define CL_GD5464 0x00D4 // 5464
  204. #define CL_GD5464_BD 0x00D5 // 5464 BD
  205. #define CL_GD5465 0x00D6 // 5465
  206. //
  207. // These Laguna chips don't exist yet, but we'll support them when
  208. // they get here, 'cause we're FORWARD COMPATIBLE! All future
  209. // chips are GUARENTEED to look and act just like the 5465.
  210. // Yep, yep, yep! (sigh.)
  211. //
  212. #define CL_GD546x_D7 0x00D7
  213. #define CL_GD546x_D8 0x00D8
  214. #define CL_GD546x_D9 0x00D9
  215. #define CL_GD546x_DA 0x00DA
  216. #define CL_GD546x_DB 0x00DB
  217. #define CL_GD546x_DC 0x00DC
  218. #define CL_GD546x_DD 0x00DD
  219. #define CL_GD546x_DE 0x00DE
  220. #define CL_GD546x_DF 0x00DF
  221. //
  222. // I'm preparing to rip all the VGA out of the miniport.
  223. // This flag is to allow me to get it right the
  224. // first time.
  225. //
  226. #define USE_VGA 1
  227. //
  228. // How much memory to lock down for bus mastered host data transfers
  229. //
  230. #define SIZE_BUS_MASTER_BUFFER (4*1024)
  231. //
  232. // Default mode: VGA mode 3
  233. //
  234. #define DEFAULT_MODE 0
  235. //
  236. // Laguna memory-mapped registers
  237. //
  238. #define STATUS_REG 0x400
  239. #define VSCONTROL_REG 0x3FC
  240. #define CONTROL_REG 0x402
  241. #define OFFSET_2D_REG 0x405
  242. #define TILE_CTRL_REG 0x407
  243. #define LNCNTL_REG 0x50E
  244. //
  245. // PCI memory-mapped registers
  246. //
  247. #define PCI_COMMAND_REG 0x304
  248. #define PCI_BASE_ADDR_0_REG 0x0310 // Base Address 0 register
  249. #define PCI_BASE_ADDR_1_REG 0x0314 // Base Address 1 register
  250. //
  251. // Number of PCI slots in a machine.
  252. //
  253. #define MAX_SLOTS 256
  254. //
  255. // Number of access ranges used by the Laguna.
  256. //
  257. #if USE_VGA
  258. #define FIRST_VGA_ACCESS_RANGE 0
  259. #define LAST_VGA_ACCESS_RANGE 2
  260. #define NUM_VGA_ACCESS_RANGES 3
  261. #define FIRST_MM_ACCESS_RANGE 3
  262. #define LAST_MM_ACCESS_RANGE 4
  263. #define NUM_MM_ACCESS_RANGES 2
  264. #define MM_REGISTER_ACCESS_RANGE 3
  265. #define MM_FRAME_BUFFER_ACCESS_RANGE 4
  266. #define TOTAL_ACCESS_RANGES NUM_VGA_ACCESS_RANGES + NUM_MM_ACCESS_RANGES
  267. #else
  268. #define FIRST_VGA_ACCESS_RANGE 0
  269. #define LAST_VGA_ACCESS_RANGE 2
  270. #define NUM_VGA_ACCESS_RANGES 3
  271. #define FIRST_MM_ACCESS_RANGE 3
  272. #define LAST_MM_ACCESS_RANGE 4
  273. #define NUM_MM_ACCESS_RANGES 2
  274. #define MM_REGISTER_ACCESS_RANGE 3
  275. #define MM_FRAME_BUFFER_ACCESS_RANGE 4
  276. #define TOTAL_ACCESS_RANGES NUM_VGA_ACCESS_RANGES + NUM_MM_ACCESS_RANGES
  277. #endif
  278. //
  279. // If we don't know how much register space the chip decodes, we guess
  280. //
  281. #define DEFAULT_RESERVED_REGISTER_SPACE 0xA000
  282. #define DEFAULT_RESERVED_REGISTER_MASK 0xFFFF8000 // 32 k
  283. //
  284. // If we don't know how much frame buffer space the chip decodes, we guess
  285. //
  286. #define DEFAULT_RESERVED_FB_SPACE 0x02000000 // 32 meg
  287. #define DEFAULT_RESERVED_FB_MASK 0xFE000000 // 32 meg
  288. //
  289. // Palette-related info.
  290. // Highest valid DAC color register index.
  291. //
  292. #define VIDEO_MAX_COLOR_REGISTER 0xFF
  293. #if USE_VGA
  294. //
  295. // Register definitions used with VideoPortRead/Write functions
  296. // VGA IO index
  297. //
  298. #define SEQ_ADDRESS_PORT 0x0014 // Sequence Controller Address
  299. #define SEQ_DATA_PORT 0x0015 // Sequence Controller Data register
  300. #define IND_SR_6 0x0006 // Index in Sequencer to enable exts
  301. #define IND_SR_9 0x0009 // Scratch pad register SR9
  302. #define IND_SR_14 0x0014 // Scratch pad register SR14
  303. #define CRTC_ADDRESS_PORT_MONO 0x0004 // Mono mode CRTC Address
  304. #define CRTC_DATA_PORT_MONO 0x0005 // Mono mode CRTC Data register
  305. #define CRTC_ADDRESS_PORT_COLOR 0x0024 // Color mode CRTC Address
  306. #define CRTC_DATA_PORT_COLOR 0x0025 // Color mode CRTC Data register
  307. #define IND_CL_ID_REG 0x0027 // index in CRTC of ID Register
  308. #endif
  309. //
  310. // Register definitions used with VideoPortRead/Write functions
  311. // Memory-mapped IO index
  312. //
  313. #define DAC_PIXEL_MASK_PORT 0x00A0 // DAC pixel mask reg
  314. #define DAC_ADDRESS_WRITE_PORT 0x00A8 // DAC register write index reg
  315. #define DAC_DATA_REG_PORT 0x00AC // DAC data transfer reg
  316. #define MISC_OUTPUT_REG_READ_PORT 0x0080 // Misc Output reg read port
  317. //
  318. // Define the supported version numbers for the device description structure.
  319. //
  320. #define DEVICE_DESCRIPTION_VERSION 0
  321. #define DEVICE_DESCRIPTION_VERSION1 1
  322. //
  323. // Define the page size for the Intel 386 as 4096 (0x1000).
  324. //
  325. #define PAGE_SIZE (ULONG)0x1000
  326. //
  327. // Define the index of max.frequency table for each resolution.
  328. //
  329. #define MODE_640_INDEX 0
  330. #define MODE_720_INDEX 1
  331. #define MODE_800_INDEX 2
  332. #define MODE_832_INDEX 3
  333. #define MODE_1024_INDEX 4
  334. #define MODE_1152_INDEX 5
  335. #define MODE_1280_INDEX 6
  336. #define MODE_1600_INDEX 7
  337. #define INVALID_MODE_INDEX 8
  338. //
  339. // bios stuff
  340. //
  341. #define VESA_POWER_FUNCTION 0x4f10
  342. #define VESA_POWER_ON 0x0000
  343. #define VESA_POWER_STANDBY 0x0100
  344. #define VESA_POWER_SUSPEND 0x0200
  345. #define VESA_POWER_OFF 0x0400
  346. #define VESA_GET_POWER_FUNC 0x0000
  347. #define VESA_SET_POWER_FUNC 0x0001
  348. #define VESA_STATUS_SUCCESS 0x004f
  349. /*----------------------------- TYPEDEFS ----------------------------------*/
  350. //
  351. // Used to pass information about the common buffer from the miniport to the display driver.
  352. //
  353. typedef struct _COMMON_BUFFER_INFO {
  354. PUCHAR PhysAddress;
  355. PUCHAR VirtAddress;
  356. ULONG Length;
  357. } COMMON_BUFFER_INFO;
  358. //
  359. // Mode table structure
  360. // Structure used for the mode table informations
  361. //
  362. typedef struct {
  363. BOOLEAN ValidMode; // TRUE: Mode is valid.
  364. ULONG ChipType; // Chips which support this mode.
  365. USHORT fbType; // color or monochrome, text or graphics,
  366. // via VIDEO_MODE_COLOR and VIDEO_MODE_GRAPHICS
  367. // and interlace or non-interlace via
  368. // VIDEO_MODE_INTERLACED
  369. USHORT Frequency; // Frequency
  370. USHORT BIOSModeNum; // BIOS Mode number
  371. USHORT BytesPerScanLine; // Bytes Per Scan Line
  372. USHORT XResol; // Horizontal resolution in pixels or char
  373. USHORT YResol; // Vertical resolution in pixels or char
  374. UCHAR XCharSize; // Char cell width in pixels
  375. UCHAR YCharSize; // Char cell height in pixels
  376. UCHAR NumOfPlanes; // Number of memory planes
  377. UCHAR BitsPerPixel; // Bits per pixel
  378. UCHAR MonitorTypeVal; // Monitor type setting bytes
  379. UCHAR *SetModeString; // Instruction string used by SetMode().
  380. } MODETABLE, *PMODETABLE;
  381. //
  382. // Valid flags for ChipType field.
  383. // Must match defines in CGLMODE.C
  384. //
  385. #define LG_NONE (0 )
  386. #define LG_ALL (1 )
  387. #define LG_5462 (1 << 1)
  388. #define LG_5464 (1 << 2)
  389. #define LG_5465 (1 << 3)
  390. #define LG_5465AD (1 << 4)
  391. #define ALWAY_ON_VS_CLK_CTL 0x0000C0A0 // VW_CLK, RAMDAC_CLK
  392. typedef struct _LG_PWRMGR_DATA {
  393. WORD wInitSignature;
  394. int Mod_refcnt[TOTAL_MOD];
  395. DWORD ACPI_state;
  396. DWORD VS_clk_ctl_state;
  397. } LGPWRMGR_DATA, *P_LGPWRMGR_DATA;
  398. //
  399. // Define device extension structure. This is device dependent/private
  400. // information.
  401. //
  402. typedef struct _HW_DEVICE_EXTENSION {
  403. LGPWRMGR_DATA PMdata; // Power manager data area
  404. #if USE_VGA
  405. PUCHAR IOAddress; // base I/O address of VGA ports.
  406. #endif
  407. PUCHAR FrameAddress; // base virtual address of video memory
  408. ULONG FrameLength;
  409. PUCHAR RegisterAddress; // base virtual address of Register Space
  410. ULONG RegisterLength;
  411. PHYSICAL_ADDRESS PhysicalFrameAddress;
  412. ULONG PhysicalFrameLength;
  413. UCHAR PhysicalFrameInIoSpace;
  414. PHYSICAL_ADDRESS PhysicalRegisterAddress;
  415. ULONG PhysicalRegisterLength;
  416. UCHAR PhysicalRegisterInIoSpace;
  417. DWORD dwFBMTRRReg;
  418. ULONG AdapterMemorySize; // Installed RAM
  419. ULONG CurrentModeNum; // Current Mode Number
  420. PMODETABLE CurrentMode; // pointer current mode information
  421. ULONG ChipID; // PCI Device ID
  422. ULONG ChipRev; // PCI Chip Revision
  423. ULONG NumAvailableModes; // number of available modes
  424. ULONG NumTotalModes; // total number of modes
  425. ULONG PowerState; // Power state =
  426. // VideoPowerOn or VideoPowerStandBy or
  427. // VideoPowerSuspend or VideoPowerOff
  428. UCHAR TileSize; // Tile size
  429. UCHAR TiledMode; // Tiled mode or 0xFF if error
  430. UCHAR TiledTPL; // Tiled mode TPL
  431. UCHAR TiledInterleave; // Tiled Interleave
  432. PUCHAR PhysicalCommonBufferAddr;
  433. PUCHAR VirtualCommonBufferAddr;
  434. ULONG CommonBufferSize;
  435. ULONG SlotNumber; // PCI slot number
  436. unsigned long SystemIoBusNumber; // Bus number (0=PCI, 1=AGP)
  437. WORD BIOSVersion;
  438. // DDC2B & EDID data
  439. DWORD dwDDCFlag;
  440. BOOLEAN EDIDFlag;
  441. UCHAR EDIDBuffer[128];
  442. ULONG ulEDIDMaxTiming;
  443. USHORT usMaxVtFrequency;
  444. USHORT usMaxXResolution;
  445. USHORT usMaxFrequencyTable[8];
  446. BOOLEAN MultiSyncFlag;
  447. ULONG ulMaxHzFrequency;
  448. // USB fix flag
  449. DWORD dwAGPDataStreamingFlag;
  450. DWORD fLowRes;
  451. // Monitor sync polarity.
  452. DWORD dwPolarity;
  453. // secondary adapter can't access VGA resources
  454. ULONG Dont_Do_VGA;
  455. // output clock and data lines need to be inverted on some chips or cards
  456. // (used only in CLDDC2B.c)
  457. UCHAR I2Cflavor;
  458. BOOLEAN MonitorEnabled;
  459. } HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
  460. //
  461. // Define the device description structure.
  462. //
  463. typedef struct _DEVICE_DESCRIPTION {
  464. ULONG Version;
  465. BOOLEAN Master;
  466. BOOLEAN ScatterGather;
  467. BOOLEAN DemandMode;
  468. BOOLEAN AutoInitialize;
  469. BOOLEAN Dma32BitAddresses;
  470. BOOLEAN IgnoreCount;
  471. BOOLEAN Reserved1; // must be false
  472. BOOLEAN Reserved2; // must be false
  473. ULONG BusNumber;
  474. ULONG DmaChannel;
  475. INTERFACE_TYPE InterfaceType;
  476. DMA_WIDTH DmaWidth;
  477. DMA_SPEED DmaSpeed;
  478. ULONG MaximumLength;
  479. ULONG DmaPort;
  480. } DEVICE_DESCRIPTION, *PDEVICE_DESCRIPTION;
  481. /*-------------------------- External FUNCTIONS -----------------------------*/
  482. typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT; // ntndis
  483. PVOID
  484. HalAllocateCommonBuffer(
  485. PADAPTER_OBJECT AdapterObject,
  486. ULONG Length,
  487. PPHYSICAL_ADDRESS LogicalAddress,
  488. BOOLEAN CacheEnabled
  489. );
  490. PVOID
  491. HalFreeCommonBuffer(
  492. PADAPTER_OBJECT AdapterObject,
  493. ULONG Length,
  494. PPHYSICAL_ADDRESS LogicalAddress,
  495. PVOID VirtualAddress,
  496. BOOLEAN CacheEnabled
  497. );
  498. PADAPTER_OBJECT
  499. HalGetAdapter(
  500. PDEVICE_DESCRIPTION DeviceDescription,
  501. PULONG NumberOfMapRegisters
  502. );
  503. VOID
  504. RtlZeroMemory (
  505. VOID UNALIGNED *Destination,
  506. ULONG Length
  507. );
  508. ULONG
  509. HalGetBusDataByOffset(
  510. IN BUS_DATA_TYPE BusDataType,
  511. IN ULONG BusNumber,
  512. IN ULONG SlotNumber,
  513. IN PVOID Buffer,
  514. IN ULONG Offset,
  515. IN ULONG Length
  516. );
  517. ULONG
  518. HalSetBusDataByOffset(
  519. IN BUS_DATA_TYPE BusDataType,
  520. IN ULONG BusNumber,
  521. IN ULONG SlotNumber,
  522. IN PVOID Buffer,
  523. IN ULONG Offset,
  524. IN ULONG Length
  525. );
  526. /*-------------------------- GLOBAL FUNCTIONS -----------------------------*/
  527. //
  528. // Global Reference.
  529. //
  530. extern MODETABLE ModeTable[];
  531. extern ULONG TotalVideoModes;
  532. VP_STATUS CLFindAdapter(
  533. PVOID HwDeviceExtension,
  534. PVOID HwContext,
  535. PWSTR ArgumentString,
  536. PVIDEO_PORT_CONFIG_INFO ConfigInfo,
  537. PUCHAR Again
  538. );
  539. BOOLEAN CLInitialize(
  540. PVOID HwDeviceExtension
  541. );
  542. #if _WIN32_WINNT >= 0x0500
  543. ULONG CLGetChildDescriptor(
  544. IN PVOID HwDeviceExtension,
  545. IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo,
  546. OUT PVIDEO_CHILD_TYPE VideoChildType,
  547. OUT PVOID pChildDescriptor,
  548. OUT PULONG UId,
  549. OUT PVOID pUnused
  550. );
  551. VP_STATUS CLGetPowerState(
  552. PVOID HwDeviceExtension,
  553. ULONG HwId,
  554. PVIDEO_POWER_MANAGEMENT VideoPowerControl
  555. );
  556. VP_STATUS CLSetPowerState(
  557. PVOID HwDeviceExtension,
  558. ULONG HwId,
  559. PVIDEO_POWER_MANAGEMENT VideoPowerControl
  560. );
  561. #endif
  562. BOOLEAN ReadDataLine(
  563. PHW_DEVICE_EXTENSION HwDeviceExtension
  564. );
  565. BOOLEAN ReadClockLine(
  566. PHW_DEVICE_EXTENSION HwDeviceExtension
  567. );
  568. VOID WriteClockLine(
  569. PHW_DEVICE_EXTENSION HwDeviceExtension,
  570. UCHAR data
  571. );
  572. VOID WriteDataLine(
  573. PHW_DEVICE_EXTENSION HwDeviceExtension,
  574. UCHAR data
  575. );
  576. VOID WaitVSync(
  577. PHW_DEVICE_EXTENSION HwDeviceExtension
  578. );
  579. #if _WIN32_WINNT >= 0x0500
  580. BOOLEAN GetDDCInformation(
  581. PHW_DEVICE_EXTENSION HwDeviceExtension,
  582. PVOID QueryBuffer,
  583. ULONG BufferSize
  584. );
  585. #endif
  586. void VS_Control_Hack(PHW_DEVICE_EXTENSION HwDeviceExtension, BOOL Enable);
  587. void Output_To_VS_CLK_CONTROL(PHW_DEVICE_EXTENSION HwDeviceExtension, DWORD val);
  588. void PMNT_Init(PHW_DEVICE_EXTENSION HwDeviceExtension);
  589. VP_STATUS PMNT_SetACPIState (PHW_DEVICE_EXTENSION HwDeviceExtension, ULONG state);
  590. VP_STATUS PMNT_GetACPIState (PHW_DEVICE_EXTENSION HwDeviceExtension, ULONG* state);
  591. VP_STATUS PMNT_SetHwModuleState (PHW_DEVICE_EXTENSION HwDeviceExtension,
  592. ULONG hwmod, ULONG state);
  593. VP_STATUS PMNT_GetHwModuleState (PHW_DEVICE_EXTENSION HwDeviceExtension,
  594. ULONG hwmod, ULONG* state);
  595. void PMNT_Close (PHW_DEVICE_EXTENSION HwDeviceExtension);
  596. #if 1 // PDR#11350
  597. BOOLEAN CLResetHw(
  598. PHW_DEVICE_EXTENSION HwDeviceExtension,
  599. ULONG Columns,
  600. ULONG Rows
  601. );
  602. #endif
  603. BOOLEAN CLStartIO(
  604. PVOID HwDeviceExtension,
  605. PVIDEO_REQUEST_PACKET RequestPacket
  606. );
  607. VP_STATUS CLSetColorLookup(
  608. PHW_DEVICE_EXTENSION HwDeviceExtension,
  609. PVIDEO_CLUT ClutBuffer,
  610. ULONG ClutBufferSize
  611. );
  612. BOOLEAN CLIsPresent(
  613. PHW_DEVICE_EXTENSION HwDeviceExtension
  614. );
  615. ULONG CLFindVmemSize(
  616. PHW_DEVICE_EXTENSION HwDeviceExtension
  617. );
  618. VOID CLWriteRegistryInfo(
  619. PHW_DEVICE_EXTENSION hwDeviceExtension,
  620. BOOLEAN hdbrsten
  621. );
  622. VOID CLValidateModes(
  623. PHW_DEVICE_EXTENSION HwDeviceExtension
  624. );
  625. VOID CLCopyModeInfo(
  626. PHW_DEVICE_EXTENSION HwDeviceExtension,
  627. PVIDEO_MODE_INFORMATION videoModes,
  628. ULONG ModeIndex,
  629. PMODETABLE ModeInfo
  630. );
  631. VP_STATUS CLSetMode(
  632. PHW_DEVICE_EXTENSION HwDeviceExtension,
  633. PVIDEO_MODE Mode
  634. );
  635. BOOLEAN CLSetMonitorType(
  636. PHW_DEVICE_EXTENSION HwDeviceExtension,
  637. USHORT VertScanlines,
  638. UCHAR MonitorTypeVal
  639. );
  640. VP_STATUS CLPowerManagement(
  641. PHW_DEVICE_EXTENSION HwDeviceExtension,
  642. PVIDEO_POWER_MANAGEMENT pPMinfo,
  643. BOOLEAN SetPowerState
  644. );
  645. BOOLEAN CLEnablePciBurst(
  646. PHW_DEVICE_EXTENSION hwDeviceExtension
  647. );
  648. VP_STATUS CLFindLagunaOnPciBus(
  649. PHW_DEVICE_EXTENSION hwDeviceExtension,
  650. PVIDEO_ACCESS_RANGE pAccessRanges
  651. );
  652. VOID CLPatchModeTable (
  653. PHW_DEVICE_EXTENSION HwDeviceExtension
  654. );
  655. VOID ClAllocateCommonBuffer(
  656. PHW_DEVICE_EXTENSION HwDeviceExtension
  657. );
  658. VOID CLEnableTiling(
  659. PHW_DEVICE_EXTENSION HwDeviceExtension,
  660. PMODETABLE pReqModeTable
  661. );
  662. VP_STATUS CLEnablePCIConfigMMIO(
  663. PHW_DEVICE_EXTENSION HwDeviceExtension
  664. );
  665. void SetMode(BYTE *pModeTable, BYTE *pMemory, BYTE * pBinaryData, ULONG SkipIO);
  666. //
  667. // The rest of this file isn't used.
  668. //
  669. #if 0
  670. #if ENABLE_BUS_MASTERING
  671. HW_DMA_RETURN CLStartDma(
  672. PHW_DEVICE_EXTENSION HwDeviceExtension,
  673. PVIDEO_REQUEST_PACKET RequestPacket,
  674. PVOID pMappedUserEvent,
  675. PVOID pDisplayEvent,
  676. PVOID pDmaCompletionEvent
  677. );
  678. #endif
  679. #if ENABLE_BUS_MASTERING
  680. PUCHAR IoBuffer;
  681. ULONG IoBufferSize;
  682. PVOID DmaHandle;
  683. #endif
  684. #endif