DxgkCbNotifyInterrupt routine

The DxgkCbNotifyInterrupt function informs the graphics processing unit (GPU) scheduler about a graphics hardware update at interrupt-service-routine (ISR) time.



VOID APIENTRY DxgkCbNotifyInterrupt(
  _In_     const HANDLE hAdapter,
{ ... }


hAdapter [in]

[in] A handle to the adapter object for the GPU. A driver receives the handle from the DeviceHandle member of the DXGKRNL_INTERFACE structure in a call to its DxgkDdiStartDevice function.

pData [in, out]

[in] A pointer to a DXGKARGCB_NOTIFY_INTERRUPT_DATA structure that describes notification information.

Return value



A display miniport driver calls the DxgkCbNotifyInterrupt function to report a graphics hardware interrupt that the DXGK_INTERRUPT_TYPE enumeration type defines. Typically, DxgkCbNotifyInterrupt is called from the display miniport driver's DxgkDdiInterruptRoutine function (ISR), which is called when graphics hardware interrupts occur. The DxgkCbNotifyInterrupt function informs the GPU scheduler about an update to a fence through a direct memory access (DMA) stream to the graphics hardware.

If the display miniport driver uses multiple interrupt handlers that correspond to multiple IRQLs, the driver must not call DxgkCbNotifyInterrupt in a reentrant fashion. Therefore, in this case, the display miniport driver should always call DxgkCbNotifyInterrupt from a fixed level of the interrupt handler.

Similarly, if message-signaled interrupts are used, the display miniport driver can call DxgkCbNotifyInterrupt from an interrupt handler that corresponds to a fixed message number. The driver must report the message number that is used for notification in the InterruptMessageNumber member of the DXGK_DRIVERCAPS structure, when the DXGKQAITYPE_DRIVERCAPS enumeration value is specified in the Type member of the DXGKARG_QUERYADAPTERINFO structure in a call to the driver's DxgkDdiQueryAdapterInfo function.

After the display miniport driver calls DxgkCbNotifyInterrupt but before the driver exits its ISR, the driver must queue a deferred procedure call (DPC) by using the DxgkCbQueueDpc function. This DPC must be queued because the GPU scheduler must also be notified, when the driver's DPC callback routine calls the DxgkCbNotifyDpc function, about the same event at DPC time. A certain amount of processing that is related to graphics hardware events can be only performed by the operating system at DPC time.

If the display miniport driver determines that more than one interrupt was triggered in hardware and the driver must call DxgkCbNotifyInterrupt for each interrupt to report the interrupt to the operating system, the driver should report DMA-type interrupts before a CRTC-type interrupt. For more information about interrupt types, see the DXGK_INTERRUPT_TYPE reference page.

Callers of DxgkCbNotifyInterrupt run at interrupt level (that is, DIRQL, which is some IRQL between DISPATCH_LEVEL and PROFILE_LEVEL, not inclusive).


The following code example shows software engine code that monitors a software queue and notifies the GPU scheduler about packet completion.

typedef struct _SubmitParams {
    HW_DEVICE_EXTENSION *pHwDeviceExtension;
    UINT                NodeOrdinal;
    UINT                FenceID;
    UINT                PreemptionFenceID;
} SubmitParams;

BOOLEAN R200TEST_SWNode_SynchronizeVidSchNotifyInt(PVOID* params)
    SubmitParams  *pSchNotifyParams = (SubmitParams*)params;
    DXGKCB_NOTIFY_INTERRUPT  DxgkCbNotifyInterrupt;

    DxgkCbNotifyInterrupt = (DXGKCB_NOTIFY_INTERRUPT)pSchNotifyParams->pHwDeviceExtension->pVidSchINTCB;

    if(!DxgkCbNotifyInterrupt) {
        return FALSE;

    if(pSchNotifyParams->PreemptionFenceID) {
        notifyInt.InterruptType = DXGK_INTERRUPT_DMA_PREEMPTED;
        notifyInt.DmaPreempted.PreemptionFenceId = pSchNotifyParams->PreemptionFenceID;
        notifyInt.DmaPreempted.LastCompletedFenceId = pSchNotifyParams->FenceID;
        notifyInt.DmaPreempted.NodeOrdinal = pSchNotifyParams->NodeOrdinal;
    else {
        notifyInt.InterruptType = DXGK_INTERRUPT_DMA_COMPLETED;
        notifyInt.DmaCompleted.SubmissionFenceId = pSchNotifyParams->FenceID;
        notifyInt.DmaCompleted.NodeOrdinal = pSchNotifyParams->NodeOrdinal;

    DxgkCbNotifyInterrupt(pSchNotifyParams->pHwDeviceExtension->DeviceHandle, &notifyInt);

    pSchNotifyParams->pHwDeviceExtension->PrevSubmitFenceIDArray[pSchNotifyParams->NodeOrdinal] = pSchNotifyParams->FenceID;

    if(pSchNotifyParams->PreemptionFenceID) {
        pSchNotifyParams->pHwDeviceExtension->PrevPreemptFenceIDArray[pSchNotifyParams->NodeOrdinal] = pSchNotifyParams->PreemptionFenceID;

    return TRUE;



Available in Windows Vista and later versions of the Windows operating systems.


D3dkmddi.h (include D3dkmddi.h)


See Remarks section.

See also




Send comments about this topic to Microsoft

© 2014 Microsoft