Setting the Size and Pitch of the Memory Allocation

A display miniport driver that supports GDI Hardware Acceleration should set the size and pitch of the allocations of system or video memory when it processes the following allocation calls.

DxgkDdiCreateAllocation
When the driver processes a call to DxgkDdiCreateAllocation, it should set the size, in bytes, of the system or video memory allocation. The size of the allocation is set through the pCreateAllocation-> pAllocationInfo->Size member. If the allocation is visible to the CPU, the size should include the pitch value, which is the width of the surface, including padding, in bytes.

Allocations are visible to the CPU if the pGetStandardAllocationDriverData->pCreateGdiSurfaceData->Type member is set to D3DKMDT_GDISURFACE_STAGING_CPUVISIBLE or D3DKMDT_GDISURFACE_EXISTINGSYSMEM. For the properties of these surface types, see the descriptions in D3DKMDT_GDISURFACETYPE.

DxgkDdiGetStandardAllocationDriverData
When the driver processes a call to DxgkDdiGetStandardAllocationDriverData for an allocation that is visible to the CPU, it should:

  1. Set the pGetStandardAllocationDriverData->StandardAllocationType member to D3DKMDT_STANDARDALLOCATION_GDISURFACE.

  2. Set the description of a surface that can be used for redirection by GDI Hardware Acceleration and the Desktop Windows Manager (DWM) through the D3DKMDT_GDISURFACEDATA structure that is pointed to by the pGetStandardAllocationDriverData->pCreateGdiSurfaceData member. For example, set the pitch of the allocation through the Pitch member of D3DKMDT_GDISURFACEDATA.