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.

768 lines
20 KiB

  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. s3.h
  5. Abstract:
  6. This module contains the definitions for the S3 miniport driver.
  7. Environment:
  8. Kernel mode
  9. Revision History:
  10. --*/
  11. #include "dderror.h"
  12. #include "devioctl.h"
  13. #include "miniport.h"
  14. #include "ntddvdeo.h"
  15. #include "video.h"
  16. //
  17. // We don't use the CRT 'min' function because that would drag in
  18. // unwanted CRT baggage.
  19. //
  20. #define MIN(a, b) ((a) < (b) ? (a) : (b))
  21. //
  22. // Size of the ROM we map in
  23. //
  24. #define MAX_ROM_SCAN 512
  25. //
  26. // Number of access ranges used by an S3.
  27. //
  28. #define NUM_S3_ACCESS_RANGES 36
  29. #define NUM_S3_ACCESS_RANGES_USED 22
  30. #define NUM_S3_PCI_ACCESS_RANGES 2
  31. #define S3_EXTENDED_RANGE_START 4
  32. //
  33. // Index of Frame buffer in access range array
  34. //
  35. #define A000_FRAME_BUF 1
  36. #define LINEAR_FRAME_BUF 36
  37. //
  38. // Constants defining 'New Memory-mapped I/O' window:
  39. //
  40. #define NEW_MMIO_WINDOW_SIZE 0x4000000 // Total window size -- 64 MB
  41. #define NEW_MMIO_IO_OFFSET 0x1000000 // Offset to start of little endian
  42. // control registers -- 16 MB
  43. #define NEW_MMIO_IO_LENGTH 0x0020000 // Length of control registers
  44. // -- 128 KB
  45. ////////////////////////////////////////////////////////////////////////
  46. // Capabilities flags
  47. //
  48. // These are private flags passed to the S3 display driver. They're
  49. // put in the high word of the 'AttributeFlags' field of the
  50. // 'VIDEO_MODE_INFORMATION' structure (found in 'ntddvdeo.h') passed
  51. // to the display driver via an 'VIDEO_QUERY_AVAIL_MODES' or
  52. // 'VIDEO_QUERY_CURRENT_MODE' IOCTL.
  53. //
  54. // NOTE: These definitions must match those in the S3 display driver's
  55. // 'driver.h'!
  56. typedef enum {
  57. CAPS_STREAMS_CAPABLE = 0x00000040, // Has overlay streams processor
  58. CAPS_FORCE_DWORD_REREADS= 0x00000080, // Dword reads occasionally return
  59. // an incorrect result, so always
  60. // retry the reads
  61. CAPS_NEW_MMIO = 0x00000100, // Can use 'new memory-mapped
  62. // I/O' scheme introduced with
  63. // 868/968
  64. CAPS_POLYGON = 0x00000200, // Can do polygons in hardware
  65. CAPS_24BPP = 0x00000400, // Has 24bpp capability
  66. CAPS_BAD_24BPP = 0x00000800, // Has 868/968 early rev chip bugs
  67. // when at 24bpp
  68. CAPS_PACKED_EXPANDS = 0x00001000, // Can do 'new 32-bit transfers'
  69. CAPS_PIXEL_FORMATTER = 0x00002000, // Can do colour space conversions,
  70. // and one-dimensional hardware
  71. // stretches
  72. CAPS_BAD_DWORD_READS = 0x00004000, // Dword or word reads from the
  73. // frame buffer will occasionally
  74. // return an incorrect result,
  75. // so always do byte reads
  76. CAPS_NO_DIRECT_ACCESS = 0x00008000, // Frame buffer can't be directly
  77. // accessed by GDI or DCI --
  78. // because dword or word reads
  79. // would crash system, or Alpha
  80. // is running in sparse space
  81. CAPS_HW_PATTERNS = 0x00010000, // 8x8 hardware pattern support
  82. CAPS_MM_TRANSFER = 0x00020000, // Memory-mapped image transfers
  83. CAPS_MM_IO = 0x00040000, // Memory-mapped I/O
  84. CAPS_MM_32BIT_TRANSFER = 0x00080000, // Can do 32bit bus size transfers
  85. CAPS_16_ENTRY_FIFO = 0x00100000, // At least 16 entries in FIFO
  86. CAPS_SW_POINTER = 0x00200000, // No hardware pointer; use software
  87. // simulation
  88. CAPS_BT485_POINTER = 0x00400000, // Use Brooktree 485 pointer
  89. CAPS_TI025_POINTER = 0x00800000, // Use TI TVP3020/3025 pointer
  90. CAPS_SCALE_POINTER = 0x01000000, // Set if the S3 hardware pointer
  91. // x position has to be scaled by
  92. // two
  93. CAPS_SPARSE_SPACE = 0x02000000, // Frame buffer is mapped in sparse
  94. // space on the Alpha
  95. CAPS_NEW_BANK_CONTROL = 0x04000000, // Set if 801/805/928 style banking
  96. CAPS_NEWER_BANK_CONTROL = 0x08000000, // Set if 864/964 style banking
  97. CAPS_RE_REALIZE_PATTERN = 0x10000000, // Set if we have to work around the
  98. // 864/964 hardware pattern bug
  99. CAPS_SLOW_MONO_EXPANDS = 0x20000000, // Set if we have to slow down
  100. // monochrome expansions
  101. CAPS_MM_GLYPH_EXPAND = 0x40000000, // Use memory-mapped I/O glyph-
  102. // expand method of drawing text
  103. CAPS_WAIT_ON_PALETTE = 0x80000000, // Wait for vertical retrace before
  104. // setting the palette registers
  105. } CAPS;
  106. #define CAPS_DAC_POINTER (CAPS_BT485_POINTER | CAPS_TI025_POINTER)
  107. //
  108. // Supported board definitions.
  109. //
  110. typedef enum _S3_BOARDS {
  111. S3_GENERIC = 0,
  112. S3_ORCHID,
  113. S3_NUMBER_NINE,
  114. S3_DELL,
  115. S3_METHEUS,
  116. S3_DIAMOND,
  117. S3_HP,
  118. S3_IBM_PS2,
  119. MAX_S3_BOARD
  120. } S3_BOARDS;
  121. //
  122. // Chip type definitions -- for families of chips
  123. //
  124. // if you change this typedef it will change the size of the second element
  125. // (named Fixed) of the union in the typedef for S3_VIDEO_FREQUENCIES and
  126. // PS3_VIDEO_FREQUENCIES, look at that typedef for a caution about the effect
  127. // this will have on autoinitialization
  128. //
  129. typedef enum _S3_CHIPSETS {
  130. S3_911 = 0, // 911 and 924 boards
  131. S3_801, // 801 and 805 boards
  132. S3_928, // 928 boards
  133. S3_864, // 864, 964, 732, 764, and 765 boards
  134. S3_866, // 866, 868, and 968 boards
  135. MAX_S3_CHIPSET
  136. } S3_CHIPSETS;
  137. //
  138. // Chip subtypes -- for more differentiation within families
  139. //
  140. // Note that ordering is important.
  141. //
  142. typedef enum _S3_SUBTYPE {
  143. SUBTYPE_911 = 0, // 911 and 924
  144. SUBTYPE_80x, // 801 and 805
  145. SUBTYPE_928, // 928 and 928PCI
  146. SUBTYPE_805i, // 805i
  147. SUBTYPE_864, // 864
  148. SUBTYPE_964, // 964
  149. SUBTYPE_764, // Trio64
  150. SUBTYPE_732, // Trio32
  151. SUBTYPE_866, // 866
  152. SUBTYPE_868, // 868
  153. SUBTYPE_765, // Trio64 V+
  154. SUBTYPE_968, // 968
  155. MAX_S3_SUBTYPE
  156. } S3_SUBTYPE;
  157. //
  158. // DAC type definitions
  159. //
  160. typedef enum _S3_DACS {
  161. UNKNOWN_DAC = 0, // unknown DAC type
  162. BT_485, // Brooktree's Bt 485
  163. TI_3020, // TI's 3020 or 3025
  164. S3_SDAC, // S3's SDAC
  165. MAX_S3_DACS
  166. } S3_DACS;
  167. //
  168. // Hardware pointer capabilities flags
  169. //
  170. typedef enum _POINTER_CAPABILITY {
  171. POINTER_BUILT_IN = 0x01, // A pointer is built in to the hardware
  172. POINTER_WORKS_ONLY_AT_8BPP = 0x02, // If set, the hardware pointer works
  173. // only at 8bpp, and only for modes
  174. // 1024x768 or less
  175. POINTER_NEEDS_SCALING = 0x04, // x-coordinate must be scaled by 2 at
  176. // 32bpp
  177. } POINTER_CAPABILITY;
  178. //
  179. // Characteristics of each mode
  180. //
  181. typedef struct _S3_VIDEO_MODES {
  182. USHORT Int10ModeNumberContiguous;
  183. USHORT Int10ModeNumberNoncontiguous;
  184. ULONG ScreenStrideContiguous;
  185. VIDEO_MODE_INFORMATION ModeInformation;
  186. } S3_VIDEO_MODES, *PS3_VIDEO_MODES;
  187. //
  188. // Mode-set specific information.
  189. //
  190. typedef struct _S3_VIDEO_FREQUENCIES {
  191. ULONG BitsPerPel;
  192. ULONG ScreenWidth;
  193. ULONG ScreenFrequency;
  194. union {
  195. //
  196. // The compiler uses the first element of a union to determine where
  197. // it places the values given when the union is autoinitialized.
  198. //
  199. // If size of the Fixed element of this union is changed by adding
  200. // chips to the enum typedef for S3_CHIPSET then the Int10 element
  201. // needs to be padded with dummy fields to make autoinitialization
  202. // of the Fixed element work correctly.
  203. //
  204. // If values are removed from the S3_CHIPSET typedef then either the
  205. // Int10 element should shrunk by removing pads or the Fixed element
  206. // should be padded.
  207. //
  208. struct {
  209. ULONG_PTR FrequencyPrimarySet;
  210. ULONG_PTR FrequencyPrimaryMask;
  211. ULONG_PTR FrequencySecondarySet;
  212. ULONG_PTR FrequencySecondaryMask;
  213. ULONG_PTR SizePad0; // make struct sizes match
  214. } Int10;
  215. struct {
  216. union {
  217. //
  218. // This is done so that Clock overlays FrequencyPrimarySet
  219. // and CRTCTable[1] overlays FrequencyPrimaryMask, whether
  220. // we are compiling for 32 or 64 bits.
  221. //
  222. ULONG Clock;
  223. ULONG_PTR Pad;
  224. };
  225. PUSHORT CRTCTable[MAX_S3_CHIPSET];
  226. } Fixed;
  227. };
  228. PS3_VIDEO_MODES ModeEntry;
  229. ULONG ModeIndex;
  230. UCHAR ModeValid;
  231. } S3_VIDEO_FREQUENCIES, *PS3_VIDEO_FREQUENCIES;
  232. //
  233. // Streams parameter information.
  234. //
  235. typedef struct _K2TABLE {
  236. USHORT ScreenWidth;
  237. UCHAR BitsPerPel;
  238. UCHAR RefreshRate;
  239. UCHAR MemoryFlags;
  240. UCHAR MemorySpeed;
  241. ULONG Value;
  242. } K2TABLE;
  243. #define MEM_1EDO 0x0
  244. #define MEM_2EDO 0x2
  245. #define MEM_FAST 0x3
  246. #define MEM_TYPE_MASK 0x3
  247. #define MEM_1MB 0x0
  248. #define MEM_2MB 0x10
  249. #define MEM_SIZE_MASK 0x10
  250. //
  251. // Private IOCTL for communicating S3 streams parameters. These definitions
  252. // must match those in the display driver!
  253. //
  254. #define IOCTL_VIDEO_S3_QUERY_STREAMS_PARAMETERS \
  255. CTL_CODE(FILE_DEVICE_VIDEO, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS)
  256. typedef struct _VIDEO_QUERY_STREAMS_MODE {
  257. ULONG ScreenWidth;
  258. ULONG BitsPerPel;
  259. ULONG RefreshRate;
  260. } VIDEO_QUERY_STREAMS_MODE;
  261. typedef struct _VIDEO_QUERY_STREAMS_PARAMETERS {
  262. ULONG MinOverlayStretch;
  263. ULONG FifoValue;
  264. } VIDEO_QUERY_STREAMS_PARAMETERS;
  265. //
  266. // Register definitions used with VideoPortRead/Write functions
  267. //
  268. // It's a good idea to write your miniport to allow for easy register
  269. // re-mapping, but I wouldn't recommend that anyone use this particular
  270. // implementation because it's pretty dumb.
  271. //
  272. #define DAC_PIXEL_MASK_REG (PVOID)((PUCHAR)((PHW_DEVICE_EXTENSION)HwDeviceExtension)->MappedAddress[2] + (0x03C6 - 0x03C0))
  273. #define BT485_ADDR_CMD_REG0 (PVOID)((PUCHAR)((PHW_DEVICE_EXTENSION)HwDeviceExtension)->MappedAddress[2] + (0x03C6 - 0x03C0))
  274. #define TI025_INDEX_REG (PVOID)((PUCHAR)((PHW_DEVICE_EXTENSION)HwDeviceExtension)->MappedAddress[2] + (0x03C6 - 0x03C0))
  275. #define TI025_DATA_REG (PVOID)((PUCHAR)((PHW_DEVICE_EXTENSION)HwDeviceExtension)->MappedAddress[2] + (0x03C7 - 0x03C0))
  276. #define CRT_DATA_REG (PVOID)((PUCHAR)((PHW_DEVICE_EXTENSION)HwDeviceExtension)->MappedAddress[3] + (0x03D5 - 0x03D4))
  277. #define SYSTEM_CONTROL_REG (PVOID)((PUCHAR)((PHW_DEVICE_EXTENSION)HwDeviceExtension)->MappedAddress[3] + (0x03DA - 0x03D4))
  278. #define CRT_ADDRESS_REG ((PHW_DEVICE_EXTENSION)HwDeviceExtension)->MappedAddress[3]
  279. #define GP_STAT ((PHW_DEVICE_EXTENSION)HwDeviceExtension)->MappedAddress[12] // 0x9AE8
  280. #define DAC_ADDRESS_WRITE_PORT (PVOID)((PUCHAR)HwDeviceExtension->MappedAddress[2] + (0x03C8 - 0x03C0))
  281. #define DAC_DATA_REG_PORT (PVOID)((PUCHAR)HwDeviceExtension->MappedAddress[2] + (0x03C9 - 0x03C0))
  282. #define MISC_OUTPUT_REG_WRITE (PVOID)((PUCHAR)HwDeviceExtension->MappedAddress[2] + (0x03C2 - 0x03C0))
  283. #define MISC_OUTPUT_REG_READ (PVOID)((PUCHAR)HwDeviceExtension->MappedAddress[2] + (0x03CC - 0x03C0))
  284. #define SEQ_ADDRESS_REG (PVOID)((PUCHAR)HwDeviceExtension->MappedAddress[2] + (0x03C4 - 0x03C0))
  285. #define SEQ_DATA_REG (PVOID)((PUCHAR)HwDeviceExtension->MappedAddress[2] + (0x03C5 - 0x03C0))
  286. #define IOCTL_PRIVATE_GET_FUNCTIONAL_UNIT \
  287. CTL_CODE(FILE_DEVICE_VIDEO, 0x180, METHOD_BUFFERED, FILE_ANY_ACCESS)
  288. typedef struct _FUNCTIONAL_UNIT_INFO {
  289. ULONG FunctionalUnitID;
  290. ULONG Reserved;
  291. } FUNCTIONAL_UNIT_INFO, *PFUNCTIONAL_UNIT_INFO;
  292. //
  293. // Define device extension structure. This is device dependent/private
  294. // information.
  295. //
  296. typedef struct _HW_DEVICE_EXTENSION {
  297. PHYSICAL_ADDRESS PhysicalFrameAddress;
  298. ULONG PhysicalFrameIoSpace;
  299. ULONG FrameLength;
  300. PHYSICAL_ADDRESS PhysicalRegisterAddress;
  301. ULONG RegisterLength;
  302. UCHAR RegisterSpace;
  303. PHYSICAL_ADDRESS PhysicalMmIoAddress;
  304. ULONG MmIoLength;
  305. ULONG ChildCount;
  306. UCHAR MmIoSpace;
  307. UCHAR FrequencySecondaryIndex;
  308. UCHAR BiosPresent;
  309. UCHAR CR5C;
  310. BOOLEAN bNeedReset;
  311. PUCHAR MmIoBase;
  312. PS3_VIDEO_MODES ActiveModeEntry;
  313. PS3_VIDEO_FREQUENCIES ActiveFrequencyEntry;
  314. PS3_VIDEO_FREQUENCIES Int10FrequencyTable;
  315. PS3_VIDEO_FREQUENCIES FixedFrequencyTable;
  316. USHORT PCIDeviceID;
  317. ULONG FunctionalUnitID;
  318. ULONG BoardID;
  319. S3_CHIPSETS ChipID;
  320. S3_SUBTYPE SubTypeID;
  321. ULONG DacID;
  322. ULONG Capabilities;
  323. ULONG NumAvailableModes;
  324. ULONG NumTotalModes;
  325. ULONG AdapterMemorySize;
  326. PVOID MappedAddress[NUM_S3_ACCESS_RANGES];
  327. } HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
  328. //
  329. // SDAC M and N paramaters
  330. //
  331. typedef struct {
  332. UCHAR m;
  333. UCHAR n;
  334. } SDAC_PLL_PARMS;
  335. #define SDAC_TABLE_SIZE 16
  336. //
  337. // Highest valid DAC color register index.
  338. //
  339. #define VIDEO_MAX_COLOR_REGISTER 0xFF
  340. //
  341. // Data
  342. //
  343. //
  344. // Global Physical Access Ranges.
  345. // Logical access ranges must be stored in the HwDeviceExtension so different
  346. // addresses can be used for different boards.
  347. //
  348. extern VIDEO_ACCESS_RANGE S3AccessRanges[];
  349. //
  350. // Memory Size array
  351. //
  352. extern ULONG gacjMemorySize[];
  353. //
  354. // nnlck.c clock generator table
  355. //
  356. extern long vclk_range[];
  357. //
  358. // Hard-coded modeset tables
  359. //
  360. extern USHORT s3_set_vga_mode[];
  361. extern USHORT s3_set_vga_mode_no_bios[];
  362. extern USHORT S3_911_Enhanced_Mode[];
  363. extern USHORT S3_801_Enhanced_Mode[];
  364. extern USHORT S3_928_Enhanced_Mode[];
  365. extern USHORT S3_928_1280_Enhanced_Mode[];
  366. //
  367. // Externs for 864 PPC board
  368. //
  369. extern USHORT S3_864_Enhanced_Mode[];
  370. extern USHORT S3_864_1280_Enhanced_Mode[];
  371. extern SDAC_PLL_PARMS SdacTable[];
  372. extern UCHAR MParameterTable[];
  373. //
  374. // Hard-coded modeset frequency tables
  375. //
  376. extern S3_VIDEO_FREQUENCIES GenericFixedFrequencyTable[];
  377. extern S3_VIDEO_FREQUENCIES OrchidFixedFrequencyTable[];
  378. extern S3_VIDEO_FREQUENCIES NumberNine928NewFixedFrequencyTable[];
  379. //
  380. // Int 10 frequency tables
  381. //
  382. extern S3_VIDEO_FREQUENCIES GenericFrequencyTable[];
  383. extern S3_VIDEO_FREQUENCIES Dell805FrequencyTable[];
  384. extern S3_VIDEO_FREQUENCIES NumberNine928NewFrequencyTable[];
  385. extern S3_VIDEO_FREQUENCIES NumberNine928OldFrequencyTable[];
  386. extern S3_VIDEO_FREQUENCIES Metheus928FrequencyTable[];
  387. extern S3_VIDEO_FREQUENCIES Generic64NewFrequencyTable[];
  388. extern S3_VIDEO_FREQUENCIES Generic64OldFrequencyTable[];
  389. extern S3_VIDEO_FREQUENCIES NumberNine64FrequencyTable[];
  390. extern S3_VIDEO_FREQUENCIES Diamond64FrequencyTable[];
  391. extern S3_VIDEO_FREQUENCIES HerculesFrequencyTable[];
  392. extern S3_VIDEO_FREQUENCIES Hercules64FrequencyTable[];
  393. extern S3_VIDEO_FREQUENCIES Hercules68FrequencyTable[];
  394. //
  395. // Mode Tables
  396. //
  397. extern S3_VIDEO_MODES S3Modes[];
  398. extern ULONG NumS3VideoModes;
  399. //
  400. // Streams Tables
  401. //
  402. extern K2TABLE K2WidthRatio[];
  403. extern K2TABLE K2FifoValue[];
  404. //
  405. // Function prototypes
  406. //
  407. //
  408. // sdac.c
  409. //
  410. BOOLEAN
  411. InitializeSDAC(
  412. PHW_DEVICE_EXTENSION
  413. );
  414. BOOLEAN
  415. FindSDAC(
  416. PHW_DEVICE_EXTENSION
  417. );
  418. //
  419. // nnclk.c
  420. //
  421. long calc_clock(long, int);
  422. long gcd(long, long);
  423. VOID set_clock(
  424. PHW_DEVICE_EXTENSION HwDeviceExtension,
  425. LONG clock_value);
  426. //
  427. // S3.c
  428. //
  429. ULONG
  430. S3GetChildDescriptor(
  431. PVOID HwDeviceExtension,
  432. PVIDEO_CHILD_ENUM_INFO ChildEnumInfo,
  433. PVIDEO_CHILD_TYPE pChildType,
  434. PVOID pvChildDescriptor,
  435. PULONG pHwId,
  436. PULONG pUnused
  437. );
  438. VP_STATUS
  439. GetDeviceDataCallback(
  440. PVOID HwDeviceExtension,
  441. PVOID Context,
  442. VIDEO_DEVICE_DATA_TYPE DeviceDataType,
  443. PVOID Identifier,
  444. ULONG IdentifierLength,
  445. PVOID ConfigurationData,
  446. ULONG ConfigurationDataLength,
  447. PVOID ComponentInformation,
  448. ULONG ComponentInformationLength
  449. );
  450. VP_STATUS
  451. S3FindAdapter(
  452. PVOID HwDeviceExtension,
  453. PVOID HwContext,
  454. PWSTR ArgumentString,
  455. PVIDEO_PORT_CONFIG_INFO ConfigInfo,
  456. PUCHAR Again
  457. );
  458. BOOLEAN
  459. S3Initialize(
  460. PVOID HwDeviceExtension
  461. );
  462. BOOLEAN
  463. S3ResetHw(
  464. PVOID HwDeviceExtension,
  465. ULONG Columns,
  466. ULONG Rows
  467. );
  468. BOOLEAN
  469. S3StartIO(
  470. PVOID HwDeviceExtension,
  471. PVIDEO_REQUEST_PACKET RequestPacket
  472. );
  473. VP_STATUS
  474. S3SetColorLookup(
  475. PHW_DEVICE_EXTENSION HwDeviceExtension,
  476. PVIDEO_CLUT ClutBuffer,
  477. ULONG ClutBufferSize
  478. );
  479. VOID
  480. SetHWMode(
  481. PHW_DEVICE_EXTENSION HwDeviceExtension,
  482. PUSHORT pusCmdStream
  483. );
  484. VP_STATUS
  485. S3RegistryCallback(
  486. PVOID HwDeviceExtension,
  487. PVOID Context,
  488. PWSTR ValueName,
  489. PVOID ValueData,
  490. ULONG ValueLength
  491. );
  492. LONG
  493. CompareRom(
  494. PUCHAR Rom,
  495. PUCHAR String
  496. );
  497. VOID
  498. MapLinearControlSpace(
  499. PHW_DEVICE_EXTENSION HwDeviceExtension
  500. );
  501. BOOLEAN
  502. S3IsaDetection(
  503. PHW_DEVICE_EXTENSION HwDeviceExtension,
  504. PULONG key
  505. );
  506. VOID
  507. S3GetInfo(
  508. PHW_DEVICE_EXTENSION HwDeviceExtension,
  509. POINTER_CAPABILITY *PointerCapability,
  510. VIDEO_ACCESS_RANGE accessRange[]
  511. );
  512. VOID
  513. S3DetermineFrequencyTable(
  514. PVOID HwDeviceExtension,
  515. VIDEO_ACCESS_RANGE accessRange[],
  516. INTERFACE_TYPE AdapterInterfaceType
  517. );
  518. VOID
  519. S3DetermineDACType(
  520. PVOID HwDeviceExtension,
  521. POINTER_CAPABILITY *PointerCapability
  522. );
  523. VOID
  524. S3ValidateModes(
  525. PVOID HwDeviceExtension,
  526. POINTER_CAPABILITY *PointerCapability
  527. );
  528. VOID
  529. S3DetermineMemorySize(
  530. PVOID HwDeviceExtension
  531. );
  532. VOID
  533. S3RecordChipType(
  534. PHW_DEVICE_EXTENSION HwDeviceExtension,
  535. PULONG key
  536. );
  537. VOID
  538. AlphaDetermineMemoryUsage(
  539. PHW_DEVICE_EXTENSION HwDeviceExtension,
  540. VIDEO_ACCESS_RANGE accessRange[]
  541. );
  542. ULONG
  543. UnlockExtendedRegs(
  544. PHW_DEVICE_EXTENSION HwDeviceExtension
  545. );
  546. VOID
  547. LockExtendedRegs(
  548. PHW_DEVICE_EXTENSION HwDeviceExtension,
  549. ULONG key
  550. );
  551. //
  552. // Non-int 10 platform support
  553. //
  554. VOID
  555. ZeroMemAndDac(
  556. PHW_DEVICE_EXTENSION HwDeviceExtension
  557. );
  558. VP_STATUS
  559. Set_Oem_Clock(
  560. PHW_DEVICE_EXTENSION HwDeviceExtension
  561. );
  562. VP_STATUS
  563. Wait_VSync(
  564. PHW_DEVICE_EXTENSION HwDeviceExtension
  565. );
  566. BOOLEAN
  567. Bus_Test(
  568. PHW_DEVICE_EXTENSION HwDeviceExtension
  569. );
  570. BOOLEAN
  571. Set864MemoryTiming(
  572. PHW_DEVICE_EXTENSION HwDeviceExtension
  573. );
  574. BOOLEAN
  575. S3ConfigurePCI(
  576. PHW_DEVICE_EXTENSION HwDeviceExtension,
  577. PULONG NumPCIAccessRanges,
  578. PVIDEO_ACCESS_RANGE PCIAccessRanges
  579. );
  580. VP_STATUS
  581. QueryStreamsParameters(
  582. PHW_DEVICE_EXTENSION HwDeviceExtension,
  583. VIDEO_QUERY_STREAMS_MODE *pStreamsMode,
  584. VIDEO_QUERY_STREAMS_PARAMETERS *pStreamsParameters
  585. );
  586. VOID
  587. WorkAroundForMach(
  588. PHW_DEVICE_EXTENSION HwDeviceExtension
  589. );
  590. //
  591. // ddc.c
  592. //
  593. BOOLEAN
  594. GetDdcInformation (
  595. PHW_DEVICE_EXTENSION phwDeviceExtension,
  596. PUCHAR QueryBuffer,
  597. ULONG BufferSize
  598. );
  599. //
  600. // power management
  601. //
  602. VP_STATUS
  603. S3GetPowerState(
  604. PHW_DEVICE_EXTENSION HwDeviceExtension,
  605. ULONG HwDeviceId,
  606. PVIDEO_POWER_MANAGEMENT VideoPowerManagement
  607. );
  608. VP_STATUS
  609. S3SetPowerState(
  610. PHW_DEVICE_EXTENSION HwDeviceExtension,
  611. ULONG HwDeviceId,
  612. PVIDEO_POWER_MANAGEMENT VideoPowerManagement
  613. );
  614. #define VESA_POWER_FUNCTION 0x4f10
  615. #define VESA_POWER_ON 0x0000
  616. #define VESA_POWER_STANDBY 0x0100
  617. #define VESA_POWER_SUSPEND 0x0200
  618. #define VESA_POWER_OFF 0x0400
  619. #define VESA_GET_POWER_FUNC 0x0000
  620. #define VESA_SET_POWER_FUNC 0x0001
  621. #define VESA_STATUS_SUCCESS 0x004f