DXGKCB_ALLOCATEPAGESFORMDL callback function (d3dkmddi.h)

DXGKCB_ALLOCATEPAGESFORMDL allocates physical memory pages for a memory descriptor list (MDL) to be mapped to the IOMMU's logical address space.

Syntax

DXGKCB_ALLOCATEPAGESFORMDL DxgkcbAllocatepagesformdl;

NTSTATUS DxgkcbAllocatepagesformdl(
  [in]     IN_CONST_HANDLE hAdapter,
  [in/out] INOUT_PDXGKARGCB_ALLOCATEPAGESFORMDL pAllocatePagesForMdl
)
{...}

Parameters

[in] hAdapter

A handle to the display adapter.

[in/out] pAllocatePagesForMdl

Pointer to a DXGKARGCB_ALLOCATEPAGESFORMDL structure that contains arguments to allocate pages for MDL.

Return value

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

Remarks

This callback function is a Windows graphics port driver function equivalent to the MmAllocatePagesForMdl function.

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

All memory accessed by the GPU during paging operations, or mapped via the GpuMmu must be mapped to the IOMMU. Dxgkrnl provides callbacks to the kernel-mode driver to allow the allocation and remapping in one step.

Note

Calls to DXGKCB_ALLOCATEPAGESFORMDL are limited to the 4GB PAGE_SIZE MDL restriction, and Dxgkrnl always specifies the MM_ALLOCATE_FULLY_REQUIRED flag in the internal call to MmAllocatePagesForMdlEx function. The driver should also 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_ALLOCATEPAGESFORMDL

DXGKCB_FREEPAGESFROMMDL

DXGKRNL_INTERFACE