Skip to content

Draft: HDR support in Mutter

Naveen Kumar requested to merge naveenk2/mutter:test-hdr-v2 into main

[WIP] This MR implements the basic support for presenting HDR content from Wayland clients. This will allow clients with HDR content to define their surfaces with PQ encoded content & attach Colorspace information.

Phase 1: HDR Metadata pass-through for fullscreen surfaces

image

When a HDR surface is fullscreen and client presents the HDR content with metadata and display hw supports HDR, nothing is done by the KMS/GL i.e. no modifications to the content and metadata is only passed through from client to KMS display.

Phase 2: GL shaders & KMS path to modify the content based on metadata (Single surface i.e. Fullscreen)

image

When a HDR surface is fullscreen and can be unredirected, pass the metadata the client provided via the Wayland protocol to KMS, allowing fully correct presented result. i.e. tone & gamut mapping, transformation (PQ/Rec.2020 to sRGB & vice versa)

Phase 3: Support multiple surfaces

Wayland client app for HDR:

Weston HDR video client app: https://gitlab.freedesktop.org/NaveenKumar/weston/-/tree/test-hdr

To test this feature using Wayland clients, we have modified harishkrupo's Weston client app according to our needs, sourced from below url. https://gitlab.freedesktop.org/harishkrupo/weston/-/commit/a29321a11f8e4a072d196f02b9f921f74e2bfa99

Wayland-protocols for HDR:

Wayland-protocols: https://gitlab.freedesktop.org/NaveenKumar/wayland-protocols/-/tree/test-hdr

This is just a placeholder to get data from clients to test our HDR stack. The actual protocol is being discussed here: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/14 & https://gitlab.freedesktop.org/pq/color-and-hdr

Split HDR support in following parts.

Phase 1:

Phase 2:

  • HDR support (Pt. 7, Clutter: Tone mappings from PQ to SDR)
  • HDR support (Pt. 8, Clutter: Colorspace conversions from Rec2020 to sRGB)
  • HDR support (Pt. 9, Clutter: Signal mapping from sRGB to PQ)
  • HDR support (Pt. 10, DRM: Tone & Gamut mappings, transformation for fullscreen surfaces) - TODO - naveenk2

Phase 3:

Future Plans:

  • Add the support for other Colorspaces & TF
  • Maybe allow metadata pass-through for non-fullscreen surfaces

Feedback:

  • Enhance the feature as per the feedback and other inputs from reviewers

Related to - #2134

CC'ed @jadahl , @swick, @uma-intel & @kishore.kunche

Edited by Naveen Kumar

Merge request reports