Fixes dmabuf sharing with glimagesink failing with
certain color format between msdkvpp and glimagesink
from gst-plugins-bad master.

Backport patches:
* 0001-media_libva-export-packed-YUV-when-VA_EXPORT_SURFACE.patch

Submitted patches:
* 0002-media-libva-Add-export-AYUV-color-in-vaExportSurface.patch

Signed-off-by: Lim Siew Hoon <[email protected]>
---
 ...rt-packed-YUV-when-VA_EXPORT_SURFACE.patch | 62 +++++++++++++++++++
 ...export-AYUV-color-in-vaExportSurface.patch | 34 ++++++++++
 .../libva/intel-media-driver_20.3.0.bb        |  2 +
 3 files changed, 98 insertions(+)
 create mode 100644 
recipes-multimedia/libva/files/0001-media_libva-export-packed-YUV-when-VA_EXPORT_SURFACE.patch
 create mode 100644 
recipes-multimedia/libva/files/0002-media-libva-Add-export-AYUV-color-in-vaExportSurface.patch

diff --git 
a/recipes-multimedia/libva/files/0001-media_libva-export-packed-YUV-when-VA_EXPORT_SURFACE.patch
 
b/recipes-multimedia/libva/files/0001-media_libva-export-packed-YUV-when-VA_EXPORT_SURFACE.patch
new file mode 100644
index 00000000..f7c4e160
--- /dev/null
+++ 
b/recipes-multimedia/libva/files/0001-media_libva-export-packed-YUV-when-VA_EXPORT_SURFACE.patch
@@ -0,0 +1,62 @@
+From 8fc1d919fd33db698e5470602942ab6a2d6b7841 Mon Sep 17 00:00:00 2001
+From: Haihao Xiang <[email protected]>
+Date: Thu, 3 Dec 2020 10:52:15 +0800
+Subject: [PATCH 1/2] media_libva: export packed YUV when
+ VA_EXPORT_SURFACE_COMPOSED_LAYERS is not set
+
+vaExportSurfaceHandle works for packed RGB w/wo
+VA_EXPORT_SURFACE_COMPOSED_LAYERS, it should work for packed YUV too
+w/wo VA_EXPORT_SURFACE_COMPOSED_LAYERS
+
+Example:
+gst-launch-1.0 videotestsrc ! msdkvpp ! \
+'video/x-raw(memory:DMABuf)',format=YUY2 ! glimagesink
+
+The patch was imported from the iHD media-driver git server
+(https://github.com/intel/media-driver.git) as of commit id
+38e5f4ab95a5c4fb3fe55d3d132795ee804d9310.
+
+Upstream-status: Backport
+
+Signed-off-by: Lim Siew Hoon <[email protected]>
+---
+ media_driver/linux/common/ddi/media_libva.cpp | 22 +++++++++++++++++--
+ 1 file changed, 20 insertions(+), 2 deletions(-)
+
+diff --git a/media_driver/linux/common/ddi/media_libva.cpp 
b/media_driver/linux/common/ddi/media_libva.cpp
+index 91c3ff14..778b7011 100755
+--- a/media_driver/linux/common/ddi/media_libva.cpp
++++ b/media_driver/linux/common/ddi/media_libva.cpp
+@@ -6672,9 +6672,27 @@ static uint32_t 
DdiMedia_GetDrmFormatOfSeparatePlane(uint32_t fourcc, int plane)
+             return DRM_FORMAT_R16;
+ 
+         case VA_FOURCC_YUY2:
++            return DRM_FORMAT_YUYV;
++        case VA_FOURCC_YVYU:
++            return DRM_FORMAT_YVYU;
++        case VA_FOURCC_VYUY:
++            return DRM_FORMAT_VYUY;
+         case VA_FOURCC_UYVY:
+-            // These are not representable as separate planes.
+-            return 0;
++            return DRM_FORMAT_UYVY;
++        case VA_FOURCC_Y210:
++            return DRM_FORMAT_Y210;
++        case VA_FOURCC_Y216:
++            return DRM_FORMAT_Y216;
++        case VA_FOURCC_Y410:
++            return DRM_FORMAT_Y410;
++        case VA_FOURCC_Y416:
++            return DRM_FORMAT_Y416;
++#if VA_CHECK_VERSION(1, 9, 0)
++        case VA_FOURCC_Y212:
++            return DRM_FORMAT_Y216;
++        case VA_FOURCC_Y412:
++            return DRM_FORMAT_Y416;
++#endif
+ 
+         case VA_FOURCC_ARGB:
+             return DRM_FORMAT_ARGB8888;
+-- 
+2.17.1
+
diff --git 
a/recipes-multimedia/libva/files/0002-media-libva-Add-export-AYUV-color-in-vaExportSurface.patch
 
b/recipes-multimedia/libva/files/0002-media-libva-Add-export-AYUV-color-in-vaExportSurface.patch
new file mode 100644
index 00000000..c5f3c424
--- /dev/null
+++ 
b/recipes-multimedia/libva/files/0002-media-libva-Add-export-AYUV-color-in-vaExportSurface.patch
@@ -0,0 +1,34 @@
+From 979e90d7bc9ff6d9064e1f0378015abf40d86af2 Mon Sep 17 00:00:00 2001
+From: Lim Siew Hoon <[email protected]>
+Date: Thu, 24 Dec 2020 18:47:56 +0800
+Subject: [PATCH 2/2] media-libva: Add export AYUV color in
+ vaExportSurfaceHandle when VA_EXPORT_SURFACE_COMPOSED_LAYERS is not set.
+
+Example:
+gst-launch-1.0 videotestsrc ! msdkvpp \
+'video/x-raw(memory:DMABuf)',format=VUYA ! glimagesink
+
+Upstream status: submitted.
+https://github.com/intel/media-driver/pull/1115
+
+Signed-off-by: Lim Siew Hoon <[email protected]>
+---
+ media_driver/linux/common/ddi/media_libva.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/media_driver/linux/common/ddi/media_libva.cpp 
b/media_driver/linux/common/ddi/media_libva.cpp
+index 778b7011..0e9f07d3 100755
+--- a/media_driver/linux/common/ddi/media_libva.cpp
++++ b/media_driver/linux/common/ddi/media_libva.cpp
+@@ -6679,6 +6679,8 @@ static uint32_t 
DdiMedia_GetDrmFormatOfSeparatePlane(uint32_t fourcc, int plane)
+             return DRM_FORMAT_VYUY;
+         case VA_FOURCC_UYVY:
+             return DRM_FORMAT_UYVY;
++        case VA_FOURCC_AYUV:
++            return DRM_FORMAT_AYUV;
+         case VA_FOURCC_Y210:
+             return DRM_FORMAT_Y210;
+         case VA_FOURCC_Y216:
+-- 
+2.17.1
+
diff --git a/recipes-multimedia/libva/intel-media-driver_20.3.0.bb 
b/recipes-multimedia/libva/intel-media-driver_20.3.0.bb
index a53867bd..93ce6109 100644
--- a/recipes-multimedia/libva/intel-media-driver_20.3.0.bb
+++ b/recipes-multimedia/libva/intel-media-driver_20.3.0.bb
@@ -20,6 +20,8 @@ DEPENDS += "libva gmmlib"
 
 SRC_URI = 
"git://github.com/intel/media-driver.git;protocol=https;branch=intel-media-20.3 
\
            file://0001-Encode-Fixed-VP9-444-frame-header.patch \
+           
file://0001-media_libva-export-packed-YUV-when-VA_EXPORT_SURFACE.patch \
+           
file://0002-media-libva-Add-export-AYUV-color-in-vaExportSurface.patch \
           "
 
 SRCREV = "86ec0b6f61862806d8aed1803537728d1dfadf84"
-- 
2.17.1

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

Reply via email to