summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/mediasdk/files
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-multimedia/mediasdk/files')
-rw-r--r--recipes-multimedia/mediasdk/files/0001-FindITT.cmake-fix-detection-of-header-library.patch49
-rw-r--r--recipes-multimedia/mediasdk/files/0001-FindOpenCL.cmake-don-t-look-for-driver-at-build-time.patch35
-rw-r--r--recipes-multimedia/mediasdk/files/0001-Fix-video-stuttering-during-wayland-rendering.patch230
3 files changed, 0 insertions, 314 deletions
diff --git a/recipes-multimedia/mediasdk/files/0001-FindITT.cmake-fix-detection-of-header-library.patch b/recipes-multimedia/mediasdk/files/0001-FindITT.cmake-fix-detection-of-header-library.patch
deleted file mode 100644
index 87c4e82e..00000000
--- a/recipes-multimedia/mediasdk/files/0001-FindITT.cmake-fix-detection-of-header-library.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1From be7cec47777bd35c44a59f2af73f12ce9c26d65c Mon Sep 17 00:00:00 2001
2From: Anuj Mittal <anuj.mittal@intel.com>
3Date: Wed, 7 Oct 2020 09:33:06 +0800
4Subject: [PATCH] FindITT.cmake: fix detection of header/library
5
6Use find_library to check for the library so distributions installing to
7standard locations can also work in addition to custom paths specified
8using CMAKE_ITT_HOME.
9
10Also add ittnotify to PATH_SUFFIXES for header for cases when
11ittnotify.h is installed in /usr/include/ittnotify for example.
12
13Upstream-Status: Submitted
14
15Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
16---
17 builder/FindITT.cmake | 6 +++---
18 1 file changed, 3 insertions(+), 3 deletions(-)
19
20diff --git a/builder/FindITT.cmake b/builder/FindITT.cmake
21index ba2542c5..d96acf2e 100644
22--- a/builder/FindITT.cmake
23+++ b/builder/FindITT.cmake
24@@ -35,19 +35,19 @@ if( ENABLE_ITT )
25
26 find_path( ITT_INCLUDE_DIRS ittnotify.h
27 PATHS ${CMAKE_ITT_HOME} ${CMAKE_VTUNE_HOME}
28- PATH_SUFFIXES include )
29+ PATH_SUFFIXES include ittnotify)
30
31 # Unfortunately SEAPI and VTune uses different names for itt library:
32 # * SEAPI uses libittnotify${arch}.a
33 # * VTune uses libittnotify.a
34 # We are trying to check both giving preference to SEAPI name.
35- find_path( ITT_LIBRARY_DIRS libittnotify${arch}.a
36+ find_library( ITT_LIBRARY_DIRS ittnotify${arch}
37 PATHS ${CMAKE_ITT_HOME} ${CMAKE_VTUNE_HOME}
38 PATH_SUFFIXES lib64 )
39 if( NOT ITT_LIBRARY_DIRS MATCHES NOTFOUND )
40 set( ITT_LIBRARIES "ittnotify${arch}" )
41 else()
42- find_path( ITT_LIBRARY_DIRS libittnotify.a
43+ find_library( ITT_LIBRARY_DIRS ittnotify
44 PATHS ${CMAKE_ITT_HOME} ${CMAKE_VTUNE_HOME}
45 PATH_SUFFIXES lib64 )
46 if( NOT ITT_LIBRARY_PATH MATCHES NOTFOUND )
47--
482.26.2
49
diff --git a/recipes-multimedia/mediasdk/files/0001-FindOpenCL.cmake-don-t-look-for-driver-at-build-time.patch b/recipes-multimedia/mediasdk/files/0001-FindOpenCL.cmake-don-t-look-for-driver-at-build-time.patch
deleted file mode 100644
index 34ffb912..00000000
--- a/recipes-multimedia/mediasdk/files/0001-FindOpenCL.cmake-don-t-look-for-driver-at-build-time.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From cc30986a6033e3b3b8709cf62a84bd832209e493 Mon Sep 17 00:00:00 2001
2From: Anuj Mittal <anuj.mittal@intel.com>
3Date: Wed, 9 Sep 2020 15:04:14 +0800
4Subject: [PATCH] FindOpenCL.cmake: don't look for driver at build time
5
6We don't need the icd driver to be present when building.
7
8Upstream-Status: Inappropriate
9
10Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
11---
12 builder/FindOpenCL.cmake | 2 --
13 1 file changed, 2 deletions(-)
14
15diff --git a/builder/FindOpenCL.cmake b/builder/FindOpenCL.cmake
16index ed531bc8..d8ac00a6 100644
17--- a/builder/FindOpenCL.cmake
18+++ b/builder/FindOpenCL.cmake
19@@ -25,13 +25,11 @@ set( OCL_LIBS "" )
20
21 if ( NOT OPENCL_INCLUDE MATCHES NOTFOUND )
22 if ( NOT OPENCL_LIBRARY MATCHES NOTFOUND )
23- if ( EXISTS /etc/OpenCL/vendors/intel.icd )
24 set ( OPENCL_FOUND TRUE )
25
26 get_filename_component( OPENCL_LIBRARY_PATH ${OPENCL_LIBRARY} PATH )
27
28 list( APPEND OPENCL_LIBS OpenCL )
29- endif()
30 endif()
31 endif()
32
33--
342.26.2
35
diff --git a/recipes-multimedia/mediasdk/files/0001-Fix-video-stuttering-during-wayland-rendering.patch b/recipes-multimedia/mediasdk/files/0001-Fix-video-stuttering-during-wayland-rendering.patch
deleted file mode 100644
index 1a28fa1e..00000000
--- a/recipes-multimedia/mediasdk/files/0001-Fix-video-stuttering-during-wayland-rendering.patch
+++ /dev/null
@@ -1,230 +0,0 @@
1From 0c07c8b9ecbb1224b74712f5b41f2504d27ff38f Mon Sep 17 00:00:00 2001
2From: Lim Siew Hoon <siew.hoon.lim@intel.com>
3Date: Tue, 24 Nov 2020 14:44:05 +0800
4Subject: [PATCH] Fix video stuttering during wayland rendering
5
6The issue at here when RenderFrame exits, does not mean
7corresponding wl_buffer is not used anymore by weston.
8So, the wl_buffer has be wait until buffer_release function
9call out under wl_buffer_listener get trigger. Than only
10consider wl_buffer is no longer used anymore by weston and
11safe to use by previous upper component like vpp csc.
12
13The implementation code fixed at here is to prevent surface
14get overwrite and used back by vpp csc inside sample_decode
15when wl_buffer still not yet release when RenderFrame exits.
16
17Platform: EHL, TGL-U, TGL-H
18OS: Yocto native wayland weston
19Tested:
20./sample_decode h264 -i Puppies_1920x1080.h264 -rwld -rgb4 -f 30
21
22Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
23
24The patch was imported from the MediaSDK git server
25(git@github.com:Intel-Media-SDK/MediaSDK.git) as of commit id
2675bd6562f7ea90e2a2666dccab9c09ea58d3d23e.
27
28Upstream-Status: Backport
29
30Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
31---
32 samples/sample_common/src/vaapi_device.cpp | 2 +-
33 .../wayland/include/class_wayland.h | 16 ++++-
34 .../sample_misc/wayland/src/class_wayland.cpp | 67 +++++++++++++++++--
35 .../wayland/src/listener_wayland.cpp | 2 +
36 4 files changed, 78 insertions(+), 9 deletions(-)
37
38diff --git a/samples/sample_common/src/vaapi_device.cpp b/samples/sample_common/src/vaapi_device.cpp
39index de435fe7..238449ff 100644
40--- a/samples/sample_common/src/vaapi_device.cpp
41+++ b/samples/sample_common/src/vaapi_device.cpp
42@@ -397,7 +397,7 @@ mfxStatus CVAAPIDeviceWayland::RenderFrame(mfxFrameSurface1 * pSurface, mfxFrame
43 return mfx_res;
44 }
45
46- m_Wayland->RenderBuffer(m_wl_buffer, pSurface->Info.CropW, pSurface->Info.CropH);
47+ m_Wayland->RenderBuffer(m_wl_buffer, pSurface);
48
49 return mfx_res;
50 }
51diff --git a/samples/sample_misc/wayland/include/class_wayland.h b/samples/sample_misc/wayland/include/class_wayland.h
52index c2c8cea0..18a1e406 100644
53--- a/samples/sample_misc/wayland/include/class_wayland.h
54+++ b/samples/sample_misc/wayland/include/class_wayland.h
55@@ -28,7 +28,13 @@ extern "C"
56 }
57 #include <poll.h>
58 #include <wayland-client.h>
59+#include <list>
60 #include "wayland-drm-client-protocol.h"
61+#include "mfxstructures.h"
62+#include "mfx_buffering.h"
63+#include "sample_defs.h"
64+
65+typedef struct buffer wld_buffer;
66
67 /* ShmPool Struct */
68 struct ShmPool {
69@@ -38,7 +44,7 @@ struct ShmPool {
70 unsigned size;
71 };
72
73-class Wayland {
74+class Wayland: public CBuffering {
75 public:
76 Wayland();
77 virtual ~Wayland();
78@@ -47,8 +53,7 @@ class Wayland {
79 virtual void FreeSurface();
80 virtual void SetRenderWinPos(int x, int y);
81 virtual void RenderBuffer(struct wl_buffer *buffer
82- , int32_t width
83- , int32_t height);
84+ , mfxFrameSurface1 *surface);
85 virtual void RenderBufferWinPosSize(struct wl_buffer *buffer
86 , int x
87 , int y
88@@ -115,6 +120,9 @@ class Wayland {
89 void DestroyCallback();
90 virtual void Sync();
91 virtual void SetPerfMode(bool perf_mode);
92+ void AddBufferToList(wld_buffer *buffer);
93+ void RemoveBufferFromList(struct wl_buffer *buffer);
94+ void DestroyBufferList();
95 private:
96 //no copies allowed
97 Wayland(const Wayland &);
98@@ -140,6 +148,8 @@ class Wayland {
99 char *m_device_name;
100 int m_x, m_y;
101 bool m_perf_mode;
102+ protected:
103+ std::list<wld_buffer*> m_buffers_list;
104 };
105
106 extern "C" Wayland* WaylandCreate();
107diff --git a/samples/sample_misc/wayland/src/class_wayland.cpp b/samples/sample_misc/wayland/src/class_wayland.cpp
108index 5d0e6208..62f326e3 100644
109--- a/samples/sample_misc/wayland/src/class_wayland.cpp
110+++ b/samples/sample_misc/wayland/src/class_wayland.cpp
111@@ -35,6 +35,11 @@ extern "C" {
112
113 #define BATCH_SIZE 0x80000
114
115+struct buffer {
116+ struct wl_buffer *buffer;
117+ mfxFrameSurface1 *pInSurface;
118+};
119+
120 static const struct wl_callback_listener frame_listener = {
121 handle_done
122 };
123@@ -169,15 +174,22 @@ void Wayland::SetRenderWinPos(int x, int y)
124 }
125
126 void Wayland::RenderBuffer(struct wl_buffer *buffer
127- , int32_t width
128- , int32_t height)
129+ , mfxFrameSurface1 *surface)
130 {
131+ wld_buffer *m_buffer = new wld_buffer;
132+ if (m_buffer == NULL)
133+ return;
134+
135+ m_buffer->buffer = buffer;
136+ m_buffer->pInSurface = surface;
137+
138 wl_surface_attach(m_surface, buffer, 0, 0);
139- wl_surface_damage(m_surface, m_x, m_y, width, height);
140+ wl_surface_damage(m_surface, m_x, m_y, surface->Info.CropW, surface->Info.CropH);
141
142 wl_proxy_set_queue((struct wl_proxy *) buffer, m_event_queue);
143
144- wl_buffer_add_listener(buffer, &buffer_listener, NULL);
145+ AddBufferToList(m_buffer);
146+ wl_buffer_add_listener(buffer, &buffer_listener, this);
147 m_pending_frame=1;
148 if (m_perf_mode)
149 m_callback = wl_display_sync(m_display);
150@@ -365,6 +377,8 @@ Wayland::~Wayland()
151 wl_compositor_destroy(m_compositor);
152 if(NULL != m_event_queue)
153 wl_event_queue_destroy(m_event_queue);
154+ if(0 != m_buffers_list.size())
155+ DestroyBufferList();
156 if(NULL != m_registry)
157 wl_registry_destroy(m_registry);
158 if(NULL != m_display)
159@@ -428,6 +442,50 @@ void Wayland::DrmHandleAuthenticated()
160 m_bufmgr = drm_intel_bufmgr_gem_init(m_fd, BATCH_SIZE);
161 }
162
163+void Wayland::AddBufferToList(wld_buffer *buffer)
164+{
165+ if (buffer == NULL)
166+ return;
167+
168+ if (buffer->pInSurface) {
169+ msdkFrameSurface *surface = FindUsedSurface(buffer->pInSurface);
170+ msdk_atomic_inc16(&(surface->render_lock));
171+ m_buffers_list.push_back(buffer);
172+ }
173+}
174+
175+void Wayland::RemoveBufferFromList(struct wl_buffer *buffer)
176+{
177+ wld_buffer *m_buffer = NULL;
178+ m_buffer = m_buffers_list.front();
179+ if (NULL != m_buffer && (m_buffer->buffer == buffer)) {
180+ if (m_buffer->pInSurface) {
181+ msdkFrameSurface *surface = FindUsedSurface(m_buffer->pInSurface);
182+ msdk_atomic_dec16(&(surface->render_lock));
183+ }
184+ m_buffer->buffer = NULL;
185+ m_buffer->pInSurface = NULL;
186+ m_buffers_list.pop_front();
187+ delete m_buffer;
188+ }
189+}
190+
191+void Wayland::DestroyBufferList()
192+{
193+ wld_buffer *m_buffer = NULL;
194+ while (!m_buffers_list.empty())
195+ {
196+ m_buffer = m_buffers_list.front();
197+ if (m_buffer->pInSurface)
198+ {
199+ msdkFrameSurface *surface = FindUsedSurface(m_buffer->pInSurface);
200+ msdk_atomic_dec16(&(surface->render_lock));
201+ }
202+ m_buffers_list.pop_front();
203+ delete m_buffer;
204+ }
205+}
206+
207 Wayland* WaylandCreate()
208 {
209 return new Wayland;
210@@ -437,4 +495,3 @@ void WaylandDestroy(Wayland *pWld)
211 {
212 delete pWld;
213 }
214-
215diff --git a/samples/sample_misc/wayland/src/listener_wayland.cpp b/samples/sample_misc/wayland/src/listener_wayland.cpp
216index dc68c1d5..90f582a7 100644
217--- a/samples/sample_misc/wayland/src/listener_wayland.cpp
218+++ b/samples/sample_misc/wayland/src/listener_wayland.cpp
219@@ -98,6 +98,8 @@ void handle_done(void *data, struct wl_callback *callback, uint32_t time)
220
221 void buffer_release(void *data, struct wl_buffer *buffer)
222 {
223+ Wayland *wayland = static_cast<Wayland*>(data);
224+ wayland->RemoveBufferFromList(buffer);
225 wl_buffer_destroy(buffer);
226 buffer = NULL;
227 }
228--
2292.17.1
230