diff --git a/recipes-multimedia/libva/files/0001-Force-to-render-path-according-to-app-setting.patch b/recipes-multimedia/libva/files/0001-Force-to-render-path-according-to-app-setting.patch new file mode 100644 index 00000000..a6f5dbb3 --- /dev/null +++ b/recipes-multimedia/libva/files/0001-Force-to-render-path-according-to-app-setting.patch @@ -0,0 +1,54 @@ +From bfc77f3476a406600e05e3bfa5e289a94bf58aef Mon Sep 17 00:00:00 2001 +From: JayYang +Date: Fri, 4 Aug 2023 12:03:51 +0800 +Subject: [PATCH 1/4] Force to render path according to app setting + +If apps set VA flag VA_PROC_PIPELINE_FAST, force workload to render. + +Upstream-Status: Backport [https://github.com/intel/media-driver/commit/00d560ba561f57b8be85c41a791e6db05e1743e9] +Signed-off-by: Lim Siew Hoon +--- + .../linux/common/vp/ddi/ddi_vp_functions.cpp | 22 +++++++++---------- + 1 file changed, 10 insertions(+), 12 deletions(-) + +diff --git a/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp b/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp +index 89da5239f..fa02bf147 100644 +--- a/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp ++++ b/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp +@@ -3991,23 +3991,21 @@ VAStatus DdiVpFunctions::DdiSetProcPipelineParams( + } + #endif //(_DEBUG || _RELEASE_INTERNAL) + +- // Set stream type using pipeline_flags VA_PROC_PIPELINE_FAST flag + // Currently we only support 1 primary surface in VP +- if (pipelineParam->pipeline_flags & VA_PROC_PIPELINE_FAST) ++ if (vpCtx->iPriSurfs < VP_MAX_PRIMARY_SURFS) + { +- vpHalSrcSurf->SurfType = SURF_IN_SUBSTREAM; ++ vpHalSrcSurf->SurfType = SURF_IN_PRIMARY; ++ vpCtx->iPriSurfs++; + } + else + { +- if (vpCtx->iPriSurfs < VP_MAX_PRIMARY_SURFS) +- { +- vpHalSrcSurf->SurfType = SURF_IN_PRIMARY; +- vpCtx->iPriSurfs++; +- } +- else +- { +- vpHalSrcSurf->SurfType = SURF_IN_SUBSTREAM; +- } ++ vpHalSrcSurf->SurfType = SURF_IN_SUBSTREAM; ++ } ++ ++ // Set workload path using pipeline_flags VA_PROC_PIPELINE_FAST flag ++ if (pipelineParam->pipeline_flags & VA_PROC_PIPELINE_FAST) ++ { ++ vpHalRenderParams->bForceToRender = true; + } + + // Set src rect +-- +2.40.1 + diff --git a/recipes-multimedia/libva/files/0002-Add-DRM-format-mappings-for-JPEG-decoder-output.patch b/recipes-multimedia/libva/files/0002-Add-DRM-format-mappings-for-JPEG-decoder-output.patch new file mode 100644 index 00000000..423614ac --- /dev/null +++ b/recipes-multimedia/libva/files/0002-Add-DRM-format-mappings-for-JPEG-decoder-output.patch @@ -0,0 +1,102 @@ +From ea6cd2db43bab97744884001e0d98ba2ff5d3903 Mon Sep 17 00:00:00 2001 +From: Philip Langdale +Date: Sat, 5 Aug 2023 11:46:26 +0800 +Subject: [PATCH 2/4] Add DRM format mappings for JPEG decoder output + +The output formats from the JPEG decoder are currently not included +in the DRM format mapping functions. This means that any attempt to +call vaExportSurface on JPEG images will fail. + +However, there is no functional gap beyond the missing mappings, so if +we add them in, exporting will then work correctly. + +The four formats in question are IMC3, 422H, 422V, and 444P. + +* 422H and 444P have trivial 1:1 mappings. +* IMC3 can be treated the same as I420, because the only difference is + the chroma pitch, and that's explicitly set in the descriptor +* 422V (aka 440P) has the same memory layout as 422H - it's just a + difference in how the consumer handle the chroma + +I also added the missing XYUV composite object mapping - it was already +present for separate planes. + +Tested with ffmpeg+mpv. + +Upstream-Status: Backport [https://github.com/intel/media-driver/commit/c7cd5a68315674d44ac97ec7cc78856fa90b8036] +Signed-off-by: Lim Siew Hoon +--- + media_driver/linux/common/ddi/media_libva.cpp | 21 ++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/media_driver/linux/common/ddi/media_libva.cpp b/media_driver/linux/common/ddi/media_libva.cpp +index af35be841..1706138a1 100755 +--- a/media_driver/linux/common/ddi/media_libva.cpp ++++ b/media_driver/linux/common/ddi/media_libva.cpp +@@ -6981,8 +6981,12 @@ static uint32_t DdiMedia_GetDrmFormatOfSeparatePlane(uint32_t fourcc, int plane) + { + case VA_FOURCC_NV12: + case VA_FOURCC_I420: ++ case VA_FOURCC_IMC3: + case VA_FOURCC_YV12: + case VA_FOURCC_YV16: ++ case VA_FOURCC_422H: ++ case VA_FOURCC_422V: ++ case VA_FOURCC_444P: + case VA_FOURCC_Y800: + case VA_FOURCC_RGBP: + case VA_FOURCC_BGRP: +@@ -7055,8 +7059,12 @@ static uint32_t DdiMedia_GetDrmFormatOfSeparatePlane(uint32_t fourcc, int plane) + case VA_FOURCC_NV12: + return DRM_FORMAT_GR88; + case VA_FOURCC_I420: ++ case VA_FOURCC_IMC3: + case VA_FOURCC_YV12: + case VA_FOURCC_YV16: ++ case VA_FOURCC_422H: ++ case VA_FOURCC_422V: ++ case VA_FOURCC_444P: + case VA_FOURCC_RGBP: + case VA_FOURCC_BGRP: + return DRM_FORMAT_R8; +@@ -7070,7 +7078,6 @@ static uint32_t DdiMedia_GetDrmFormatOfSeparatePlane(uint32_t fourcc, int plane) + } + return 0; + } +- + static uint32_t DdiMedia_GetDrmFormatOfCompositeObject(uint32_t fourcc) + { + switch (fourcc) +@@ -7079,10 +7086,18 @@ static uint32_t DdiMedia_GetDrmFormatOfCompositeObject(uint32_t fourcc) + return DRM_FORMAT_NV12; + case VA_FOURCC_I420: + return DRM_FORMAT_YUV420; ++ case VA_FOURCC_IMC3: ++ return DRM_FORMAT_YUV420; + case VA_FOURCC_YV12: + return DRM_FORMAT_YVU420; + case VA_FOURCC_YV16: + return DRM_FORMAT_YVU422; ++ case VA_FOURCC_422H: ++ return DRM_FORMAT_YUV422; ++ case VA_FOURCC_422V: ++ return DRM_FORMAT_YUV422; ++ case VA_FOURCC_444P: ++ return DRM_FORMAT_YUV444; + case VA_FOURCC_YUY2: + return DRM_FORMAT_YUYV; + case VA_FOURCC_YVYU: +@@ -7093,6 +7108,10 @@ static uint32_t DdiMedia_GetDrmFormatOfCompositeObject(uint32_t fourcc) + return DRM_FORMAT_UYVY; + case VA_FOURCC_AYUV: + return DRM_FORMAT_AYUV; ++#if VA_CHECK_VERSION(1, 13, 0) ++ case VA_FOURCC_XYUV: ++ return DRM_FORMAT_XYUV8888; ++#endif + case VA_FOURCC_Y210: + return DRM_FORMAT_Y210; + #if VA_CHECK_VERSION(1, 9, 0) +-- +2.40.1 + diff --git a/recipes-multimedia/libva/files/0003-Add-DRM-format-mappings-for-JPEG-output-to-softlet.patch b/recipes-multimedia/libva/files/0003-Add-DRM-format-mappings-for-JPEG-output-to-softlet.patch new file mode 100644 index 00000000..26bd9931 --- /dev/null +++ b/recipes-multimedia/libva/files/0003-Add-DRM-format-mappings-for-JPEG-output-to-softlet.patch @@ -0,0 +1,81 @@ +From 8839e41fd18f7ed695e912ac0720c824df3905d6 Mon Sep 17 00:00:00 2001 +From: Philip Langdale +Date: Wed, 30 Aug 2023 09:34:58 -0700 +Subject: [PATCH 3/4] Add DRM format mappings for JPEG output to softlet + +This is the softlet equivalent of my previous change to add DRM format +mappings for the JPEG decoder output formats to the legacy code path. + +Tested compilation, but don't have the hardware to test at runtime. + +Upstream-Status: Backport [https://github.com/intel/media-driver/commit/ce81beded8b791d24473a173e53ae399f6a6a059] +Signed-off-by: Lim Siew Hoon +--- + .../common/ddi/media_libva_interface_next.cpp | 22 +++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/media_softlet/linux/common/ddi/media_libva_interface_next.cpp b/media_softlet/linux/common/ddi/media_libva_interface_next.cpp +index b3851e9b5..231268cb7 100644 +--- a/media_softlet/linux/common/ddi/media_libva_interface_next.cpp ++++ b/media_softlet/linux/common/ddi/media_libva_interface_next.cpp +@@ -4672,8 +4672,12 @@ uint32_t MediaLibvaInterfaceNext::GetDrmFormatOfSeparatePlane(uint32_t fourcc, i + { + case VA_FOURCC_NV12: + case VA_FOURCC_I420: ++ case VA_FOURCC_IMC3: + case VA_FOURCC_YV12: + case VA_FOURCC_YV16: ++ case VA_FOURCC_422H: ++ case VA_FOURCC_422V: ++ case VA_FOURCC_444P: + case VA_FOURCC_Y800: + case VA_FOURCC_RGBP: + case VA_FOURCC_BGRP: +@@ -4746,8 +4750,12 @@ uint32_t MediaLibvaInterfaceNext::GetDrmFormatOfSeparatePlane(uint32_t fourcc, i + case VA_FOURCC_NV12: + return DRM_FORMAT_GR88; + case VA_FOURCC_I420: ++ case VA_FOURCC_IMC3: + case VA_FOURCC_YV12: + case VA_FOURCC_YV16: ++ case VA_FOURCC_422H: ++ case VA_FOURCC_422V: ++ case VA_FOURCC_444P: + case VA_FOURCC_RGBP: + case VA_FOURCC_BGRP: + return DRM_FORMAT_R8; +@@ -4770,10 +4778,18 @@ uint32_t MediaLibvaInterfaceNext::GetDrmFormatOfCompositeObject(uint32_t fourcc) + return DRM_FORMAT_NV12; + case VA_FOURCC_I420: + return DRM_FORMAT_YUV420; ++ case VA_FOURCC_IMC3: ++ return DRM_FORMAT_YUV420; + case VA_FOURCC_YV12: + return DRM_FORMAT_YVU420; + case VA_FOURCC_YV16: + return DRM_FORMAT_YVU422; ++ case VA_FOURCC_422H: ++ return DRM_FORMAT_YUV422; ++ case VA_FOURCC_422V: ++ return DRM_FORMAT_YUV422; ++ case VA_FOURCC_444P: ++ return DRM_FORMAT_YUV444; + case VA_FOURCC_YUY2: + return DRM_FORMAT_YUYV; + case VA_FOURCC_YVYU: +@@ -4782,6 +4798,12 @@ uint32_t MediaLibvaInterfaceNext::GetDrmFormatOfCompositeObject(uint32_t fourcc) + return DRM_FORMAT_VYUY; + case VA_FOURCC_UYVY: + return DRM_FORMAT_UYVY; ++ case VA_FOURCC_AYUV: ++ return DRM_FORMAT_AYUV; ++#if VA_CHECK_VERSION(1, 13, 0) ++ case VA_FOURCC_XYUV: ++ return DRM_FORMAT_XYUV8888; ++#endif + case VA_FOURCC_Y210: + return DRM_FORMAT_Y210; + #if VA_CHECK_VERSION(1, 9, 0) +-- +2.40.1 + diff --git a/recipes-multimedia/libva/files/0004-Disable-vp9-padding-on-mtl.patch b/recipes-multimedia/libva/files/0004-Disable-vp9-padding-on-mtl.patch new file mode 100644 index 00000000..075f2350 --- /dev/null +++ b/recipes-multimedia/libva/files/0004-Disable-vp9-padding-on-mtl.patch @@ -0,0 +1,27 @@ +From ea2ae0cd656a17eee9897aa1bf4e61b0d05ec347 Mon Sep 17 00:00:00 2001 +From: Lim Siew Hoon +Date: Tue, 5 Sep 2023 16:13:42 +0800 +Subject: [PATCH 4/4] Disable vp9 padding on mtl. + +Upstream-Status: Submitted [https://github.com/intel/media-driver/pull/1720] +Signed-off-by: Lim Siew Hoon +--- + media_softlet/linux/Xe_M_plus/ddi/media_sku_wa_mtl.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/media_softlet/linux/Xe_M_plus/ddi/media_sku_wa_mtl.cpp b/media_softlet/linux/Xe_M_plus/ddi/media_sku_wa_mtl.cpp +index 679ca45f6..0e6837034 100644 +--- a/media_softlet/linux/Xe_M_plus/ddi/media_sku_wa_mtl.cpp ++++ b/media_softlet/linux/Xe_M_plus/ddi/media_sku_wa_mtl.cpp +@@ -284,7 +284,7 @@ static bool InitMtlMediaWaExt(struct GfxDeviceInfo *devInfo, + + MEDIA_WR_WA(waTable, WaDisableSetObjectCapture, 1); + +- MEDIA_WR_WA(waTable, Wa_Vp9UnalignedHeight, 1); ++ MEDIA_WR_WA(waTable, Wa_Vp9UnalignedHeight, 0); + + return true; + } +-- +2.40.1 + diff --git a/recipes-multimedia/libva/intel-media-driver_23.2.4.bb b/recipes-multimedia/libva/intel-media-driver_23.2.4.bb index ccc59f27..1b94a6f6 100644 --- a/recipes-multimedia/libva/intel-media-driver_23.2.4.bb +++ b/recipes-multimedia/libva/intel-media-driver_23.2.4.bb @@ -23,6 +23,10 @@ SRC_URI = "git://github.com/intel/media-driver.git;protocol=https;nobranch=1 \ file://0002-Add-mocs-index-in-patch-list.patch \ file://0003-fix-vdsfc-csc-issue.patch \ file://0004-XRGB-force-to-tile4.patch \ + file://0001-Force-to-render-path-according-to-app-setting.patch \ + file://0002-Add-DRM-format-mappings-for-JPEG-decoder-output.patch \ + file://0003-Add-DRM-format-mappings-for-JPEG-output-to-softlet.patch \ + file://0004-Disable-vp9-padding-on-mtl.patch \ " SRCREV = "cf942344b9e439d19873f1d47c0c890d7c63b6ad"