Bewerken

Delen via


DXGKDDI_BEGINEXCLUSIVEACCESS callback function (d3dkmddi.h)

Dxgkrnl calls DxgkDdiBeginExclusiveAccess to notify the kernel-mode driver that an IOMMU domain switch is about to occur.

Syntax

DXGKDDI_BEGINEXCLUSIVEACCESS DxgkddiBeginexclusiveaccess;

NTSTATUS DxgkddiBeginexclusiveaccess(
  IN_CONST_HANDLE hAdapter,
  IN_PDXGKARG_BEGINEXCLUSIVEACCESS pBeginExclusiveAccess
)
{...}

Parameters

hAdapter

[in] A handle to a context block that is associated with a display adapter.

pBeginExclusiveAccess

[in] Pointer to a DXGKARG_BEGINEXCLUSIVEACCESS structure that contains the input arguments for DxgkDdiBeginExclusiveAccess.

Return value

DxgkDdiBeginExclusiveAccess should return STATUS_SUCCESS if the operation succeeds. Otherwise, it should return an appropriate NTSTATUS error code.

Remarks

IOMMU domain attach and detach is extremely fast, but is nonetheless not currently atomic. This means that a transaction issued over PCIe isn't guaranteed to be translated correctly while swapping to a domain with different mappings.

To handle this situation, Dxgkrnl calls the following KMD DDI pair:

  • DxgkDdiBeginExclusiveAccess to notify KMD that an IOMMU domain switch is about to occur.
  • DxgkDdiEndExclusiveAccess after the IOMMU domain switch is complete.

The driver must ensure that its hardware is silent whenever the device is switched to a new IOMMU domain. That is, the driver must ensure that it doesn't read or write to system memory from the device between these two calls.

Between these two calls, Dxgkrnl guarantees the following:

  • The scheduler will be suspended. All active workloads will be flushed, and no new workloads will be sent to or scheduled on the hardware.
  • No other DDI calls will be made.

As part of these calls, the driver may choose to disable and suppress interrupts (including vsync interrupts) for the duration of the exclusive access, even without explicit notification from the OS.

Requirements

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

See also

DRIVER_INITIALIZATION_DATA

DXGKARG_BEGINEXCLUSIVEACCESS

DxgkDdiEndExclusiveAccess