DXGKDDI_CALIBRATEGPUCLOCK callback function (d3dkmddi.h)

Called by the Microsoft DirectX graphics kernel subsystem to calibrate the GPU time stamps in the DXGK_HISTORY_BUFFER history buffer with the CPU clock time.

Syntax

DXGKDDI_CALIBRATEGPUCLOCK DxgkddiCalibrategpuclock;

NTSTATUS DxgkddiCalibrategpuclock(
  IN_CONST_HANDLE hAdapter,
  IN UINT32 NodeOrdinal,
  IN UINT32 EngineOrdinal,
  OUT_PDXGKARG_CALIBRATEGPUCLOCK pClockCalibration
)
{...}

Parameters

hAdapter

A handle to the adapter object for the GPU for which timing calibration info is to be obtained.

The display miniport driver previously provided this handle to the DirectX graphics kernel subsystem in the MiniportDeviceContext output parameter of the DxgkDdiAddDevice function.

NodeOrdinal

An index of a node for which timing calibration info will be obtained. This node is within the physical adapter defined by the hAdapter parameter.

EngineOrdinal

The zero-based index of the engine, within the node that NodeOrdinal specifies, for which timing calibration info will be obtained. For graphics adapters that are not part of a link in a linked display adapter (LDA) configuration, you should always set EngineOrdinal to 0.

pClockCalibration

A pointer to a DXGKARG_CALIBRATEGPUCLOCK structure that provides clock counter info from the GPU and CPU.

Return value

Returns STATUS_SUCCESS if it succeeds; otherwise, it returns one of the error codes defined in Ntstatus.h.

Remarks

The DirectX graphics kernel subsystem uses the returned info in the pClockCalibration parameter to estimate the drift between the GPU and CPU clocks.

To minimize calibration inaccuracies, the driver should compute the values for the GpuClockCounter and CpuClockCounter members of the DXGKARG_CALIBRATEGPUCLOCK structure as nearly simultaneously as possible.

The DirectX graphics kernel subsystem calls this function often enough, typically at least once every 30ms, to minimize the accumulated drift between the GPU and CPU clocks.

Requirements

Requirement Value
Minimum supported client Windows 8.1,WDDM 1.3
Minimum supported server Windows Server 2012 R2
Target Platform Desktop
Header d3dkmddi.h
IRQL DISPATCH_LEVEL

See also

DXGKARG_CALIBRATEGPUCLOCK

DXGK_HISTORY_BUFFER

DxgkDdiAddDevice