1From eaa1f13dfdd0679fbb6d48e3521a0a1d50fe9f07 Mon Sep 17 00:00:00 2001 2From: Jeffy Chen <jeffy.chen@rock-chips.com> 3Date: Mon, 7 Mar 2022 18:22:04 +0800 4Subject: [PATCH 59/79] pixel-formats: Support NV15/YU08/YU10 5 6Only for importing dmabuf to drm fb. 7 8Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> 9--- 10 libweston/pixel-formats.c | 12 ++++++++++++ 11 libweston/pixel-formats.h | 12 ++++++++++++ 12 2 files changed, 24 insertions(+) 13 14diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c 15index 85fae20..18f9c0e 100644 16--- a/libweston/pixel-formats.c 17+++ b/libweston/pixel-formats.c 18@@ -485,6 +485,18 @@ static const struct pixel_format_info pixel_format_table[] = { 19 .num_planes = 3, 20 .chroma_order = ORDER_VU, 21 }, 22+ { 23+ DRM_FORMAT(NV15), 24+ .num_planes = 1, 25+ }, 26+ { 27+ DRM_FORMAT(YUV420_8BIT), 28+ .num_planes = 1, 29+ }, 30+ { 31+ DRM_FORMAT(YUV420_10BIT), 32+ .num_planes = 1, 33+ }, 34 }; 35 36 WL_EXPORT const struct pixel_format_info * 37diff --git a/libweston/pixel-formats.h b/libweston/pixel-formats.h 38index 0b1a5f5..4592ce3 100644 39--- a/libweston/pixel-formats.h 40+++ b/libweston/pixel-formats.h 41@@ -28,6 +28,18 @@ 42 #include <stdbool.h> 43 #include <pixman.h> 44 45+#ifndef DRM_FORMAT_NV15 46+#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') 47+#endif 48+ 49+#ifndef DRM_FORMAT_YUV420_8BIT 50+#define DRM_FORMAT_YUV420_8BIT fourcc_code('Y', 'U', '0', '8') 51+#endif 52+ 53+#ifndef DRM_FORMAT_YUV420_10BIT 54+#define DRM_FORMAT_YUV420_10BIT fourcc_code('Y', 'U', '1', '0') 55+#endif 56+ 57 /** 58 * Contains information about pixel formats, mapping format codes from 59 * wl_shm and drm_fourcc.h (which are deliberately identical, but for the 60-- 612.20.1 62 63