Multiplane overlay support

Multiplane overlay (MPO) support is a WDDM feature that allows the graphics hardware to compose multiple layers of content into a single image that it can then display on a screen. It's essentially a hardware-accelerated method of compositing different "planes" of content - where a plane can be a video, the desktop, an application window, etc. - without having to involve the CPU or use up other system resources to do the blending in software.

The MPO feature is available starting in Windows 8.1 (WDDM 1.3). This article describes how to implement this capability in your driver.

MPO functions called by user-mode display drivers

The following table lists user-mode MPO functions that the operating system implements and that user-mode display drivers (UMDs) can call.

Function Description
pfnPresentMultiPlaneOverlayCb (D3D) Copies content from a source MPO allocation to a destination allocation.
pfnPresentMultiPlaneOverlayCb (DXGI) Copies content from a source MPO allocation to a destination allocation.

MPO functions implemented by the UMD

This section contains functions that a WDDM 1.3 and later UMD must implement in order to support MPOs.

The following table lists the functions that a UMD must implement in order to support MPOs.

Function Description
pfnCheckMultiPlaneOverlaySupport (D3D) Called by the Direct3D runtime to check the details on hardware support for MPOs.
pfnCheckMultiPlaneOverlaySupport (DXGI) Called by the DirectX Graphics Infrastructure (DXGI) runtime to check the details on hardware support for MPOs.
pfnPresentMultiplaneOverlay (D3D) Called by the Direct3D runtime to notify the UMD that an application finished rendering and request that the UMD display the source surface. The driver should display this surface by copying, flipping, or performing a color-fill operation.
pfnPresentMultiplaneOverlay (DXGI) Called by the DXGI runtime to notify the UMD that an application finished rendering and requests that the UMD display the source surface. The driver should display the surface by copying, flipping, or performing a color-fill operation.

The following table lists the functions that a UMD can optionally implement.

Function Description
pfnGetMultiPlaneOverlayCaps Called by the DXGI runtime to request that the UMD get basic overlay plane capabilities.
pfnGetMultiplaneOverlayGroupCaps Called by the DXGI runtime to request that the UMD get a group of overlay plane capabilities.

MPO user-mode structures and enumerations

All user-mode structures and enumerations that are used with MPO device driver interfaces (DDIs).

DDI Description
D3DDDI_MULTIPLANE_ALLOCATION_INFO Specifies info about an MPO allocation.
D3DDDI_MULTIPLANE_OVERLAY_ATTRIBUTES Used by the UMD to specify overlay plane attributes.
D3DDDI_MULTIPLANE_OVERLAY_BLEND Identifies a blend operation to be performed on an overlay plane.
D3DDDI_MULTIPLANE_OVERLAY_CAPS Used by the UMD to specify overlay plane capabilities.
D3DDDI_MULTIPLANE_OVERLAY_FEATURE_CAPS Identifies overlay capabilities.
D3DDDI_MULTIPLANE_OVERLAY_FLAGS Identifies a flip operation to be performed on an overlay plane.
D3DDDI_MULTIPLANE_OVERLAY_GROUP_CAPS Used by the UMD to specify a group of overlay plane capabilities.
D3DDDI_MULTIPLANE_OVERLAY_GROUP_CAPS_INPUT Specifies info on an MPO capability group.
D3DDDI_MULTIPLANE_OVERLAY_STRETCH_QUALITY Identifies filtering processes that the hardware should perform when it stretches or shrinks MPO data.
D3DDDI_MULTIPLANE_OVERLAY_VIDEO_FRAME_FORMAT Identifies the overlay plane's video frame format. Only the D3DDDI_MULTIPLANE_OVERLAY_VIDEO_FRAME_FORMAT_PROGRESSIVE value is supported.
D3DDDI_MULTIPLANE_OVERLAY_YCbCr_FLAGS Identifies YUV range and conversion info that describes an MPO.
D3DDDI_PRESENT_MULTIPLANE_OVERLAY Specifies an overlay plane to display.
D3DDDIARG_CHECKMULTIPLANEOVERLAYSUPPORT Used in a call to the pfnCheckMultiPlaneOverlaySupport (D3D) function to check details on hardware support for MPOs.
D3DDDIARG_PRESENTMULTIPLANEOVERLAY Specifies an MPO resource to display.
D3DDDICB_PRESENTMULTIPLANEOVERLAY Describes MPO allocations that content is copied to and from.

MPO kernel-mode driver-implemented functions

The following table lists the MPO functions that the kernel-mode display miniport driver (KMD) implements.

