summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/onevpl/onevpl/0001-Adding-Wayland-support-to-legacy-tools.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-multimedia/onevpl/onevpl/0001-Adding-Wayland-support-to-legacy-tools.patch')
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-Adding-Wayland-support-to-legacy-tools.patch161
1 files changed, 138 insertions, 23 deletions
diff --git a/recipes-multimedia/onevpl/onevpl/0001-Adding-Wayland-support-to-legacy-tools.patch b/recipes-multimedia/onevpl/onevpl/0001-Adding-Wayland-support-to-legacy-tools.patch
index 857626b4..69d4a417 100644
--- a/recipes-multimedia/onevpl/onevpl/0001-Adding-Wayland-support-to-legacy-tools.patch
+++ b/recipes-multimedia/onevpl/onevpl/0001-Adding-Wayland-support-to-legacy-tools.patch
@@ -1,24 +1,27 @@
1From 64250fb3e73c1977067381c70aeffbaa980f4136 Mon Sep 17 00:00:00 2001 1From 2d72bd9c295ac84654e0f24b64675d3c95a15c2e Mon Sep 17 00:00:00 2001
2From: jinchung <jin.chung.teng@intel.com> 2From: "Yew, Chang Ching" <chang.ching.yew@intel.com>
3Date: Fri, 28 May 2021 11:34:01 +0800 3Date: Tue, 29 Jun 2021 15:51:41 +0800
4Subject: [PATCH] Adding Wayland support to legacy tools 4Subject: [PATCH] Adding Wayland support to legacy tools
5 5
6Upstream-Status: Submitted 6Upstream-Status: Submitted
7https://github.com/oneapi-src/oneVPL/pull/6 7https://github.com/oneapi-src/oneVPL/pull/6
8 8
9Signed-off-by: jinchung <jin.chung.teng@intel.com> 9Signed-off-by: jinchung <jin.chung.teng@intel.com>
10Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com>
10--- 11---
11 tools/legacy/CMakeLists.txt | 1 + 12 tools/legacy/CMakeLists.txt | 1 +
12 tools/legacy/sample_common/CMakeLists.txt | 8 + 13 tools/legacy/sample_common/CMakeLists.txt | 8 +
13 tools/legacy/sample_common/src/vaapi_device.cpp | 2 +- 14 .../legacy/sample_common/CMakeLists.txt.orig | 105 ++++
14 tools/legacy/sample_misc/wayland/CMakeLists.txt | 29 ++ 15 .../legacy/sample_common/src/vaapi_device.cpp | 2 +-
15 .../sample_misc/wayland/include/class_wayland.h | 160 +++++++ 16 .../legacy/sample_misc/wayland/CMakeLists.txt | 29 +
16 .../sample_misc/wayland/include/listener_wayland.h | 66 +++ 17 .../wayland/include/class_wayland.h | 160 ++++++
17 .../wayland/include/wayland-drm-client-protocol.h | 235 ++++++++++ 18 .../wayland/include/listener_wayland.h | 66 +++
18 .../sample_misc/wayland/src/class_wayland.cpp | 500 +++++++++++++++++++++ 19 .../include/wayland-drm-client-protocol.h | 235 ++++++++
19 .../sample_misc/wayland/src/listener_wayland.cpp | 105 +++++ 20 .../sample_misc/wayland/src/class_wayland.cpp | 500 ++++++++++++++++++
20 .../sample_misc/wayland/src/wayland-drm-protocol.c | 84 ++++ 21 .../wayland/src/listener_wayland.cpp | 105 ++++
21 10 files changed, 1189 insertions(+), 1 deletion(-) 22 .../wayland/src/wayland-drm-protocol.c | 84 +++
23 11 files changed, 1294 insertions(+), 1 deletion(-)
24 create mode 100644 tools/legacy/sample_common/CMakeLists.txt.orig
22 create mode 100644 tools/legacy/sample_misc/wayland/CMakeLists.txt 25 create mode 100644 tools/legacy/sample_misc/wayland/CMakeLists.txt
23 create mode 100644 tools/legacy/sample_misc/wayland/include/class_wayland.h 26 create mode 100644 tools/legacy/sample_misc/wayland/include/class_wayland.h
24 create mode 100644 tools/legacy/sample_misc/wayland/include/listener_wayland.h 27 create mode 100644 tools/legacy/sample_misc/wayland/include/listener_wayland.h
@@ -28,27 +31,28 @@ Signed-off-by: jinchung <jin.chung.teng@intel.com>
28 create mode 100644 tools/legacy/sample_misc/wayland/src/wayland-drm-protocol.c 31 create mode 100644 tools/legacy/sample_misc/wayland/src/wayland-drm-protocol.c
29 32
30diff --git a/tools/legacy/CMakeLists.txt b/tools/legacy/CMakeLists.txt 33diff --git a/tools/legacy/CMakeLists.txt b/tools/legacy/CMakeLists.txt
31index 165a5b2..1d4af73 100644 34index 59e1ad2..de7c452 100644
32--- a/tools/legacy/CMakeLists.txt 35--- a/tools/legacy/CMakeLists.txt
33+++ b/tools/legacy/CMakeLists.txt 36+++ b/tools/legacy/CMakeLists.txt
34@@ -11,3 +11,4 @@ add_subdirectory(sample_common) 37@@ -11,4 +11,5 @@ add_subdirectory(sample_common)
35 add_subdirectory(sample_decode) 38 add_subdirectory(sample_decode)
36 add_subdirectory(sample_vpp) 39 add_subdirectory(sample_vpp)
37 add_subdirectory(sample_encode) 40 add_subdirectory(sample_encode)
38+add_subdirectory(sample_misc/wayland) 41+add_subdirectory(sample_misc/wayland)
42 add_subdirectory(sample_multi_transcode)
39diff --git a/tools/legacy/sample_common/CMakeLists.txt b/tools/legacy/sample_common/CMakeLists.txt 43diff --git a/tools/legacy/sample_common/CMakeLists.txt b/tools/legacy/sample_common/CMakeLists.txt
40index db4de3d..4f04226 100644 44index 32b7944..b4710f6 100644
41--- a/tools/legacy/sample_common/CMakeLists.txt 45--- a/tools/legacy/sample_common/CMakeLists.txt
42+++ b/tools/legacy/sample_common/CMakeLists.txt 46+++ b/tools/legacy/sample_common/CMakeLists.txt
43@@ -70,6 +70,7 @@ if(UNIX) 47@@ -73,6 +73,7 @@ if(UNIX)
44 pkg_check_modules(PKG_LIBDRM libdrm) 48 pkg_check_modules(PKG_LIBDRM libdrm)
45 pkg_check_modules(PKG_X11 x11) 49 pkg_check_modules(PKG_X11 x11)
46 pkg_check_modules(PKG_LIBVA_X11 libva-x11>=1.10.0) 50 pkg_check_modules(PKG_LIBVA_X11 libva-x11>=1.10.0)
47+ pkg_check_modules(PKG_WAYLAND_CLIENT wayland-client) 51+ pkg_check_modules(PKG_WAYLAND_CLIENT wayland-client)
48 if(PKG_LIBVA_FOUND) 52 if(PKG_LIBVA_FOUND)
49 target_compile_definitions(${TARGET} PUBLIC -DLIBVA_SUPPORT) 53 target_compile_definitions(${TARGET} PUBLIC -DLIBVA_SUPPORT)
50 target_include_directories(${TARGET} PUBLIC ${PKG_LIBVA_INCLUDE_DIRS}) 54 target_compile_definitions(${TARGET} PUBLIC -DLIBVA_DRM_SUPPORT)
51@@ -88,6 +89,13 @@ if(UNIX) 55@@ -91,6 +92,13 @@ if(UNIX)
52 else() 56 else()
53 message(WARNING "x11 modules not found: building without libVA X11 support") 57 message(WARNING "x11 modules not found: building without libVA X11 support")
54 endif() 58 endif()
@@ -62,6 +66,117 @@ index db4de3d..4f04226 100644
62 66
63 target_link_libraries(${TARGET} ${CMAKE_DL_LIBS}) 67 target_link_libraries(${TARGET} ${CMAKE_DL_LIBS})
64 68
69diff --git a/tools/legacy/sample_common/CMakeLists.txt.orig b/tools/legacy/sample_common/CMakeLists.txt.orig
70new file mode 100644
71index 0000000..32b7944
72--- /dev/null
73+++ b/tools/legacy/sample_common/CMakeLists.txt.orig
74@@ -0,0 +1,105 @@
75+# ##############################################################################
76+# Copyright (C) Intel Corporation
77+#
78+# SPDX-License-Identifier: MIT
79+# ##############################################################################
80+cmake_minimum_required(VERSION 3.10.2)
81+
82+set(TARGET sample_common)
83+
84+set(sources "")
85+list(
86+ APPEND
87+ sources
88+ src/base_allocator.cpp
89+ src/decode_render.cpp
90+ src/mfx_buffering.cpp
91+ src/sysmem_allocator.cpp
92+ src/general_allocator.cpp
93+ src/sample_utils.cpp
94+ src/plugin_utils.cpp
95+ src/preset_manager.cpp
96+ src/parameters_dumper.cpp
97+ src/vpl_implementation_loader.cpp
98+ src/vm/atomic.cpp
99+ src/vm/time.cpp)
100+
101+if(UNIX)
102+ list(
103+ APPEND
104+ sources
105+ src/vaapi_utils.cpp
106+ src/vaapi_device.cpp
107+ src/vaapi_allocator.cpp
108+ src/vm/time_linux.cpp
109+ src/vm/atomic_linux.cpp
110+ src/vm/thread_linux.cpp
111+ src/vaapi_utils_x11.cpp
112+ src/vaapi_utils_drm.cpp)
113+else()
114+ list(
115+ APPEND
116+ sources
117+ src/d3d11_allocator.cpp
118+ src/d3d11_device.cpp
119+ src/d3d_allocator.cpp
120+ src/vm/thread_windows.cpp
121+ src/d3d_device.cpp)
122+endif()
123+
124+set(CMAKE_POSITION_INDEPENDENT_CODE true)
125+add_library(${TARGET} STATIC ${sources})
126+target_include_directories(
127+ ${TARGET} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
128+
129+if(MSVC)
130+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
131+endif()
132+
133+add_definitions(-DMFX_DEPRECATED_OFF)
134+
135+if(POLICY CMP0074)
136+ # ignore warning of VPL_ROOT in find_package search path
137+ cmake_policy(SET CMP0074 OLD)
138+endif()
139+
140+find_package(VPL REQUIRED)
141+target_link_libraries(${TARGET} VPL::dispatcher media_sdk_compatibility_headers)
142+
143+if(UNIX)
144+ find_package(PkgConfig REQUIRED)
145+ # note: pkg-config version for libva is *API* version
146+ pkg_check_modules(PKG_LIBVA libva>=1.2 libva-drm>=1.2)
147+ pkg_check_modules(PKG_LIBDRM libdrm)
148+ pkg_check_modules(PKG_X11 x11)
149+ pkg_check_modules(PKG_LIBVA_X11 libva-x11>=1.10.0)
150+ if(PKG_LIBVA_FOUND)
151+ target_compile_definitions(${TARGET} PUBLIC -DLIBVA_SUPPORT)
152+ target_compile_definitions(${TARGET} PUBLIC -DLIBVA_DRM_SUPPORT)
153+ target_include_directories(${TARGET} PUBLIC ${PKG_LIBVA_INCLUDE_DIRS})
154+ else()
155+ message(WARNING "libva not found: building without libVA support")
156+ endif()
157+ if(PKG_LIBDRM_FOUND)
158+ target_include_directories(${TARGET} PUBLIC ${PKG_LIBDRM_INCLUDE_DIRS})
159+ else()
160+ message(WARNING "libva-drm not found: building without libVA DRM support")
161+ endif()
162+ if(PKG_X11_FOUND)
163+ target_compile_definitions(${TARGET} PUBLIC -DLIBVA_X11_SUPPORT)
164+ target_include_directories(${TARGET} PUBLIC ${PKG_X11_LIBRARY_DIRS})
165+ else()
166+ message(WARNING "x11 modules not found: building without libVA X11 support")
167+ endif()
168+
169+ target_link_libraries(${TARGET} ${CMAKE_DL_LIBS})
170+
171+ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
172+ set(THREADS_PREFER_PTHREAD_FLAG TRUE)
173+ find_package(Threads REQUIRED)
174+ target_link_libraries(${TARGET} Threads::Threads)
175+
176+else()
177+ target_compile_definitions(${TARGET} PUBLIC -DMFX_D3D11_SUPPORT)
178+ target_link_libraries(${TARGET} DXGI D3D11 D3D9 DXVA2)
179+endif()
65diff --git a/tools/legacy/sample_common/src/vaapi_device.cpp b/tools/legacy/sample_common/src/vaapi_device.cpp 180diff --git a/tools/legacy/sample_common/src/vaapi_device.cpp b/tools/legacy/sample_common/src/vaapi_device.cpp
66index 3f6d3ba..b034376 100644 181index 3f6d3ba..b034376 100644
67--- a/tools/legacy/sample_common/src/vaapi_device.cpp 182--- a/tools/legacy/sample_common/src/vaapi_device.cpp
@@ -350,7 +465,7 @@ index 0000000..1bbaa91
350+#endif /* LISTENER_WAYLAND_H */ 465+#endif /* LISTENER_WAYLAND_H */
351diff --git a/tools/legacy/sample_misc/wayland/include/wayland-drm-client-protocol.h b/tools/legacy/sample_misc/wayland/include/wayland-drm-client-protocol.h 466diff --git a/tools/legacy/sample_misc/wayland/include/wayland-drm-client-protocol.h b/tools/legacy/sample_misc/wayland/include/wayland-drm-client-protocol.h
352new file mode 100644 467new file mode 100644
353index 0000000..e11b35d 468index 0000000..e8f33c0
354--- /dev/null 469--- /dev/null
355+++ b/tools/legacy/sample_misc/wayland/include/wayland-drm-client-protocol.h 470+++ b/tools/legacy/sample_misc/wayland/include/wayland-drm-client-protocol.h
356@@ -0,0 +1,235 @@ 471@@ -0,0 +1,235 @@
@@ -1208,7 +1323,7 @@ index 0000000..90f582a
1208+} 1323+}
1209diff --git a/tools/legacy/sample_misc/wayland/src/wayland-drm-protocol.c b/tools/legacy/sample_misc/wayland/src/wayland-drm-protocol.c 1324diff --git a/tools/legacy/sample_misc/wayland/src/wayland-drm-protocol.c b/tools/legacy/sample_misc/wayland/src/wayland-drm-protocol.c
1210new file mode 100644 1325new file mode 100644
1211index 0000000..8e1fd50 1326index 0000000..7640883
1212--- /dev/null 1327--- /dev/null
1213+++ b/tools/legacy/sample_misc/wayland/src/wayland-drm-protocol.c 1328+++ b/tools/legacy/sample_misc/wayland/src/wayland-drm-protocol.c
1214@@ -0,0 +1,84 @@ 1329@@ -0,0 +1,84 @@
@@ -1297,5 +1412,5 @@ index 0000000..8e1fd50
1297+}; 1412+};
1298+ 1413+
1299-- 1414--
13002.7.4 14152.32.0
1301 1416