From 80e0c28588e092302b2b42e6a54d3991a316c1a5 Mon Sep 17 00:00:00 2001 From: Diego Gomez Date: Sat, 11 Apr 2026 09:47:54 -0400 Subject: [PATCH] backend/drm: default COLOR_RANGE to full instead of limited When color_range is WLR_COLOR_RANGE_NONE (unspecified by the compositor), default to full range instead of limited. NVIDIA's DRM driver defaults to limited range (16-235) when COLOR_RANGE is not explicitly set, causing a washed-out desktop on Wayland. This is a no-op on Intel and AMD (which ignore COLOR_RANGE for RGB per the DRM spec) but fixes NVIDIA's washed-out output. An equivalent fix has been submitted to KWin: https://invent.kde.org/plasma/kwin/-/merge_requests/9075 See https://github.com/NVIDIA/open-gpu-kernel-modules/discussions/1105 --- backend/drm/atomic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c index daa8ba9bf..6ade15317 100644 --- a/backend/drm/atomic.c +++ b/backend/drm/atomic.c @@ -511,10 +511,13 @@ static void set_color_encoding_and_range(struct atomic *atom, uint32_t color_range; switch (range) { - case WLR_COLOR_RANGE_NONE: case WLR_COLOR_RANGE_LIMITED: color_range = WLR_DRM_COLOR_YCBCR_LIMITED_RANGE; break; + case WLR_COLOR_RANGE_NONE: + // Workaround for the proprietary NVIDIA driver, which defaults to + // limited range when COLOR_RANGE is not set, even for RGB content. + // See https://github.com/NVIDIA/open-gpu-kernel-modules/discussions/1105 case WLR_COLOR_RANGE_FULL: color_range = WLR_DRM_COLOR_YCBCR_FULL_RANGE; break;