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 <[email protected]>
---
 ...ix-valgrind-leak-reported-on-wayland.patch | 111 ++++++++++++++++++
 ..._multi_transcode-segfault-on-wayland.patch |  87 ++++++++++++++
 ...3-Fix-X11-rendering-corruption-issue.patch |  30 +++++
 ...0004-Adjust-MPEG-1920x1088-alignment.patch |  75 ++++++++++++
 ...ulti_transcode-intermittent-segfault.patch |  34 ++++++
 recipes-multimedia/onevpl/onevpl_2023.1.3.bb  |   5 +
 6 files changed, 342 insertions(+)
 create mode 100644 
recipes-multimedia/onevpl/files/0001-Fix-valgrind-leak-reported-on-wayland.patch
 create mode 100644 
recipes-multimedia/onevpl/files/0002-Fix-sample_multi_transcode-segfault-on-wayland.patch
 create mode 100644 
recipes-multimedia/onevpl/files/0003-Fix-X11-rendering-corruption-issue.patch
 create mode 100644 
recipes-multimedia/onevpl/files/0004-Adjust-MPEG-1920x1088-alignment.patch
 create mode 100644 
recipes-multimedia/onevpl/files/0005-Fix-sample_multi_transcode-intermittent-segfault.patch

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
new file mode 100644
index 00000000..b625048d
--- /dev/null
+++ 
b/recipes-multimedia/onevpl/files/0001-Fix-valgrind-leak-reported-on-wayland.patch
@@ -0,0 +1,111 @@
+From 19005bb487c31aacecab333d8a40ab6434885911 Mon Sep 17 00:00:00 2001
+From: Vincent Cheah Beng Keat <[email protected]>
+Date: Fri, 24 Mar 2023 22:59:08 +0800
+Subject: [PATCH 1/5] Fix valgrind leak reported on wayland
+
+upstream-status: accepted
+Expect it to be removed once move to v2023.2.0 and above.
+https://github.com/oneapi-src/oneVPL/commit/d276bb08e060956cde678d2c15fc291eec46d1dc
+---
+ .../legacy/sample_common/include/vaapi_utils.h  |  2 ++
+ tools/legacy/sample_common/src/vaapi_device.cpp |  1 +
+ tools/legacy/sample_common/src/vaapi_utils.cpp  |  3 ++-
+ .../sample_misc/wayland/src/class_wayland.cpp   | 17 +++++++++++++++--
+ 4 files changed, 20 insertions(+), 3 deletions(-)
+
+diff --git a/tools/legacy/sample_common/include/vaapi_utils.h 
b/tools/legacy/sample_common/include/vaapi_utils.h
+index 9d80255..2598883 100644
+--- a/tools/legacy/sample_common/include/vaapi_utils.h
++++ b/tools/legacy/sample_common/include/vaapi_utils.h
+@@ -315,11 +315,13 @@ private:
+ 
+ public:
+     typedef Wayland* (*WaylandCreate_type)(void);
++    typedef void (*WaylandDestroy_type)(Wayland*);
+ 
+     VA_WaylandClientProxy();
+     ~VA_WaylandClientProxy();
+ 
+     const WaylandCreate_type WaylandCreate;
++    const WaylandDestroy_type WaylandDestroy;
+ };
+ 
+     #endif // LIBVA_WAYLAND_SUPPORT
+diff --git a/tools/legacy/sample_common/src/vaapi_device.cpp 
b/tools/legacy/sample_common/src/vaapi_device.cpp
+index e621251..98c5883 100644
+--- a/tools/legacy/sample_common/src/vaapi_device.cpp
++++ b/tools/legacy/sample_common/src/vaapi_device.cpp
+@@ -349,6 +349,7 @@ mfxStatus CVAAPIDeviceX11::RenderFrame(mfxFrameSurface1* 
pSurface,
+ 
+ CVAAPIDeviceWayland::~CVAAPIDeviceWayland(void) {
+     Close();
++    m_WaylandClient.WaylandDestroy((MfxLoader::Wayland*)m_Wayland);
+ }
+ 
+ mfxStatus CVAAPIDeviceWayland::Init(mfxHDL hWindow, mfxU16 nViews, mfxU32 
nAdapterNum) {
+diff --git a/tools/legacy/sample_common/src/vaapi_utils.cpp 
b/tools/legacy/sample_common/src/vaapi_utils.cpp
+index e107624..d7aba0a 100644
+--- a/tools/legacy/sample_common/src/vaapi_utils.cpp
++++ b/tools/legacy/sample_common/src/vaapi_utils.cpp
+@@ -182,7 +182,8 @@ Xcbpresent_Proxy::~Xcbpresent_Proxy() {}
+ 
+ VA_WaylandClientProxy::VA_WaylandClientProxy()
+         : lib(WAYLAND_LIB),
+-          SIMPLE_LOADER_FUNCTION(WaylandCreate) {}
++          SIMPLE_LOADER_FUNCTION(WaylandCreate),
++          SIMPLE_LOADER_FUNCTION(WaylandDestroy) {}
+ 
+ VA_WaylandClientProxy::~VA_WaylandClientProxy() {}
+ 
+diff --git a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp 
b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
+index 1a0bffa..8f6edbb 100644
+--- a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
++++ b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
+@@ -149,11 +149,15 @@ void Wayland::FreeSurface() {
+     if (NULL != m_surface)
+         wl_surface_destroy(m_surface);
+ #if defined(WAYLAND_LINUX_XDG_SHELL_SUPPORT)
+-    if (nullptr != m_xdg_toplevel)
++    if (NULL != m_xdg_toplevel)
+         xdg_toplevel_destroy(m_xdg_toplevel);
+-    if (nullptr != m_xdg_surface)
++    if (NULL != m_xdg_surface)
+         xdg_surface_destroy(m_xdg_surface);
+ #endif
++#if defined(WAYLAND_LINUX_DMABUF_SUPPORT)
++    if (NULL != m_dmabuf)
++        zwp_linux_dmabuf_v1_destroy(m_dmabuf);
++#endif
+ }
+ 
+ void Wayland::Sync() {
+@@ -379,10 +383,16 @@ struct wl_buffer* Wayland::CreatePrimeBuffer(uint32_t 
name,
+ }
+ 
+ Wayland::~Wayland() {
++#if defined(WAYLAND_LINUX_XDG_SHELL_SUPPORT)
++    if (NULL != m_xdg_wm_base)
++        xdg_wm_base_destroy(m_xdg_wm_base);
++#endif
+     if (NULL != m_shell)
+         wl_shell_destroy(m_shell);
+     if (NULL != m_shm)
+         wl_shm_destroy(m_shm);
++    if (NULL != m_drm)
++        wl_drm_destroy(m_drm);
+     if (NULL != m_bufmgr) {
+         drm_intel_bufmgr_destroy(m_bufmgr);
+     }
+@@ -492,6 +502,9 @@ void Wayland::DestroyBufferList() {
+             msdkFrameSurface* surface = FindUsedSurface(m_buffer->pInSurface);
+             msdk_atomic_dec16(&(surface->render_lock));
+         }
++        wl_buffer_destroy(m_buffer->buffer);
++        m_buffer->buffer     = NULL;
++        m_buffer->pInSurface = NULL;
+         m_buffers_list.pop_front();
+         delete m_buffer;
+     }
+-- 
+2.40.1
+
diff --git 
a/recipes-multimedia/onevpl/files/0002-Fix-sample_multi_transcode-segfault-on-wayland.patch
 
b/recipes-multimedia/onevpl/files/0002-Fix-sample_multi_transcode-segfault-on-wayland.patch
new file mode 100644
index 00000000..9c8dad18
--- /dev/null
+++ 
b/recipes-multimedia/onevpl/files/0002-Fix-sample_multi_transcode-segfault-on-wayland.patch
@@ -0,0 +1,87 @@
+From 72ef4e2878f8cc2df431411027c92dc41ff26a2b Mon Sep 17 00:00:00 2001
+From: Vincent Cheah Beng Keat <[email protected]>
+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: accepted
+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
+
diff --git 
a/recipes-multimedia/onevpl/files/0003-Fix-X11-rendering-corruption-issue.patch 
b/recipes-multimedia/onevpl/files/0003-Fix-X11-rendering-corruption-issue.patch
new file mode 100644
index 00000000..d01c21e6
--- /dev/null
+++ 
b/recipes-multimedia/onevpl/files/0003-Fix-X11-rendering-corruption-issue.patch
@@ -0,0 +1,30 @@
+From 9e13ea07fda1516f3c680929bea880aa4d303721 Mon Sep 17 00:00:00 2001
+From: Lim Siew Hoon <[email protected]>
+Date: Thu, 23 Mar 2023 09:46:04 +0800
+Subject: [PATCH 3/5] Fix X11 rendering corruption issue.
+
+upstream-status: accepted
+Expect it to be removed once move to v2023.3.0 and above.
+https://github.com/oneapi-src/oneVPL/commit/f129e3ba2ca276f08003ae314d674fba4b5290cd
+
+Signed-off-by: Lim Siew Hoon <[email protected]>
+---
+ tools/legacy/sample_common/src/vaapi_device.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/legacy/sample_common/src/vaapi_device.cpp 
b/tools/legacy/sample_common/src/vaapi_device.cpp
+index 98c5883..b90443a 100644
+--- a/tools/legacy/sample_common/src/vaapi_device.cpp
++++ b/tools/legacy/sample_common/src/vaapi_device.cpp
+@@ -271,7 +271,7 @@ mfxStatus CVAAPIDeviceX11::RenderFrame(mfxFrameSurface1* 
pSurface,
+         width  = pSurface->Info.CropX + pSurface->Info.CropW;
+         height = pSurface->Info.CropY + pSurface->Info.CropH;
+ 
+-        stride = width * bpp / 8;
++        stride = memId->m_image.pitches[0];
+         size   = PAGE_ALIGN(stride * height);
+ 
+         bo = drmintellib.drm_intel_bo_gem_create_from_prime(m_bufmgr,
+-- 
+2.40.1
+
diff --git 
a/recipes-multimedia/onevpl/files/0004-Adjust-MPEG-1920x1088-alignment.patch 
b/recipes-multimedia/onevpl/files/0004-Adjust-MPEG-1920x1088-alignment.patch
new file mode 100644
index 00000000..2ef97c3c
--- /dev/null
+++ b/recipes-multimedia/onevpl/files/0004-Adjust-MPEG-1920x1088-alignment.patch
@@ -0,0 +1,75 @@
+From e73b46657b286cd015e489e691166cbc79f5e79e Mon Sep 17 00:00:00 2001
+From: Lim Siew Hoon <[email protected]>
+Date: Thu, 20 Apr 2023 10:16:30 +0800
+Subject: [PATCH 4/5] Adjust MPEG 1920x1088 alignment
+
+Driver alignment for Mjpeg decode is 8,
+but vpp need 16 alignment.
+
+[Internal]
+OSPR: Auto
+Commit_Type: BugFix
+Platforms: Gen11+
+OS: Windows and Linux
+Feature impact: Dec_Legacy
+Resolves: N/A
+Related-to: PR#6323
+Klocwork: N/A
+TP_Passed: N/A
+IP Scan: N/A
+Open/Embargo Dependency: N/A
+
+Signed-off-by: Teng, Jin Chung <[email protected]>
+
+upstream-status: accepted
+Expect it to be removed once move to v2023.3.0 and above.
+https://github.com/oneapi-src/oneVPL/commit/7fe92332a7c32e85e6bb0a2724d66ce7124006ee
+
+Signed-off-by: Lim Siew Hoon <[email protected]>
+---
+ tools/legacy/sample_decode/src/pipeline_decode.cpp       | 9 +++++++++
+ .../sample_multi_transcode/src/pipeline_transcode.cpp    | 8 ++++++++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/tools/legacy/sample_decode/src/pipeline_decode.cpp 
b/tools/legacy/sample_decode/src/pipeline_decode.cpp
+index c0d5c46..47c17f3 100644
+--- a/tools/legacy/sample_decode/src/pipeline_decode.cpp
++++ b/tools/legacy/sample_decode/src/pipeline_decode.cpp
+@@ -800,6 +800,15 @@ mfxStatus CDecodingPipeline::InitMfxParams(sInputParams* 
pParams) {
+                 m_mfxVideoParams.mfx.FrameInfo.PicStruct = m_mfxBS.PicStruct;
+             }
+ 
++            // MJPEG decoder just need 8 alignment for height but VPP need 16 
alignment still
++            if (m_bVppIsUsed && (m_mfxVideoParams.mfx.CodecId == 
MFX_CODEC_JPEG) &&
++                (pParams->bUseHWLib)) {
++                m_mfxVideoParams.mfx.FrameInfo.Height =
++                    (MFX_PICSTRUCT_PROGRESSIVE == 
m_mfxVideoParams.mfx.FrameInfo.PicStruct)
++                        ? MSDK_ALIGN16(m_mfxVideoParams.mfx.FrameInfo.Height)
++                        : MSDK_ALIGN32(m_mfxVideoParams.mfx.FrameInfo.Height);
++            }
++
+             switch (pParams->nRotation) {
+                 case 0:
+                     m_mfxVideoParams.mfx.Rotation = MFX_ROTATION_0;
+diff --git a/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp 
b/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp
+index 5e69a94..26b0915 100644
+--- a/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp
++++ b/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp
+@@ -406,6 +406,14 @@ mfxStatus CTranscodingPipeline::VPPPreInit(sInputParams* 
pParams) {
+         }
+ 
+         if (m_bIsVpp) {
++            // MJPEG decoder just need 8 alignment for height but VPP need 16 
alignment still
++            if ((pParams->DecodeId == MFX_CODEC_JPEG) && (pParams->libType != 
MFX_IMPL_SOFTWARE)) {
++                m_mfxDecParams.mfx.FrameInfo.Height =
++                    (m_mfxDecParams.mfx.FrameInfo.PicStruct == 
MFX_PICSTRUCT_PROGRESSIVE)
++                        ? MSDK_ALIGN16(m_mfxDecParams.mfx.FrameInfo.Height)
++                        : MSDK_ALIGN32(m_mfxDecParams.mfx.FrameInfo.Height);
++            }
++
+             sts = InitVppMfxParams(m_mfxVppParams, pParams);
+             MSDK_CHECK_STATUS(sts, "InitVppMfxParams failed");
+ 
+-- 
+2.40.1
+
diff --git 
a/recipes-multimedia/onevpl/files/0005-Fix-sample_multi_transcode-intermittent-segfault.patch
 
b/recipes-multimedia/onevpl/files/0005-Fix-sample_multi_transcode-intermittent-segfault.patch
new file mode 100644
index 00000000..855fdd8f
--- /dev/null
+++ 
b/recipes-multimedia/onevpl/files/0005-Fix-sample_multi_transcode-intermittent-segfault.patch
@@ -0,0 +1,34 @@
+From 1f03f8e2569e69e558d077643ea628d3ba3cacb7 Mon Sep 17 00:00:00 2001
+From: Vincent Cheah Beng Keat <[email protected]>
+Date: Thu, 25 May 2023 01:16:18 +0800
+Subject: [PATCH 5/5] Fix sample_multi_transcode intermittent segfault
+
+HSD ID: 15012772965
+Tested command: ./sample_multi_transcode -par config.par
+
+upstream-status: accepted
+Expect it to be removed once move to v2023.3.0 and above.
+https://github.com/oneapi-src/oneVPL/commit/c21756e6a235fbde08844cca5e429ca142eef479
+---
+ tools/legacy/sample_misc/wayland/src/class_wayland.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp 
b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
+index af4d3f3..e86ceee 100644
+--- a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
++++ b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
+@@ -152,8 +152,10 @@ void Wayland::FreeSurface() {
+         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)
++            if (wl_display_dispatch_queue(m_display, m_event_queue) < 1) {
++                DestroyBufferList();
+                 break;
++            }
+         }
+ 
+         wl_surface_destroy(m_surface);
+-- 
+2.40.1
+
diff --git a/recipes-multimedia/onevpl/onevpl_2023.1.3.bb 
b/recipes-multimedia/onevpl/onevpl_2023.1.3.bb
index c106efb6..5b8b6260 100644
--- a/recipes-multimedia/onevpl/onevpl_2023.1.3.bb
+++ b/recipes-multimedia/onevpl/onevpl_2023.1.3.bb
@@ -9,6 +9,11 @@ LIC_FILES_CHKSUM = 
"file://LICENSE;md5=c18ea6bb4786a26bf4eee88a7424a408 \
                     
file://third-party-programs.txt;md5=f43d223f2b736e89abed9660483d0386"
 
 SRC_URI = "git://github.com/oneapi-src/oneVPL.git;protocol=https;branch=master 
\
+           file://0001-Fix-valgrind-leak-reported-on-wayland.patch \
+           file://0002-Fix-sample_multi_transcode-segfault-on-wayland.patch \
+           file://0003-Fix-X11-rendering-corruption-issue.patch \
+           file://0004-Adjust-MPEG-1920x1088-alignment.patch \
+           file://0005-Fix-sample_multi_transcode-intermittent-segfault.patch \
             "
 SRCREV = "4cdf44ccaa605460499c52f39eff5517da2fc3c8"
 S = "${WORKDIR}/git"
-- 
2.40.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7987): 
https://lists.yoctoproject.org/g/meta-intel/message/7987
Mute This Topic: https://lists.yoctoproject.org/mt/99261582/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to