Initializing Use of Memory Segments
Memory segments, in the context of the display driver model for Windows Vista and later (WDDM), describe the graphics processing unit's (GPU) address space to the video memory manager. Memory segments generalize and virtualize video memory resources. Memory segments are configured according to the memory types that the hardware supports (for example, frame buffer memory or system memory aperture).
To initialize how it uses memory segments, the Microsoft DirectX graphics kernel subsystem (Dxgkrnl.sys) calls the display miniport driver's DxgkDdiQueryAdapterInfo function. To direct the display miniport driver to return information about memory segments from the DxgkDdiQueryAdapterInfo call, the graphics subsystem specifies either the DXGKQAITYPE_QUERYSEGMENT or the DXGKQAITYPE_QUERYSEGMENT3 value in the Type member of the DXGKARG_QUERYADAPTERINFO structure.
The graphics subsystem calls the display miniport driver's DxgkDdiQueryAdapterInfo function twice for segment information. The first call to DxgkDdiQueryAdapterInfo retrieves the number of segments supported by the driver, and the second call retrieves detailed information about each segment. In the calls to DxgkDdiQueryAdapterInfo, the driver points the pOutputData member of DXGKARG_QUERYADAPTERINFO to populated DXGK_QUERYSEGMENTOUT structures (for a driver version prior to Windows Display Driver Model (WDDM) 1.2) or to populated DXGK_QUERYSEGMENTOUT3 structures (for a WDDM 1.2 and later driver).
In the first call, the pSegmentDescriptor member of DXGK_QUERYSEGMENTOUT (for a driver version prior to WDDM 1.2) or DXGK_QUERYSEGMENTOUT3 (for a WDDM 1.2 and later driver) is set to NULL. The driver should fill only the NbSegment member of DXGK_QUERYSEGMENTOUT or DXGK_QUERYSEGMENTOUT3 with the number of segment types that it supports. This number also indicates the number of unpopulated DXGK_SEGMENTDESCRIPTOR (for a driver version prior to WDDM 1.2) or DXGK_SEGMENTDESCRIPTOR3 (for a WDDM 1.2 and later driver) structures that the driver requires from the second call to DxgkDdiQueryAdapterInfo.
In the second call, the driver should fill all members of DXGK_QUERYSEGMENTOUT or DXGK_QUERYSEGMENTOUT3. In the second call, the driver should populate an array the size of NbSegment of DXGK_SEGMENTDESCRIPTOR or DXGK_SEGMENTDESCRIPTOR3 structures in the pSegmentDescriptor member of DXGK_QUERYSEGMENTOUT or DXGK_QUERYSEGMENTOUT3 with information about the segments that the driver supports.
In both calls to DxgkDdiQueryAdapterInfo, the pInputData member of DXGKARG_QUERYADAPTERINFO points to a DXGK_QUERYSEGMENTIN structure that contains information about the location and properties of the AGP aperture. If no AGP aperture is available, or if one is present but no appropriate GART driver is installed, the information about the AGP aperture is set to zero. If no AGP aperture is present, the display miniport driver should not indicate, in the pSegmentDescriptor array of DXGK_QUERYSEGMENTOUT or DXGK_QUERYSEGMENTOUT3, that it supports an AGP-type aperture segment. If an AGP-type aperture segment is indicated in such circumstances, the adapter fails to initialize.
During initialization, because memory is plentiful, memory for the paging buffer can be allocated from a specific segment. The video memory manager allocates memory for the paging buffer from the segment specified in the PagingBufferSegmentId member of DXGK_QUERYSEGMENTOUT or DXGK_QUERYSEGMENTOUT3. The driver indicates the identifier of the paging-buffer segment in the second call to DxgkDdiQueryAdapterInfo. The driver should also specify the size in bytes that should be allocated for the paging buffer in the PagingBufferSize member of DXGK_QUERYSEGMENTOUT or DXGK_QUERYSEGMENTOUT3.
Build date: 1/22/2014