From 97ae5aee61a3fbf32d58edc3810cf6d59caaae20 Mon Sep 17 00:00:00 2001 From: dengbo Date: Fri, 12 May 2017 18:53:22 +0800 Subject: [PATCH 6/8] weston: Add EGL_YUV and EGL_SAMPLE attribs to use mali400 rendering nv21 surface Add EGL_YUV_COLOR_SPACE_HINT_EXT and EGL_SAMPLE_RANGE_HINT_EXT attribs, in order to compatible with mali400 ddk; So this commit can use GPU composite nv21 surface in weston; --- libweston/gl-renderer.c | 8 ++++++++ shared/weston-egl-ext.h | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c index 691b837..97e2dd7 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c @@ -1619,6 +1619,14 @@ import_simple_dmabuf(struct gl_renderer *gr, attribs[atti++] = attributes->stride[2]; } + /* + * Add EGL_YUV and EGL_SAMPLE attribs to use mali400 + * rendering nv21 surface + */ + 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; image = egl_image_create(gr, EGL_LINUX_DMA_BUF_EXT, NULL, diff --git a/shared/weston-egl-ext.h b/shared/weston-egl-ext.h index f3e6dce..a36e770 100644 --- a/shared/weston-egl-ext.h +++ b/shared/weston-egl-ext.h @@ -123,6 +123,17 @@ typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) ( #define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 #define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 #define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A +#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B +#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C +#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D +#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E +#define EGL_ITU_REC601_EXT 0x327F +#define EGL_ITU_REC709_EXT 0x3280 +#define EGL_ITU_REC2020_EXT 0x3281 +#define EGL_YUV_FULL_RANGE_EXT 0x3282 +#define EGL_YUV_NARROW_RANGE_EXT 0x3283 +#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 +#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 #endif #ifndef EGL_EXT_swap_buffers_with_damage -- 1.9.1