From bfe256589e86245451ed05ce5181ee77c123b60c Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Fri, 3 Jul 2020 14:23:45 +0800 Subject: [PATCH 20/93] pixman-renderer: Support yuv formats Support yuy2/yv12/i420/nv12/nv16. Signed-off-by: Jeffy Chen --- libweston/pixel-formats.c | 11 +++++++++++ meson.build | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c index fc33997..7590171 100644 --- a/libweston/pixel-formats.c +++ b/libweston/pixel-formats.c @@ -440,6 +440,7 @@ static const struct pixel_format_info pixel_format_table[] = { SAMPLER_TYPE(EGL_TEXTURE_Y_XUXV_WL), .num_planes = 1, .hsub = 2, + PIXMAN_FMT(yuy2), }, { DRM_FORMAT(YVYU), @@ -469,6 +470,9 @@ static const struct pixel_format_info pixel_format_table[] = { .num_planes = 2, .hsub = 2, .vsub = 2, +#ifdef HAVE_PIXMAN_NV12 + PIXMAN_FMT(nv12), +#endif }, { DRM_FORMAT(NV21), @@ -484,6 +488,9 @@ static const struct pixel_format_info pixel_format_table[] = { .num_planes = 2, .hsub = 2, .vsub = 1, +#ifdef HAVE_PIXMAN_NV16 + PIXMAN_FMT(nv16), +#endif }, { DRM_FORMAT(NV61), @@ -540,6 +547,9 @@ static const struct pixel_format_info pixel_format_table[] = { .num_planes = 3, .hsub = 2, .vsub = 2, +#ifdef HAVE_PIXMAN_I420 + PIXMAN_FMT(i420), +#endif }, { DRM_FORMAT(YVU420), @@ -548,6 +558,7 @@ static const struct pixel_format_info pixel_format_table[] = { .chroma_order = ORDER_VU, .hsub = 2, .vsub = 2, + PIXMAN_FMT(yv12), }, { DRM_FORMAT(YUV422), diff --git a/meson.build b/meson.build index 396d158..086d599 100644 --- a/meson.build +++ b/meson.build @@ -157,6 +157,16 @@ dep_libdrm = dependency('libdrm', version: '>= 2.4.108') dep_libdrm_headers = dep_libdrm.partial_dependency(compile_args: true) dep_threads = dependency('threads') +if cc.has_header_symbol('pixman.h', 'PIXMAN_nv12', dependencies : dep_pixman) + config_h.set('HAVE_PIXMAN_NV12', 1) +endif +if cc.has_header_symbol('pixman.h', 'PIXMAN_i420', dependencies : dep_pixman) + config_h.set('HAVE_PIXMAN_I420', 1) +endif +if cc.has_header_symbol('pixman.h', 'PIXMAN_nv16', dependencies : dep_pixman) + config_h.set('HAVE_PIXMAN_NV16', 1) +endif + dep_lcms2 = dependency('lcms2', version: '>= 2.9', required: false) prog_python = import('python').find_installation('python3') -- 2.20.1