meta-intel/recipes-multimedia/onevpl/files/0002-Fix-sample_multi_transcode-segfault-on-wayland.patch
Lim Siew Hoon d7692dba74 onevpl: fix various issues
1. Fixed memory leaking on sample rendering in wayland
2. Fixed sample_multi_transcode segfault rendering in wayland.
3. Fixed sample X11 rendering in corruption issue.
4. Fixed Adjust MJPEG 1920x1080 alignment issue.
5. Fixed sample_multi_transcode intermittent segfault issue.

Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2023-06-02 11:16:50 +08:00

88 lines
2.8 KiB
Diff

From 72ef4e2878f8cc2df431411027c92dc41ff26a2b Mon Sep 17 00:00:00 2001
From: Vincent Cheah Beng Keat <vincent.beng.keat.cheah@intel.com>
Date: Wed, 15 Mar 2023 22:37:08 +0800
Subject: [PATCH 2/5] Fix sample_multi_transcode segfault on wayland
HSD ID: 15012772965
Tested command: ./sample_multi_transcode -par ../../config.par
Upstream-Status: Backport
Expect it to be removed once move to v2023.2.0 and above.
https://github.com/oneapi-src/oneVPL/commit/59c850db505d32e6b7e4d68ced8d714afe390a70
---
.../sample_misc/wayland/src/class_wayland.cpp | 27 +++++++++++++++----
.../src/pipeline_transcode.cpp | 6 ++++-
2 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
index 8f6edbb..af4d3f3 100644
--- a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
+++ b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
@@ -144,19 +144,36 @@ bool Wayland::CreateSurface() {
}
void Wayland::FreeSurface() {
- if (NULL != m_shell_surface)
+ if (NULL != m_shell_surface) {
wl_shell_surface_destroy(m_shell_surface);
- if (NULL != m_surface)
+ m_shell_surface = NULL;
+ }
+ if (NULL != m_surface) {
+ while (!m_buffers_list.empty()) {
+ wl_surface_attach(m_surface, NULL, 0, 0);
+ wl_surface_commit(m_surface);
+ if (wl_display_dispatch_queue(m_display, m_event_queue) < 1)
+ break;
+ }
+
wl_surface_destroy(m_surface);
+ m_surface = NULL;
+ }
#if defined(WAYLAND_LINUX_XDG_SHELL_SUPPORT)
- if (NULL != m_xdg_toplevel)
+ if (NULL != m_xdg_toplevel) {
xdg_toplevel_destroy(m_xdg_toplevel);
- if (NULL != m_xdg_surface)
+ m_xdg_toplevel = NULL;
+ }
+ if (NULL != m_xdg_surface) {
xdg_surface_destroy(m_xdg_surface);
+ m_xdg_surface = NULL;
+ }
#endif
#if defined(WAYLAND_LINUX_DMABUF_SUPPORT)
- if (NULL != m_dmabuf)
+ if (NULL != m_dmabuf) {
zwp_linux_dmabuf_v1_destroy(m_dmabuf);
+ m_dmabuf = NULL;
+ }
#endif
}
diff --git a/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp b/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp
index 1c39daf..5e69a94 100644
--- a/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp
+++ b/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp
@@ -4675,12 +4675,16 @@ void CTranscodingPipeline::Close() {
m_bIsJoinSession = false;
}
- //Destroy renderer
#if defined(_WIN32) || defined(_WIN64)
+ //Destroy renderer
if (m_hwdev4Rendering) {
delete m_hwdev4Rendering;
m_hwdev4Rendering = NULL;
}
+#else
+ if (m_hwdev4Rendering) {
+ m_hwdev4Rendering->Close();
+ }
#endif
if (m_b3DLutEnable) {
--
2.40.1