mirror of
https://github.com/openwrt/video.git
synced 2025-12-21 19:14:35 +04:00
Support for off-screen rendering ("libOSMesa") has been dropped upstream.
In order to still be able to cross-compile the panfrost driver also on
non-Linux buildhosts, or Linux hosts without libdrm, a patch has been
applied.
This patch has also been submitted upstream via
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36170
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
117 lines
3.8 KiB
Diff
117 lines
3.8 KiB
Diff
--- a/meson.build
|
|
+++ b/meson.build
|
|
@@ -1771,21 +1771,26 @@ _llvm = get_option('llvm')
|
|
dep_llvm = null_dep
|
|
with_llvm = false
|
|
if _llvm.allowed()
|
|
- dep_llvm = dependency(
|
|
- 'llvm',
|
|
- method : host_machine.system() == 'windows' ? 'auto' : 'config-tool',
|
|
- version : _llvm_version,
|
|
- modules : llvm_modules,
|
|
- optional_modules : llvm_optional_modules,
|
|
- required : (
|
|
- with_amd_vk or with_gallium_radeonsi or with_gallium_clover or with_clc
|
|
- or _llvm.enabled()
|
|
- ),
|
|
- static : not _shared_llvm,
|
|
- fallback : ['llvm', 'dep_llvm'],
|
|
- include_type : 'system',
|
|
- )
|
|
- with_llvm = dep_llvm.found()
|
|
+ llvm_proj = subproject('llvm')
|
|
+ if llvm_proj.found()
|
|
+ dep_llvm = llvm_proj.get_variable('dep_llvm')
|
|
+ with_llvm = true
|
|
+ else
|
|
+ dep_llvm = dependency(
|
|
+ 'llvm',
|
|
+ method : host_machine.system() == 'windows' ? 'auto' : 'config-tool',
|
|
+ version : _llvm_version,
|
|
+ modules : llvm_modules,
|
|
+ optional_modules : llvm_optional_modules,
|
|
+ required : (
|
|
+ with_amd_vk or with_gallium_radeonsi or with_gallium_clover or with_clc
|
|
+ or _llvm.enabled()
|
|
+ ),
|
|
+ static : not _shared_llvm,
|
|
+ fallback : ['llvm', 'dep_llvm'],
|
|
+ include_type : 'system',
|
|
+ )
|
|
+ endif
|
|
endif
|
|
if with_llvm
|
|
pre_args += '-DMESA_LLVM_VERSION_STRING="@0@"'.format(dep_llvm.version())
|
|
@@ -1884,7 +1889,11 @@ endif
|
|
|
|
dep_clang = null_dep
|
|
if with_clc or with_gallium_clover
|
|
- llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
|
|
+ if dep_llvm.type_name() == 'internal'
|
|
+ llvm_libdir = subproject('llvm').get_variable('libdir')
|
|
+ else
|
|
+ llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
|
|
+ endif
|
|
|
|
dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false)
|
|
|
|
--- a/src/compiler/clc/meson.build
|
|
+++ b/src/compiler/clc/meson.build
|
|
@@ -25,14 +25,14 @@ if not _shared_llvm or \
|
|
|
|
opencl_c_base_h = custom_target(
|
|
'opencl-c-base.h',
|
|
- input : [files_xxd, join_paths(clang_resource_dir, 'opencl-c-base.h')],
|
|
+ input : [files_xxd, 'opencl-c-base.h'],
|
|
output : 'opencl-c-base.h.h',
|
|
command : [prog_python, '@INPUT@', '@OUTPUT@', '-n', 'opencl_c_base_source'],
|
|
)
|
|
|
|
opencl_c_h = custom_target(
|
|
'opencl-c.h',
|
|
- input : [files_xxd, join_paths(clang_resource_dir, 'opencl-c.h')],
|
|
+ input : [files_xxd, 'opencl-c.h'],
|
|
output : 'opencl-c.h.h',
|
|
command : [prog_python, '@INPUT@', '@OUTPUT@', '-n', 'opencl_c_source'],
|
|
)
|
|
--- a/src/gallium/frontends/clover/meson.build
|
|
+++ b/src/gallium/frontends/clover/meson.build
|
|
@@ -25,6 +25,12 @@ if with_opencl_icd
|
|
clover_cpp_args += '-DHAVE_CLOVER_ICD'
|
|
endif
|
|
|
|
+if dep_llvm.type_name() == 'internal'
|
|
+ llvm_libdir = subproject('llvm').get_variable('libdir')
|
|
+else
|
|
+ llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
|
|
+endif
|
|
+
|
|
libclllvm = static_library(
|
|
'clllvm',
|
|
files(
|
|
@@ -43,7 +49,7 @@ libclllvm = static_library(
|
|
clover_cpp_args,
|
|
clover_opencl_cpp_args,
|
|
'-DFALLBACK_CLANG_RESOURCE_DIR="@0@"'.format(join_paths(
|
|
- dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang',
|
|
+ llvm_libdir, 'clang',
|
|
dep_llvm.version()
|
|
)),
|
|
],
|
|
--- a/src/gallium/targets/opencl/meson.build
|
|
+++ b/src/gallium/targets/opencl/meson.build
|
|
@@ -12,7 +12,12 @@ if with_ld_version_script
|
|
opencl_link_deps += files('opencl.sym')
|
|
endif
|
|
|
|
-llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
|
|
+if dep_llvm.type_name() == 'internal'
|
|
+ llvm_libdir = subproject('llvm').get_variable('libdir')
|
|
+else
|
|
+ llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
|
|
+endif
|
|
+
|
|
opencl_libname = with_opencl_icd ? 'MesaOpenCL' : 'OpenCL'
|
|
|
|
polly_dep = null_dep
|