Skip to content

Color management (ICC profiles) and HDR support (like GNOME 50, Hyprland, Niri)(wp_color_management v2)DRM Color Pipeline API #782

@abhiramh23

Description

@abhiramh23

Currently, mangowc lacks color management and HDR capabilities. This request proposes adding config-file-driven color management and HDR support similar to what's available in Hyprland (ICC profiles, multiple color spaces), Niri (gradient color spaces, wlr-output-management), and GNOME 50 (wp_color_management v2, SDR native mode, HDR screen sharing).

Kernel Foundation: Linux 6.19/7.0 Now Has the Infrastructure

DRM Color Pipeline API

· Merged in Linux 6.19, backed by Valve, Igalia, AMD, and others
· Provides a standardized kernel API for color pipeline operations
· Allows compositors to describe exact color transformations to the kernel
· Includes support for:
· 1D curves (EOTF, inverse EOTF, OETF)
· 3x4 Color Transformation Matrices (CTM)
· 1D LUTs and 3D LUTs (17^3 tetrahedrally interpolated)
· PQ (Perceptual Quantizer) and HLG (Hybrid Log-Gamma) for HDR
· BT.2020/BT.709 color spaces

Driver Support in 6.19/7.0

· AMDGPU: Full color pipeline support for DCN 3.0+ GPUs
· Intel: i915 and Xe drivers with plane color management (Xe3P support for Nova Lake)
· NVIDIA: The open-source Nova driver has begun preparing for future GPU support
· VKMS: Virtual driver for testing, ensuring API stability

Wayland Color Protocol Matures

· wp_color_management v2 protocol (as used in GNOME 50) enables client-side color description
· Mesa/Vulkan now implements the Wayland color management protocol

Vulkan HDR Metadata on Wayland

· Vulkan driver added VK_EXT_hdr_metadata support under Wayland
· Allows Vulkan applications to pass HDR metadata to displays
· Essential for accurate tone mapping in games and creative apps

Reference Implementations

Hyprland Approach

Hyprland supports ICC profiles and multiple color spaces including sRGB, BT.2020, and DCI-P3. Key features:

· Per-monitor ICC profile loading via hyprctl keyword monitor "DP-1,preferred,auto,1.0,icc_profile:/path/profile.icc"
· Application-specific color spaces via windowrules: windowrule = colorspace adobe-rgb,^(gimp)$
· HDR metadata support with PQ and HLG transfer functions
· EDID fallback when no ICC profile is specified
· NVIDIA note: Works but requires beta drivers for HDR

Niri Approach

Niri implements wlr-output-management for external tools and supports gradient color spaces:

· Gradient interpolation in srgb, srgb-linear, oklab, and oklch with hue control
· Configuration-driven approach with INI-like sections
· Background color per output for fallback

GNOME 50 Approach

GNOME 50 (RC) includes wp_color_management v2 protocol support:

· SDR native color mode for wide-gamut displays
· HDR screen sharing with PipeWire streams advertising FP16/RGB10 formats using BT.2020 + PQ
· Per-output ICC profile assignment via Settings > Color
· NVIDIA note: Mutter 47.rc added EGLDevice fixes for older GeForce cards

Proposed Implementation

Wayland Protocol Support

· Implement wp_color_management v2 (as in GNOME 50)
· Support wlr-output-management for external tools (as in Niri)
· Leverage Linux 6.19's DRM Color Pipeline API for kernel-level color operations

SDR Native Mode

Add a sdr_mode option for wide-gamut displays that don't need full HDR, similar to GNOME 50's SDR native color mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions