Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
To allocate memory for the context save area of a context, the kernel mode driver can use context allocations via DxgkCbCreateContextAllocation. Some new functionality is added to context allocations to make them fit into the new graphics processing unit (GPU) virtual address model.
AccessedPhysically
A context allocation can specify the AccessedPhysically flags to indicate that the allocation should be allocated contiguously in a memory segment or mapped into the aperture if accessed from system memory.
Assigning a GPU virtual address to a context allocation
The video memory manager exposes a new DxgkCbMapContextAllocation service to the kernel mode driver to allocate a GPU virtual address to a context allocation.
Context allocations are mapped into the application GPU virtual address space associated with the specified context.
Note The driver should be careful not to expose privileged information when a context allocation is to be mapped directly to an application GPU virtual address space.
These services behave like their user mode counterpart.
Updating the content of a context allocation
It may sometime be necessary for the kernel mode driver to update the content of a context allocation. For example, a privileged (AccessedPhysically, no GPU virtual mapping) context allocation may contain a reference to the page directory associated with a particular context. When the kernel mode driver is notified of the page directory relocation by DxgkDdiSetRootPageTable, the kernel mode driver may need to update the content of that context allocation.
For this purpose a new DxgkCbUpdateContextAllocationdevice driver interface (DDI) is added. This DDI queues a request to the video memory manager to initiate an update of the context allocation. The context allocation being updated is mapped into the scratch area of the video memory manager paging process, then the driver is called with a new UpdateContextAllocation paging operation to do the actual update of the context allocation. The video memory manager returns from DxgkCbUpdateContextAllocation after the update is completed.
The kernel mode driver can pass some private driver data between its calls to DxgkCbUpdateContextAllocation and the resulting UpdateContextAllocation paging operation.