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