DRM/KMS defaults to limited color range (16-235) for RGB planes, should default to full (0-255) #1105
diegoalejandrogomez
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The NVIDIA DRM/KMS output path defaults to limited color range (16-235) for RGB content when the
COLOR_RANGEplane property is not explicitly set. The X11 DDX driver defaults to full range (0-255) for the same hardware. This causes every Wayland compositor to produce washed-out output compared to X11.How to reproduce
The difference can be confirmed with
nvidia-settingson X11:ColorRange = 0(Full): correct outputColorRange = 1(Limited): identical to Wayland appearanceRoot cause
In
kernel-open/nvidia-drm/nvidia-drm-crtc.c, the functionnv_drm_color_range_to_nvkms_color_range()maps:DRM_COLOR_YCBCR_FULL_RANGE→NVKMS_INPUT_COLOR_RANGE_FULLDRM_COLOR_YCBCR_LIMITED_RANGE→NVKMS_INPUT_COLOR_RANGE_LIMITEDNVKMS_INPUT_COLOR_RANGE_DEFAULTWhen compositors don't set
COLOR_RANGE(which the DRM spec says is for YCbCr only), the driver usesNVKMS_INPUT_COLOR_RANGE_DEFAULT, which results in limited range output on DisplayPort connections.Additionally, the standard DRM connector property Broadcast RGB (which controls full vs limited RGB range) is not exposed by the NVIDIA driver. Both Intel and AMD expose this: https://drmdb.emersion.fr/properties/3233857728/Broadcast%20RGB
This is likely the correct property for this use case, as pointed out by a wlroots maintainer. Without it, there is no proper way to control RGB output range on the DRM path.
Expected behavior
For RGB content, the DRM/KMS path should default to full range (0-255), matching the X11 DDX behavior.
Workaround
Compositors can explicitly set
COLOR_RANGE = DRM_COLOR_YCBCR_FULL_RANGEon RGB planes in their atomic commits. This has been submitted to KWin: https://invent.kde.org/plasma/kwin/-/merge_requests/9075Environment
Beta Was this translation helpful? Give feedback.
All reactions