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.

152 lines
4.2 KiB

  1. /**********************************************************
  2. * Copyright Cirrus Logic, 1997. All rights reserved.
  3. ***********************************************************
  4. *
  5. * 5465BW.H - Bandwidth function header for CL-GD5465
  6. *
  7. ***********************************************************
  8. *
  9. * Author: Rick Tillery
  10. * Date: 03/20/97
  11. *
  12. * Revision History:
  13. * -----------------
  14. * WHO WHEN WHAT/WHY/HOW
  15. * --- ---- ------------
  16. *
  17. ***********************************************************/
  18. // If WinNT 3.5 skip all the source code
  19. #if defined WINNT_VER35 // WINNT_VER35
  20. #else
  21. #ifndef _5465BW_H
  22. #define _5465BW_H
  23. #ifndef WINNT_VER40
  24. #include <Windows.h>
  25. #endif
  26. #ifdef DEBUGSTRINGS
  27. #ifndef ODS
  28. extern void __cdecl Msg( LPSTR szFormat, ... );
  29. #define ODS Msg
  30. #endif // ODS
  31. #else
  32. #ifndef ODS
  33. #define ODS (void)
  34. #endif // ODS
  35. #endif // DEBUGSTRINGS
  36. #ifdef _DEBUG
  37. #define BREAK1 _asm int 01h
  38. #define BREAK3 _asm int 03h
  39. #else
  40. #define BREAK1
  41. #define BREAK3
  42. #endif // _DEBUG
  43. #include "BW.h"
  44. #include <stdlib.h>
  45. //
  46. // CL-GD5465 specifications
  47. //
  48. #define FIFOWIDTH 64 // Bits
  49. #define BLTFIFOSIZE 32 // QWORDS
  50. #define CAPFIFOSIZE 16 // QWORDS
  51. #define GFXFIFOSIZE 64 // QWORDS
  52. #define VIDFIFOSIZE 32 // QWORDS
  53. #define NORM_RANDOM 14 // MCLKs for random access
  54. #ifndef OLDONE
  55. #define CONC_RANDOM 8 // MCLKs for concurrent random access
  56. #define CONC_HIT_LATENCY (8 - 2) // MCLKs for concurrent hit minus
  57. #else
  58. #define CONC_RANDOM 10 // MCLKs for concurrent random access
  59. #define CONC_HIT_LATENCY 8 // MCLKs for concurrent hit minus
  60. #endif
  61. #define NORM_HIT_LATENCY (4 - 2) // MCLKs for hit minus MCLK/VCLK sync
  62. // MCLK/VCLK sync
  63. #define RIF_SAVINGS 4 // MCLKs savings for sequential randoms
  64. #define SYNCDELAY 3 // MCLKs for synchronization delay to
  65. // account for VCLK/MCLK sync, state
  66. // machine and RIF delays
  67. #define DISP_LATENCY 6ul // Max delay through display arbitraion
  68. // pipeline.
  69. #define ONEVIDLEVELFILL 2 // MCLKs to fill one video FIFO level
  70. #define ONELEVEL 1
  71. #define ARBSYNC 5 // Arbitration sync (pipelining)
  72. #define CURSORFILL 2
  73. #define BLTFILL (BLTFIFOSIZE / 2) // MCLKs to burst fill BLT FIFO
  74. #define CAPFILL (CAPFIFOSIZE / 2) // MCLKs to burst fill capture FIFO
  75. #define VIDFILL (VIDFIFOSIZE / 2) // MCLKs to burst fill video FIFO
  76. #define VID420FILL (VIDFIFOSIZE / 4) // 4:2:0 divides FIFO into two
  77. #define REF_XTAL (14318182ul) // Crystal reference frequency (Hz)
  78. #define TVO_XTAL (27000000ul) // TV-Out reference freq.
  79. typedef struct BWREGS_
  80. {
  81. BYTE MISCOutput; // 0x0080
  82. BYTE VCLK3Denom; // 0x0084
  83. BYTE VCLK3Num; // 0x0088
  84. WORD DispThrsTiming; // 0x00EA
  85. WORD GfVdFormat; // 0x00C0
  86. WORD RIFControl; // 0x0200
  87. BYTE BCLK_Mult; // 0x02C0
  88. BYTE BCLK_Denom; // 0x02C1
  89. WORD Control2; // 0x0418
  90. BYTE CR1; // 0x4 Get Screen Width from these registers
  91. BYTE CR1E; // 0x78
  92. }BWREGS, FAR *LPBWREGS;
  93. #ifdef WINNT_VER40
  94. // Be sure to synchronize the following structures with the one
  95. // in i386\Laguna.inc!
  96. //
  97. typedef struct PROGREGS_
  98. {
  99. WORD VW0_FIFO_THRSH;
  100. WORD DispThrsTiming;
  101. }PROGREGS, FAR *LPPROGREGS;
  102. #else
  103. typedef struct PROGREGS_
  104. {
  105. WORD VW0_FIFO_THRSH;
  106. WORD DispThrsTiming;
  107. }PROGREGS, FAR *LPPROGREGS;
  108. #endif
  109. static int ScaleMultiply(DWORD, DWORD, LPDWORD);
  110. DWORD ChipCalcTileWidth(LPBWREGS);
  111. BOOL ChipCalcMCLK(LPBWREGS, LPDWORD);
  112. BOOL ChipCalcVCLK(LPBWREGS, LPDWORD);
  113. BOOL ChipGetMCLK
  114. (
  115. #ifdef WINNT_VER40
  116. PDEV *,
  117. #endif
  118. LPDWORD
  119. );
  120. BOOL ChipGetVCLK
  121. (
  122. #ifdef WINNT_VER40
  123. PDEV *,
  124. #endif
  125. LPDWORD
  126. );
  127. BOOL ChipIsEnoughBandwidth(LPPROGREGS, LPVIDCONFIG, LPBWREGS);
  128. #endif // _5465BW_H
  129. #endif // WINNT_VER35
  130.