control: tag 1004039 + patch

Hi,

On 2022-01-19 18:51, W.J. van der Laan wrote:
> Package: libgl1-mesa-dri
> Version: 21.3.4-1
> Severity: important
> X-Debbugs-Cc: laa...@protonmail.com
> 
> Dear Maintainer,
> 
> The package libgl1-mesa-dri_*_riscv64.deb doesn't contain radeonsi_dri.so on
> riscv64, as it does for other platforms. This driver is required for 3D
> acceleration on newer AMD graphics cards.
> 
> What we suspect to be the cause is the following change in mesa packaging
>  
>       [ Aurelien Jarno ]
>       * Disable LLVM support on riscv64, it doesn't have JIT. (Closes: 
> #995618)
> 
>      -- Timo Aaltonen <tjaal...@debian.org>  Mon, 04 Oct 2021 15:18:27 +0300
> 
> LLVM is used to compile shaders for the GPU, as this is a kind of 
> cross-compiling
> it's not affected by the lack of JIT for riscv64. Removing LLVM on the other 
> hand
> makes that the driver is no longer being built.

Sorry about that. Disabling LLVM means that GPU support is not enabled,
but on the other hand enabling LLVM means that applications just crash
on video cards without acceleration. We need to find a way to get both
kind of systems working correctly.

After discussing with Jessica, it seems we can enable LLVM, but
disabling anything that needs CPU JIT support. It seems that is achieved
by disabling swrast on the Vulkan side and disabling draw-use-llvm on
the Gallium side. I therefore ended-up with the attached patch with does
that in addition to reenable LLVM support, and that works well for
software rendering on the CPU.

Regards,
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurel...@aurel32.net                 http://www.aurel32.net
diff -u mesa-21.3.4/debian/control mesa-21.3.4/debian/control
--- mesa-21.3.4/debian/control
+++ mesa-21.3.4/debian/control
@@ -43,10 +43,10 @@
  libelf-dev [amd64 arm64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64],
  libwayland-dev (>= 1.15.0) [linux-any],
  libwayland-egl-backend-dev (>= 1.15.0) [linux-any],
- llvm-13-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64],
- libclang-13-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64],
- libclang-cpp13-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64],
- libclc-13-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64],
+ llvm-13-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64],
+ libclang-13-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64],
+ libclang-cpp13-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64],
+ libclc-13-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64],
  wayland-protocols (>= 1.9),
  zlib1g-dev,
  libglvnd-core-dev (>= 1.3.2),
@@ -412,7 +412,7 @@
 
 Package: mesa-opencl-icd
 Section: libs
-Architecture: amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64
+Architecture: amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64
 Pre-Depends: ${misc:Pre-Depends}
 Depends:
  libclc-13,
diff -u mesa-21.3.4/debian/rules mesa-21.3.4/debian/rules
--- mesa-21.3.4/debian/rules
+++ mesa-21.3.4/debian/rules
@@ -63,6 +63,10 @@
   ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64))
 	VULKAN_DRIVERS += amd swrast
   endif
+  # Only enable amd on riscv64, swrast needs CPU JIT support which doesn't work yet
+  ifneq (,$(filter $(DEB_HOST_ARCH), riscv64))
+	VULKAN_DRIVERS += amd
+  endif
 
   ifeq ($(DEB_HOST_ARCH_OS), linux)
 	confflags_DRI3 = -Ddri3=enabled
@@ -111,7 +115,7 @@
 
   # LLVM is required for building r300g, radeonsi and llvmpipe drivers.
   # It's also required for building OpenCL support.
-  ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64))
+  ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64))
 	GALLIUM_DRIVERS += radeonsi
 	confflags_GALLIUM += -Dllvm=enabled
 	confflags_GALLIUM += -Dgallium-opencl=icd
@@ -133,6 +137,11 @@
   ifeq (,$(filter pkg.mesa.nolibva,$(DEB_BUILD_PROFILES)))
 	confflags_GALLIUM += -Dgallium-va=enabled
   endif
+
+  # llvmpipe needs CPU JIT support which doesn't work yet
+  ifneq (,$(filter $(DEB_HOST_ARCH), riscv64))
+        confflags_GALLIUM += -Ddraw-use-llvm=false
+  endif
 endif
 
 

Reply via email to