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.

195 lines
5.5 KiB

  1. /******************************************************************************\
  2. *
  3. * $Workfile: PRECOMP.H $
  4. *
  5. * Contents:
  6. * Common headers used throughout the display driver. This entire include file
  7. * will typically be pre-compiled.
  8. *
  9. * Copyright (c) 1996 Cirrus Logic, Inc.
  10. *
  11. * $Log: X:/log/laguna/nt35/displays/cl546x/PRECOMP.H $
  12. *
  13. * Rev 1.10 Feb 16 1998 15:54:18 frido
  14. * Removed rx.h from NT 5.0 headers.
  15. *
  16. * Rev 1.9 29 Aug 1997 17:14:46 RUSSL
  17. * Added overlay support
  18. *
  19. * Rev 1.8 08 Aug 1997 16:05:10 FRIDO
  20. *
  21. * Added mMCore.h file.
  22. *
  23. * Rev 1.7 26 Feb 1997 13:20:20 noelv
  24. *
  25. * disable MCD code for NT 3.5x
  26. *
  27. * Rev 1.6 26 Feb 1997 09:24:14 noelv
  28. *
  29. * Added MCD include files.
  30. *
  31. * Rev 1.5 20 Jan 1997 14:48:32 bennyn
  32. *
  33. * Added ddinline.h
  34. *
  35. * Rev 1.4 16 Jan 1997 11:41:22 bennyn
  36. *
  37. * Added pwrmgr.h & lgddmsg.h
  38. *
  39. * Rev 1.3 01 Nov 1996 09:24:12 BENNYN
  40. *
  41. * Added shareable DD blt include files
  42. *
  43. * Rev 1.2 20 Aug 1996 11:05:22 noelv
  44. * Bugfix release from Frido 8-19-96
  45. *
  46. * Rev 1.1 15 Aug 1996 11:38:56 frido
  47. * First revision.
  48. *
  49. \******************************************************************************/
  50. #include <stddef.h>
  51. #include <stdarg.h>
  52. #include <limits.h>
  53. #ifdef WINNT_VER40
  54. #include <windef.h>
  55. #include <wingdi.h>
  56. #include <winerror.h>
  57. #else
  58. #include <windows.h>
  59. #endif
  60. #include <memory.h>
  61. #include <stdio.h>
  62. #include <stdlib.h>
  63. #include <winddi.h>
  64. #include <devioctl.h>
  65. #include <ntddvdeo.h>
  66. #include <ioaccess.h>
  67. #if _WIN32_WINNT < 0x0500
  68. #include <rx.h>
  69. #endif
  70. #include <ntsdexts.h>
  71. #include <dciddi.h>
  72. #ifndef WINNT_VER35
  73. #include <mcdrv.h> // OpenGL MCD ddk supplied header
  74. #endif
  75. #include "bltp.h"
  76. #include "l2d.h"
  77. #include "l3system.h"
  78. #if DRIVER_5465 && defined(OVERLAY)
  79. #include "overlay.h"
  80. #include "5465bw.h"
  81. #endif
  82. #include "driver.h"
  83. #include "HDtable.h"
  84. #include "lines.h"
  85. #include "Optimize.h"
  86. #include "ddinline.h"
  87. #include "lgddmsg.h"
  88. #include "pwrmgr.h"
  89. #include "mmCore.h"
  90. /// Define the A vector polynomial bits
  91. //
  92. // Each bit corresponds to one of the terms in the polynomial
  93. //
  94. // Rop(D,S,P) = a + a D + a S + a P + a DS + a DP + a SP + a DSP
  95. // 0 d s p ds dp sp dsp
  96. #define AVEC_NOT 0x01
  97. #define AVEC_D 0x02
  98. #define AVEC_S 0x04
  99. #define AVEC_P 0x08
  100. #define AVEC_DS 0x10
  101. #define AVEC_DP 0x20
  102. #define AVEC_SP 0x40
  103. #define AVEC_DSP 0x80
  104. #define AVEC_NEED_SOURCE (AVEC_S | AVEC_DS | AVEC_SP | AVEC_DSP)
  105. #define AVEC_NEED_PATTERN (AVEC_P | AVEC_DP | AVEC_SP | AVEC_DSP)
  106. #define AVEC_NEED_DEST (AVEC_D | AVEC_DP | AVEC_DS | AVEC_DSP)
  107. // This is Laguna specific or 3 OP ROP specific
  108. #define ROP3MIX(fg, bg) ((fg & 0xCC) | (bg & 0x33))
  109. // SWAP - Swaps the value of two variables, using a temporary variable
  110. #define SWAP(a, b, tmp) { (tmp) = (a); (a) = (b); (b) = (tmp); }
  111. #if defined(i386)
  112. #define QUOTIENT_REMAINDER(ulNumerator, ulDenominator, ulQuotient, ulRemainder) \
  113. { \
  114. __asm mov eax, ulNumerator \
  115. __asm sub edx, edx \
  116. __asm div ulDenominator \
  117. __asm mov ulQuotient, eax \
  118. __asm mov ulRemainder, edx \
  119. }
  120. #else
  121. #define QUOTIENT_REMAINDER(ulNumerator, ulDenominator, ulQuotient, ulRemainder) \
  122. { \
  123. ulQuotient = (ULONG) ulNumerator / (ULONG) ulDenominator; \
  124. ulRemainder = (ULONG) ulNumerator % (ULONG) ulDenominator; \
  125. }
  126. #endif
  127. #define BD_OP1_IS_SRAM_MONO (BD_OP1 * IS_SRAM_MONO)
  128. #ifdef DEBUG
  129. #define ASSERTDD(x, y) if (!(x)) RIP (y)
  130. #else
  131. #define ASSERTDD(x, y)
  132. #endif
  133. typedef VOID (FNFILL)(PDEV*, LONG, RECTL*, ULONG, ULONG, BRUSHOBJ*, POINTL*);
  134. //
  135. // File Prototypes
  136. BOOL bIntersect(RECTL* prcl1, RECTL* prcl2, RECTL* prclResult);
  137. BOOL bSetMask(PPDEV ppdev, BRUSHOBJ *pbo, POINTL *pptlBrush, ULONG *bltdef);
  138. BOOL bMmFastFill(
  139. PDEV* ppdev,
  140. LONG cEdges, // Includes close figure edge
  141. POINTFIX* pptfxFirst,
  142. ULONG ulHwForeMix,
  143. ULONG ulHwBackMix,
  144. ULONG iSolidColor,
  145. BRUSHOBJ* pbo);
  146. VOID vMmFillSolid( // Type FNFILL
  147. PDEV* ppdev,
  148. LONG c, // Can't be zero
  149. RECTL* prcl, // List of rectangles to be filled, in relative
  150. // coordinates
  151. ULONG ulHwForeMix, // Hardware mix mode
  152. ULONG ulHwBackMix, // Not used
  153. BRUSHOBJ* pbo, // Drawing colour is pbo->iSolidColor
  154. POINTL* pptlBrush); // Not used
  155. VOID vMmFillPatFast( // Type FNFILL
  156. PDEV* ppdev,
  157. LONG c, // Can't be zero
  158. RECTL* prcl, // List of rectangles to be filled, in relative
  159. // coordinates
  160. ULONG ulHwForeMix, // Hardware mix mode (foreground mix mode if
  161. // the brush has a mask)
  162. ULONG ulHwBackMix, // Not used (unless the brush has a mask, in
  163. // which case it's the background mix mode)
  164. BRUSHOBJ* pbo, // pbo
  165. POINTL* pptlBrush); // Pattern alignment
  166.