Monitor Hot Plug Detection
The information on this page applies to graphics drivers that are implemented using a version earlier than WDDM version 2.2.
A video output on a display adapter is considered a child device of the display adapter. A monitor or other external display device that connects to the output is not considered a child device. During initialization, the display miniport driver's DxgkDdiQueryChildRelations function assigns each child device a type and an HPD awareness value. The type is one of the DXGK_CHILD_DEVICE_TYPE enumerators:
TypeVideoOutput
TypeOther
The HPD awareness value is one of the DXGK_CHILD_DEVICE_HPD_AWARENESS enumerators:
HpdAwarenessAlwaysConnected
HpdAwarenessInterruptible
HpdAwarenessPolled
A child device that has a type of TypeVideoOutput and any HPD awareness value other than HpdAwarenessAlwaysConnected is called a video output connector.
If the display miniport driver cannot determine whether a monitor is connected to the video output, the driver should emulate the behavior of an interruptible device, with the HPD awareness value set to HpdAwarenessInterruptible. If the display miniport driver needs to indicate that an interruptible monitor should be connected to the video output, such as when a user enters a keyboard shortcut to switch to a television view, the driver should call the DxgkCbIndicateChildStatus function with ChildStatus.HotPlug.Connected set to TRUE.
At certain times, the operating system requests that the display miniport driver report the status of all video output connectors that have an HPD awareness value of HpdAwarenessPolled. There is no regular polling interval; rather, the request is made when there is a specific need to update the list of available display devices and modes. For example, when a laptop computer is docked, the operating system needs to know whether a monitor is connected to the video output on the docking station. The operating system makes the request by calling the display miniport driver's DxgkDdiQueryChildStatus function for each child device that has an HPD awareness value of HpdAwarenessPolled.
For video output connectors that have an HPD awareness value of HpdAwarenessInterruptible, the display miniport driver is responsible for notifying the operating system whenever an external display device is hot plugged or unplugged. The display miniport driver's interrupt handling code calls the display port driver's DxgkCbIndicateChildStatus function to report that an external display device has been connected to or disconnected from a particular video output. When a laptop computer is docked, the display miniport driver's DxgkDdiNotifyAcpiEvent function must call DxgkCbIndicateChildStatus for each video output on the docking station that has an HPD awareness value of HpdAwarenessInterruptible.
If a connector with an HPD awareness value of HpdAwarenessPolled is made unavailable (that is, covered up) when a laptop computer is docked, the display miniport driver's DxgkDdiNotifyAcpiEvent function must call DxgkCbIndicateChildStatus to report that the connector is disconnected.
The video output associated with an integrated display panel on a portable computer is an unusual case. The operating system needs to know whether the portable computer's lid is open or closed, so the idea of connected is used to mean open and the idea of not connected is used to mean closed. The video output associated with an integrated display on a portable computer has an HPD awareness value of HpdAwarenessInterruptible. That does not mean, however, that the display adapter generates an interrupt when the lid is opened or closed. Rather, the ACPI BIOS generates an interrupt when the lid is opened or closed. That interrupt results in a call to the display miniport driver's DxgkDdiNotifyAcpiEvent function, which calls DxgkCbIndicateChildStatus to report the status (open or closed) of the lid. The display miniport driver reports the status of the lid by setting the HotPlug.Connected member of a DXGK_CHILD_STATUS structure to TRUE (open) or FALSE (closed) and passing the DXGK_CHILD_STATUS structure to DxgkCbIndicateChildStatus.
The following list describes the steps followed when a monitor is connected to an HD15 connector, assuming that the connector has an HPD awareness value of HpdAwarenessPolled.
A monitor is connected to the HD15 connector on the display adapter. The display adapter does not detect this as a hot-plug event.
At some future time, a user-mode application requests a list of display devices.
For each video output connector on the display adapter that has an HPD awareness value of HpdAwarenessPolled, the VidPN manager calls the display miniport driver's DxgkDdiQueryChildStatus function to determine whether an external display device is connected. When DxgkDdiQueryChildStatus is called for the HD15 connector, it reports that an external monitor is indeed connected.
The following list describes the steps followed when a monitor is connected to a DVI connector, assuming that the connector has an HPD awareness value of HpdAwarenessInterruptible.
A flat panel is connected to the DVI connector on the display adapter.
The display adapter detects a hot-plug event and generates an interrupt.
The interrupt is handled by the display miniport driver's DxgkDdiInterruptRoutine function, which schedules a deferred procedure call (DPC). Subsequently the display miniport driver's DPC callback function is called.
The DPC callback function passes a DXGK_CHILD_STATUS structure to the display port driver's DxgkCbIndicateChildStatus function to report the status of the DVI connector. The ChildUid member of the DXGK_CHILD_STATUS structure identifies the DVI connector, and the HotPlug.Connected member (set to TRUE in this case) indicates that an external display device is connected.
Suppose a DVI connector supports a dongle that has three branches: DVI, HD15, and S-video. In that case, the display miniport driver would have previously enumerated three child devices associated with the one physical DVI connector: DVI-on-DVI, HD15-on-DVI, and S-video-on-DVI. Each of those child devices would have a type of TypeVideoOutput and an HPD awareness value of HpdAwarenessInterruptible. The following list describes the steps followed when a monitor is connected to the HD15 branch of the dongle.
The display adapter detects a hot-plug event and generates an interrupt.
The interrupt is handled by the display miniport driver's DxgkDdiInterruptRoutine function, which schedules a deferred procedure call (DPC). Subsequently the display miniport driver's DPC callback function is called.
The DPC callback function determines that the hot-plug event was on the HD15 branch of the dongle (HD15-on-DVI).
The DPC callback functions passes a DXGK_CHILD_STATUS structure to DxgkCbIndicateChildStatus to report the status of the HD15-on-DVI video output. The ChildUid member of the DXGK_CHILD_STATUS structure identifies the video output, and the HotPlug.Connected member (set to TRUE in this case) indicates that an external display device is connected.
The following list describes the steps followed when the lid is closed on a laptop computer.
The lid is closed on a portable computer, which generates an ACPI event. Subsequently, the display miniport driver's DxgkDdiNotifyAcpiEvent function is called.
DxgkDdiNotifyAcpiEvent passes a DXGK_CHILD_STATUS structure to the display port driver's DxgkCbIndicateChildStatus function to report the status of the child device associated with the built-in display panel. Specifically, DxgkDdiNotifyAcpiEvent sets the HotPlug.Connected member of the DXGK_CHILD_STATUS structure to FALSE.