Function Description
DXGKDDI_CHECKMULTIPLANEOVERLAYSUPPORT Called by the DirectX graphics kernel subsystem to check the details of hardware support for MPOs.
DXGKDDI_CHECKMULTIPLANEOVERLAYSUPPORT3 The following function is called to determine whether a specific multi-plane overlay configuration is supported.
DXGKDDI_GETMULTIPLANEOVERLAYCAPS Called to retrieve MPO capabilities. Support for this DDI is required for any WDDM 2.2 driver that wants to support multiple planes.
DXGKDDI_POSTMULTIPLANEOVERLAYPRESENT Called after a new multi-plane overlay configuration has taken effect, allowing the driver to optimize hardware state. Optional for WDDM 1.3 2.0 or later drivers that support multi-plane overlays.
DXGKDDI_SETVIDPNSOURCEADDRESSWITHMULTIPLANEOVERLAY3 Called to change the overlay configuration being displayed.
DXGKDDI_CHECKMULTIPLANEOVERLAYSUPPORT2 DxgkDdiCheckMultiPlaneOverlaySupport2 is called to determine whether a specific multi-plane overlay configuration is supported.
DXGKDDI_SETVIDPNSOURCEADDRESSWITHMULTIPLANEOVERLAY Sets the addresses of multiple surfaces, including the Desktop Window Manager (DWM)'s swapchain, that are associated with a particular video present source. This function is used to present multiple surfaces (including the DWM’s swapchain) to the screen.
DXGKDDI_SETVIDPNSOURCEADDRESSWITHMULTIPLANEOVERLAY2 DxgkDdiSetVidPnSourceAddressWithMultiPlaneOverlay2 is called to change the overlay configuration being displayed.

MPO kernel-mode structures

The following table lists the structures that KMD uses.

Structure Description
DXGK_CHECK_MULTIPLANE_OVERLAY_SUPPORT_PLANE Specifies the support attributes that the hardware provides for MPOs.
DXGK_CHECK_MULTIPLANE_OVERLAY_SUPPORT_RETURN_INFO Specifies limitations on hardware support of MPOs.
DXGK_MULTIPLANE_OVERLAY_ATTRIBUTES Used by the KMD to specify overlay plane attributes.
DXGK_MULTIPLANE_OVERLAY_ATTRIBUTES2 DXGK_MULTIPLANE_OVERLAY_ATTRIBUTES2 is used by the KMD to specify overlay plane attributes.
DXGK_MULTIPLANE_OVERLAY_BLEND Identifies a blend operation to be performed on an overlay plane.
DXGK_MULTIPLANE_OVERLAY_FLAGS Identifies a flip operation to be performed on an overlay plane.
DXGK_MULTIPLANE_OVERLAY_PLANE Specifies an overlay plane to display in a call to the DxgkDdiSetVidPnSourceAddressWithMultiPlaneOverlay function.
DXGK_MULTIPLANE_OVERLAY_PLANE2 DXGK_MULTIPLANE_OVERLAY_PLANE2 is used with the DxgkDdiSetVidPnSourceAddressWithMultiPlaneOverlay2 function to specify an overlay plane to display.
DXGK_MULTIPLANE_OVERLAY_PLANE_WITH_SOURCE DXGK_MULTIPLANE_OVERLAY_PLANE_WITH_SOURCE describes the multi-plane overlay plane attributes, allocation, and video present network source identification number.
DXGK_MULTIPLANE_OVERLAY_VSYNC_INFO Specifies an overlay plane to display during a VSync interval.
DXGK_MULTIPLANE_OVERLAY_YCbCr_FLAGS Identifies YUV range and conversion info that describes an MPO.
DXGK_PRESENTMULTIPLANEOVERLAYINFO Specifies info on a VidPN input and an overlay plane to display.
DXGK_PRESENTMULTIPLANEOVERLAYLIST Specifies an overlay plane to display in a call to the DxgkDdiPresent function.
DXGKARG_CHECKMULTIPLANEOVERLAYSUPPORT Used in a call to the DxgkDdiCheckMultiPlaneOverlaySupport function to check details on hardware support for MPOs.
DXGKARG_CHECKMULTIPLANEOVERLAYSUPPORT2 DXGKARG_CHECKMULTIPLANEOVERLAYSUPPORT2 is passed to the DxgkDdiCheckMultiPlaneOverlaySupport2 function to determine whether a specific multi-plane overlay configuration is supported.
DXGKARG_SETVIDPNSOURCEADDRESSWITHMULTIPLANEOVERLAY Contains arguments for the DxgkDdiSetVidPnSourceAddressWithMultiPlaneOverlay function.
DXGKARG_SETVIDPNSOURCEADDRESSWITHMULTIPLANEOVERLAY2 DXGKARG_SETVIDPNSOURCEADDRESSWITHMULTIPLANEOVERLAY2 is passed to the DxgkDdiSetVidPnSourceAddressWithMultiPlaneOverlay2 function to change the overlay configuration being displayed.

MPO kernel-mode enumerations

The following table lists the enumerations used by KMD.

Enumeration Description
DXGK_MULTIPLANE_OVERLAY_STEREO_FLIP_MODE Identifies the overlay plane's stereo flip mode. Only the DXGK_MULTIPLANE_OVERLAY_STEREO_FLIP_NONE value is supported.
DXGK_MULTIPLANE_OVERLAY_STEREO_FORMAT Identifies the overlay plane's stereo presentation format. Only the DXGK_MULTIPLANE_OVERLAY_STEREO_FORMAT_MONO value is supported.
DXGK_MULTIPLANE_OVERLAY_STRETCH_QUALITY Identifies filtering processes that the hardware should perform when it stretches or shrinks MPO data.
DXGK_MULTIPLANE_OVERLAY_VIDEO_FRAME_FORMAT Identifies the overlay plane's video frame format. Only the DXGK_MULTIPLANE_OVERLAY_VIDEO_FRAME_FORMAT_PROGRESSIVE value is supported.

The D3DDDICAPS_GET_MULTIPLANE_OVERLAY_GROUP_CAPS value in D3DDDICAPS_TYPE indicates UMD support for MPOs.