Bewerken

Delen via


DXGKCB_ALLOCATECONTIGUOUSMEMORY callback function (d3dkmddi.h)

DXGKCB_ALLOCATECONTIGUOUSMEMORY allocates contiguous memory regions in the IOMMU's logical address space.

Syntax

DXGKCB_ALLOCATECONTIGUOUSMEMORY DxgkcbAllocatecontiguousmemory;

NTSTATUS DxgkcbAllocatecontiguousmemory(
  [in]     IN_CONST_HANDLE hAdapter,
  [in/out] INOUT_PDXGKARGCB_ALLOCATECONTIGUOUSMEMORY pAllocateContiguousMemory
)
{...}

Parameters

[in] hAdapter

Handle to a display adapter.

[in/out] 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 error code.

Remarks

This callback function is Dxgkrnl's equivalent to the MmAllocateContiguousMemory function.

DXGKCB_XXX functions are implemented by Dxgkrnl. To use this callback function, set the appropriate members of DXGKARGCB_ALLOCATECONTIGUOUSMEMORY and then call DxgkCbAllocateContiguousMemory via the DXGKRNL_INTERFACE.

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.

See IOMMU-based GPU isolation for more information.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1803 (WDDM 2.4)
Header d3dkmddi.h
IRQL PASSIVE_LEVEL

See also

DXGKARGCB_ALLOCATECONTIGUOUSMEMORY

DXGKCB_FREECONTIGUOUSMEMORY

DXGKRNL_INTERFACE