[PATCH mesa-branch 0/4] Mesa update plus various fixes and cleanups.

  • Done
  • quality assurance status badge
Details
3 participants
  • Kaelyn Takata
  • Brendan Tildesley
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Kaelyn Takata
Severity
normal

Debbugs page

Kaelyn Takata wrote 2 years ago
(address . guix-patches@gnu.org)(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
cover.1682984719.git.kaelyn.alexi@protonmail.com
This is a small collection of fixes and cleanups for mesa, along with updating
it to the latest release.

Issues that should be resolved by the series include:

I've done some cursory testing so far, such as checking glxinfo, vulkaninfo
(from vulkan-tools), vainfo (from libva-utils), and vdpauinfo, and playing
h264 and h265 videos with hardware acceleration using an mpv built against the
updated mesa.

Cheers,
Kaelyn


Kaelyn Takata (4):
gnu: mesa: Fix library paths in Vulkan layer manifests.
gnu: mesa: Use gexps instead of quasiquote.
gnu: mesa: Fix hardware video decoding.
gnu: mesa: Update to 23.0.3.

gnu/local.mk | 1 -
gnu/packages/gl.scm | 81 +++++++++++++------
.../mesa-fix-sporadic-test-failures.patch | 27 -------
3 files changed, 55 insertions(+), 54 deletions(-)
delete mode 100644 gnu/packages/patches/mesa-fix-sporadic-test-failures.patch


base-commit: f21007ce4aceeacf5bbfc7cd45d526073141f194
--
2.39.2
Kaelyn Takata wrote 2 years ago
[PATCH mesa-branch 1/4] gnu: mesa: Fix library paths in Vulkan layer manifests.
(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
d1866a8bead520c34cb08890e914ec9590f36090.1682984719.git.kaelyn.alexi@protonmail.com
* gnu/packages/gl.scm (mesa): Fix library paths in Vulkan layer manifests.
---
gnu/packages/gl.scm | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 3a63d70c7a..6521170ebb 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2023 Kaelyn Takata <kaelyn.alexi@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -488,7 +489,28 @@ (define-public mesa
file)
(symlink reference file)))
others))))
- (delete-duplicates inodes))))))))
+ (delete-duplicates inodes)))))
+ (add-after 'install 'set-layer-path-in-manifests
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (implicit-path (string-append
+ out
+ "/share/vulkan/implicit_layer.d/"))
+ (explicit-path (string-append
+ out
+ "/share/vulkan/explicit_layer.d/"))
+ (fix-layer-path
+ (lambda (layer-name)
+ (let* ((explicit (string-append explicit-path layer-name ".json"))
+ (implicit (string-append implicit-path layer-name ".json"))
+ (manifest (if (file-exists? explicit)
+ explicit
+ implicit)))
+ (substitute* manifest
+ (((string-append "\"lib" layer-name ".so\""))
+ (string-append "\"" out "/lib/lib" layer-name ".so\"")))))))
+ (for-each fix-layer-path '("VkLayer_MESA_device_select"
+ "VkLayer_MESA_overlay"))))))))
(home-page "https://mesa3d.org/")
(synopsis "OpenGL and Vulkan implementations")
(description "Mesa is a free implementation of the OpenGL and Vulkan
--
2.39.2
Kaelyn Takata wrote 2 years ago
[PATCH mesa-branch 3/4] gnu: mesa: Fix hardware video decoding.
(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
ca99f6a48bf035f49e8a828db800b071424a2e72.1682984719.git.kaelyn.alexi@protonmail.com
* gnu/packages/gl.scm (mesa): Fix hardware video decoding.
[arguments]: Add -Dvideo-codecs to the #:configure-flags
[native-search-paths]: Add VDPAU_DRIVER_PATH so libvdpau can find the drivers.
---
gnu/packages/gl.scm | 9 +++++++++
1 file changed, 9 insertions(+)

Toggle diff (27 lines)
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 3d6d1e2ab5..09a1df4936 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -362,6 +362,10 @@ (define-public mesa
;; Enable the Vulkan overlay layer on all architectures.
"-Dvulkan-layers=device-select,overlay"

+ ;; Enable the codecs that were built by default as part of the
+ ;; 21.3.x releases to avoid functionality regressions.
+ "-Dvideo-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc"
+
;; Also enable the tests.
"-Dbuild-tests=true"

@@ -513,6 +517,11 @@ (define-public mesa
(string-append "\"" out "/lib/lib" layer-name ".so\"")))))))
(for-each fix-layer-path '("VkLayer_MESA_device_select"
"VkLayer_MESA_overlay"))))))))
+ (native-search-paths
+ (list (search-path-specification
+ ;; Ensure the Mesa VDPAU drivers can be found.
+ (variable "VDPAU_DRIVER_PATH")
+ (files '("lib/vdpau")))))
(home-page "https://mesa3d.org/")
(synopsis "OpenGL and Vulkan implementations")
(description "Mesa is a free implementation of the OpenGL and Vulkan
--
2.39.2
Kaelyn Takata wrote 2 years ago
[PATCH mesa-branch 2/4] gnu: mesa: Use gexps instead of quasiquote.
(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
4742c9c59e960506b3badea201fea6754e7aef8e.1682984719.git.kaelyn.alexi@protonmail.com
* gnu/packages/gl.scm (mesa)[arguments]: Use gexps instead of quasiquote.
---
gnu/packages/gl.scm | 38 ++++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)

Toggle diff (104 lines)
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 6521170ebb..3d6d1e2ab5 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -315,8 +315,10 @@ (define-public mesa
(@ (gnu packages base) which)))
(outputs '("out" "bin"))
(arguments
- `(#:configure-flags
- '(,@(match (%current-system)
+ (list
+ #:configure-flags
+ #~(list
+ #$@(match (%current-system)
("aarch64-linux"
;; TODO: Fix svga driver for non-Intel architectures.
'("-Dgallium-drivers=etnaviv,freedreno,kmsro,lima,nouveau,\
@@ -345,7 +347,7 @@ (define-public mesa
"-Dshared-glapi=enabled"

;; Explicitly enable Vulkan on some architectures.
- ,@(match (%current-system)
+ #$@(match (%current-system)
((or "i686-linux" "x86_64-linux")
'("-Dvulkan-drivers=intel,amd"))
((or "powerpc64le-linux" "powerpc-linux")
@@ -369,12 +371,12 @@ (define-public mesa
;; documentation recommends using 'release' for performance anyway.
#:build-type "release"

- #:modules ((ice-9 match)
- (srfi srfi-1)
- (guix build utils)
- (guix build meson-build-system))
+ #:modules '((ice-9 match)
+ (srfi srfi-1)
+ (guix build utils)
+ (guix build meson-build-system))
#:phases
- (modify-phases %standard-phases
+ #~(modify-phases %standard-phases
(add-after 'unpack 'disable-failing-test
(lambda _
;; Disable the intel vulkan (anv_state_pool) tests, as they may
@@ -383,7 +385,7 @@ (define-public mesa
(substitute* "src/intel/vulkan/meson.build"
(("if with_tests")
"if false"))
- ,@(match (%current-system)
+ #$@(match (%current-system)
("riscv64-linux"
;; According to the test logs the llvm JIT is not designed
;; for this architecture and the llvmpipe tests all segfault.
@@ -428,8 +430,8 @@ (define-public mesa
(_
'((display "No tests to disable on this architecture.\n"))))))
(add-before 'configure 'fix-dlopen-libnames
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
+ (lambda _
+ (let ((out #$output))
;; Remain agnostic to .so.X.Y.Z versions while doing
;; the substitutions so we're future-safe.
(substitute* "src/glx/meson.build"
@@ -446,9 +448,9 @@ (define-public mesa
(("\"gbm_dri\\.so")
(string-append "\"" out "/lib/dri/gbm_dri.so"))))))
(add-after 'install 'split-outputs
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (bin (assoc-ref outputs "bin")))
+ (lambda _
+ (let ((out #$output)
+ (bin #$output:bin))
;; Not all architectures have the Vulkan overlay control script.
(mkdir-p (string-append out "/bin"))
(call-with-output-file (string-append out "/bin/.empty")
@@ -457,13 +459,13 @@ (define-public mesa
(string-append bin "/bin"))
(delete-file-recursively (string-append out "/bin")))))
(add-after 'install 'symlinks-instead-of-hard-links
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda _
;; All the drivers and gallium targets create hard links upon
;; installation (search for "hardlink each megadriver instance"
;; in the makefiles). This is no good for us since we'd produce
;; nars that contain several copies of these files. Thus, turn
;; them into symlinks, which saves ~124 MiB.
- (let* ((out (assoc-ref outputs "out"))
+ (let* ((out #$output)
(lib (string-append out "/lib"))
(files (find-files lib
(lambda (file stat)
@@ -491,8 +493,8 @@ (define-public mesa
others))))
(delete-duplicates inodes)))))
(add-after 'install 'set-layer-path-in-manifests
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
+ (lambda _
+ (let* ((out #$output)
(implicit-path (string-append
out
"/share/vulkan/implicit_layer.d/"))
--
2.39.2
Kaelyn Takata wrote 2 years ago
[PATCH mesa-branch 4/4] gnu: mesa: Update to 23.0.3.
(address . 63219@debbugs.gnu.org)(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
f97a95976c031cb7c8a3580b1882e6bd381873b0.1682984719.git.kaelyn.alexi@protonmail.com
* gnu/packages/gl.scm (mesa): Update to 23.0.3.
[source]: Remove obsolete patch and update HTTPS url.
[arguments]: Enable the crocus gallium driver.
* gnu/packages/patches/mesa-fix-sporadic-test-failures.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): Remove it.
---
gnu/local.mk | 1 -
gnu/packages/gl.scm | 14 ++++------
.../mesa-fix-sporadic-test-failures.patch | 27 -------------------
3 files changed, 5 insertions(+), 37 deletions(-)
delete mode 100644 gnu/packages/patches/mesa-fix-sporadic-test-failures.patch

Toggle diff (84 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 4976b5c740..cb260e4ece 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1558,7 +1558,6 @@ dist_patch_DATA = \
%D%/packages/patches/mercurial-hg-extension-path.patch \
%D%/packages/patches/mercurial-openssl-compat.patch \
%D%/packages/patches/mesa-opencl-all-targets.patch \
- %D%/packages/patches/mesa-fix-sporadic-test-failures.patch \
%D%/packages/patches/mhash-keygen-test-segfault.patch \
%D%/packages/patches/mia-fix-boost-headers.patch \
%D%/packages/patches/mia-vtk9.patch \
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 09a1df4936..e93f21c374 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -267,21 +267,17 @@ (define libva-without-mesa
(define-public mesa
(package
(name "mesa")
- (version "22.2.4")
+ (version "23.0.3")
(source
(origin
(method url-fetch)
- (uri (list (string-append "https://mesa.freedesktop.org/archive/"
+ (uri (list (string-append "https://archive.mesa3d.org/"
"mesa-" version ".tar.xz")
(string-append "ftp://ftp.freedesktop.org/pub/mesa/"
- "mesa-" version ".tar.xz")
- (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
- version "/mesa-" version ".tar.xz")))
+ "mesa-" version ".tar.xz")))
(sha256
(base32
- "1azpr68pdg63yq3igmzwsgn2ypg49m0mp3hfkq0lcyswr99npmv5"))
- (patches
- (list (search-patch "mesa-fix-sporadic-test-failures.patch")))))
+ "1mcjf41x2bhxs6yxars7nh2vfryfw50g6rvbcfbb1wqdv2jn4qrq"))))
(build-system meson-build-system)
(propagated-inputs
;; The following are in the Requires.private field of gl.pc.
@@ -330,7 +326,7 @@ (define-public mesa
((or "powerpc64le-linux" "powerpc-linux" "riscv64-linux")
'("-Dgallium-drivers=nouveau,r300,r600,radeonsi,swrast,virgl"))
(_
- '("-Dgallium-drivers=iris,nouveau,r300,r600,radeonsi,\
+ '("-Dgallium-drivers=crocus,iris,nouveau,r300,r600,radeonsi,\
svga,swrast,virgl")))
;; Enable various optional features. TODO: opencl requires libclc,
;; omx requires libomxil-bellagio
diff --git a/gnu/packages/patches/mesa-fix-sporadic-test-failures.patch b/gnu/packages/patches/mesa-fix-sporadic-test-failures.patch
deleted file mode 100644
index 50ac5530a2..0000000000
--- a/gnu/packages/patches/mesa-fix-sporadic-test-failures.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 7749599d737d205a88bbb6fa755ba095d9b581fa
-Author: Gert Wollny <gert.wollny@collabora.com>
-Date: Mon Aug 15 17:15:43 2022 +0200
-
- r600/sfn: Initialize out buffer when printing op
-
- 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
- r600/sfn: rewrite NIR backend
-
- Closes: #7021
-
- Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
- Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
-
-diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp b/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp
-index 3d40ea1796a..00826ed6457 100644
---- a/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp
-+++ b/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp
-@@ -206,7 +206,7 @@ bool WriteScratchInstr::do_ready() const
-
- void WriteScratchInstr::do_print(std::ostream& os) const
- {
-- char buf[6];
-+ char buf[6] = {0};
-
- os << "WRITE_SCRATCH ";
- if (m_address)
--
2.39.2
Kaelyn Takata wrote 2 years ago
[PATCH mesa-branch v2 2/4] gnu: mesa: Use gexps instead of quasiquote.
(address . 63219@debbugs.gnu.org)(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
25a13f2aeea918cbee30449f2c216f7f436d568e.1683002606.git.kaelyn.alexi@protonmail.com
* gnu/packages/gl.scm (mesa)[arguments]: Use gexps instead of quasiquote.
---
gnu/packages/gl.scm | 48 +++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 23 deletions(-)

Toggle diff (136 lines)
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 6521170ebb..f705b864f1 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -315,8 +315,10 @@ (define-public mesa
(@ (gnu packages base) which)))
(outputs '("out" "bin"))
(arguments
- `(#:configure-flags
- '(,@(match (%current-system)
+ (list
+ #:configure-flags
+ #~(list
+ #$@(match (%current-system)
("aarch64-linux"
;; TODO: Fix svga driver for non-Intel architectures.
'("-Dgallium-drivers=etnaviv,freedreno,kmsro,lima,nouveau,\
@@ -345,7 +347,7 @@ (define-public mesa
"-Dshared-glapi=enabled"

;; Explicitly enable Vulkan on some architectures.
- ,@(match (%current-system)
+ #$@(match (%current-system)
((or "i686-linux" "x86_64-linux")
'("-Dvulkan-drivers=intel,amd"))
((or "powerpc64le-linux" "powerpc-linux")
@@ -369,12 +371,12 @@ (define-public mesa
;; documentation recommends using 'release' for performance anyway.
#:build-type "release"

- #:modules ((ice-9 match)
- (srfi srfi-1)
- (guix build utils)
- (guix build meson-build-system))
+ #:modules '((ice-9 match)
+ (srfi srfi-1)
+ (guix build utils)
+ (guix build meson-build-system))
#:phases
- (modify-phases %standard-phases
+ #~(modify-phases %standard-phases
(add-after 'unpack 'disable-failing-test
(lambda _
;; Disable the intel vulkan (anv_state_pool) tests, as they may
@@ -383,7 +385,7 @@ (define-public mesa
(substitute* "src/intel/vulkan/meson.build"
(("if with_tests")
"if false"))
- ,@(match (%current-system)
+ #$@(match (%current-system)
("riscv64-linux"
;; According to the test logs the llvm JIT is not designed
;; for this architecture and the llvmpipe tests all segfault.
@@ -428,8 +430,8 @@ (define-public mesa
(_
'((display "No tests to disable on this architecture.\n"))))))
(add-before 'configure 'fix-dlopen-libnames
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
+ (lambda _
+ (let ((out #$output))
;; Remain agnostic to .so.X.Y.Z versions while doing
;; the substitutions so we're future-safe.
(substitute* "src/glx/meson.build"
@@ -446,9 +448,9 @@ (define-public mesa
(("\"gbm_dri\\.so")
(string-append "\"" out "/lib/dri/gbm_dri.so"))))))
(add-after 'install 'split-outputs
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (bin (assoc-ref outputs "bin")))
+ (lambda _
+ (let ((out #$output)
+ (bin #$output:bin))
;; Not all architectures have the Vulkan overlay control script.
(mkdir-p (string-append out "/bin"))
(call-with-output-file (string-append out "/bin/.empty")
@@ -457,13 +459,13 @@ (define-public mesa
(string-append bin "/bin"))
(delete-file-recursively (string-append out "/bin")))))
(add-after 'install 'symlinks-instead-of-hard-links
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda _
;; All the drivers and gallium targets create hard links upon
;; installation (search for "hardlink each megadriver instance"
;; in the makefiles). This is no good for us since we'd produce
;; nars that contain several copies of these files. Thus, turn
;; them into symlinks, which saves ~124 MiB.
- (let* ((out (assoc-ref outputs "out"))
+ (let* ((out #$output)
(lib (string-append out "/lib"))
(files (find-files lib
(lambda (file stat)
@@ -491,8 +493,8 @@ (define-public mesa
others))))
(delete-duplicates inodes)))))
(add-after 'install 'set-layer-path-in-manifests
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
+ (lambda _
+ (let* ((out #$output)
(implicit-path (string-append
out
"/share/vulkan/implicit_layer.d/"))
@@ -529,7 +531,7 @@ (define-public mesa-opencl
(arguments
(substitute-keyword-arguments (package-arguments mesa)
((#:configure-flags flags)
- `(cons "-Dgallium-opencl=standalone" ,flags))))
+ #~(cons "-Dgallium-opencl=standalone" #$flags))))
(inputs
(modify-inputs (package-inputs mesa)
(prepend libclc)))
@@ -543,10 +545,10 @@ (define-public mesa-opencl-icd
(arguments
(substitute-keyword-arguments (package-arguments mesa)
((#:configure-flags flags)
- `(cons "-Dgallium-opencl=icd"
- ,(delete "-Dgallium-opencl=standalone" flags)))
+ #~(cons "-Dgallium-opencl=icd"
+ (delete "-Dgallium-opencl=standalone" #$flags)))
((#:phases phases)
- `(modify-phases ,phases
+ #~(modify-phases #$phases
(add-after 'install 'mesa-icd-absolute-path
(lambda _
;; Use absolute path for OpenCL platform library.
@@ -554,7 +556,7 @@ (define-public mesa-opencl-icd
;; for ICD in our applications to find OpenCL platform.
(use-modules (guix build utils)
(ice-9 textual-ports))
- (let* ((out (assoc-ref %outputs "out"))
+ (let* ((out #$output)
(mesa-icd (string-append out "/etc/OpenCL/vendors/mesa.icd"))
(old-path (call-with-input-file mesa-icd get-string-all))
(new-path (string-append out "/lib/" (string-trim-both old-path))))
--
2.39.2
Kaelyn Takata wrote 2 years ago
[PATCH mesa-branch v3 0/4] Mesa update plus various fixes and cleanups.
(address . 63219@debbugs.gnu.org)(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
cover.1683230943.git.kaelyn.alexi@protonmail.com
v2:
* updated gexp patch to also use gexps in the packages inheriting from mesa.

v3:
* rebased and properly re-sent.

Kaelyn Takata (4):
gnu: mesa: Fix library paths in Vulkan layer manifests.
gnu: mesa: Use gexps instead of quasiquote.
gnu: mesa: Fix hardware video decoding.
gnu: mesa: Update to 23.0.3.

gnu/local.mk | 1 -
gnu/packages/gl.scm | 91 ++++++++++++-------
.../mesa-fix-sporadic-test-failures.patch | 27 ------
3 files changed, 60 insertions(+), 59 deletions(-)
delete mode 100644 gnu/packages/patches/mesa-fix-sporadic-test-failures.patch


base-commit: 0584f5b48987c058e2dd694c2bc886b7aa40e15d
--
2.39.2
Kaelyn Takata wrote 2 years ago
[PATCH mesa-branch v3 1/4] gnu: mesa: Fix library paths in Vulkan layer manifests.
(address . 63219@debbugs.gnu.org)(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
4b3b466bdacfc3c1196ce0a7198559a52c0a020d.1683230943.git.kaelyn.alexi@protonmail.com
* gnu/packages/gl.scm (mesa): Fix library paths in Vulkan layer manifests.
---
gnu/packages/gl.scm | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 3a63d70c7a..6521170ebb 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2023 Kaelyn Takata <kaelyn.alexi@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -488,7 +489,28 @@ (define-public mesa
file)
(symlink reference file)))
others))))
- (delete-duplicates inodes))))))))
+ (delete-duplicates inodes)))))
+ (add-after 'install 'set-layer-path-in-manifests
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (implicit-path (string-append
+ out
+ "/share/vulkan/implicit_layer.d/"))
+ (explicit-path (string-append
+ out
+ "/share/vulkan/explicit_layer.d/"))
+ (fix-layer-path
+ (lambda (layer-name)
+ (let* ((explicit (string-append explicit-path layer-name ".json"))
+ (implicit (string-append implicit-path layer-name ".json"))
+ (manifest (if (file-exists? explicit)
+ explicit
+ implicit)))
+ (substitute* manifest
+ (((string-append "\"lib" layer-name ".so\""))
+ (string-append "\"" out "/lib/lib" layer-name ".so\"")))))))
+ (for-each fix-layer-path '("VkLayer_MESA_device_select"
+ "VkLayer_MESA_overlay"))))))))
(home-page "https://mesa3d.org/")
(synopsis "OpenGL and Vulkan implementations")
(description "Mesa is a free implementation of the OpenGL and Vulkan
--
2.39.2
Kaelyn Takata wrote 2 years ago
[PATCH mesa-branch v3 3/4] gnu: mesa: Fix hardware video decoding.
(address . 63219@debbugs.gnu.org)(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
50d525c2c364d0a64c92b4f956eab304e370e102.1683230943.git.kaelyn.alexi@protonmail.com
* gnu/packages/gl.scm (mesa): Fix hardware video decoding.
[arguments]: Add -Dvideo-codecs to the #:configure-flags
[native-search-paths]: Add VDPAU_DRIVER_PATH so libvdpau can find the drivers.
---
gnu/packages/gl.scm | 9 +++++++++
1 file changed, 9 insertions(+)

Toggle diff (27 lines)
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index f705b864f1..5248151a95 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -362,6 +362,10 @@ (define-public mesa
;; Enable the Vulkan overlay layer on all architectures.
"-Dvulkan-layers=device-select,overlay"

+ ;; Enable the codecs that were built by default as part of the
+ ;; 21.3.x releases to avoid functionality regressions.
+ "-Dvideo-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc"
+
;; Also enable the tests.
"-Dbuild-tests=true"

@@ -513,6 +517,11 @@ (define-public mesa
(string-append "\"" out "/lib/lib" layer-name ".so\"")))))))
(for-each fix-layer-path '("VkLayer_MESA_device_select"
"VkLayer_MESA_overlay"))))))))
+ (native-search-paths
+ (list (search-path-specification
+ ;; Ensure the Mesa VDPAU drivers can be found.
+ (variable "VDPAU_DRIVER_PATH")
+ (files '("lib/vdpau")))))
(home-page "https://mesa3d.org/")
(synopsis "OpenGL and Vulkan implementations")
(description "Mesa is a free implementation of the OpenGL and Vulkan
--
2.39.2
Kaelyn Takata wrote 2 years ago
[PATCH mesa-branch v3 2/4] gnu: mesa: Use gexps instead of quasiquote.
(address . 63219@debbugs.gnu.org)(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
7ff21afd6c6446d9f986ecf6982b41722fed81ac.1683230943.git.kaelyn.alexi@protonmail.com
* gnu/packages/gl.scm (mesa)[arguments]: Use gexps instead of quasiquote.
---
gnu/packages/gl.scm | 48 +++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 23 deletions(-)

Toggle diff (136 lines)
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 6521170ebb..f705b864f1 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -315,8 +315,10 @@ (define-public mesa
(@ (gnu packages base) which)))
(outputs '("out" "bin"))
(arguments
- `(#:configure-flags
- '(,@(match (%current-system)
+ (list
+ #:configure-flags
+ #~(list
+ #$@(match (%current-system)
("aarch64-linux"
;; TODO: Fix svga driver for non-Intel architectures.
'("-Dgallium-drivers=etnaviv,freedreno,kmsro,lima,nouveau,\
@@ -345,7 +347,7 @@ (define-public mesa
"-Dshared-glapi=enabled"

;; Explicitly enable Vulkan on some architectures.
- ,@(match (%current-system)
+ #$@(match (%current-system)
((or "i686-linux" "x86_64-linux")
'("-Dvulkan-drivers=intel,amd"))
((or "powerpc64le-linux" "powerpc-linux")
@@ -369,12 +371,12 @@ (define-public mesa
;; documentation recommends using 'release' for performance anyway.
#:build-type "release"

- #:modules ((ice-9 match)
- (srfi srfi-1)
- (guix build utils)
- (guix build meson-build-system))
+ #:modules '((ice-9 match)
+ (srfi srfi-1)
+ (guix build utils)
+ (guix build meson-build-system))
#:phases
- (modify-phases %standard-phases
+ #~(modify-phases %standard-phases
(add-after 'unpack 'disable-failing-test
(lambda _
;; Disable the intel vulkan (anv_state_pool) tests, as they may
@@ -383,7 +385,7 @@ (define-public mesa
(substitute* "src/intel/vulkan/meson.build"
(("if with_tests")
"if false"))
- ,@(match (%current-system)
+ #$@(match (%current-system)
("riscv64-linux"
;; According to the test logs the llvm JIT is not designed
;; for this architecture and the llvmpipe tests all segfault.
@@ -428,8 +430,8 @@ (define-public mesa
(_
'((display "No tests to disable on this architecture.\n"))))))
(add-before 'configure 'fix-dlopen-libnames
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
+ (lambda _
+ (let ((out #$output))
;; Remain agnostic to .so.X.Y.Z versions while doing
;; the substitutions so we're future-safe.
(substitute* "src/glx/meson.build"
@@ -446,9 +448,9 @@ (define-public mesa
(("\"gbm_dri\\.so")
(string-append "\"" out "/lib/dri/gbm_dri.so"))))))
(add-after 'install 'split-outputs
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (bin (assoc-ref outputs "bin")))
+ (lambda _
+ (let ((out #$output)
+ (bin #$output:bin))
;; Not all architectures have the Vulkan overlay control script.
(mkdir-p (string-append out "/bin"))
(call-with-output-file (string-append out "/bin/.empty")
@@ -457,13 +459,13 @@ (define-public mesa
(string-append bin "/bin"))
(delete-file-recursively (string-append out "/bin")))))
(add-after 'install 'symlinks-instead-of-hard-links
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda _
;; All the drivers and gallium targets create hard links upon
;; installation (search for "hardlink each megadriver instance"
;; in the makefiles). This is no good for us since we'd produce
;; nars that contain several copies of these files. Thus, turn
;; them into symlinks, which saves ~124 MiB.
- (let* ((out (assoc-ref outputs "out"))
+ (let* ((out #$output)
(lib (string-append out "/lib"))
(files (find-files lib
(lambda (file stat)
@@ -491,8 +493,8 @@ (define-public mesa
others))))
(delete-duplicates inodes)))))
(add-after 'install 'set-layer-path-in-manifests
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
+ (lambda _
+ (let* ((out #$output)
(implicit-path (string-append
out
"/share/vulkan/implicit_layer.d/"))
@@ -529,7 +531,7 @@ (define-public mesa-opencl
(arguments
(substitute-keyword-arguments (package-arguments mesa)
((#:configure-flags flags)
- `(cons "-Dgallium-opencl=standalone" ,flags))))
+ #~(cons "-Dgallium-opencl=standalone" #$flags))))
(inputs
(modify-inputs (package-inputs mesa)
(prepend libclc)))
@@ -543,10 +545,10 @@ (define-public mesa-opencl-icd
(arguments
(substitute-keyword-arguments (package-arguments mesa)
((#:configure-flags flags)
- `(cons "-Dgallium-opencl=icd"
- ,(delete "-Dgallium-opencl=standalone" flags)))
+ #~(cons "-Dgallium-opencl=icd"
+ (delete "-Dgallium-opencl=standalone" #$flags)))
((#:phases phases)
- `(modify-phases ,phases
+ #~(modify-phases #$phases
(add-after 'install 'mesa-icd-absolute-path
(lambda _
;; Use absolute path for OpenCL platform library.
@@ -554,7 +556,7 @@ (define-public mesa-opencl-icd
;; for ICD in our applications to find OpenCL platform.
(use-modules (guix build utils)
(ice-9 textual-ports))
- (let* ((out (assoc-ref %outputs "out"))
+ (let* ((out #$output)
(mesa-icd (string-append out "/etc/OpenCL/vendors/mesa.icd"))
(old-path (call-with-input-file mesa-icd get-string-all))
(new-path (string-append out "/lib/" (string-trim-both old-path))))
--
2.39.2
Kaelyn Takata wrote 2 years ago
[PATCH mesa-branch v3 4/4] gnu: mesa: Update to 23.0.3.
(address . 63219@debbugs.gnu.org)(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
ca8644d98b40fb680062e7c1963f9a3e782754e8.1683230943.git.kaelyn.alexi@protonmail.com
* gnu/packages/gl.scm (mesa): Update to 23.0.3.
[source]: Remove obsolete patch and update HTTPS url.
[arguments]: Enable the crocus gallium driver.
* gnu/packages/patches/mesa-fix-sporadic-test-failures.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): Remove it.
---
gnu/local.mk | 1 -
gnu/packages/gl.scm | 14 ++++------
.../mesa-fix-sporadic-test-failures.patch | 27 -------------------
3 files changed, 5 insertions(+), 37 deletions(-)
delete mode 100644 gnu/packages/patches/mesa-fix-sporadic-test-failures.patch

Toggle diff (84 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 5f5de953d7..9a801f3f3e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1559,7 +1559,6 @@ dist_patch_DATA = \
%D%/packages/patches/mercurial-hg-extension-path.patch \
%D%/packages/patches/mercurial-openssl-compat.patch \
%D%/packages/patches/mesa-opencl-all-targets.patch \
- %D%/packages/patches/mesa-fix-sporadic-test-failures.patch \
%D%/packages/patches/mhash-keygen-test-segfault.patch \
%D%/packages/patches/mia-fix-boost-headers.patch \
%D%/packages/patches/mia-vtk9.patch \
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 5248151a95..235b386dad 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -267,21 +267,17 @@ (define libva-without-mesa
(define-public mesa
(package
(name "mesa")
- (version "22.2.4")
+ (version "23.0.3")
(source
(origin
(method url-fetch)
- (uri (list (string-append "https://mesa.freedesktop.org/archive/"
+ (uri (list (string-append "https://archive.mesa3d.org/"
"mesa-" version ".tar.xz")
(string-append "ftp://ftp.freedesktop.org/pub/mesa/"
- "mesa-" version ".tar.xz")
- (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
- version "/mesa-" version ".tar.xz")))
+ "mesa-" version ".tar.xz")))
(sha256
(base32
- "1azpr68pdg63yq3igmzwsgn2ypg49m0mp3hfkq0lcyswr99npmv5"))
- (patches
- (list (search-patch "mesa-fix-sporadic-test-failures.patch")))))
+ "1mcjf41x2bhxs6yxars7nh2vfryfw50g6rvbcfbb1wqdv2jn4qrq"))))
(build-system meson-build-system)
(propagated-inputs
;; The following are in the Requires.private field of gl.pc.
@@ -330,7 +326,7 @@ (define-public mesa
((or "powerpc64le-linux" "powerpc-linux" "riscv64-linux")
'("-Dgallium-drivers=nouveau,r300,r600,radeonsi,swrast,virgl"))
(_
- '("-Dgallium-drivers=iris,nouveau,r300,r600,radeonsi,\
+ '("-Dgallium-drivers=crocus,iris,nouveau,r300,r600,radeonsi,\
svga,swrast,virgl")))
;; Enable various optional features. TODO: opencl requires libclc,
;; omx requires libomxil-bellagio
diff --git a/gnu/packages/patches/mesa-fix-sporadic-test-failures.patch b/gnu/packages/patches/mesa-fix-sporadic-test-failures.patch
deleted file mode 100644
index 50ac5530a2..0000000000
--- a/gnu/packages/patches/mesa-fix-sporadic-test-failures.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit 7749599d737d205a88bbb6fa755ba095d9b581fa
-Author: Gert Wollny <gert.wollny@collabora.com>
-Date: Mon Aug 15 17:15:43 2022 +0200
-
- r600/sfn: Initialize out buffer when printing op
-
- 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
- r600/sfn: rewrite NIR backend
-
- Closes: #7021
-
- Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
- Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
-
-diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp b/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp
-index 3d40ea1796a..00826ed6457 100644
---- a/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp
-+++ b/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp
-@@ -206,7 +206,7 @@ bool WriteScratchInstr::do_ready() const
-
- void WriteScratchInstr::do_print(std::ostream& os) const
- {
-- char buf[6];
-+ char buf[6] = {0};
-
- os << "WRITE_SCRATCH ";
- if (m_address)
--
2.39.2
Brendan Tildesley wrote 2 years ago
[PATCH mesa-branch 0/4] Mesa update plus various fixes and cleanups.
(address . 63219@debbugs.gnu.org)(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
42655d46-f9a9-8556-df5c-78901bb29129@brendan.scot
You're a legend! The -Dvideo-codecs= line fixed an important regression
for me.
I think it would also be desirable to update libva and libva-utils along
with this patchset.
Also, mesa 23.1.0 will be out soon, although I think it's more important
to get this fix/update in
master asap to get things working for people.
Maxim Cournoyer wrote 2 years ago
(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
87cz3cyssq.fsf_-_@gmail.com
Hi,

Brendan Tildesley <mail@brendan.scot> writes:

Toggle quote (8 lines)
> You're a legend! The -Dvideo-codecs= line fixed an important
> regression for me.
> I think it would also be desirable to update libva and libva-utils
> along with this patchset.
> Also, mesa 23.1.0 will be out soon, although I think it's more
> important to get this fix/update in
> master asap to get things working for people.

Pushed the mesa updates to master, along with the libva info updates;
thanks a lot to Kaelyn for working on this important update!

--
Thanks,
Maxim
Kaelyn wrote 2 years ago
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
JfwHXhRvMcjLElowRhTQTrJze3a4ucbAxjGrZjdHYLPI9PwIgesGiSfF1YqVWgtcA-pgel5LTFB7yrw11TujnYurRlUqOZtpA-BVE26ctgw=@protonmail.com
------- Original Message -------
On Sunday, May 7th, 2023 at 5:07 PM, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

Toggle quote (17 lines)
>
> Hi,
>
> Brendan Tildesley mail@brendan.scot writes:
>
> > You're a legend! The -Dvideo-codecs= line fixed an important
> > regression for me.
> > I think it would also be desirable to update libva and libva-utils
> > along with this patchset.
> > Also, mesa 23.1.0 will be out soon, although I think it's more
> > important to get this fix/update in
> > master asap to get things working for people.
>
>
> Pushed the mesa updates to master, along with the libva info updates;
> thanks a lot to Kaelyn for working on this important update!

You're welcome! Thank you for pushing the mesa changes along with the libva updates!

Cheers,
Kaelyn

Toggle quote (4 lines)
>
> --
> Thanks,
> Maxim
Maxim Cournoyer wrote 2 years ago
control message for bug #63219
(address . control@debbugs.gnu.org)
87ild3y8s7.fsf@gmail.com
close 63219
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 63219@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 63219
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help