From 4052dd1e331668d77578662278833660c4966780 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 16 Apr 2024 10:48:44 +0900 Subject: Add virgl option to use virtio_gpu Change-Id: I6cdb3bf3f105ca22f6adc48ad5076348f34ece41 Signed-off-by: Joonbum Ko --- packaging/mesa.spec | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/packaging/mesa.spec b/packaging/mesa.spec index daaf2907e75..3506be26734 100644 --- a/packaging/mesa.spec +++ b/packaging/mesa.spec @@ -39,10 +39,21 @@ ExclusiveArch: %define enable_driver() %{expand:%%{?!enable_%{1}: %%global enable_%{1} 1}} +%define append_drivers() %{?gallium_drivers: %global gallium_drivers %{expand:%{gallium_drivers}},%{expand:%{1}}}\ + %{?!gallium_drivers: %global gallium_drivers %{expand:%{1}}} + +%define enable_gallium_driver() \ + %append_drivers %{1} \ + %enable_driver %{1} + %ifarch %ix86 x86_64 -%define gallium_drivers "i915,swrast" +%enable_gallium_driver i915 +%enable_gallium_driver swrast +%enable_gallium_driver virgl + %define vulkan_drivers "" %define dri_drivers "" + %else %define USE_GBM 0 %define USE_VULKAN 1 @@ -53,11 +64,18 @@ ExclusiveArch: %if %{USE_VULKAN} == 1 %enable_driver vulkan %endif -%define gallium_drivers "vc4,v3d,kmsro,swrast" + +%enable_gallium_driver kmsro +%enable_gallium_driver swrast +%enable_gallium_driver vc4 +%enable_gallium_driver v3d +%enable_gallium_driver virgl + %define vulkan_drivers "%{?enable_vulkan:%{VULKAN_DRIVER}}" %define dri_drivers "auto" %endif +%{echo: enabled gallium drivers : %{expand:%{gallium_drivers}}} %description Mesa is a 3-D graphics library with an API which is very similar to @@ -99,7 +117,6 @@ meson --prefix %{_hal_prefix} build/ \ -Dgallium-drivers=%{gallium_drivers} \ -Dvulkan-drivers=%{vulkan_drivers} - ninja -C build/ %install @@ -127,7 +144,22 @@ cp COPYING %{buildroot}%{_hal_prefix}/share/licenses/%{name}/ %{_hal_prefix}/share/licenses/%{name}/COPYING %{_hal_libdir}/libglapi* %{_hal_libdir}/driver/* -%{_hal_libdir}/dri/* +%if %{expand:%{?enable_vc4:1}%{?!enable_vc4:0}} +%{_hal_libdir}/dri/vc4_dri.so +%endif +%if %{expand:%{?enable_v3d:1}%{?!enable_v3d:0}} +%{_hal_libdir}/dri/v3d_dri.so +%endif +%if %{expand:%{?enable_swrast:1}%{?!enable_swrast:0}} +%{_hal_libdir}/dri/swrast_dri.so +%endif +%if %{expand:%{?enable_virgl:1}%{?!enable_virgl:0}} +%{_hal_libdir}/dri/virtio_gpu_dri.so +%endif +%if %{expand:%{?enable_i915:1}%{?!enable_i915:0}} +%{_hal_libdir}/dri/i915_dri.so +%endif + %if "%{USE_GBM}" == "1" %{_hal_libdir}/libgbm* %endif -- cgit v1.2.3