HwVidSynchronizeExecutionCallback Functionality
Miniport drivers for adapters that do not generate interrupts seldom call VideoPortSynchronizeExecution with a HwVidSynchronizeExecutionCallback function.
In fact, even miniport drivers that have a HwVidInterrupt function do not necessarily have a HwVidSynchronizeExecutionCallback function. Because the video port driver does not send a request to a miniport's HwVidStartIO function until it completes processing of the preceding request (see HwVidStartIO Functionality for more information), miniport drivers rarely call VideoPortSynchronizeExecution.
There are two possible uses for a miniport's HwVidSynchronizeExecutionCallback function:
·To access the adapter registers using the miniport's device extension for a driver function other than the HwVidInterrupt function
When the HwVidSynchronizeExecutionCallback function is given control, interrupts from the adapter are masked off so the miniport's HwVidInterrupt function cannot change state in the device extension while the HwVidSynchronizeExecutionCallback function is running in an SMP machine.
·To write commands to the adapter registers or ports very quickly if the adapter requires it
When the HwVidSynchronizeExecutionCallback function is given control, almost all system interrupts are masked off, so the HwVidSynchronizeExecutionCallback function cannot be preempted by a device (or even, a clock) interrupt.
A HwVidSynchronizeExecutionCallback function must return control as quickly as possible.
With the first type of HwVidSynchronizeExecutionCallback function, the miniport calls VideoPortSynchronizeExecution with the Priority set to VpMediumPriority. With the second type of HwVidSynchronizeExecutionCallback function, the miniport also makes this call with the Priority set to VpMediumPriority if the driver has no HwVidInterrupt function. Otherwise, such a miniport makes this call with the Priority set to VpHighPriority.
In general, a miniport driver should not call VideoPortSynchronizeExecution with the second type of HwVidSynchronizeExecutionCallback function unless the driver designer has no other alternative: that is, unless the adapter is such that it must be programmed with system interrupts masked off. Otherwise, the miniport should call VideoPortSynchronizeExecution with the Priority set to VpLowPriority.
A HwVidSynchronizeExecutionCallback function, like a HwVidInterrupt function, cannot be pageable and cannot call certain VideoPortXxx functions without bringing down the system. For a summary of VideoPortXxx that the HwVidSynchronizeExecutionCallback function can call safely, see HwVidInterrupt Functionality.