From 8ac02ab40c03233285bd77d58433e19792bc152e Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Mon, 7 Mar 2022 18:22:04 +0800 Subject: [PATCH 56/79] pixel-formats: Support NV15/YU08/YU10 Only for importing dmabuf to drm fb. Signed-off-by: Jeffy Chen --- libweston/pixel-formats.c | 12 ++++++++++++ shared/weston-drm-fourcc.h | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c index a7ae8c00..0aa94573 100644 --- a/libweston/pixel-formats.c +++ b/libweston/pixel-formats.c @@ -591,6 +591,18 @@ static const struct pixel_format_info pixel_format_table[] = { DRM_FORMAT(XYUV8888), .bpp = 32, }, + { + DRM_FORMAT(NV15), + .num_planes = 1, + }, + { + DRM_FORMAT(YUV420_8BIT), + .num_planes = 1, + }, + { + DRM_FORMAT(YUV420_10BIT), + .num_planes = 1, + }, }; WL_EXPORT const struct pixel_format_info * diff --git a/shared/weston-drm-fourcc.h b/shared/weston-drm-fourcc.h index 31d80398..be9eaf68 100644 --- a/shared/weston-drm-fourcc.h +++ b/shared/weston-drm-fourcc.h @@ -34,6 +34,18 @@ #define DRM_MOD_VALID(mod) \ ((mod) != DRM_FORMAT_MOD_LINEAR && (mod) != DRM_FORMAT_MOD_INVALID) +#ifndef DRM_FORMAT_NV15 +#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') +#endif + +#ifndef DRM_FORMAT_YUV420_8BIT +#define DRM_FORMAT_YUV420_8BIT fourcc_code('Y', 'U', '0', '8') +#endif + +#ifndef DRM_FORMAT_YUV420_10BIT +#define DRM_FORMAT_YUV420_10BIT fourcc_code('Y', 'U', '1', '0') +#endif + /* The kernel header drm_fourcc.h defines the DRM formats below. We duplicate * some of the definitions here so that building Weston won't require * bleeding-edge kernel headers. -- 2.20.1