Projects
openEuler:Mainline
mesa
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 16
View file
_service:tar_scm:mesa.spec
Changed
@@ -6,6 +6,8 @@ %else %define with_hardware 1 %define with_vdpau 1 +%define with_omx 1 +%define with_nine 1 %endif %ifarch %{ix86} x86_64 @@ -13,6 +15,7 @@ %define with_vmware 1 %define with_xa 1 %define with_iris 1 +%define with_crocus 1 %endif %ifarch %{ix86} x86_64 @@ -25,12 +28,17 @@ %define with_xa 1 %endif +%ifarch riscv64 +%define with_xa 1 +%define with_vmware 1 +%endif + %global dri_drivers %{?platform_drivers} %if 0%{?with_vulkan_hw} -%define vulkan_drivers swrast,intel,amd +%define vulkan_drivers swrast,intel,amd,intel_hasvk %else -%define vulkan_drivers swrast +%define vulkan_drivers swrast,amd %endif %global sanitize 0 @@ -38,7 +46,7 @@ Name: mesa Summary: Mesa graphics libraries Version: 23.1.3 -Release: 1 +Release: 2 License: MIT URL: http://www.mesa3d.org @@ -46,11 +54,14 @@ Patch1: backport-fix-build-err-on-arm.patch Patch2: 0001-evergreen-big-endian.patch +Patch3: llvmpipe-add-an-implementation-with-llvm-orcjit.patch +Patch4: llvmpipe-add-riscv-support-in-orcjit.patch +Patch5: llvmpipe-make-unnamed-global-have-internal-linkage.patch BuildRequires: gcc BuildRequires: gcc-c++ -BuildRequires: meson >= 0.45 +BuildRequires: meson >= 1.0.0 %if %{with_hardware} BuildRequires: kernel-headers %endif @@ -304,7 +315,7 @@ -Ddri3=enabled \ -Dosmesa=true \ %if 0%{?with_hardware} - -Dgallium-drivers=swrast%{?with_iris:,iris},virgl,nouveau%{?with_vmware:,svga},radeonsi,r600%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_kmsro:,kmsro} \ + -Dgallium-drivers=swrast%{?with_iris:,iris},virgl,nouveau%{?with_vmware:,svga},radeonsi,r300,r600%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_kmsro:,kmsro}%{?with_crocus:,crocus} \ %else -Dgallium-drivers=swrast,virgl \ %endif @@ -461,9 +472,11 @@ %dir %{_datadir}/drirc.d %{_datadir}/drirc.d/00-mesa-defaults.conf %if %{with_hardware} +%{_libdir}/dri/r300_dri.so %{_libdir}/dri/r600_dri.so %{_libdir}/dri/radeonsi_dri.so %ifarch %{ix86} x86_64 +%{_libdir}/dri/crocus_dri.so %{_libdir}/dri/iris_dri.so %endif %if 0%{?with_vc4} @@ -496,6 +509,7 @@ %{_libdir}/vdpau/libvdpau_nouveau.so.1* %{_libdir}/vdpau/libvdpau_r600.so.1* %{_libdir}/vdpau/libvdpau_radeonsi.so.1* +%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1* %endif %endif @@ -503,16 +517,14 @@ %if 0%{?with_vulkan_hw} %{_libdir}/libvulkan_intel.so %{_libdir}/libvulkan_radeon.so -%ifarch x86_64 -%{_datadir}/drirc.d/00-radv-defaults.conf -%{_datadir}/vulkan/icd.d/intel_icd.x86_64.json -%{_datadir}/vulkan/icd.d/radeon_icd.x86_64.json -%else -%{_datadir}/vulkan/icd.d/intel_icd.i686.json -%{_datadir}/vulkan/icd.d/radeon_icd.i686.json -%endif +%{_libdir}/libvulkan_intel_hasvk.so +%{_datadir}/vulkan/icd.d/intel_hasvk_icd.*.json +%{_datadir}/vulkan/icd.d/intel_icd.*.json %endif +%{_datadir}/drirc.d/00-radv-defaults.conf +%{_datadir}/vulkan/icd.d/radeon_icd.*.json %{_libdir}/vdpau/libvdpau_virtio_gpu.so.1* +%{_libdir}/libvulkan_radeon.so %{_libdir}/libvulkan_lvp.so %{_datadir}/vulkan/icd.d/lvp_icd.*.json %{_libdir}/libVkLayer_MESA_device_select.so @@ -523,6 +535,10 @@ %endif %changelog +* Tue Aug 08 2023 Jingwiw <wangjingwei@iscas.ac.cn> - 23.1.3-2 +- Add OrcJIT and add riscv architecture optimization +- Optimize the mesa spec and add more backend + * Mon Jul 31 2023 zhouwenpei <zhouwenpei1@h-partners.com> - 23.1.3-1 - upgrade to mesa-23.1.3
View file
_service:tar_scm:llvmpipe-add-an-implementation-with-llvm-orcjit.patch
Added
@@ -0,0 +1,2426 @@ +From 653d2fce91f09904e08c55647ca0bb901e402617 Mon Sep 17 00:00:00 2001 +From: Alex Fan <alex.fan.q@gmail.com> +Date: Tue, 28 Jun 2022 15:51:24 +0000 +Subject: PATCH llvmpipe: add an implementation with llvm orcjit + +no per-func perf nor disasm is implemented yet. +disk cache is also left empty +--- + src/gallium/auxiliary/draw/draw_context.c | 4 + + src/gallium/auxiliary/draw/draw_llvm.c | 94 +- + src/gallium/auxiliary/draw/draw_llvm.h | 27 +- + src/gallium/auxiliary/gallivm/lp_bld_coro.c | 6 +- + src/gallium/auxiliary/gallivm/lp_bld_coro.h | 8 + + src/gallium/auxiliary/gallivm/lp_bld_init.c | 9 +- + src/gallium/auxiliary/gallivm/lp_bld_init.h | 41 +- + .../auxiliary/gallivm/lp_bld_init_orc.cpp | 882 ++++++++++++++++++ + src/gallium/auxiliary/meson.build | 2 +- + src/gallium/drivers/llvmpipe/lp_context.c | 14 + + src/gallium/drivers/llvmpipe/lp_context.h | 4 + + src/gallium/drivers/llvmpipe/lp_screen.c | 4 + + src/gallium/drivers/llvmpipe/lp_state_cs.c | 19 + + src/gallium/drivers/llvmpipe/lp_state_cs.h | 3 + + src/gallium/drivers/llvmpipe/lp_state_fs.c | 33 + + src/gallium/drivers/llvmpipe/lp_state_fs.h | 6 + + .../llvmpipe/lp_state_fs_linear_llvm.c | 4 + + src/gallium/drivers/llvmpipe/lp_state_setup.c | 9 + + src/gallium/drivers/llvmpipe/lp_state_setup.h | 3 + + src/gallium/drivers/llvmpipe/lp_test_arit.c | 19 + + src/gallium/drivers/llvmpipe/lp_test_blend.c | 33 +- + src/gallium/drivers/llvmpipe/lp_test_conv.c | 33 +- + src/gallium/drivers/llvmpipe/lp_test_format.c | 50 +- + .../llvmpipe/lp_test_lookup_multiple.c | 173 ++++ + src/gallium/drivers/llvmpipe/lp_test_printf.c | 31 +- + src/gallium/drivers/llvmpipe/meson.build | 2 +- + 26 files changed, 1494 insertions(+), 19 deletions(-) + create mode 100644 src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp + create mode 100644 src/gallium/drivers/llvmpipe/lp_test_lookup_multiple.c + +diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c +index 81ceefc32bb..4fdd7f319b6 100644 +--- a/src/gallium/auxiliary/draw/draw_context.c ++++ b/src/gallium/auxiliary/draw/draw_context.c +@@ -76,7 +76,11 @@ draw_create_context(struct pipe_context *pipe, void *context, + + #ifdef DRAW_LLVM_AVAILABLE + if (try_llvm && draw_get_option_use_llvm()) { ++#if GALLIVM_USE_ORCJIT == 1 ++ draw->llvm = draw_llvm_create(draw, (LLVMOrcThreadSafeContextRef)context); ++#else + draw->llvm = draw_llvm_create(draw, (LLVMContextRef)context); ++#endif + } + #endif + +diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c +index 8b3a1522725..ae9dd4d64f5 100644 +--- a/src/gallium/auxiliary/draw/draw_llvm.c ++++ b/src/gallium/auxiliary/draw/draw_llvm.c +@@ -766,8 +766,13 @@ get_vertex_header_ptr_type(struct draw_llvm_variant *variant) + /** + * Create per-context LLVM info. + */ ++#if GALLIVM_USE_ORCJIT == 1 ++struct draw_llvm * ++draw_llvm_create(struct draw_context *draw, LLVMOrcThreadSafeContextRef context) ++#else + struct draw_llvm * + draw_llvm_create(struct draw_context *draw, LLVMContextRef context) ++#endif + { + struct draw_llvm *llvm; + +@@ -780,6 +785,16 @@ draw_llvm_create(struct draw_context *draw, LLVMContextRef context) + + llvm->draw = draw; + ++#if GALLIVM_USE_ORCJIT == 1 ++ llvm->_ts_context = context; ++ if (!llvm->_ts_context) { ++ llvm->_ts_context = LLVMOrcCreateNewThreadSafeContext(); ++ llvm->context_owned = true; ++ } ++ if (!llvm->_ts_context) ++ goto fail; ++ llvm->context = LLVMOrcThreadSafeContextGetContext(llvm->_ts_context); ++#else + llvm->context = context; + if (!llvm->context) { + llvm->context = LLVMContextCreate(); +@@ -792,6 +807,7 @@ draw_llvm_create(struct draw_context *draw, LLVMContextRef context) + } + if (!llvm->context) + goto fail; ++#endif + + llvm->nr_variants = 0; + list_inithead(&llvm->vs_variants_list.list); +@@ -819,9 +835,16 @@ fail: + void + draw_llvm_destroy(struct draw_llvm *llvm) + { ++#if GALLIVM_USE_ORCJIT == 1 ++ if (llvm->context_owned) ++ LLVMOrcDisposeThreadSafeContext(llvm->_ts_context); ++ llvm->_ts_context = NULL; ++ llvm->context = NULL; ++#else + if (llvm->context_owned) + LLVMContextDispose(llvm->context); + llvm->context = NULL; ++#endif + + /* XXX free other draw_llvm data? */ + FREE(llvm); +@@ -895,7 +918,11 @@ draw_llvm_create_variant(struct draw_llvm *llvm, + if (!cached.data_size) + needs_caching = true; + } ++#if GALLIVM_USE_ORCJIT == 1 ++ variant->gallivm = gallivm_create(module_name, llvm->_ts_context, &cached); ++#else + variant->gallivm = gallivm_create(module_name, llvm->context, &cached); ++#endif + + create_jit_types(variant); + +@@ -914,8 +941,13 @@ draw_llvm_create_variant(struct draw_llvm *llvm, + + gallivm_compile_module(variant->gallivm); + ++#if GALLIVM_USE_ORCJIT == 1 ++ variant->jit_func = (draw_jit_vert_func) ++ gallivm_jit_function(variant->gallivm, variant->function_name); ++#else + variant->jit_func = (draw_jit_vert_func) + gallivm_jit_function(variant->gallivm, variant->function); ++#endif + + if (needs_caching) + llvm->draw->disk_cache_insert_shader(llvm->draw->disk_cache_cookie, +@@ -1990,6 +2022,10 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant) + + variant_func = LLVMAddFunction(gallivm->module, func_name, func_type); + variant->function = variant_func; ++#if GALLIVM_USE_ORCJIT == 1 ++ variant->function_name = MALLOC(strlen(func_name)+1); ++ strcpy(variant->function_name, func_name); ++#endif + + LLVMSetFunctionCallConv(variant_func, LLVMCCallConv); + for (i = 0; i < num_arg_types; ++i) +@@ -2684,6 +2720,11 @@ draw_llvm_destroy_variant(struct draw_llvm_variant *variant) + variant->shader->variants_cached--; + list_del(&variant->list_item_global.list); + llvm->nr_variants--; ++ ++#if GALLIVM_USE_ORCJIT == 1 ++ if(variant->function_name) ++ FREE(variant->function_name); ++#endif + FREE(variant); + } + +@@ -2798,6 +2839,10 @@ draw_gs_llvm_generate(struct draw_llvm *llvm, + variant_func = LLVMAddFunction(gallivm->module, func_name, func_type); + + variant->function = variant_func; ++#if GALLIVM_USE_ORCJIT == 1 ++ variant->function_name = MALLOC(strlen(func_name)+1); ++ strcpy(variant->function_name, func_name); ++#endif + + LLVMSetFunctionCallConv(variant_func, LLVMCCallConv); + +@@ -2957,7 +3002,11 @@ draw_gs_llvm_create_variant(struct draw_llvm *llvm, + if (!cached.data_size) + needs_caching = true; + } ++#if GALLIVM_USE_ORCJIT == 1 ++ variant->gallivm = gallivm_create(module_name, llvm->_ts_context, &cached); ++#else + variant->gallivm = gallivm_create(module_name, llvm->context, &cached); ++#endif + + create_gs_jit_types(variant); + +@@ -2968,8 +3017,13 @@ draw_gs_llvm_create_variant(struct draw_llvm *llvm, + + gallivm_compile_module(variant->gallivm); + ++#if GALLIVM_USE_ORCJIT == 1 ++ variant->jit_func = (draw_gs_jit_func) ++ gallivm_jit_function(variant->gallivm, variant->function_name); ++#else + variant->jit_func = (draw_gs_jit_func) + gallivm_jit_function(variant->gallivm, variant->function); ++#endif + + if (needs_caching)
View file
_service:tar_scm:llvmpipe-add-riscv-support-in-orcjit.patch
Added
@@ -0,0 +1,136 @@ +From 337f91f990070b6a3251550c682fec5ffcce478c Mon Sep 17 00:00:00 2001 +From: Alex Fan <alex.fan.q@gmail.com> +Date: Fri, 29 Jul 2022 12:44:14 +1000 +Subject: PATCH llvmpipe: add riscv support in orcjit + +assume cpu supports extension +i,+m,+a,+f,+d,+c +--- + .../auxiliary/gallivm/lp_bld_init_orc.cpp | 58 ++++++++++++++++++- + src/util/detect_arch.h | 16 +++++ + 2 files changed, 73 insertions(+), 1 deletion(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp +index b245edc5586..eaacebd65d6 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp +@@ -48,7 +48,7 @@ + /* conflict with ObjectLinkingLayer.h */ + #include "util/u_memory.h" + +-#if (defined(_WIN32) && LLVM_VERSION_MAJOR >= 15) ++#if DETECT_ARCH_RISCV64 || DETECT_ARCH_RISCV32 || (defined(_WIN32) && LLVM_VERSION_MAJOR >= 15) + /* use ObjectLinkingLayer (JITLINK backend) */ + #define USE_JITLINK + #endif +@@ -521,6 +521,30 @@ llvm::orc::JITTargetMachineBuilder LPJit::create_jtdb() { + options.StackAlignmentOverride = 4; + #endif + ++#if DETECT_ARCH_RISCV64 ++#if defined(__riscv_float_abi_soft) ++ options.MCOptions.ABIName = "lp64"; ++#elif defined(__riscv_float_abi_single) ++ options.MCOptions.ABIName = "lp64f"; ++#elif defined(__riscv_float_abi_double) ++ options.MCOptions.ABIName = "lp64d"; ++#else ++#error "GALLIVM: unknown target riscv float abi" ++#endif ++#endif ++ ++#if DETECT_ARCH_RISCV32 ++#if defined(__riscv_float_abi_soft) ++ options.MCOptions.ABIName = "ilp32"; ++#elif defined(__riscv_float_abi_single) ++ options.MCOptions.ABIName = "ilp32f"; ++#elif defined(__riscv_float_abi_double) ++ options.MCOptions.ABIName = "ilp32d"; ++#else ++#error "GALLIVM: unknown target riscv float abi" ++#endif ++#endif ++ + JTMB.setOptions(options); + + std::vector<std::string> MAttrs; +@@ -619,6 +643,14 @@ llvm::orc::JITTargetMachineBuilder LPJit::create_jtdb() { + MAttrs.push_back("+fp64"); + #endif + ++#if DETECT_ARCH_RISCV64 ++ /* Before riscv is more matured and util_get_cpu_caps() is implemented, ++ * assume this for now since most of linux capable riscv machine are ++ * riscv64gc ++ */ ++ MAttrs = {"+m","+c","+a","+d","+f"}; ++#endif ++ + JTMB.addFeatures(MAttrs); + + if (gallivm_debug & (GALLIVM_DEBUG_IR | GALLIVM_DEBUG_ASM | GALLIVM_DEBUG_DUMP_BC)) { +@@ -686,6 +718,30 @@ llvm::orc::JITTargetMachineBuilder LPJit::create_jtdb() { + MCPU = util_get_cpu_caps()->has_msa ? "mips64r5" : "mips64r2"; + #endif + ++#if DETECT_ARCH_RISCV64 ++ /** ++ * should be fixed with https://reviews.llvm.org/D121149 in llvm 15, ++ * set it anyway for llvm 14 ++ */ ++ if (MCPU == "generic") ++ MCPU = "generic-rv64"; ++ ++ JTMB.setCodeModel(CodeModel::Medium); ++ JTMB.setRelocationModel(Reloc::PIC_); ++#endif ++ ++#if DETECT_ARCH_RISCV32 ++ /** ++ * should be fixed with https://reviews.llvm.org/D121149 in llvm 15, ++ * set it anyway for llvm 14 ++ */ ++ if (MCPU == "generic") ++ MCPU = "generic-rv32"; ++ ++ JTMB.setCodeModel(CodeModel::Medium); ++ JTMB.setRelocationModel(Reloc::PIC_); ++#endif ++ + JTMB.setCPU(MCPU); + if (gallivm_debug & (GALLIVM_DEBUG_IR | GALLIVM_DEBUG_ASM | GALLIVM_DEBUG_DUMP_BC)) { + debug_printf("llc -mcpu option: %s\n", MCPU.c_str()); +diff --git a/src/util/detect_arch.h b/src/util/detect_arch.h +index 334358fcc26..34c0928216d 100644 +--- a/src/util/detect_arch.h ++++ b/src/util/detect_arch.h +@@ -97,6 +97,14 @@ + #define DETECT_ARCH_MIPS 1 + #endif + ++#if defined(__riscv) ++#if __riscv_xlen == 64 ++#define DETECT_ARCH_RISCV64 1 ++#elif __riscv_xlen == 32 ++#define DETECT_ARCH_RISCV32 1 ++#endif ++#endif ++ + #ifndef DETECT_ARCH_X86 + #define DETECT_ARCH_X86 0 + #endif +@@ -137,4 +145,12 @@ + #define DETECT_ARCH_MIPS 0 + #endif + ++#ifndef DETECT_ARCH_RISCV32 ++#define DETECT_ARCH_RISCV32 0 ++#endif ++ ++#ifndef DETECT_ARCH_RISCV64 ++#define DETECT_ARCH_RISCV64 0 ++#endif ++ + #endif /* UTIL_DETECT_ARCH_H_ */ +-- +2.41.0 +
View file
_service:tar_scm:llvmpipe-make-unnamed-global-have-internal-linkage.patch
Added
@@ -0,0 +1,29 @@ +From 3148f08bd0207a8bd50ff5c8b82d7a5b0871c3d1 Mon Sep 17 00:00:00 2001 +From: Alex Fan <alex.fan.q@gmail.com> +Date: Mon, 28 Nov 2022 22:29:44 +1100 +Subject: PATCH llvmpipe: make unnamed global have internal linkage + +work around bug https://github.com/llvm/llvm-project/issues/54813 +Being unnamed makes it not useable from other module, therefore +changing to internal linkage is safe + +Signed-off-by: Alex Fan <alex.fan.q@gmail.com> +--- + src/gallium/drivers/llvmpipe/lp_state_fs.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c +index 2a5977134b0..5a396b44137 100644 +--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c ++++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c +@@ -3306,6 +3306,7 @@ generate_fragment(struct llvmpipe_context *lp, + LLVMValueRef glob_sample_pos = + LLVMAddGlobal(gallivm->module, + LLVMArrayType(flt_type, key->coverage_samples * 2), ""); ++ LLVMSetLinkage(glob_sample_pos, LLVMInternalLinkage); + LLVMValueRef sample_pos_array; + + if (key->multisample && key->coverage_samples == 4) { +-- +2.41.0 +
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2