IddCx Objects
The IddCx (Indirect Display Driver Class eXtension) framework uses the extensible UMDF object model to represent the various components of indirect display devices. The UMDF object model allows the driver-specific storage to be associated with each IddCx (and hence UMDF) object. For more information, see UMDF Object Model.
The order in which IDD objects are created is:
- The driver first creates an IDDCX_ADAPTER object.
- The driver then creates an IDDCX_MONITOR object.
- Once the IDDCX_ADAPTER and IDDCX_MONITOR objects are created, the OS creates IDDCX_SWAPCHAIN and IDDCX_OPMCTX objects and sends them to the driver.
The following sections provide more details about these objects.
IDDCX_ADAPTER
This object represents a single logical display adapter created by the driver in a two stage process:
- The driver calls the IddCxAdapterInitAsync callback function.
- The OS calls the driver's EvtIddCxAdapterInitFinished DDI to complete the initialization.
The IDD model doesn't have an explicit destroy adapter callback. Once the adapter initialization sequence successfully completes, the adapter is valid until the UMDF device passed at initialization time is stopped. When the indirect display driver (IDD) creates the adapter, it provides static adapter information about the indirect display adapter.
Handling multifunction devices
In the simplest case, there's a one-to-one mapping between the UMDF device object created by the plug and play subsystem for the attached indirect display device and the IDDCX_ADAPTER object that the IDD creates.
There can be more complex scenarios where a single indirect display dongle contains multiple plug and play devices. For example, an indirect display solution might have multiple PnP device functions such as a microphone (audio driver) and camera (video driver). In such situations, the IDD is responsible for creating a single IDDCX_ADAPTER object for the multiple UMDF device objects created for each PnP device. The driver needs to consider the following points in this scenario:
- The IDDCX_ADAPTER should only be created once all the PnP devices that make up the indirect display solution are successfully started.
- The driver must pass a single WDFDEVICE when creating the adapter, so it requires logic to decide which UMDF device it will pass.
- If any of the devices that make up the indirect display adapter have a hardware error, the driver should report all devices that make up the adapter as being in error.
IDDCX_MONITOR
This object represents a specific monitor connected to one of the connectors on the indirect display adapter.
The driver creates the monitor object in a two stage process:
- It first calls the IddCxMonitorCreate callback to create the IDDCX_MONITOR object.
- It then calls the IddCxMonitorArrival callback to complete the monitor arrival.
When a monitor is unplugged, the driver calls the IddCxMonitorDeparture callback to report it. This call causes the IDDCX_MONITOR object to be destroyed. Even if the same monitor is unplugged and then reconnected, the IddCxMonitorDeparture/IddCxMonitorArrival sequence needs to be called again.
The IDDCX_MONITOR is a child of the IDDCX_ADAPTER object.
IDDCX_SWAPCHAIN
This object represents a swapchain that provides desktop images to display on a connected monitor. The swapchain has multiple buffers to allow the OS to compose the next desktop image in one buffer while the IDD is accessing another buffer. The IDDCX_SWAPCHAIN is a child of the IDDCX_MONITOR so there's only one assigned swapchain to a given monitor at any time.
The OS creates and destroys the IDDCX_SWAPCHAIN objects and assigns/unassigns them to monitors using the EvtIddCxMonitorAssignSwapChain and EvtIddCxMonitorUnassignSwapChain calls.
IDDCX_OPMCTX
This object represents an active Output Protection Manager (OPM) context from a single application OPM context that the application can use to control output protection on a single monitor. Multiple OPM contexts can be active on a given monitor at the same time. The OS calls the driver to create and destroy the OPM contexts using the driver's EvtIddCxMonitorOPMCreateProtectedOutput and EvtIddCxMonitorOPMDestroyProtectedOutput DDI calls.