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.

204 lines
7.8 KiB

  1. /**********************************************************
  2. * Copyright Cirrus Logic, Inc. 1996. All rights reserved.
  3. ***********************************************************
  4. *
  5. * 7555BW.H
  6. *
  7. * Contains preprocessor definitions needed for CL-GD7555
  8. * bandwidth equations.
  9. *
  10. ***********************************************************
  11. *
  12. * WHO WHEN WHAT/WHY/HOW
  13. * --- ---- ------------
  14. * RT 11/07/96 Created.
  15. * TT 02-24-97 Modified from 5446misc.h for 7555.
  16. *
  17. ***********************************************************/
  18. //#ifndef _7555BW_H
  19. //#define _7555BW_H
  20. //
  21. //#include <Windows.h>
  22. //#include <Windowsx.h>
  23. //
  24. //#include "VPM_Cir.h"
  25. //#include "Debug.h"
  26. //#include "BW.h"
  27. /* type definitions & structures -------------------------*/
  28. typedef struct _BWEQ_STATE_INFO
  29. {
  30. RECTL rVPort; /* Rect. at video port, if capture enabled */
  31. RECTL rCrop; /* Rect. after cropping, if capture enabled */
  32. RECTL rPrescale; /* Rect. after scaling, if capture enabled */
  33. RECTL rSrc; /* Rect. in memory for display */
  34. RECTL rDest; /* Rect. on the screen for display */
  35. DWORD dwSrcDepth; /* Bits per pixel of data, in memory */
  36. DWORD dwPixelsPerSecond;/* Rate of data into video port, if capture enabled */
  37. DWORD dwFlags; /* See FLG_ in OVERLAY.H */
  38. } BWEQ_STATE_INFO, *PBWEQ_STATE_INFO;
  39. /* preprocessor definitions ------------------------------*/
  40. #define WIDTH(a) ((a).right - (a).left)
  41. #define HEIGHT(a) ((a).bottom - (a).top)
  42. #define REF_XTAL (14318182ul) // Crystal reference frequency (Hz)
  43. /*
  44. * VGA MISC Register
  45. */
  46. #define MISC_WRITE 0x03C2 // Miscellaneous Output Register (Write)
  47. #define MISC_READ 0x03CC // Miscellaneous Output Register (Read)
  48. #define MISC_VCLK_SELECT 0x0C // Choose one of the four VCLKs
  49. #define MISC_MEMORY_ACCESS 0x02 // Enable memory access
  50. /*
  51. * VGA CRTC Registers
  52. */
  53. #define CR01 0x01 // Horizontal Display End Register
  54. #define CR01_HORZ_END 0xFF // Horizontal Display End
  55. #define CR42 0x42 // VW FIFO Threshold and Chroma Key
  56. // Mode Select Register
  57. #define CR42_MVWTHRESH 0x0C // VW FIFO Threshold
  58. #define CR51 0x51 // V-Port Data Format Register
  59. #define CR51_VPORTMVW_THRESH 0xE0 // V-Port FIFO Threshold in VW
  60. #define CR5A 0x5A // V-Port Cycle and V-Port FIFO Control
  61. #define CR5A_VPORTGFX_THRESH 0x07 // V-Port FIFO Threshold in Surrounding
  62. // graphics
  63. #define CR5D 0x5D // Number of Memory Cycles per Scanline
  64. // Override Register
  65. #define CR5D_MEMCYCLESPERSCAN 0xFF // Number of Memory Cycles per Scanline
  66. // Override
  67. #define CR80 0x80 // Power Management Control Register
  68. #define CR80_LCD_ENABLE 0x01 // Flat Panel Enable
  69. #define CR83 0x83 // Flat Panel Type Register
  70. #define CR83_LCD_TYPE 0x70 // Flat Panel Type Select
  71. /*
  72. * VGA GRC Registers
  73. */
  74. #define GRC_INDEX 0x03CE // Graphics controller index register
  75. #define GRC_DATA 0x03CF // Graphics controller data register
  76. #define GR18 0x18 // EDO RAM Control Register
  77. #define GR18_LONG_RAS 0x04 // EDO DRAM Long RAS# Cycle Enable
  78. /*
  79. * VGA Sequencer Registers
  80. */
  81. #define SR0F 0x0F // Display Memory Control Register
  82. #define SR0F_DISPLAY_RAS 0x04 // Display Memory RAS# Cycle Select
  83. #define SR0B 0x0B // VCLK0 Numerator
  84. #define SR0C 0x0C // VCLK1 Numerator
  85. #define SR0D 0x0D // VCLK2 Numerator
  86. #define SR0E 0x0E // VCLK3 Numerator
  87. #define SR0X_VCLK_NUMERATOR 0x7F // VCLK Numerator
  88. #define SR1B 0x1B // VCLK0 Denomintor and Post-Scalar
  89. #define SR1C 0x1C // VCLK1 Denomintor and Post-Scalar
  90. #define SR1D 0x1D // VCLK2 Denomintor and Post-Scalar
  91. #define SR1E 0x1E // VCLK3 Denomintor and Post-Scalar
  92. #define SR1X_VCLK_DENOMINATOR 0x3E // VCLK Denominator
  93. #define SR1X_VCLK_POST_SCALAR 0x01 // VCLK Post-Scalar
  94. #define SR1E_VCLK_MCLK_DIV2 0x01 // MCLK Divide by 2 (when SR1F[6] = 1)
  95. #define SR1F 0x1F // MCLK Frequency and VCLK Source Select
  96. #define SR1F_VCLK_SRC 0x40 // VCLK Source Select
  97. #define SR1F_MCLK_FREQ 0x3F // MCLK Frequency
  98. #define SR20 0x20 // Miscellaneous Control Register 2
  99. #define SR20_9MCLK_RAS 0x40 // Select 9-MCLK RAS# Cycles for EDO DRAMs
  100. #define SR20_VCLKDIV4 0x02 // Set VCLK0, 1 Source to VCLK VCO/4
  101. #define SR2F 0x2F // HFA FIFO Threshold for Surrounding
  102. // Graphics Register
  103. #define SR2F_HFAFIFOGFX_THRESH 0x0F // HFA FIFO Threshold for Surr. Gfx
  104. #define SR32 0x32 // HFA FIFO Threshold in VW and DAC
  105. // IREF Power Control Register
  106. #define SR32_HFAFIFOMVW_THRESH 0x07 // HFA FIFO Thresh in VW
  107. #define SR34 0x34 // Host CPU Cycle Stop Control Register
  108. #define SR34_CPUSTOP_ENABLE 0x10 // Terminate Paged Host CPU Cycles when
  109. // Re-starting is Disabled
  110. #define SR34_DSTN_CPUSTOP 0x08 // Stop Host CPU Cycle before Half-
  111. // Frame Accelerator Cycle
  112. #define SR34_VPORT_CPUSTOP 0x04 // Stop Host CPU Cycle before V-Port cycle
  113. #define SR34_MVW_CPUSTOP 0x02 // Stop Host CPU Cycle before VW cycle
  114. #define SR34_GFX_CPUSTOP 0x01 // Stop Host CPU Cycle before CRT
  115. // Monitor cycle
  116. #define GFXFIFO_THRESH 8
  117. //typedef struct PROGREGS_
  118. //{
  119. // BYTE bSR2F;
  120. // BYTE bSR32;
  121. // BYTE bSR34;
  122. //
  123. // BYTE bCR42;
  124. // BYTE bCR51;
  125. // BYTE bCR5A;
  126. // BYTE bCR5D;
  127. //}PROGREGS, FAR *LPPROGREGS;
  128. //
  129. #if 0 //myf32
  130. typedef struct BWREGS_
  131. {
  132. BYTE bSR2F;
  133. BYTE bSR32;
  134. BYTE bSR34;
  135. BYTE bCR42;
  136. BYTE bCR51;
  137. BYTE bCR5A;
  138. BYTE bCR5D;
  139. BYTE bCR5F;
  140. }BWREGS, FAR *LPBWREGS;
  141. #endif
  142. /*
  143. * Function prototypes
  144. */
  145. //BOOL IsSufficientBandwidth7555 (WORD, WORD, DWORD, DWORD, DWORD, DWORD,
  146. //DWORD, DWORD, LPBWREGS);
  147. //BOOL IsSufficientBandwidth7555 (WORD, LPRECTL, LPRECTL, DWORD);
  148. // 7555BW.c
  149. //static int ScaleMultiply(DWORD, // Factor 1
  150. // DWORD, // Factor 2
  151. // LPDWORD); // Pointer to returned product
  152. //BOOL ChipCalcMCLK(LPBWREGS, // Current register settings
  153. // LPDWORD); // Pointer to returned MCLK
  154. //BOOL ChipCalcVCLK(LPBWREGS, // Current register settings
  155. // LPDWORD); // Pointer to returned VCLK
  156. //BOOL ChipGetMCLK(LPDWORD); // Pointer to returned MCLK
  157. //BOOL ChipGetVCLK(LPDWORD); // Pointer to returned VCLK
  158. //BOOL ChipIsDSTN(LPBWREGS); // Current register settings
  159. //BOOL ChipCheckBandwidth(LPVIDCONFIG, // Current video configuration
  160. // LPBWREGS, // Current register values
  161. // LPPROGREGS); // Holds return value for regs
  162. // // (may be NULL)
  163. //BOOL ChipIsEnoughBandwidth(LPVIDCONFIG, // Current video configuration
  164. // LPPROGREGS); // Holds return value for regs
  165. // // (may be NULL)
  166. //// 7555IO.c
  167. //BOOL ChipIOReadBWRegs(LPBWREGS); // Filled with current reg settings
  168. //BOOL ChipIOWriteProgRegs(LPPROGREGS); // Writes register values
  169. //BOOL ChipIOReadProgRegs(LPPROGREGS); // Get current register settings
  170. //
  171. //#endif // _7555BW_H
  172.