From 37129dcc646a179d8c6ca4cdd96a43cf3613572f Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Mon, 7 Mar 2022 18:22:04 +0800 Subject: [PATCH 56/93] 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 a7ae8c0..0aa9457 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 31d8039..be9eaf6 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