mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
backend/drm/atomic: Always use BT.709 encoding for YUV
When we overlay/scanout non-RGB planes we were relying on the default DRM color encoding, which could vary per DRM device. We want this to be consistent across devices and with YUV conversion done by renderers, so change this to always use BT.709 encoding (if the property is available). I've chosen BT.709 because it should be correct for HD video, which is probably most common.
This commit is contained in:
parent
2420bfef0b
commit
5234e30578
3 changed files with 22 additions and 0 deletions
|
|
@ -378,6 +378,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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue