From 1b7462011d473db1f9107980b188fb448bcba33a Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Wed, 22 Jan 2025 16:29:05 +0100 Subject: [PATCH] gl-render: Set default color hints for EGL images In order to be consistent with our internal YUV shader and KMS plane output. Note that the extension requires the hints to be ignored for RGB formats. Note that the attribs array previously was slightly larger than the maximum number of attributes required. Signed-off-by: Robert Mader --- libweston/renderer-gl/gl-renderer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index 0c25bb529..1e5516c13 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -3219,7 +3219,7 @@ static EGLImageKHR import_simple_dmabuf(struct gl_renderer *gr, const struct dmabuf_attributes *attributes) { - EGLint attribs[52]; + EGLint attribs[53]; int atti = 0; bool has_modifier; @@ -3308,6 +3308,12 @@ import_simple_dmabuf(struct gl_renderer *gr, } } + attribs[atti++] = EGL_YUV_COLOR_SPACE_HINT_EXT; + attribs[atti++] = EGL_ITU_REC601_EXT; + + attribs[atti++] = EGL_SAMPLE_RANGE_HINT_EXT; + attribs[atti++] = EGL_YUV_NARROW_RANGE_EXT; + attribs[atti++] = EGL_NONE; return gr->create_image(gr->egl_display, EGL_NO_CONTEXT,