summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/onevpl/onevpl/0001-sample_misc-use-wayland-dmabuf-to-render-nv12.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-multimedia/onevpl/onevpl/0001-sample_misc-use-wayland-dmabuf-to-render-nv12.patch')
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-sample_misc-use-wayland-dmabuf-to-render-nv12.patch94
1 files changed, 0 insertions, 94 deletions
diff --git a/recipes-multimedia/onevpl/onevpl/0001-sample_misc-use-wayland-dmabuf-to-render-nv12.patch b/recipes-multimedia/onevpl/onevpl/0001-sample_misc-use-wayland-dmabuf-to-render-nv12.patch
deleted file mode 100644
index d061e3ef..00000000
--- a/recipes-multimedia/onevpl/onevpl/0001-sample_misc-use-wayland-dmabuf-to-render-nv12.patch
+++ /dev/null
@@ -1,94 +0,0 @@
1From 0091d3fea76e64ffbd537b2ae47b8912c89c09d7 Mon Sep 17 00:00:00 2001
2From: "Ung, Teng En" <teng.en.ung@intel.com>
3Date: Fri, 8 Oct 2021 14:38:45 +0000
4Subject: [PATCH 3/3] sample_misc: use wayland dmabuf to render nv12
5
6Upstream-Status: Submitted
7innersource PR #269
8
9---
10 .../sample_misc/wayland/src/class_wayland.cpp | 60 +++++++++++++++----
11 1 file changed, 47 insertions(+), 13 deletions(-)
12
13diff --git a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
14index dc2fc718..d2e7e4e2 100644
15--- a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
16+++ b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
17@@ -26,6 +26,7 @@ or https://software.intel.com/en-us/media-client-solutions-support.
18 #include <iostream>
19 extern "C" {
20 #include <drm.h>
21+#include <drm_fourcc.h>
22 #include <intel_bufmgr.h>
23 #include <xf86drm.h>
24 }
25@@ -305,20 +306,53 @@ struct wl_buffer* Wayland::CreatePrimeBuffer(uint32_t name,
26 int32_t offsets[3],
27 int32_t pitches[3]) {
28 struct wl_buffer* buffer = NULL;
29- if (NULL == m_drm)
30- return NULL;
31
32- buffer = wl_drm_create_prime_buffer(m_drm,
33- name,
34- width,
35- height,
36- format,
37- offsets[0],
38- pitches[0],
39- offsets[1],
40- pitches[1],
41- offsets[2],
42- pitches[2]);
43+#if defined(WAYLAND_LINUX_DMABUF_SUPPORT)
44+ if (format == WL_DRM_FORMAT_NV12) {
45+ if(NULL == m_dmabuf)
46+ return NULL;
47+
48+ struct zwp_linux_buffer_params_v1 *dmabuf_params = NULL;
49+ int i = 0;
50+ uint64_t modifier = I915_FORMAT_MOD_Y_TILED;
51+
52+ dmabuf_params = zwp_linux_dmabuf_v1_create_params(m_dmabuf);
53+ for(i = 0; i < 2; i++) {
54+ zwp_linux_buffer_params_v1_add(dmabuf_params,
55+ name,
56+ i,
57+ offsets[i],
58+ pitches[i],
59+ modifier >> 32,
60+ modifier & 0xffffffff);
61+ }
62+
63+ buffer = zwp_linux_buffer_params_v1_create_immed(dmabuf_params,
64+ width,
65+ height,
66+ format,
67+ 0);
68+
69+ zwp_linux_buffer_params_v1_destroy(dmabuf_params);
70+ } else
71+#endif
72+ {
73+ if(NULL == m_drm)
74+ return NULL;
75+
76+ buffer = wl_drm_create_prime_buffer(m_drm,
77+ name,
78+ width,
79+ height,
80+ format,
81+ offsets[0],
82+ pitches[0],
83+ offsets[1],
84+ pitches[1],
85+ offsets[2],
86+ pitches[2]);
87+ }
88+
89 return buffer;
90 }
91
92--
932.31.1
94