Supporting Path-Independent Rotation

Starting with Windows 8.1 Update, the operating system supports cloning portrait-first displays on landscape-first displays with the greatest possible resolution. The display miniport driver must set the proper offset values in the D3DKMDT_VIDPN_PRESENT_PATH_ROTATION_SUPPORT structure for the primary clone path and secondary clone path, as described in Supporting Rotation in a Display Miniport Driver.

These Device driver interfaces (DDIs) are new in Windows 8.1 Update:

  • D3DKMDT_VPPR_GET_CONTENT_ROTATION
  • D3DKMDT_VPPR_GET_CONTENT_ROTATION_PART
  • D3DKMDT_VPPR_GET_OFFSET_ROTATION

These DDIs are updated in Windows 8.1 Update:

Cloning a portrait-first device

When a driver of a portrait-first device is requested to clone to a landscape-first monitor, it should report source-mode (x,y) resolutions that match the resolutions in the primary clone path. The secondary clone path could then support 90- and 270-degree offset values (D3DKMDT_VIDPN_PRESENT_PATH_ROTATION_SUPPORT.Offset90 or .Offset270 are TRUE). So when a VidPN is committed with an D3DKMDT_VIDPN_PRESENT_PATH_ROTATION enumeration value that indicates a 90- or 270-degree offset, this means that the (x,y) resolutions are flipped in this particular path.

By default the operating system chooses the secondary clone path to be the internal display panel. In the case that the internal panel is portrait-first, the operating system expects D3DKMDT_VIDPN_PRESENT_PATH_ROTATION_SUPPORT.Offset270 to be set on this path in order to display on the internal display panel in landscape mode. In the case of a landscape-first external monitor in the secondary clone path, the operating system expects the driver to support D3DKMDT_VIDPN_PRESENT_PATH_ROTATION_SUPPORT.Offset90, although this is likely to be a rare scenario.

Example clone scenarios

Here's a typical scenario where a portrait-first device with native resolution 800 (width) x 1280 pixels (height) is connected in clone mode to a landscape-first TV with height 1080 pixels. The driver would report this info to the operating system:

source mode
1280 x 800

TV target mode
1920 x 1080 (aspect-ratio preserved scaling)

device target mode
800 x 1280 (identity scaling)

primary clone path (TV)
driver supports only D3DKMDT_VIDPN_PRESENT_PATH_ROTATION_SUPPORT.Offset0, as well as normal rotation support

secondary clone path (device)
driver supports only D3DKMDT_VIDPN_PRESENT_PATH_ROTATION_SUPPORT.Offset270, as well as normal rotation support

The call to the DxgkDdiCommitVidPn function then returns with these path settings from the D3DKMDT_VIDPN_PRESENT_PATH_ROTATION enumeration:

primary clone path (TV)
D3DKMDT_VPPR_IDENTITY

secondary clone path (device)
D3DKMDT_VPPR_IDENTITY_OFFSET270

The operating system expects the driver to rotate the provided content 270 degrees.

If, in the Display control panel's Orientation drop-down box, the user chooses the Landscape (flipped) option, the call to the DxgkDdiCommitVidPn function returns with these path settings from the D3DKMDT_VIDPN_PRESENT_PATH_ROTATION enumeration:

primary clone path (TV)
D3DKMDT_VPPR_ROTATE180

secondary clone path (device)
D3DKMDT_VPPR_ROTATE180_OFFSET270

If the Desktop Window Manager (DWM) has already rotated the content 180 degrees, the driver must still rotate it another 270 degrees in the secondary clone path. Otherwise, the driver must rotate the content 180 degrees for the TV and 90 degrees for the device. Note that to rotate the content, the driver must set the Rotate member of the DXGK_PRESENTFLAGS structure.