Draft: HDR support in Mutter
[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
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)
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:
- HDR support (Pt. 1, EDID: Parsing HDR and Colorimetry) - !2351 (merged)
- HDR support (Pt. 2, Wayland-protocols: Wayland-protocols for HDR) - Wayland-protocols for HDR
- HDR support (Pt. 3, Implement HDR & Colorspace protocol support) - this MR !2356
- HDR support (Pt. 4, Add HDR10 mode support) - backends/native: Add HDR10 mode support
- HDR support (Pt. 5, DRM: HDR metadata passthrough for fullscreen surfaces) - this MR !2356
- HDR support (Pt. 6, Test: Wayland client app for HDR) - Wayland HDR video client app
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