diff options
Diffstat (limited to 'recipes-multimedia/onevpl/files/0001-Fix-valgrind-leak-reported-on-wayland.patch')
-rw-r--r-- | recipes-multimedia/onevpl/files/0001-Fix-valgrind-leak-reported-on-wayland.patch | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/recipes-multimedia/onevpl/files/0001-Fix-valgrind-leak-reported-on-wayland.patch b/recipes-multimedia/onevpl/files/0001-Fix-valgrind-leak-reported-on-wayland.patch deleted file mode 100644 index e368bb6e..00000000 --- a/recipes-multimedia/onevpl/files/0001-Fix-valgrind-leak-reported-on-wayland.patch +++ /dev/null | |||
@@ -1,111 +0,0 @@ | |||
1 | From 19005bb487c31aacecab333d8a40ab6434885911 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vincent Cheah Beng Keat <vincent.beng.keat.cheah@intel.com> | ||
3 | Date: Fri, 24 Mar 2023 22:59:08 +0800 | ||
4 | Subject: [PATCH 1/5] Fix valgrind leak reported on wayland | ||
5 | |||
6 | Upstream-Status: Backport | ||
7 | Expect it to be removed once move to v2023.2.0 and above. | ||
8 | https://github.com/oneapi-src/oneVPL/commit/d276bb08e060956cde678d2c15fc291eec46d1dc | ||
9 | --- | ||
10 | .../legacy/sample_common/include/vaapi_utils.h | 2 ++ | ||
11 | tools/legacy/sample_common/src/vaapi_device.cpp | 1 + | ||
12 | tools/legacy/sample_common/src/vaapi_utils.cpp | 3 ++- | ||
13 | .../sample_misc/wayland/src/class_wayland.cpp | 17 +++++++++++++++-- | ||
14 | 4 files changed, 20 insertions(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/tools/legacy/sample_common/include/vaapi_utils.h b/tools/legacy/sample_common/include/vaapi_utils.h | ||
17 | index 9d80255..2598883 100644 | ||
18 | --- a/tools/legacy/sample_common/include/vaapi_utils.h | ||
19 | +++ b/tools/legacy/sample_common/include/vaapi_utils.h | ||
20 | @@ -315,11 +315,13 @@ private: | ||
21 | |||
22 | public: | ||
23 | typedef Wayland* (*WaylandCreate_type)(void); | ||
24 | + typedef void (*WaylandDestroy_type)(Wayland*); | ||
25 | |||
26 | VA_WaylandClientProxy(); | ||
27 | ~VA_WaylandClientProxy(); | ||
28 | |||
29 | const WaylandCreate_type WaylandCreate; | ||
30 | + const WaylandDestroy_type WaylandDestroy; | ||
31 | }; | ||
32 | |||
33 | #endif // LIBVA_WAYLAND_SUPPORT | ||
34 | diff --git a/tools/legacy/sample_common/src/vaapi_device.cpp b/tools/legacy/sample_common/src/vaapi_device.cpp | ||
35 | index e621251..98c5883 100644 | ||
36 | --- a/tools/legacy/sample_common/src/vaapi_device.cpp | ||
37 | +++ b/tools/legacy/sample_common/src/vaapi_device.cpp | ||
38 | @@ -349,6 +349,7 @@ mfxStatus CVAAPIDeviceX11::RenderFrame(mfxFrameSurface1* pSurface, | ||
39 | |||
40 | CVAAPIDeviceWayland::~CVAAPIDeviceWayland(void) { | ||
41 | Close(); | ||
42 | + m_WaylandClient.WaylandDestroy((MfxLoader::Wayland*)m_Wayland); | ||
43 | } | ||
44 | |||
45 | mfxStatus CVAAPIDeviceWayland::Init(mfxHDL hWindow, mfxU16 nViews, mfxU32 nAdapterNum) { | ||
46 | diff --git a/tools/legacy/sample_common/src/vaapi_utils.cpp b/tools/legacy/sample_common/src/vaapi_utils.cpp | ||
47 | index e107624..d7aba0a 100644 | ||
48 | --- a/tools/legacy/sample_common/src/vaapi_utils.cpp | ||
49 | +++ b/tools/legacy/sample_common/src/vaapi_utils.cpp | ||
50 | @@ -182,7 +182,8 @@ Xcbpresent_Proxy::~Xcbpresent_Proxy() {} | ||
51 | |||
52 | VA_WaylandClientProxy::VA_WaylandClientProxy() | ||
53 | : lib(WAYLAND_LIB), | ||
54 | - SIMPLE_LOADER_FUNCTION(WaylandCreate) {} | ||
55 | + SIMPLE_LOADER_FUNCTION(WaylandCreate), | ||
56 | + SIMPLE_LOADER_FUNCTION(WaylandDestroy) {} | ||
57 | |||
58 | VA_WaylandClientProxy::~VA_WaylandClientProxy() {} | ||
59 | |||
60 | diff --git a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp | ||
61 | index 1a0bffa..8f6edbb 100644 | ||
62 | --- a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp | ||
63 | +++ b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp | ||
64 | @@ -149,11 +149,15 @@ void Wayland::FreeSurface() { | ||
65 | if (NULL != m_surface) | ||
66 | wl_surface_destroy(m_surface); | ||
67 | #if defined(WAYLAND_LINUX_XDG_SHELL_SUPPORT) | ||
68 | - if (nullptr != m_xdg_toplevel) | ||
69 | + if (NULL != m_xdg_toplevel) | ||
70 | xdg_toplevel_destroy(m_xdg_toplevel); | ||
71 | - if (nullptr != m_xdg_surface) | ||
72 | + if (NULL != m_xdg_surface) | ||
73 | xdg_surface_destroy(m_xdg_surface); | ||
74 | #endif | ||
75 | +#if defined(WAYLAND_LINUX_DMABUF_SUPPORT) | ||
76 | + if (NULL != m_dmabuf) | ||
77 | + zwp_linux_dmabuf_v1_destroy(m_dmabuf); | ||
78 | +#endif | ||
79 | } | ||
80 | |||
81 | void Wayland::Sync() { | ||
82 | @@ -379,10 +383,16 @@ struct wl_buffer* Wayland::CreatePrimeBuffer(uint32_t name, | ||
83 | } | ||
84 | |||
85 | Wayland::~Wayland() { | ||
86 | +#if defined(WAYLAND_LINUX_XDG_SHELL_SUPPORT) | ||
87 | + if (NULL != m_xdg_wm_base) | ||
88 | + xdg_wm_base_destroy(m_xdg_wm_base); | ||
89 | +#endif | ||
90 | if (NULL != m_shell) | ||
91 | wl_shell_destroy(m_shell); | ||
92 | if (NULL != m_shm) | ||
93 | wl_shm_destroy(m_shm); | ||
94 | + if (NULL != m_drm) | ||
95 | + wl_drm_destroy(m_drm); | ||
96 | if (NULL != m_bufmgr) { | ||
97 | drm_intel_bufmgr_destroy(m_bufmgr); | ||
98 | } | ||
99 | @@ -492,6 +502,9 @@ void Wayland::DestroyBufferList() { | ||
100 | msdkFrameSurface* surface = FindUsedSurface(m_buffer->pInSurface); | ||
101 | msdk_atomic_dec16(&(surface->render_lock)); | ||
102 | } | ||
103 | + wl_buffer_destroy(m_buffer->buffer); | ||
104 | + m_buffer->buffer = NULL; | ||
105 | + m_buffer->pInSurface = NULL; | ||
106 | m_buffers_list.pop_front(); | ||
107 | delete m_buffer; | ||
108 | } | ||
109 | -- | ||
110 | 2.40.1 | ||
111 | |||