diff options
| -rw-r--r-- | recipes-multimedia/onevpl/onevpl/0001-Fix-basename-build-issue-with-musl_libc.patch | 37 | ||||
| -rw-r--r-- | recipes-multimedia/onevpl/onevpl/0001-Fix-compile-issue-with-CMAKE_CXX_FLAGS-setting.patch | 31 | ||||
| -rw-r--r-- | recipes-multimedia/onevpl/onevpl/0001-Fix-the-rendering-to-X11-failures.patch | 135 | ||||
| -rw-r--r-- | recipes-multimedia/onevpl/onevpl/0001-samples-Add-support-of-DRM_FORMAT_NV12-for-console-m.patch | 170 | ||||
| -rw-r--r-- | recipes-multimedia/onevpl/onevpl/0001-samples-Fixed-tile-modifier-issue-for-NV12-format.patch | 51 | ||||
| -rw-r--r-- | recipes-multimedia/onevpl/onevpl_2021.6.0.bb (renamed from recipes-multimedia/onevpl/onevpl_2021.5.0.bb) | 11 |
6 files changed, 41 insertions, 394 deletions
diff --git a/recipes-multimedia/onevpl/onevpl/0001-Fix-basename-build-issue-with-musl_libc.patch b/recipes-multimedia/onevpl/onevpl/0001-Fix-basename-build-issue-with-musl_libc.patch new file mode 100644 index 00000000..93e5ed0d --- /dev/null +++ b/recipes-multimedia/onevpl/onevpl/0001-Fix-basename-build-issue-with-musl_libc.patch | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | From d16afe9f9302e4995f12d699019eba170bb6db21 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Yew, Chang Ching" <chang.ching.yew@intel.com> | ||
| 3 | Date: Fri, 8 Oct 2021 08:45:39 +0800 | ||
| 4 | Subject: [PATCH] Fix basename() build issue with musl_libc | ||
| 5 | |||
| 6 | Upstream-Status: Submitted | ||
| 7 | innersource PR #264 | ||
| 8 | |||
| 9 | Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com> | ||
| 10 | --- | ||
| 11 | tools/legacy/sample_common/src/vaapi_utils.cpp | 3 ++- | ||
| 12 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 13 | |||
| 14 | diff --git a/tools/legacy/sample_common/src/vaapi_utils.cpp b/tools/legacy/sample_common/src/vaapi_utils.cpp | ||
| 15 | index b69dbe44..9382535a 100644 | ||
| 16 | --- a/tools/legacy/sample_common/src/vaapi_utils.cpp | ||
| 17 | +++ b/tools/legacy/sample_common/src/vaapi_utils.cpp | ||
| 18 | @@ -7,6 +7,7 @@ | ||
| 19 | #ifdef LIBVA_SUPPORT | ||
| 20 | |||
| 21 | #include "vaapi_utils.h" | ||
| 22 | + #include <libgen.h> | ||
| 23 | #include <dlfcn.h> | ||
| 24 | #include <stdexcept> | ||
| 25 | |||
| 26 | @@ -26,7 +27,7 @@ SimpleLoader::SimpleLoader(const char* name) { | ||
| 27 | dlerror(); | ||
| 28 | so_handle = dlopen(name, RTLD_GLOBAL | RTLD_NOW); | ||
| 29 | if (NULL == so_handle) { | ||
| 30 | - so_handle = dlopen(basename(name), RTLD_GLOBAL | RTLD_NOW); | ||
| 31 | + so_handle = dlopen(basename((char *)name), RTLD_GLOBAL | RTLD_NOW); | ||
| 32 | if (NULL == so_handle) { | ||
| 33 | std::cerr << dlerror() << std::endl; | ||
| 34 | throw std::runtime_error("Can't load library"); | ||
| 35 | -- | ||
| 36 | 2.33.0 | ||
| 37 | |||
diff --git a/recipes-multimedia/onevpl/onevpl/0001-Fix-compile-issue-with-CMAKE_CXX_FLAGS-setting.patch b/recipes-multimedia/onevpl/onevpl/0001-Fix-compile-issue-with-CMAKE_CXX_FLAGS-setting.patch deleted file mode 100644 index 40c5f8f5..00000000 --- a/recipes-multimedia/onevpl/onevpl/0001-Fix-compile-issue-with-CMAKE_CXX_FLAGS-setting.patch +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | From f6af035d8cfee4a40a5d02349bf111c3af25432e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Yew, Chang Ching" <chang.ching.yew@intel.com> | ||
| 3 | Date: Thu, 12 Aug 2021 07:33:39 +0800 | ||
| 4 | Subject: [PATCH] Fix compile issue with CMAKE_CXX_FLAGS setting | ||
| 5 | |||
| 6 | Appends new options to CMAKE_CXX_FLAGS | ||
| 7 | |||
| 8 | Upstream-Status: Submitted | ||
| 9 | innersource PR #193 | ||
| 10 | |||
| 11 | Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com> | ||
| 12 | --- | ||
| 13 | cmake/CompileOptions.cmake | 2 +- | ||
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake | ||
| 17 | index 2a941b10..97c3f47a 100644 | ||
| 18 | --- a/cmake/CompileOptions.cmake | ||
| 19 | +++ b/cmake/CompileOptions.cmake | ||
| 20 | @@ -50,7 +50,7 @@ else() | ||
| 21 | add_compile_options("-fstack-protector-strong") | ||
| 22 | endif() | ||
| 23 | if(NOT MINGW) | ||
| 24 | - set(CMAKE_CXX_FLAGS "-z relro -z now -z noexecstack") | ||
| 25 | + set(CMAKE_CXX_FLAGS "-z relro -z now -z noexecstack ${CMAKE_CXX_FLAGS}") | ||
| 26 | endif() | ||
| 27 | add_compile_options("-Wall") | ||
| 28 | if(ENABLE_WARNING_AS_ERROR) | ||
| 29 | -- | ||
| 30 | 2.32.0 | ||
| 31 | |||
diff --git a/recipes-multimedia/onevpl/onevpl/0001-Fix-the-rendering-to-X11-failures.patch b/recipes-multimedia/onevpl/onevpl/0001-Fix-the-rendering-to-X11-failures.patch deleted file mode 100644 index 9335c214..00000000 --- a/recipes-multimedia/onevpl/onevpl/0001-Fix-the-rendering-to-X11-failures.patch +++ /dev/null | |||
| @@ -1,135 +0,0 @@ | |||
| 1 | From 775669dbdd97a52dc32dab82c3d5efd160f9e807 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Chew, Tong Liang" <tong.liang.chew@intel.com> | ||
| 3 | Date: Mon, 9 Aug 2021 02:19:01 +0000 | ||
| 4 | Subject: [PATCH] Fix the rendering to X11 failures | ||
| 5 | |||
| 6 | The i915 render device node is not always in renderD128. | ||
| 7 | Change the hard coded with autodetect the i915 device via ioctl | ||
| 8 | |||
| 9 | Upstream-Status: Submitted | ||
| 10 | https://github.com/oneapi-src/oneVPL/pull/21 | ||
| 11 | |||
| 12 | Signed-off-by: Chew, Tong Liang <tong.liang.chew@intel.com> | ||
| 13 | Signed-off-by: Teng, Jin Chung <jin.chung.teng@intel.com> | ||
| 14 | --- | ||
| 15 | tools/legacy/sample_common/src/vaapi_device.cpp | 24 +++++++++++++- | ||
| 16 | tools/legacy/sample_common/src/vaapi_utils_x11.cpp | 38 +++++++++++++++++++--- | ||
| 17 | 2 files changed, 57 insertions(+), 5 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/tools/legacy/sample_common/src/vaapi_device.cpp b/tools/legacy/sample_common/src/vaapi_device.cpp | ||
| 20 | index b034376..f78c5aa 100644 | ||
| 21 | --- a/tools/legacy/sample_common/src/vaapi_device.cpp | ||
| 22 | +++ b/tools/legacy/sample_common/src/vaapi_device.cpp | ||
| 23 | @@ -20,6 +20,7 @@ | ||
| 24 | #include "vaapi_allocator.h" | ||
| 25 | #if defined(X11_DRI3_SUPPORT) | ||
| 26 | #include <fcntl.h> | ||
| 27 | + #include <sys/ioctl.h> | ||
| 28 | |||
| 29 | #define ALIGN(x, y) (((x) + (y)-1) & -(y)) | ||
| 30 | #define PAGE_ALIGN(x) ALIGN(x, 4096) | ||
| 31 | @@ -27,6 +28,11 @@ | ||
| 32 | |||
| 33 | #define VAAPI_GET_X_DISPLAY(_display) (Display*)(_display) | ||
| 34 | #define VAAPI_GET_X_WINDOW(_window) (Window*)(_window) | ||
| 35 | + const char* MFX_DEVICE_NODE_RENDER = "/dev/dri/renderD"; | ||
| 36 | + const char* MFX_DEVICE_DRIVER_NAME = "i915"; | ||
| 37 | + constexpr mfxU32 MFX_DEVICE_DRIVER_NAME_LEN = 4; | ||
| 38 | + constexpr mfxU32 MFX_DEVICE_NODE_INDEX = 128; | ||
| 39 | + constexpr mfxU32 MFX_DEVICE_MAX_NODES = 16; | ||
| 40 | |||
| 41 | CVAAPIDeviceX11::~CVAAPIDeviceX11(void) { | ||
| 42 | Close(); | ||
| 43 | @@ -73,7 +79,23 @@ mfxStatus CVAAPIDeviceX11::Init(mfxHDL hWindow, mfxU16 nViews, mfxU32 nAdapterNu | ||
| 44 | |||
| 45 | // it's enough to pass render node, because we only request | ||
| 46 | // information from kernel via m_dri_fd | ||
| 47 | - m_dri_fd = open("/dev/dri/renderD128", O_RDWR); | ||
| 48 | + for (mfxU32 i = 0; i < MFX_DEVICE_MAX_NODES; ++i) { | ||
| 49 | + std::string devPath = MFX_DEVICE_NODE_RENDER + std::to_string(MFX_DEVICE_NODE_INDEX + i); | ||
| 50 | + m_dri_fd = open(devPath.c_str(), O_RDWR); | ||
| 51 | + if (m_dri_fd < 0) continue; | ||
| 52 | + | ||
| 53 | + char driverName[MFX_DEVICE_DRIVER_NAME_LEN + 1] = {}; | ||
| 54 | + drm_version_t version = {}; | ||
| 55 | + version.name_len = MFX_DEVICE_DRIVER_NAME_LEN; | ||
| 56 | + version.name = driverName; | ||
| 57 | + | ||
| 58 | + if(!ioctl(m_dri_fd, DRM_IOWR(0, drm_version), &version) && | ||
| 59 | + !strcmp(driverName, MFX_DEVICE_DRIVER_NAME)) { | ||
| 60 | + break; | ||
| 61 | + } | ||
| 62 | + close(m_dri_fd); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | if (m_dri_fd < 0) { | ||
| 66 | msdk_printf(MSDK_STRING("Failed to open dri device\n")); | ||
| 67 | return MFX_ERR_NOT_INITIALIZED; | ||
| 68 | diff --git a/tools/legacy/sample_common/src/vaapi_utils_x11.cpp b/tools/legacy/sample_common/src/vaapi_utils_x11.cpp | ||
| 69 | index 9770a2f..734cd10 100644 | ||
| 70 | --- a/tools/legacy/sample_common/src/vaapi_utils_x11.cpp | ||
| 71 | +++ b/tools/legacy/sample_common/src/vaapi_utils_x11.cpp | ||
| 72 | @@ -10,18 +10,24 @@ | ||
| 73 | #include "sample_defs.h" | ||
| 74 | |||
| 75 | #include <dlfcn.h> | ||
| 76 | - #if defined(X11_DRI3_SUPPORT) | ||
| 77 | - #include <fcntl.h> | ||
| 78 | - #endif | ||
| 79 | + #include <fcntl.h> | ||
| 80 | + #include <sys/ioctl.h> | ||
| 81 | |||
| 82 | #define VAAPI_X_DEFAULT_DISPLAY ":0.0" | ||
| 83 | |||
| 84 | + const char* MFX_X11_NODE_RENDER = "/dev/dri/renderD"; | ||
| 85 | + const char* MFX_X11_DRIVER_NAME = "i915"; | ||
| 86 | + constexpr mfxU32 MFX_X11_DRIVER_NAME_LEN = 4; | ||
| 87 | + constexpr mfxU32 MFX_X11_NODE_INDEX = 128; | ||
| 88 | + constexpr mfxU32 MFX_X11_MAX_NODES = 16; | ||
| 89 | + | ||
| 90 | X11LibVA::X11LibVA(void) | ||
| 91 | : CLibVA(MFX_LIBVA_X11), | ||
| 92 | m_display(0), | ||
| 93 | m_configID(VA_INVALID_ID), | ||
| 94 | m_contextID(VA_INVALID_ID) { | ||
| 95 | char* currentDisplay = getenv("DISPLAY"); | ||
| 96 | + int fd = -1; | ||
| 97 | |||
| 98 | m_display = (currentDisplay) ? m_x11lib.XOpenDisplay(currentDisplay) | ||
| 99 | : m_x11lib.XOpenDisplay(VAAPI_X_DEFAULT_DISPLAY); | ||
| 100 | @@ -32,7 +38,31 @@ X11LibVA::X11LibVA(void) | ||
| 101 | throw std::bad_alloc(); | ||
| 102 | } | ||
| 103 | |||
| 104 | - m_va_dpy = m_vax11lib.vaGetDisplay(m_display); | ||
| 105 | + for (mfxU32 i = 0; i < MFX_X11_MAX_NODES; ++i) { | ||
| 106 | + std::string devPath = MFX_X11_NODE_RENDER + std::to_string(MFX_X11_NODE_INDEX + i); | ||
| 107 | + fd = -1; | ||
| 108 | + fd = open(devPath.c_str(), O_RDWR); | ||
| 109 | + if (fd < 0) continue; | ||
| 110 | + | ||
| 111 | + char driverName[MFX_X11_DRIVER_NAME_LEN + 1] = {}; | ||
| 112 | + drm_version_t version = {}; | ||
| 113 | + version.name_len = MFX_X11_DRIVER_NAME_LEN; | ||
| 114 | + version.name = driverName; | ||
| 115 | + | ||
| 116 | + if(!ioctl(fd, DRM_IOWR(0, drm_version), &version) && | ||
| 117 | + !strcmp(driverName, MFX_X11_DRIVER_NAME)) { | ||
| 118 | + break; | ||
| 119 | + } | ||
| 120 | + close(fd); | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + if (fd < 0) { | ||
| 124 | + m_x11lib.XCloseDisplay(m_display); | ||
| 125 | + msdk_printf(MSDK_STRING("Failed to open adapter\n")); | ||
| 126 | + throw std::bad_alloc(); | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + m_va_dpy = m_vadrmlib.vaGetDisplayDRM(fd); | ||
| 130 | if (!m_va_dpy) { | ||
| 131 | m_x11lib.XCloseDisplay(m_display); | ||
| 132 | msdk_printf(MSDK_STRING("Failed to get VA Display\n")); | ||
| 133 | -- | ||
| 134 | 2.7.4 | ||
| 135 | |||
diff --git a/recipes-multimedia/onevpl/onevpl/0001-samples-Add-support-of-DRM_FORMAT_NV12-for-console-m.patch b/recipes-multimedia/onevpl/onevpl/0001-samples-Add-support-of-DRM_FORMAT_NV12-for-console-m.patch deleted file mode 100644 index a5191fe2..00000000 --- a/recipes-multimedia/onevpl/onevpl/0001-samples-Add-support-of-DRM_FORMAT_NV12-for-console-m.patch +++ /dev/null | |||
| @@ -1,170 +0,0 @@ | |||
| 1 | From a7f667debb6cf3007ef5b581a91ff7c925d623c3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Yew, Chang Ching" <chang.ching.yew@intel.com> | ||
| 3 | Date: Wed, 25 Aug 2021 11:13:28 +0000 | ||
| 4 | Subject: [PATCH 1/2] samples: Add support of DRM_FORMAT_NV12 for console mode | ||
| 5 | rendering | ||
| 6 | |||
| 7 | Currently in drm/console mode only RGB4 direct rendering | ||
| 8 | is possible. This patch add NV12 format provided your | ||
| 9 | platform and kernel can support it. | ||
| 10 | |||
| 11 | Tested both formats using: | ||
| 12 | sample_encode h265 -i 4k.h265 -rdrm -nv12 | ||
| 13 | sample_encode h265 -i 4k.h265 -rdrm -rgb4 | ||
| 14 | |||
| 15 | Upstream-Status: Submitted | ||
| 16 | innersource PR #221 | ||
| 17 | |||
| 18 | Signed-off: Fu, Wei A <wei.a.fu@intel.com> | ||
| 19 | Signed-off-by: Sodhi, Vunny <vunny.sodhi@intel.com> | ||
| 20 | Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com> | ||
| 21 | --- | ||
| 22 | .../sample_common/include/vaapi_utils.h | 11 ++++ | ||
| 23 | .../sample_common/src/vaapi_allocator.cpp | 1 + | ||
| 24 | .../legacy/sample_common/src/vaapi_utils.cpp | 1 + | ||
| 25 | .../sample_common/src/vaapi_utils_drm.cpp | 61 +++++++++++++++---- | ||
| 26 | 4 files changed, 63 insertions(+), 11 deletions(-) | ||
| 27 | |||
| 28 | diff --git a/tools/legacy/sample_common/include/vaapi_utils.h b/tools/legacy/sample_common/include/vaapi_utils.h | ||
| 29 | index 53318630..9df5507b 100644 | ||
| 30 | --- a/tools/legacy/sample_common/include/vaapi_utils.h | ||
| 31 | +++ b/tools/legacy/sample_common/include/vaapi_utils.h | ||
| 32 | @@ -149,6 +149,16 @@ public: | ||
| 33 | uint32_t pitch, | ||
| 34 | uint32_t bo_handle, | ||
| 35 | uint32_t* buf_id); | ||
| 36 | + typedef int (*drmModeAddFB2WithModifiers_type)(int fd, | ||
| 37 | + uint32_t width, | ||
| 38 | + uint32_t height, | ||
| 39 | + uint32_t pixel_format, | ||
| 40 | + uint32_t bo_handles[4], | ||
| 41 | + uint32_t pitches[4], | ||
| 42 | + uint32_t offsets[4], | ||
| 43 | + uint64_t modifier[4], | ||
| 44 | + uint32_t* buf_id, | ||
| 45 | + uint32_t flags); | ||
| 46 | typedef void (*drmModeFreeConnector_type)(drmModeConnectorPtr ptr); | ||
| 47 | typedef void (*drmModeFreeCrtc_type)(drmModeCrtcPtr ptr); | ||
| 48 | typedef void (*drmModeFreeEncoder_type)(drmModeEncoderPtr ptr); | ||
| 49 | @@ -192,6 +202,7 @@ public: | ||
| 50 | #define __DECLARE(name) const name##_type name | ||
| 51 | __DECLARE(drmIoctl); | ||
| 52 | __DECLARE(drmModeAddFB); | ||
| 53 | + __DECLARE(drmModeAddFB2WithModifiers); | ||
| 54 | __DECLARE(drmModeFreeConnector); | ||
| 55 | __DECLARE(drmModeFreeCrtc); | ||
| 56 | __DECLARE(drmModeFreeEncoder); | ||
| 57 | diff --git a/tools/legacy/sample_common/src/vaapi_allocator.cpp b/tools/legacy/sample_common/src/vaapi_allocator.cpp | ||
| 58 | index 51690186..12ace297 100644 | ||
| 59 | --- a/tools/legacy/sample_common/src/vaapi_allocator.cpp | ||
| 60 | +++ b/tools/legacy/sample_common/src/vaapi_allocator.cpp | ||
| 61 | @@ -364,6 +364,7 @@ mfxStatus vaapiFrameAllocator::AllocImpl(mfxFrameAllocRequest* request, | ||
| 62 | } | ||
| 63 | } | ||
| 64 | if (m_exporter) { | ||
| 65 | + vaapi_mids[i].m_fourcc = va_fourcc; | ||
| 66 | vaapi_mids[i].m_custom = m_exporter->acquire(&vaapi_mids[i]); | ||
| 67 | if (!vaapi_mids[i].m_custom) { | ||
| 68 | mfx_res = MFX_ERR_UNKNOWN; | ||
| 69 | diff --git a/tools/legacy/sample_common/src/vaapi_utils.cpp b/tools/legacy/sample_common/src/vaapi_utils.cpp | ||
| 70 | index b69dbe44..9531c65b 100644 | ||
| 71 | --- a/tools/legacy/sample_common/src/vaapi_utils.cpp | ||
| 72 | +++ b/tools/legacy/sample_common/src/vaapi_utils.cpp | ||
| 73 | @@ -94,6 +94,7 @@ DRM_Proxy::DRM_Proxy() | ||
| 74 | : lib("libdrm.so.2"), | ||
| 75 | SIMPLE_LOADER_FUNCTION(drmIoctl), | ||
| 76 | SIMPLE_LOADER_FUNCTION(drmModeAddFB), | ||
| 77 | + SIMPLE_LOADER_FUNCTION(drmModeAddFB2WithModifiers), | ||
| 78 | SIMPLE_LOADER_FUNCTION(drmModeFreeConnector), | ||
| 79 | SIMPLE_LOADER_FUNCTION(drmModeFreeCrtc), | ||
| 80 | SIMPLE_LOADER_FUNCTION(drmModeFreeEncoder), | ||
| 81 | diff --git a/tools/legacy/sample_common/src/vaapi_utils_drm.cpp b/tools/legacy/sample_common/src/vaapi_utils_drm.cpp | ||
| 82 | index c896017b..cf8d7ba7 100644 | ||
| 83 | --- a/tools/legacy/sample_common/src/vaapi_utils_drm.cpp | ||
| 84 | +++ b/tools/legacy/sample_common/src/vaapi_utils_drm.cpp | ||
| 85 | @@ -11,9 +11,9 @@ | ||
| 86 | #include <sys/ioctl.h> | ||
| 87 | #include "vaapi_allocator.h" | ||
| 88 | |||
| 89 | - #include <stdexcept> | ||
| 90 | - | ||
| 91 | #include <drm_fourcc.h> | ||
| 92 | + #include <stdexcept> | ||
| 93 | + #include "i915_drm.h" | ||
| 94 | #include "vaapi_utils_drm.h" | ||
| 95 | |||
| 96 | constexpr mfxU32 MFX_DRI_MAX_NODES_NUM = 16; | ||
| 97 | @@ -311,7 +311,8 @@ bool drmRenderer::getPlane() { | ||
| 98 | if (plane) { | ||
| 99 | if (plane->possible_crtcs & (1 << m_crtcIndex)) { | ||
| 100 | for (uint32_t j = 0; j < plane->count_formats; ++j) { | ||
| 101 | - if (plane->formats[j] == DRM_FORMAT_XRGB8888) { | ||
| 102 | + if ((plane->formats[j] == DRM_FORMAT_XRGB8888) || | ||
| 103 | + (plane->formats[j] == DRM_FORMAT_NV12)) { | ||
| 104 | m_planeID = plane->plane_id; | ||
| 105 | m_drmlib.drmModeFreePlane(plane); | ||
| 106 | m_drmlib.drmModeFreePlaneResources(planes); | ||
| 107 | @@ -404,14 +405,52 @@ void* drmRenderer::acquire(mfxMemId mid) { | ||
| 108 | if (ret) | ||
| 109 | return NULL; | ||
| 110 | |||
| 111 | - ret = m_drmlib.drmModeAddFB(m_fd, | ||
| 112 | - vmid->m_image.width, | ||
| 113 | - vmid->m_image.height, | ||
| 114 | - 24, | ||
| 115 | - 32, | ||
| 116 | - vmid->m_image.pitches[0], | ||
| 117 | - flink_open.handle, | ||
| 118 | - &fbhandle); | ||
| 119 | + uint32_t handles[4], pitches[4], offsets[4], pixel_format; | ||
| 120 | + uint64_t modifiers[4]; | ||
| 121 | + | ||
| 122 | + memset(&handles, 0, sizeof(handles)); | ||
| 123 | + memset(&pitches, 0, sizeof(pitches)); | ||
| 124 | + memset(&offsets, 0, sizeof(offsets)); | ||
| 125 | + memset(&modifiers, 0, sizeof(modifiers)); | ||
| 126 | + | ||
| 127 | + handles[0] = flink_open.handle; | ||
| 128 | + pitches[0] = vmid->m_image.pitches[0]; | ||
| 129 | + offsets[0] = vmid->m_image.offsets[0]; | ||
| 130 | + | ||
| 131 | + if (VA_FOURCC_NV12 == vmid->m_fourcc) { | ||
| 132 | + struct drm_i915_gem_set_tiling set_tiling; | ||
| 133 | + | ||
| 134 | + pixel_format = DRM_FORMAT_NV12; | ||
| 135 | + memset(&set_tiling, 0, sizeof(set_tiling)); | ||
| 136 | + set_tiling.handle = flink_open.handle; | ||
| 137 | + set_tiling.tiling_mode = I915_TILING_Y; | ||
| 138 | + set_tiling.stride = vmid->m_image.pitches[0]; | ||
| 139 | + ret = m_drmlib.drmIoctl(m_fd, DRM_IOCTL_I915_GEM_SET_TILING, &set_tiling); | ||
| 140 | + if (ret) { | ||
| 141 | + msdk_printf(MSDK_STRING("DRM_IOCTL_I915_GEM_SET_TILING Failed ret = %d\n"), ret); | ||
| 142 | + return NULL; | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + handles[1] = flink_open.handle; | ||
| 146 | + pitches[1] = vmid->m_image.pitches[1]; | ||
| 147 | + offsets[1] = vmid->m_image.offsets[1]; | ||
| 148 | + modifiers[0] = modifiers[1] = I915_FORMAT_MOD_Y_TILED; | ||
| 149 | + } | ||
| 150 | + else { | ||
| 151 | + pixel_format = DRM_FORMAT_XRGB8888; | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + ret = m_drmlib.drmModeAddFB2WithModifiers(m_fd, | ||
| 155 | + vmid->m_image.width, | ||
| 156 | + vmid->m_image.height, | ||
| 157 | + pixel_format, | ||
| 158 | + handles, | ||
| 159 | + pitches, | ||
| 160 | + offsets, | ||
| 161 | + modifiers, | ||
| 162 | + &fbhandle, | ||
| 163 | + 0); | ||
| 164 | + | ||
| 165 | if (ret) | ||
| 166 | return NULL; | ||
| 167 | |||
| 168 | -- | ||
| 169 | 2.31.1 | ||
| 170 | |||
diff --git a/recipes-multimedia/onevpl/onevpl/0001-samples-Fixed-tile-modifier-issue-for-NV12-format.patch b/recipes-multimedia/onevpl/onevpl/0001-samples-Fixed-tile-modifier-issue-for-NV12-format.patch deleted file mode 100644 index c798e3f1..00000000 --- a/recipes-multimedia/onevpl/onevpl/0001-samples-Fixed-tile-modifier-issue-for-NV12-format.patch +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | From 15cc366b66b625b0b2613a4365e7777563325a94 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Yew, Chang Ching" <chang.ching.yew@intel.com> | ||
| 3 | Date: Wed, 25 Aug 2021 11:20:30 +0000 | ||
| 4 | Subject: [PATCH 2/2] samples: Fixed tile modifier issue for NV12 format | ||
| 5 | |||
| 6 | If we are using I915_FORMAT_MOD_Y_TILED which is needed for | ||
| 7 | NV12 format then modifiers need to be enabled which can be passed | ||
| 8 | as flags argument to ioctl. | ||
| 9 | |||
| 10 | Upstream-Status: Submitted | ||
| 11 | innersource PR #221 | ||
| 12 | |||
| 13 | Signed-off-by: Sodhi, Vunny <vunny.sodhi@intel.com> | ||
| 14 | Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com> | ||
| 15 | --- | ||
| 16 | tools/legacy/sample_common/src/vaapi_utils_drm.cpp | 5 +++-- | ||
| 17 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/tools/legacy/sample_common/src/vaapi_utils_drm.cpp b/tools/legacy/sample_common/src/vaapi_utils_drm.cpp | ||
| 20 | index cf8d7ba7..3df3bb8a 100644 | ||
| 21 | --- a/tools/legacy/sample_common/src/vaapi_utils_drm.cpp | ||
| 22 | +++ b/tools/legacy/sample_common/src/vaapi_utils_drm.cpp | ||
| 23 | @@ -405,7 +405,7 @@ void* drmRenderer::acquire(mfxMemId mid) { | ||
| 24 | if (ret) | ||
| 25 | return NULL; | ||
| 26 | |||
| 27 | - uint32_t handles[4], pitches[4], offsets[4], pixel_format; | ||
| 28 | + uint32_t handles[4], pitches[4], offsets[4], pixel_format, flags = 0; | ||
| 29 | uint64_t modifiers[4]; | ||
| 30 | |||
| 31 | memset(&handles, 0, sizeof(handles)); | ||
| 32 | @@ -435,6 +435,7 @@ void* drmRenderer::acquire(mfxMemId mid) { | ||
| 33 | pitches[1] = vmid->m_image.pitches[1]; | ||
| 34 | offsets[1] = vmid->m_image.offsets[1]; | ||
| 35 | modifiers[0] = modifiers[1] = I915_FORMAT_MOD_Y_TILED; | ||
| 36 | + flags = 2; // DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] | ||
| 37 | } | ||
| 38 | else { | ||
| 39 | pixel_format = DRM_FORMAT_XRGB8888; | ||
| 40 | @@ -449,7 +450,7 @@ void* drmRenderer::acquire(mfxMemId mid) { | ||
| 41 | offsets, | ||
| 42 | modifiers, | ||
| 43 | &fbhandle, | ||
| 44 | - 0); | ||
| 45 | + flags); | ||
| 46 | |||
| 47 | if (ret) | ||
| 48 | return NULL; | ||
| 49 | -- | ||
| 50 | 2.31.1 | ||
| 51 | |||
diff --git a/recipes-multimedia/onevpl/onevpl_2021.5.0.bb b/recipes-multimedia/onevpl/onevpl_2021.6.0.bb index da530d64..3cc53062 100644 --- a/recipes-multimedia/onevpl/onevpl_2021.5.0.bb +++ b/recipes-multimedia/onevpl/onevpl_2021.6.0.bb | |||
| @@ -6,15 +6,12 @@ that works across a wide range of accelerators." | |||
| 6 | HOMEPAGE = "https://github.com/oneapi-src/oneVPL" | 6 | HOMEPAGE = "https://github.com/oneapi-src/oneVPL" |
| 7 | LICENSE = "MIT" | 7 | LICENSE = "MIT" |
| 8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c18ea6bb4786a26bf4eee88a7424a408 \ | 8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c18ea6bb4786a26bf4eee88a7424a408 \ |
| 9 | file://third-party-programs.txt;md5=52d2c0c51bb5c0d9d9c16ae91d66c8fb" | 9 | file://third-party-programs.txt;md5=67727fd253b1b4574cd9eea78a2b0620" |
| 10 | 10 | ||
| 11 | SRC_URI = "git://github.com/oneapi-src/oneVPL.git;protocol=https \ | 11 | SRC_URI = "git://github.com/oneapi-src/oneVPL.git;protocol=https \ |
| 12 | file://0001-Fix-the-rendering-to-X11-failures.patch \ | 12 | file://0001-Fix-basename-build-issue-with-musl_libc.patch \ |
| 13 | file://0001-Fix-compile-issue-with-CMAKE_CXX_FLAGS-setting.patch \ | ||
| 14 | file://0001-samples-Add-support-of-DRM_FORMAT_NV12-for-console-m.patch \ | ||
| 15 | file://0001-samples-Fixed-tile-modifier-issue-for-NV12-format.patch \ | ||
| 16 | " | 13 | " |
| 17 | SRCREV = "dde640ef0872b645d6e0275a6aaec26c01a9c0b9" | 14 | SRCREV = "cdf7444dc971544d148c51e0d93a2df1bb55dda7" |
| 18 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |
| 19 | 16 | ||
| 20 | inherit cmake | 17 | inherit cmake |
| @@ -36,5 +33,5 @@ FILES_SOLIBSDEV = "" | |||
| 36 | FILES:${PN}-dev += "${libdir}/libvpl.so" | 33 | FILES:${PN}-dev += "${libdir}/libvpl.so" |
| 37 | 34 | ||
| 38 | FILES:${PN} += "${datadir} \ | 35 | FILES:${PN} += "${datadir} \ |
| 39 | ${libdir}/libvpl_wayland.so \ | 36 | ${libdir}/oneVPL/libvpl_wayland.so \ |
| 40 | " | 37 | " |
