DXGKDDI_PREEMPTCOMMAND - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// d3dkmddi.h

DXGKDDI_PREEMPTCOMMAND DxgkddiPreemptcommand;

NTSTATUS DxgkddiPreemptcommand(
  [in] IN_CONST_HANDLE hAdapter,
  [in] IN_CONST_PDXGKARG_PREEMPTCOMMAND pPreemptCommand
)
{...}
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-d3dkmddi-dxgkddi_preemptcommand)

DXGKDDI_PREEMPTCOMMAND callback function

Description

The DxgkDdiPreemptCommand function preempts a direct memory access (DMA) buffer that was previously submitted to and currently queued in the hardware command execution unit.

Parameters

hAdapter [in]

A handle to a context block that is associated with a display adapter. The display miniport driver previously provided this handle to the Microsoft DirectX graphics kernel subsystem in the MiniportDeviceContext output parameter of the DxgkDdiAddDevice function.

pPreemptCommand [in]

A pointer to a DXGKARG_PREEMPTCOMMAND structure that describes the command that is used to preempt a DMA buffer previously submitted to the hardware command execution unit.

Return value

Returns STATUS_SUCCESS upon successful completion. If the driver instead returns an error code, the operating system causes a system bugcheck to occur. For more information, see the following Remarks section.

Remarks

If the driver determines that the hardware is already finished processing all of the submitted DMA buffers--and that the hardware informed the graphics processing unit (GPU) scheduler about the completions--when its DxgkDdiPreemptCommand function is called to preempt the DMA buffers, the driver should perform the following operations instead of submitting the preempt fence that is identified by the PreemptionFenceId member of DXGKARG_PREEMPTCOMMAND to the hardware:

If the driver returns an error code, the Microsoft DirectX graphics kernel subsystem causes a system bugcheck to occur. In a crash dump file, the error is noted by the message BugCheck 0x119, which has the following four parameters.

  1. 0x2
  2. The NTSTATUS error code returned from the failed driver call
  3. A pointer to the DXGKARG_PREEMPTCOMMAND structure
  4. A pointer to an internal scheduler data structure

DxgkDdiPreemptCommand should be made nonpageable because it runs at IRQL = DISPATCH_LEVEL

See also

DXGKARG_PREEMPTCOMMAND

DxgkCbNotifyInterrupt

DxgkCbSynchronizeExecution

DxgkDdiAddDevice

DxgkDdiInterruptRoutine