DXGKCB_ALLOCATECONTIGUOUSMEMORY callback function (d3dkmddi.h)

Implemented by the client driver to allocate contiguous memory regions in the IoMMu's logical address space. This callback function is a Windows graphics port driver function equivalent to the MmAllocateContiguousMemory function of the kernel mode driver.

Syntax

DXGKCB_ALLOCATECONTIGUOUSMEMORY DxgkcbAllocatecontiguousmemory;

NTSTATUS DxgkcbAllocatecontiguousmemory(
  IN_CONST_HANDLE hAdapter,
  INOUT_PDXGKARGCB_ALLOCATECONTIGUOUSMEMORY pAllocateContiguousMemory
)
{...}

Parameters

hAdapter

Handle to a display adapter.

pAllocateContiguousMemory

Pointer to a DXGKARGCB_ALLOCATECONTIGUOUSMEMORY structure that contains arguments to allocate contiguous memory.

Return value

Return STATUS_SUCCESS if the operation succeeds. Otherwise, return an appropriate NTSTATUS Values error code.

Remarks

Register your implementation of this callback function by setting the appropriate members of DXGKARGCB_ALLOCATECONTIGUOUSMEMORY and then calling DxgkCbAllocateContiguousMemory.

All memory accessed by the GPU during paging operations, or mapped via the GpuMmu must be mapped to the IoMmu. The Dxgkrnl provides callbacks to the KMD to allow the allocation and remapping in one step.

Note The driver should not lock any memory. Dxgkrnl will manage locked pages for the driver, and once the memory is remapped, the logical address of the pages provided to the driver may no longer match the physical addresses.

Requirements

   
Header d3dkmddi.h