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.

114 lines
3.6 KiB

  1. /******************************Module*Header*******************************\
  2. *
  3. * Module Name: memmgr.h
  4. *
  5. * contains prototypes for the memory manager.
  6. *
  7. * Copyright (c) 1997 Cirrus Logic, Inc.
  8. *
  9. * $Log: X:/log/laguna/nt35/displays/cl546x/memmgr.h $
  10. *
  11. * Rev 1.4 18 Sep 1997 16:13:28 bennyn
  12. *
  13. * Fixed NT 3.51 compile/link problem
  14. *
  15. * Rev 1.3 12 Sep 1997 12:06:32 bennyn
  16. *
  17. * Modified for DD overlay support.
  18. *
  19. * Rev 1.2 08 Aug 1997 14:34:10 FRIDO
  20. * Added SCREEN_ALLOCATE and MUST_HAVE flags.
  21. *
  22. * Rev 1.1 26 Feb 1997 10:46:08 noelv
  23. * Added OpenGL MCD code from ADC.
  24. *
  25. * Rev 1.0 06 Feb 1997 10:34:10 noelv
  26. * Initial revision.
  27. *
  28. \**************************************************************************/
  29. #ifndef _MEMMGR_H_
  30. #define _MEMMGR_H_
  31. /*
  32. * Be sure to synchronize these structures with those in i386\Laguna.inc!
  33. */
  34. #pragma pack(1)
  35. //
  36. // For offscreen memory manager
  37. //
  38. typedef VOID (*POFM_CALLBACK)();
  39. #define NO_X_TILE_AlIGN 0x1
  40. #define NO_Y_TILE_AlIGN 0x2
  41. #define PIXEL_AlIGN 0x4
  42. #define DISCARDABLE_FLAG 0x8
  43. #define SAVESCREEN_FLAG 0x10
  44. #define SCREEN_ALLOCATE 0x4000
  45. #define MUST_HAVE 0x8000
  46. #define MCD_NO_X_OFFSET 0x20 //MCD - allows forcing AllocOffScnMem to get block with x=0
  47. #define MCD_Z_BUFFER_ALLOCATE 0x40 //MCD - force 16 bpp allocate for Z on 32 scanline boundary
  48. #define MCD_DRAW_BUFFER_ALLOCATE 0x80 //MCD - force allocate for 3d backbuffer on 32 scanline boundary
  49. #define MCD_TEXTURE8_ALLOCATE 0x100 //MCD - force 8 bpp block for texture map
  50. #define MCD_TEXTURE16_ALLOCATE 0x200 //MCD - force 16 bpp block for texture map
  51. #define MCD_TEXTURE32_ALLOCATE 0x400 //MCD - force 32 bpp block for texture map
  52. #define EIGHT_BYTES_ALIGN 0x800 // Align in 8 bytes boundary
  53. #define MCD_TEXTURE_ALLOCATE (MCD_TEXTURE8_ALLOCATE|MCD_TEXTURE16_ALLOCATE|MCD_TEXTURE32_ALLOCATE)
  54. #define MCD_TEXTURE_ALLOC_SHIFT 8 //num bits to shift alignflag to get numbytes per texel
  55. typedef struct _OFMHDL
  56. {
  57. ULONG x; // actual X, Y position
  58. ULONG y;
  59. ULONG aligned_x; // aligned X, Y position
  60. ULONG aligned_y;
  61. LONG sizex; // Allocated X & Y sizes (in bytes)
  62. LONG sizey;
  63. ULONG alignflag; // Alignment flag
  64. ULONG flag; // Status flag
  65. POFM_CALLBACK pcallback; // callback function pointer
  66. struct _OFMHDL *prevhdl;
  67. struct _OFMHDL *nexthdl;
  68. struct _OFMHDL *subprvhdl;
  69. struct _OFMHDL *subnxthdl;
  70. struct _OFMHDL *prvFonthdl;
  71. struct _OFMHDL *nxtFonthdl;
  72. struct _DSURF *pdsurf; // If this offscreen memory block holds a
  73. // device bitmap, then this is it.
  74. } OFMHDL, *POFMHDL;
  75. #if DRIVER_5465 && defined(OVERLAY) && defined(WINNT_VER40)
  76. #else
  77. typedef struct _DDOFM
  78. {
  79. struct _DDOFM *prevhdl;
  80. struct _DDOFM *nexthdl;
  81. POFMHDL phdl;
  82. } DDOFM, *PDDOFM;
  83. #endif
  84. //
  85. // Offscreen memory manager function prototypes
  86. //
  87. BOOL InitOffScnMem(struct _PDEV *ppdev);
  88. POFMHDL AllocOffScnMem(struct _PDEV *ppdev, PSIZEL surf, ULONG alignflag, POFM_CALLBACK pcallback);
  89. BOOL FreeOffScnMem(struct _PDEV *ppdev, POFMHDL psurf);
  90. void CloseOffScnMem(struct _PDEV *ppdev);
  91. PVOID ConvertToVideoBufferAddr(struct _PDEV *ppdev, POFMHDL psurf);
  92. POFMHDL DDOffScnMemAlloc(struct _PDEV *ppdev);
  93. void DDOffScnMemRestore(struct _PDEV *ppdev);
  94. // restore default structure alignment
  95. #pragma pack()
  96. #endif // _MEMMGR_H_
  97.