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-11-08 15:51:51 +00:00
commit e5ed869292
6 changed files with 56 additions and 5 deletions

View file

@ -747,7 +747,7 @@ EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl,
}
unsigned int atti = 0;
EGLint attribs[50];
EGLint attribs[52];
attribs[atti++] = EGL_WIDTH;
attribs[atti++] = attributes->width;
attribs[atti++] = EGL_HEIGHT;
@ -805,6 +805,13 @@ EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl,
}
}
// Always convert YUV to RGB using BT.709 color encoding. This is to
// attempt to be consistent across GL drivers, and also to be
// consistent with DRM scanout so there's no color-shift when direct
// scanout is enabled/disabled.
attribs[atti++] = EGL_YUV_COLOR_SPACE_HINT_EXT;
attribs[atti++] = EGL_ITU_REC709_EXT;
// Our clients don't expect our usage to trash the buffer contents
attribs[atti++] = EGL_IMAGE_PRESERVED_KHR;
attribs[atti++] = EGL_TRUE;