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.

98 lines
3.7 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1994-1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: ddagp.h
  6. * Content: AGP memory header file
  7. * History:
  8. * Date By Reason
  9. * ==== == ======
  10. * 03-Feb-98 DrewB Split from ddrawpr.h for user/kernel portability.
  11. *
  12. ***************************************************************************/
  13. #ifndef __DDAGP_INCLUDED__
  14. #define __DDAGP_INCLUDED__
  15. // This value controls how big a chunk of GART memory to commit each time
  16. // we need to (rather than commiting just what we need to satisfy a surface
  17. // request). This value is in bytes. Currently 256KB.
  18. #define DEFAULT_AGP_COMMIT_DELTA (256 * 1024)
  19. #define BITS_IN_BYTE 8
  20. extern DWORD dwAGPPolicyMaxBytes;
  21. extern DWORD dwAGPPolicyCommitDelta;
  22. //
  23. // OS-specific functions for AGP manipulation.
  24. //
  25. #ifdef WIN95
  26. #define OsGetAGPDeviceHandle(pHeap) GetDXVxdHandle()
  27. #define OsCloseAGPDeviceHandle(h) CloseHandle(h)
  28. #else
  29. #define OsGetAGPDeviceHandle(pHeap) ((pHeap)->hdevAGP)
  30. #define OsCloseAGPDeviceHandle(h)
  31. #endif
  32. BOOL OsAGPReserve( HANDLE hdev, DWORD dwNumPages, BOOL fIsUC, BOOL fIsWC,
  33. FLATPTR *pfpLinStart, LARGE_INTEGER *pliDevStart,
  34. PVOID *ppvReservation );
  35. BOOL OsAGPCommit( HANDLE hdev, PVOID pvReservation,
  36. DWORD dwPageOffset, DWORD dwNumPages );
  37. BOOL OsAGPDecommit( HANDLE hdev, PVOID pvReservation, DWORD dwPageOffset,
  38. DWORD dwNumPages );
  39. BOOL OsAGPFree( HANDLE hdev, PVOID pvReservation );
  40. //
  41. // Generic functions that use the OS-specific functions.
  42. //
  43. DWORD AGPReserve( HANDLE hdev, DWORD dwSize, BOOL fIsUC, BOOL fIsWC,
  44. FLATPTR *pfpLinStart, LARGE_INTEGER *pliDevStart,
  45. PVOID *ppvReservation );
  46. BOOL AGPCommit( HANDLE hdev, PVOID pvReservation,
  47. DWORD dwOffset, DWORD dwSize, BYTE* pAgpCommitMask,
  48. DWORD* pdwCommittedSize, DWORD dwHeapSize );
  49. BOOL AGPDecommitAll( HANDLE hdev, PVOID pvReservation,
  50. BYTE* pAgpCommitMask, DWORD dwAgpCommitMaksSize,
  51. DWORD* pdwDecommittedSize,
  52. DWORD dwHeapSize);
  53. BOOL AGPFree( HANDLE hdev, PVOID pvReservation );
  54. DWORD AGPGetChunkCount( DWORD dwSize );
  55. VOID AGPUpdateCommitMask( BYTE* pAgpCommitMask, DWORD dwOffset,
  56. DWORD dwSize, DWORD dwHeapSize );
  57. BOOL AGPCommitVirtual( EDD_DIRECTDRAW_LOCAL* peDirectDrawLocal,
  58. VIDEOMEMORY* lpVidMem,
  59. int iHeapIndex,
  60. DWORD dwOffset,
  61. DWORD dwSize );
  62. BOOL AGPDecommitVirtual( EDD_VMEMMAPPING* peMap,
  63. EDD_DIRECTDRAW_GLOBAL* peDirectDrawGlobal,
  64. EDD_DIRECTDRAW_LOCAL* peDirectDrawLocal,
  65. DWORD dwHeapSize);
  66. NTSTATUS AGPMapToDummy( EDD_VMEMMAPPING* peMap,
  67. EDD_DIRECTDRAW_GLOBAL* peDirectDrawGlobal,
  68. PVOID pDummyPage);
  69. BOOL AGPCommitAllVirtual( EDD_DIRECTDRAW_LOCAL* peDirectDrawLocal,
  70. VIDEOMEMORY* lpVidMem,
  71. int iHeapIndex);
  72. VOID InitAgpHeap( EDD_DIRECTDRAW_GLOBAL* peDirectDrawGlobal,
  73. DWORD dwHeapIndex,
  74. HANDLE hdev);
  75. BOOL bDdMapAgpHeap( EDD_DIRECTDRAW_LOCAL* peDirectDrawLocal,
  76. VIDEOMEMORY* pvmHeap);
  77. #ifndef __NTDDKCOMP__
  78. #ifdef WIN95
  79. BOOL vxdIsVMMAGPAware ( HANDLE hvxd );
  80. #endif
  81. BOOL OSIsAGPAware( HANDLE hdev );
  82. #endif
  83. #endif // __DDAGP_INCLUDED__