aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLim Siew Hoon <siew.hoon.lim@intel.com>2021-12-03 11:12:38 +0800
committerAnuj Mittal <anuj.mittal@intel.com>2021-12-03 10:15:20 +0800
commit33c5426f5c8e9f4ce97d16d613e3967296e13b80 (patch)
tree8b032466cdaf0bfc4f8df77325d06e358f69f300
parent4a0107ac96b78d123975471980bf4d8e5784c2b9 (diff)
downloadmeta-intel-master.zip
meta-intel-master.tar.gz
meta-intel-master.tar.bz2
intel-media-driver: Fixed double free issue.HEADmaster
Fixed double free issue running with multiple channel decoding with vaapisink plugins in gstreamer-vaapi master. Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r--recipes-multimedia/libva/files/0001-Media-Common-Fix-the-user-setting-memory-free.patch86
-rw-r--r--recipes-multimedia/libva/intel-media-driver_21.3.5.bb1
2 files changed, 87 insertions, 0 deletions
diff --git a/recipes-multimedia/libva/files/0001-Media-Common-Fix-the-user-setting-memory-free.patch b/recipes-multimedia/libva/files/0001-Media-Common-Fix-the-user-setting-memory-free.patch
new file mode 100644
index 0000000..e513e0a
--- /dev/null
+++ b/recipes-multimedia/libva/files/0001-Media-Common-Fix-the-user-setting-memory-free.patch
@@ -0,0 +1,86 @@
+From 437e63b6c35eb5d12aac18d7f76ce1a702ad16e0 Mon Sep 17 00:00:00 2001
+From: Lim Siew Hoon <siew.hoon.lim@intel.com>
+Date: Thu, 2 Dec 2021 15:50:33 +0000
+Subject: [PATCH] [Media Common] Fix the user setting memory free
+
+From 4b8a411f2b8df112cbb5dbf8562735700cd15cf1 Mon Sep 17 00:00:00 2001
+From: "Wang, Pingli" <pingli.wang@intel.com>
+Date: Thu, 2 Dec 2021 17:57:50 +0800
+Subject: [PATCH] [Media Common]Fix the user setting memory free
+
+This commit fix the #1300
+
+Signed-off-by: Wang, Pingli <pingli.wang@intel.com>
+
+This patch was imported from iHD media-driver git server
+(https://github.com/intel/media-driver.git) as of pull request
+https://github.com/intel/media-driver/pull/1305.
+
+Upstream-status: Submitted
+
+Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
+---
+ media_softlet/linux/common/os/mos_utilities_specific_next.cpp | 4 ++++
+ media_softlet/linux/common/os/mos_utilities_specific_next.h | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/media_softlet/linux/common/os/mos_utilities_specific_next.cpp b/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
+index 584ba086..c138cb08 100644
+--- a/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
++++ b/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
+@@ -70,6 +70,7 @@ double MosUtilities::MosGetTime()
+ //!
+ const char *const MosUtilitiesSpecificNext::m_mosTracePath = "/sys/kernel/debug/tracing/trace_marker_raw";
+ int32_t MosUtilitiesSpecificNext::m_mosTraceFd = -1;
++MosMutex MosUtilitiesSpecificNext::m_userSettingMutex;
+
+ std::map<std::string, std::map<std::string, std::string>> MosUtilitiesSpecificNext::m_regBuffer;
+
+@@ -612,6 +613,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSet(MOS_PUF_KEYLIST *pKeyList, M
+ MOS_AtomicIncrement(&MosUtilities::m_mosMemAllocFakeCounter); //ulValueBuf does not count it, because it is freed after the MEMNJA final report.
+ MOS_OS_NORMALMESSAGE("ulValueBuf %p for key %s", ulValueBuf, NewKey.pValueArray[0].pcValueName);
+
++ m_userSettingMutex.Lock();
+ if ( (iPos = UserFeatureFindValue(*Key, NewKey.pValueArray[0].pcValueName)) == NOT_FOUND)
+ {
+ //not found, add a new value to key struct.
+@@ -620,6 +622,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSet(MOS_PUF_KEYLIST *pKeyList, M
+ if (iPos >= UF_CAPABILITY)
+ {
+ MOS_OS_ASSERTMESSAGE("user setting value icount %d must less than UF_CAPABILITY(64)", iPos);
++ m_userSettingMutex.Unlock();
+ return MOS_STATUS_USER_FEATURE_KEY_READ_FAILED;
+ }
+
+@@ -646,6 +649,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSet(MOS_PUF_KEYLIST *pKeyList, M
+ NewKey.pValueArray[0].ulValueBuf,
+ NewKey.pValueArray[0].ulValueLen);
+
++ m_userSettingMutex.Unlock();
+ return MOS_STATUS_SUCCESS;
+ }
+
+diff --git a/media_softlet/linux/common/os/mos_utilities_specific_next.h b/media_softlet/linux/common/os/mos_utilities_specific_next.h
+index 878ce4e6..57e505d0 100644
+--- a/media_softlet/linux/common/os/mos_utilities_specific_next.h
++++ b/media_softlet/linux/common/os/mos_utilities_specific_next.h
+@@ -30,6 +30,8 @@
+ #include "mos_defs.h"
+ #include "mos_utilities_specific.h"
+
++class MosMutex;
++
+ class MosUtilitiesSpecificNext
+ {
+ public:
+@@ -294,5 +296,7 @@ public:
+ static int32_t m_mosTraceFd;
+ static const char* const m_mosTracePath;
+ static std::map<std::string, std::map<std::string, std::string>> m_regBuffer;
++private:
++ static MosMutex m_userSettingMutex;
+ };
+ #endif // __MOS_UTILITIES_SPECIFIC_NEXT_H__
+--
+2.31.1
+
diff --git a/recipes-multimedia/libva/intel-media-driver_21.3.5.bb b/recipes-multimedia/libva/intel-media-driver_21.3.5.bb
index cc32b86..dc6cd8c 100644
--- a/recipes-multimedia/libva/intel-media-driver_21.3.5.bb
+++ b/recipes-multimedia/libva/intel-media-driver_21.3.5.bb
@@ -20,6 +20,7 @@ DEPENDS += "libva gmmlib"
SRC_URI = "git://github.com/intel/media-driver.git;protocol=https;nobranch=1 \
file://0001-MOS-user-setting-reentrant.patch \
+ file://0001-Media-Common-Fix-the-user-setting-memory-free.patch \
"
SRCREV = "ec4dc5d653733c21f8bf390794674052b5abdb09"