Merge branch 'bt709' into 'master'

Consistently use BT.709 encoding for YUV->RGB

See merge request wlroots/wlroots!5067
This commit is contained in:
David Turner 2025-10-27 22:25:01 +00:00
commit e55bf74acc
6 changed files with 56 additions and 5 deletions

View file

@ -482,6 +482,15 @@ static void set_plane_props(struct atomic *atom, struct wlr_drm_backend *drm,
atomic_add(atom, id, props->crtc_y, dst_box->y);
atomic_add(atom, id, props->crtc_w, dst_box->width);
atomic_add(atom, id, props->crtc_h, dst_box->height);
// Always set the color encoding on every plane to BT.709. This only
// affects YUV planes (eg. scanout video). This won't be correct for
// all video but at least means we will be consistent and most
// importantly should match the GLES2 renderer, so avoids visible
// color-shifts when direct scanout is enabled/disabled.
if (props->color_encoding) {
atomic_add(atom, id, props->color_encoding, DRM_COLOR_YCBCR_BT709);
}
}
static bool supports_cursor_hotspots(const struct wlr_drm_plane *plane) {