mirror of
https://github.com/andersrh/copr-andersrh.git
synced 2026-05-20 15:28:02 +00:00
Merge branch 'master' into mesa-polly
This commit is contained in:
commit
81be92c748
22 changed files with 3218 additions and 9 deletions
|
|
@ -193,7 +193,7 @@ ExcludeArch: i686
|
|||
Summary: Mozilla Firefox Web browser
|
||||
Name: firefox
|
||||
Version: 135.0.1
|
||||
Release: 10.skylake%{?pre_tag}%{?dist}
|
||||
Release: 11.skylake%{?pre_tag}%{?dist}
|
||||
URL: https://www.mozilla.org/firefox/
|
||||
# Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended.
|
||||
License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+
|
||||
|
|
@ -631,7 +631,7 @@ echo "ac_add_options --disable-webrtc" >> .mozconfig
|
|||
echo "ac_add_options --enable-debug" >> .mozconfig
|
||||
echo "ac_add_options --disable-optimize" >> .mozconfig
|
||||
%else
|
||||
%global optimize_flags "-O3 -march=skylake -mtune=skylake"
|
||||
%global optimize_flags "-O3 -march=skylake -mtune=skylake -flto"
|
||||
%ifarch ppc64le aarch64
|
||||
%global optimize_flags "-g -O2"
|
||||
%endif
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Maintainer: Eric Naim <dnaim@cachyos.org>
|
||||
# Maintainer: Anders Rytter Hansen
|
||||
|
||||
# Fedora bits
|
||||
%define __spec_install_post %{__os_install_post}
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
# Linux Kernel Versions
|
||||
%define _basekver 6.12
|
||||
%define _stablekver 16
|
||||
%define _stablekver 32
|
||||
%define _rpmver %{version}-%{release}
|
||||
%define _kver %{_rpmver}.%{_arch}
|
||||
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
Name: kernel-cachyos-lts%{?_lto_args:-lto}-skylake
|
||||
Summary: Linux BORE %{?_lto_args:+ LTO }Cachy Sauce Kernel by CachyOS with other patches and improvements.
|
||||
Version: %{_basekver}.%{_stablekver}
|
||||
Release: cachylts1%{?_lto_args:.lto}.skylake%{?dist}
|
||||
Release: cachylts4%{?_lto_args:.lto}.skylake%{?dist}
|
||||
License: GPL-2.0-only
|
||||
URL: https://cachyos.org
|
||||
|
||||
|
|
@ -107,6 +107,7 @@ BuildRequires: python-srpm-macros
|
|||
BuildRequires: clang
|
||||
BuildRequires: lld
|
||||
BuildRequires: llvm
|
||||
BuildRequires: polly
|
||||
%endif
|
||||
|
||||
%if %{_build_nv}
|
||||
|
|
@ -121,7 +122,7 @@ Source1: https://raw.githubusercontent.com/CachyOS/linux-cachyos/master/l
|
|||
# The default modprobed.db provided is used for linux-cachyos CI.
|
||||
# This should not be used for production and ideally should only be used for compile tests.
|
||||
# Note that any modprobed.db file is accepted
|
||||
Source2: https://raw.githubusercontent.com/CachyOS/linux-cachyos/master/modprobed.db
|
||||
Source2: https://raw.githubusercontent.com/Frogging-Family/linux-tkg/master/linux-tkg-config/%{_basekver}/minimal-modprobed.db
|
||||
%endif
|
||||
|
||||
%if %{_build_nv}
|
||||
|
|
@ -133,6 +134,7 @@ Patch1: %{_patch_src}/sched/0001-bore-cachy.patch
|
|||
|
||||
%if %{_build_lto}
|
||||
Patch2: %{_patch_src}/misc/dkms-clang.patch
|
||||
Patch3: %{_patch_src}/misc/0001-clang-polly.patch
|
||||
%endif
|
||||
|
||||
%if %{_build_nv}
|
||||
|
|
@ -185,6 +187,7 @@ Patch13: %{_patch_src}/misc/nvidia/565/0005-nvkms-Sanitize-trim-ELD-produ
|
|||
|
||||
%if %{_build_lto}
|
||||
scripts/config -e LTO_CLANG_THIN
|
||||
scripts/config -e POLLY_CLANG
|
||||
%endif
|
||||
|
||||
%if %{_build_minimal}
|
||||
|
|
@ -377,7 +380,8 @@ Recommends: linux-firmware
|
|||
|
||||
%files core
|
||||
%license COPYING
|
||||
%ghost /boot/initramfs-%{_kver}.img
|
||||
%ghost %attr(0600, root, root) /boot/initramfs-%{_kver}.img
|
||||
%ghost %attr(0644, root, root) /boot/symvers-%{_kver}.zst
|
||||
%{_kernel_dir}/vmlinuz
|
||||
%{_kernel_dir}/modules.builtin
|
||||
%{_kernel_dir}/modules.builtin.modinfo
|
||||
|
|
|
|||
498
my-ostree-os/kernel-cachyos-lts-skylake.spec
Normal file
498
my-ostree-os/kernel-cachyos-lts-skylake.spec
Normal file
|
|
@ -0,0 +1,498 @@
|
|||
# Maintainer: Anders Rytter Hansen
|
||||
|
||||
# Fedora bits
|
||||
%define __spec_install_post %{__os_install_post}
|
||||
%define _build_id_links none
|
||||
%define _default_patch_fuzz 2
|
||||
%define _disable_source_fetch 0
|
||||
%define debug_package %{nil}
|
||||
%define make_build make %{?_lto_args} %{?_smp_mflags}
|
||||
%undefine __brp_mangle_shebangs
|
||||
%undefine _auto_set_build_flags
|
||||
%undefine _include_frame_pointers
|
||||
|
||||
# Linux Kernel Versions
|
||||
%define _basekver 6.12
|
||||
%define _stablekver 32
|
||||
%define _rpmver %{version}-%{release}
|
||||
%define _kver %{_rpmver}.%{_arch}
|
||||
|
||||
%if %{_stablekver} == 0
|
||||
%define _tarkver %{_basekver}
|
||||
%else
|
||||
%define _tarkver %{version}
|
||||
%endif
|
||||
|
||||
# Build a minimal a kernel via modprobed.db
|
||||
# file to reduce build times
|
||||
%define _build_minimal 0
|
||||
|
||||
# Builds the kernel with clang and enables
|
||||
# ThinLTO
|
||||
%define _build_lto 0
|
||||
|
||||
# Builds nvidia-open kernel modules with
|
||||
# the kernel
|
||||
%define _nv_pkg open-gpu-kernel-modules-%{_nv_ver}
|
||||
%if 0%{?fedora} >= 42
|
||||
%define _build_nv 0
|
||||
%define _nv_ver 570.86.16
|
||||
%else
|
||||
%define _build_nv 0
|
||||
%define _nv_ver 565.77
|
||||
%define _nv_old 1
|
||||
%endif
|
||||
|
||||
# Define the tickrate used by the kernel
|
||||
# Valid values: 100, 250, 300, 500, 600, 750 and 1000
|
||||
# An invalid value will not fail and continue to use
|
||||
# 1000Hz tickrate
|
||||
%define _hz_tick 1000
|
||||
|
||||
# Defines the x86_64 ISA level used
|
||||
# to compile the kernel
|
||||
# Valid values are 1-4
|
||||
# An invalid value will continue and use
|
||||
# x86_64_v3
|
||||
%define _x86_64_lvl 3
|
||||
|
||||
# Define variables for directory paths
|
||||
# to be used during packaging
|
||||
%define _kernel_dir /lib/modules/%{_kver}
|
||||
%define _devel_dir %{_usrsrc}/kernels/%{_kver}
|
||||
|
||||
%define _patch_src https://raw.githubusercontent.com/CachyOS/kernel-patches/master/%{_basekver}
|
||||
|
||||
%if %{_build_lto}
|
||||
# Define build environment variables to build the kernel with clang
|
||||
%define _lto_args CC=clang CXX=clang++ LD=ld.lld LLVM=1 LLVM_IAS=1
|
||||
%endif
|
||||
|
||||
%define _module_args KERNEL_UNAME=%{_kver} IGNORE_PREEMPT_RT_PRESENCE=1 SYSSRC=%{_builddir}/linux-%{_tarkver} SYSOUT=%{_builddir}/linux-%{_tarkver}
|
||||
|
||||
Name: kernel-cachyos-lts%{?_lto_args:-lto}-skylake
|
||||
Summary: Linux BORE %{?_lto_args:+ LTO }Cachy Sauce Kernel by CachyOS with other patches and improvements.
|
||||
Version: %{_basekver}.%{_stablekver}
|
||||
Release: cachylts1%{?_lto_args:.lto}.skylake%{?dist}
|
||||
License: GPL-2.0-only
|
||||
URL: https://cachyos.org
|
||||
|
||||
Requires: kernel-core-uname-r = %{_kver}
|
||||
Requires: kernel-modules-uname-r = %{_kver}
|
||||
Requires: kernel-modules-core-uname-r = %{_kver}
|
||||
Provides: kernel-cachyos-lts%{?_lto_args:-lto}-skylake > 6.6.71-clts1.0%{?_lto_args:.lto}.skylake%{?dist}
|
||||
Provides: installonlypkg(kernel)
|
||||
Obsoletes: kernel-cachyos-lts%{?_lto_args:-lto}-skylake <= 6.6.71-clts1.0%{?_lto_args:.lto}.skylake%{?dist}
|
||||
|
||||
BuildRequires: bc
|
||||
BuildRequires: bison
|
||||
BuildRequires: dwarves
|
||||
BuildRequires: elfutils-devel
|
||||
BuildRequires: flex
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gettext-devel
|
||||
BuildRequires: kmod
|
||||
BuildRequires: make
|
||||
BuildRequires: openssl
|
||||
BuildRequires: openssl-devel
|
||||
BuildRequires: perl-Carp
|
||||
BuildRequires: perl-devel
|
||||
BuildRequires: perl-generators
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-pyyaml
|
||||
BuildRequires: python-srpm-macros
|
||||
|
||||
%if %{_build_lto}
|
||||
BuildRequires: clang
|
||||
BuildRequires: lld
|
||||
BuildRequires: llvm
|
||||
%endif
|
||||
|
||||
%if %{_build_nv}
|
||||
BuildRequires: gcc-c++
|
||||
%endif
|
||||
|
||||
# Indexes 0-9 are reserved for the kernel. 10-19 will be reserved for NVIDIA
|
||||
Source0: https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-%{_tarkver}.tar.xz
|
||||
Source1: https://raw.githubusercontent.com/CachyOS/linux-cachyos/master/linux-cachyos-lts/config
|
||||
|
||||
%if %{_build_minimal}
|
||||
# The default modprobed.db provided is used for linux-cachyos CI.
|
||||
# This should not be used for production and ideally should only be used for compile tests.
|
||||
# Note that any modprobed.db file is accepted
|
||||
Source2: https://raw.githubusercontent.com/Frogging-Family/linux-tkg/master/linux-tkg-config/%{_basekver}/minimal-modprobed.db
|
||||
%endif
|
||||
|
||||
%if %{_build_nv}
|
||||
Source10: https://github.com/NVIDIA/open-gpu-kernel-modules/archive/%{_nv_ver}/%{_nv_pkg}.tar.gz
|
||||
%endif
|
||||
|
||||
Patch0: %{_patch_src}/all/0001-cachyos-base-all.patch
|
||||
Patch1: %{_patch_src}/sched/0001-bore-cachy.patch
|
||||
|
||||
%if %{_build_lto}
|
||||
Patch2: %{_patch_src}/misc/dkms-clang.patch
|
||||
%endif
|
||||
|
||||
%if %{_build_nv}
|
||||
Patch10: %{_patch_src}/misc/nvidia/%{?_nv_old:565}/0001-Make-modeset-and-fbdev-default-enabled.patch
|
||||
%if 0%{?fedora} < 42
|
||||
Patch11: %{_patch_src}/misc/nvidia/565/0002-Do-not-error-on-unkown-CPU-Type-and-add-Zen5-support.patch
|
||||
Patch12: %{_patch_src}/misc/nvidia/565/0004-silence-event-assert-until-570.patch
|
||||
Patch13: %{_patch_src}/misc/nvidia/565/0005-nvkms-Sanitize-trim-ELD-product-name-strings.patch
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%description
|
||||
The meta package for %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q %{?SOURCE10:-b 10} -n linux-%{_tarkver}
|
||||
%autopatch -p1 -v -M 9
|
||||
|
||||
cp %{SOURCE1} .config
|
||||
|
||||
# Default configs to always enable
|
||||
# Enable CACHY sauce and the scheduler
|
||||
# used in the default linux-cachyos kernel
|
||||
scripts/config -e CACHY -e SCHED_BORE
|
||||
|
||||
# Use SElinux by default
|
||||
# https://github.com/sirlucjan/copr-linux-cachyos/pull/1
|
||||
scripts/config --set-str CONFIG_LSM lockdown,yama,integrity,selinux,bpf,landlock
|
||||
|
||||
# Do not change the system's hostname
|
||||
scripts/config -u DEFAULT_HOSTNAME
|
||||
|
||||
case %{_hz_tick} in
|
||||
100|250|300|500|600|750|1000)
|
||||
scripts/config -e HZ_%{_hz_tick} --set-val HZ %{_hz_tick};;
|
||||
*)
|
||||
echo "Invalid tickrate value, using default 1000"
|
||||
scripts/config -e HZ_1000 --set-val HZ 1000;;
|
||||
esac
|
||||
|
||||
%if %{_x86_64_lvl} < 5 && %{_x86_64_lvl} > 0
|
||||
scripts/config --set-val X86_64_VERSION %{_x86_64_lvl}
|
||||
%else
|
||||
echo "Invalid x86_64 ISA Level. Using x86_64_v3"
|
||||
scripts/config --set-val X86_64_VERSION 3
|
||||
%endif
|
||||
|
||||
scripts/config -d GENERIC_CPU
|
||||
scripts/config -e MSKYLAKE
|
||||
|
||||
%if %{_build_lto}
|
||||
scripts/config -e LTO_CLANG_THIN
|
||||
%endif
|
||||
|
||||
%if %{_build_minimal}
|
||||
%make_build LSMOD=%{SOURCE2} localmodconfig
|
||||
%else
|
||||
%make_build olddefconfig
|
||||
%endif
|
||||
|
||||
diff -u %{SOURCE1} .config || :
|
||||
|
||||
%if %{_build_nv}
|
||||
cd %{_builddir}/%{_nv_pkg}/kernel-open
|
||||
%patch -P 10 -p1
|
||||
cd ..
|
||||
%autopatch -p1 -v -m 11 -M 19
|
||||
%endif
|
||||
|
||||
%build
|
||||
%make_build EXTRAVERSION=-%{release}.%{_arch} all
|
||||
%make_build -C tools/bpf/bpftool vmlinux.h feature-clang-bpf-co-re=1
|
||||
|
||||
%if %{_build_nv}
|
||||
cd %{_builddir}/%{_nv_pkg}
|
||||
CFLAGS= CXXFLAGS= LDFLAGS= %make_build %{_module_args} IGNORE_CC_MISMATCH=yes modules
|
||||
%endif
|
||||
|
||||
%install
|
||||
echo "Installing the kernel image..."
|
||||
install -Dm644 "$(%make_build -s image_name)" "%{buildroot}%{_kernel_dir}/vmlinuz"
|
||||
zstdmt -19 < Module.symvers > %{buildroot}%{_kernel_dir}/symvers.zst
|
||||
|
||||
echo "Installing kernel modules..."
|
||||
ZSTD_CLEVEL=19 %make_build INSTALL_MOD_PATH="%{buildroot}" INSTALL_MOD_STRIP=1 DEPMOD=/doesnt/exist modules_install
|
||||
|
||||
echo "Installing files for the development package..."
|
||||
install -Dt %{buildroot}%{_devel_dir} -m644 .config Makefile Module.symvers System.map tools/bpf/bpftool/vmlinux.h
|
||||
cp .config %{buildroot}%{_kernel_dir}/config
|
||||
cp System.map %{buildroot}%{_kernel_dir}/System.map
|
||||
cp --parents `find -type f -name "Makefile*" -o -name "Kconfig*"` %{buildroot}%{_devel_dir}
|
||||
rm -rf %{buildroot}%{_devel_dir}/scripts
|
||||
rm -rf %{buildroot}%{_devel_dir}/include
|
||||
cp -a scripts %{buildroot}%{_devel_dir}
|
||||
rm -rf %{buildroot}%{_devel_dir}/scripts/tracing
|
||||
rm -f %{buildroot}%{_devel_dir}/scripts/spdxcheck.py
|
||||
|
||||
# The cp commands below are needed for parity with Fedora's packaging
|
||||
# Install files that are needed for `make scripts` to succeed
|
||||
cp -a --parents security/selinux/include/classmap.h %{buildroot}%{_devel_dir}
|
||||
cp -a --parents security/selinux/include/initial_sid_to_string.h %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/include/tools/be_byteshift.h %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/include/tools/le_byteshift.h %{buildroot}%{_devel_dir}
|
||||
|
||||
# Install files that are needed for `make prepare` to succeed -- Generic
|
||||
cp -a --parents tools/include/linux/compiler* %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/include/linux/types.h %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/build/Build.include %{buildroot}%{_devel_dir}
|
||||
cp --parents tools/build/fixdep.c %{buildroot}%{_devel_dir}
|
||||
cp --parents tools/objtool/sync-check.sh %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/bpf/resolve_btfids %{buildroot}%{_devel_dir}
|
||||
|
||||
cp --parents security/selinux/include/policycap_names.h %{buildroot}%{_devel_dir}
|
||||
cp --parents security/selinux/include/policycap.h %{buildroot}%{_devel_dir}
|
||||
|
||||
cp -a --parents tools/include/asm %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/include/asm-generic %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/include/linux %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/include/uapi/asm %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/include/uapi/asm-generic %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/include/uapi/linux %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/include/vdso %{buildroot}%{_devel_dir}
|
||||
cp --parents tools/scripts/utilities.mak %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/lib/subcmd %{buildroot}%{_devel_dir}
|
||||
cp --parents tools/lib/*.c %{buildroot}%{_devel_dir}
|
||||
cp --parents tools/objtool/*.[ch] %{buildroot}%{_devel_dir}
|
||||
cp --parents tools/objtool/Build %{buildroot}%{_devel_dir}
|
||||
cp --parents tools/objtool/include/objtool/*.h %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/lib/bpf %{buildroot}%{_devel_dir}
|
||||
cp --parents tools/lib/bpf/Build %{buildroot}%{_devel_dir}
|
||||
|
||||
# Misc headers
|
||||
cp -a --parents arch/x86/include %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/arch/x86/include %{buildroot}%{_devel_dir}
|
||||
cp -a include %{buildroot}%{_devel_dir}/include
|
||||
cp -a sound/soc/sof/sof-audio.h %{buildroot}%{_devel_dir}/sound/soc/sof
|
||||
cp -a tools/objtool/objtool %{buildroot}%{_devel_dir}/tools/objtool/
|
||||
cp -a tools/objtool/fixdep %{buildroot}%{_devel_dir}/tools/objtool/
|
||||
|
||||
# Install files that are needed for `make prepare` to succeed -- for x86_64
|
||||
cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/entry/syscalls/syscall_64.tbl %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/tools/relocs_32.c %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/tools/relocs_64.c %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/tools/relocs.c %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/tools/relocs_common.c %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/tools/relocs.h %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/purgatory/purgatory.c %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/purgatory/stack.S %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/purgatory/setup-x86_64.S %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/purgatory/entry64.S %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/boot/string.h %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/boot/string.c %{buildroot}%{_devel_dir}
|
||||
cp -a --parents arch/x86/boot/ctype.h %{buildroot}%{_devel_dir}
|
||||
|
||||
cp -a --parents scripts/syscalltbl.sh %{buildroot}%{_devel_dir}
|
||||
cp -a --parents scripts/syscallhdr.sh %{buildroot}%{_devel_dir}
|
||||
|
||||
cp -a --parents tools/arch/x86/include/asm %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/arch/x86/include/uapi/asm %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/objtool/arch/x86/lib %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/arch/x86/lib/ %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/arch/x86/tools/gen-insn-attr-x86.awk %{buildroot}%{_devel_dir}
|
||||
cp -a --parents tools/objtool/arch/x86/ %{buildroot}%{_devel_dir}
|
||||
|
||||
# Final cleanups ala Fedora
|
||||
echo "Cleaning up development files..."
|
||||
find %{buildroot}%{_devel_dir}/scripts \( -iname "*.o" -o -iname "*.cmd" \) -exec rm -f {} +
|
||||
find %{buildroot}%{_devel_dir}/tools \( -iname "*.o" -o -iname "*.cmd" \) -exec rm -f {} +
|
||||
touch -r %{buildroot}%{_devel_dir}/Makefile \
|
||||
%{buildroot}%{_devel_dir}/include/generated/uapi/linux/version.h \
|
||||
%{buildroot}%{_devel_dir}/include/config/auto.conf
|
||||
|
||||
# These links will be owned by the modules package, creating a broken
|
||||
# link unless the -devel package is installed. why??
|
||||
rm -rf %{buildroot}%{_kernel_dir}/build
|
||||
ln -s %{_devel_dir} %{buildroot}%{_kernel_dir}/build
|
||||
ln -s %{_kernel_dir}/build %{buildroot}%{_kernel_dir}/source
|
||||
|
||||
# Create stub initramfs to inflate disk space requirements.
|
||||
# This should hopefully prevent some initramfs failures due to
|
||||
# insufficient space in /boot (#bz #530778)
|
||||
# 90 seems to be a safe value nowadays. It is slightly inflated than the
|
||||
# measured average to also account for installed vmlinuz in /boot
|
||||
echo "Creating stub initramfs..."
|
||||
install -dm755 %{buildroot}/boot
|
||||
dd if=/dev/zero of=%{buildroot}/boot/initramfs-%{_kver}.img bs=1M count=90
|
||||
|
||||
%if %{_build_nv}
|
||||
cd %{_builddir}/%{_nv_pkg}
|
||||
echo "Installing NVIDIA open kernel modules..."
|
||||
install -Dt %{buildroot}%{_kernel_dir}/nvidia -m644 kernel-open/*.ko
|
||||
find %{buildroot}%{_kernel_dir}/nvidia -name '*.ko' -exec zstd --rm -19 {} +
|
||||
install -Dt %{buildroot}/%{_defaultlicensedir}/%{name}-nvidia-open -m644 COPYING
|
||||
%endif
|
||||
|
||||
%package core
|
||||
Summary: Linux BORE Cachy Sauce Kernel by CachyOS with other patches and improvements
|
||||
AutoReq: no
|
||||
Conflicts: xfsprogs < 4.3.0-1
|
||||
Conflicts: xorg-x11-drv-vmmouse < 13.0.99
|
||||
Provides: kernel = %{_rpmver}
|
||||
Provides: kernel-core-uname-r = %{_kver}
|
||||
Provides: kernel-uname-r = %{_kver}
|
||||
Provides: installonlypkg(kernel)
|
||||
Requires: kernel-modules-uname-r = %{_kver}
|
||||
Requires(pre): /usr/bin/kernel-install
|
||||
Requires(pre): coreutils
|
||||
Requires(pre): dracut >= 027
|
||||
Requires(pre): systemd >= 203-2
|
||||
Requires(pre): ((linux-firmware >= 20150904-56.git6ebf5d57) if linux-firmware)
|
||||
Requires(preun):systemd >= 200
|
||||
Recommends: linux-firmware
|
||||
|
||||
%description core
|
||||
The kernel package contains the Linux kernel (vmlinuz), the core of any
|
||||
Linux operating system. The kernel handles the basic functions
|
||||
of the operating system: memory allocation, process allocation, device
|
||||
input and output, etc.
|
||||
|
||||
%post core
|
||||
mkdir -p %{_localstatedir}/lib/rpm-state/%{name}
|
||||
touch %{_localstatedir}/lib/rpm-state/%{name}/installing_core_%{_kver}
|
||||
|
||||
%posttrans core
|
||||
rm -f %{_localstatedir}/lib/rpm-state/%{name}/installing_core_%{_kver}
|
||||
if [ ! -e /run/ostree-booted ]; then
|
||||
/bin/kernel-install add %{_kver} %{_kernel_dir}/vmlinuz || exit $?
|
||||
if [[ ! -e "/boot/symvers-%{_kver}.zst" ]]; then
|
||||
cp "%{_kernel_dir}/symvers.zst" "/boot/symvers-%{_kver}.zst"
|
||||
if command -v restorecon &>/dev/null; then
|
||||
restorecon "/boot/symvers-%{_kver}.zst"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
%preun core
|
||||
/bin/kernel-install remove %{_kver} || exit $?
|
||||
if [ -x /usr/sbin/weak-modules ]; then
|
||||
/usr/sbin/weak-modules --remove-kernel %{_kver} || exit $?
|
||||
fi
|
||||
|
||||
%files core
|
||||
%license COPYING
|
||||
%ghost %attr(0600, root, root) /boot/initramfs-%{_kver}.img
|
||||
%ghost %attr(0644, root, root) /boot/symvers-%{_kver}.zst
|
||||
%{_kernel_dir}/vmlinuz
|
||||
%{_kernel_dir}/modules.builtin
|
||||
%{_kernel_dir}/modules.builtin.modinfo
|
||||
%{_kernel_dir}/symvers.zst
|
||||
%{_kernel_dir}/config
|
||||
%{_kernel_dir}/System.map
|
||||
|
||||
%package modules
|
||||
Summary: Kernel modules package for %{name}
|
||||
Provides: kernel-modules = %{_rpmver}
|
||||
Provides: kernel-modules-core = %{_rpmver}
|
||||
Provides: kernel-modules-extra = %{_rpmver}
|
||||
Provides: kernel-modules-uname-r = %{_kver}
|
||||
Provides: kernel-modules-core-uname-r = %{_kver}
|
||||
Provides: kernel-modules-extra-uname-r = %{_kver}
|
||||
Provides: installonlypkg(kernel-module)
|
||||
Requires: kernel-uname-r = %{_kver}
|
||||
|
||||
%description modules
|
||||
This package provides kernel modules for the %{name}-core kernel package.
|
||||
|
||||
%post modules
|
||||
if [ ! -f %{_localstatedir}/lib/rpm-state/%{name}/installing_core_%{_kver} ]; then
|
||||
mkdir -p %{_localstatedir}/lib/rpm-state/%{name}
|
||||
touch %{_localstatedir}/lib/rpm-state/%{name}/need_to_run_dracut_%{_kver}
|
||||
fi
|
||||
|
||||
%posttrans modules
|
||||
rm -f %{_localstatedir}/lib/rpm-state/%{name}/need_to_run_dracut_%{_kver}
|
||||
/sbin/depmod -a %{_kver}
|
||||
if [ ! -e /run/ostree-booted ]; then
|
||||
if [ -f %{_localstatedir}/lib/rpm-state/%{name}/need_to_run_dracut_%{_kver} ]; then
|
||||
echo "Running: dracut -f --kver %{_kver}"
|
||||
dracut -f --kver "%{_kver}" || exit $?
|
||||
fi
|
||||
fi
|
||||
|
||||
%files modules
|
||||
%dir %{_kernel_dir}
|
||||
%{_kernel_dir}/modules.order
|
||||
%{_kernel_dir}/build
|
||||
%{_kernel_dir}/source
|
||||
%{_kernel_dir}/kernel
|
||||
|
||||
%package devel
|
||||
Summary: Development package for building kernel modules to match %{name}
|
||||
Provides: kernel-devel = %{_rpmver}
|
||||
Provides: kernel-devel-uname-r = %{_kver}
|
||||
Provides: installonlypkg(kernel)
|
||||
AutoReqProv: no
|
||||
Requires(pre): findutils
|
||||
Requires: findutils
|
||||
Requires: perl-interpreter
|
||||
Requires: openssl-devel
|
||||
Requires: elfutils-libelf-devel
|
||||
Requires: bison
|
||||
Requires: flex
|
||||
Requires: make
|
||||
|
||||
%if %{_build_lto}
|
||||
Requires: clang
|
||||
Requires: lld
|
||||
Requires: llvm
|
||||
%else
|
||||
Requires: gcc
|
||||
%endif
|
||||
|
||||
%description devel
|
||||
This package provides kernel headers and makefiles sufficient to build modules against %{name}.
|
||||
|
||||
%post devel
|
||||
if [ -f /etc/sysconfig/kernel ]; then
|
||||
. /etc/sysconfig/kernel || exit $?
|
||||
fi
|
||||
if [ "$HARDLINK" != "no" -a -x /usr/bin/hardlink -a ! -e /run/ostree-booted ]; then
|
||||
(cd /usr/src/kernels/%{_kver} &&
|
||||
/usr/bin/find . -type f | while read f; do
|
||||
hardlink -c /usr/src/kernels/*%{?dist}.*/$f $f > /dev/null
|
||||
done;
|
||||
)
|
||||
fi
|
||||
|
||||
%files devel
|
||||
%{_devel_dir}
|
||||
|
||||
%package devel-matched
|
||||
Summary: Meta package to install matching core and devel packages for %{name}
|
||||
Provides: kernel-devel-matched = %{_rpmver}
|
||||
Requires: %{name}-core = %{_rpmver}
|
||||
Requires: %{name}-devel = %{_rpmver}
|
||||
|
||||
%description devel-matched
|
||||
This meta package is used to install matching core and devel packages for %{name}.
|
||||
|
||||
%files devel-matched
|
||||
|
||||
%if %{_build_nv}
|
||||
%package nvidia-open
|
||||
Summary: nvidia-open %{_nv_ver} kernel modules for %{name}
|
||||
Provides: nvidia-kmod >= %{_nv_ver}
|
||||
Provides: installonlypkg(kernel-module)
|
||||
Requires: kernel-uname-r = %{_kver}
|
||||
Conflicts: akmod-nvidia
|
||||
Recommends: xorg-x11-drv-nvidia >= %{_nv_ver}
|
||||
|
||||
%description nvidia-open
|
||||
This package provides nvidia-open %{_nv_ver} kernel modules for %{name}.
|
||||
|
||||
%post nvidia-open
|
||||
/sbin/depmod -a %{_kver}
|
||||
|
||||
%files nvidia-open
|
||||
%license %{_defaultlicensedir}/%{name}-nvidia-open/COPYING
|
||||
%{_kernel_dir}/nvidia
|
||||
%endif
|
||||
|
||||
%files
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
From 24f85c06c28736b73c14208a0ffa6657d2aee9cd Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= <jexposit@redhat.com>
|
||||
Date: Mon, 21 Apr 2025 13:52:14 +0200
|
||||
Subject: [PATCH] Revert "kopper: Explicitly choose zink"
|
||||
|
||||
On QEMU (virtio driver), without 3D acceleration enabled and without
|
||||
mesa-vulkan-drivers installed, this commit prevents Mutter to start.
|
||||
|
||||
This reverts commit c0bc957c5d8c7edd57626284b712dd6ea1e375fc.
|
||||
|
||||
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2360851
|
||||
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13009
|
||||
---
|
||||
.pick_status.json | 2 +-
|
||||
src/gallium/frontends/dri/kopper.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/.pick_status.json b/.pick_status.json
|
||||
index 99df2fb30c2..cdf3965678c 100644
|
||||
--- a/.pick_status.json
|
||||
+++ b/.pick_status.json
|
||||
@@ -16204,7 +16204,7 @@
|
||||
"description": "kopper: Explicitly choose zink",
|
||||
"nominated": false,
|
||||
"nomination_type": 0,
|
||||
- "resolution": 1,
|
||||
+ "resolution": 4,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c
|
||||
index a1d7dcb79b4..3bdb56022a9 100644
|
||||
--- a/src/gallium/frontends/dri/kopper.c
|
||||
+++ b/src/gallium/frontends/dri/kopper.c
|
||||
@@ -73,7 +73,7 @@ kopper_init_screen(struct dri_screen *screen, bool driver_name_is_inferred)
|
||||
bool success;
|
||||
#ifdef HAVE_LIBDRM
|
||||
if (screen->fd != -1)
|
||||
- success = pipe_loader_drm_probe_fd(&screen->dev, screen->fd, true);
|
||||
+ success = pipe_loader_drm_probe_fd(&screen->dev, screen->fd, false);
|
||||
else
|
||||
success = pipe_loader_vk_probe_dri(&screen->dev);
|
||||
#else
|
||||
--
|
||||
2.49.0
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
From b97a4dc4caf609975ba9e80336e63ebc9545a91b Mon Sep 17 00:00:00 2001
|
||||
From: Erik Faye-Lund <erik.faye-lund@collabora.com>
|
||||
Date: Thu, 6 Mar 2025 13:53:07 +0100
|
||||
Subject: [PATCH] docs/features: add VK_EXT_hdr_metadata
|
||||
|
||||
This was missed when it was recently added.
|
||||
|
||||
Fixes: 4b663d561b8 ("vulkan/wsi: implement support for VK_EXT_hdr_metadata on Wayland")
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33918>
|
||||
---
|
||||
docs/features.txt | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/docs/features.txt b/docs/features.txt
|
||||
index 6e789b3ed29..53395bfee2a 100644
|
||||
--- a/docs/features.txt
|
||||
+++ b/docs/features.txt
|
||||
@@ -612,6 +612,7 @@ Khronos extensions that are not part of any Vulkan version:
|
||||
VK_EXT_global_priority DONE (anv, hasvk, panvk, radv, tu)
|
||||
VK_EXT_global_priority_query DONE (anv, hasvk, panvk, radv, tu)
|
||||
VK_EXT_graphics_pipeline_library DONE (anv, lvp, nvk, panvk, radv, tu, vn)
|
||||
+ VK_EXT_hdr_metadata DONE (anv, lvp, nvk, panvk, radv, tu)
|
||||
VK_EXT_headless_surface DONE (anv, dzn, hasvk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
|
||||
VK_EXT_image_2d_view_of_3d DONE (anv, hasvk, lvp, nvk, radv, tu, vn)
|
||||
VK_EXT_image_compression_control DONE (radv)
|
||||
--
|
||||
2.49.0
|
||||
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
From c15c45c54bb2fd03b41416c6628efcb095eec4b6 Mon Sep 17 00:00:00 2001
|
||||
From: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Date: Mon, 17 Feb 2025 16:25:09 +0100
|
||||
Subject: [PATCH 1/4] increase required wayland-protocols version to 1.41
|
||||
|
||||
This version contains the color management protocol.
|
||||
|
||||
This commit also adjusts the build-wayland script to mention
|
||||
that the DEBIAN_BASE_TAG also has to be bumped.
|
||||
|
||||
Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Reviewed-by: Eric Engestrom <eric@igalia.com>
|
||||
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
|
||||
Acked-by: Daniel Stone <daniels@collabora.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32038>
|
||||
---
|
||||
.gitlab-ci/container/build-wayland.sh | 4 +++-
|
||||
.gitlab-ci/image-tags.yml | 16 ++++++++--------
|
||||
meson.build | 2 +-
|
||||
subprojects/wayland-protocols.wrap | 6 +++---
|
||||
4 files changed, 15 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/.gitlab-ci/container/build-wayland.sh b/.gitlab-ci/container/build-wayland.sh
|
||||
index d6117254e87..551edcfe7db 100644
|
||||
--- a/.gitlab-ci/container/build-wayland.sh
|
||||
+++ b/.gitlab-ci/container/build-wayland.sh
|
||||
@@ -7,6 +7,8 @@ uncollapsed_section_start wayland "Building Wayland"
|
||||
|
||||
# When changing this file, you need to bump the following
|
||||
# .gitlab-ci/image-tags.yml tags:
|
||||
+# ALPINE_X86_64_BUILD_TAG
|
||||
+# DEBIAN_BASE_TAG
|
||||
# DEBIAN_BUILD_TAG
|
||||
# DEBIAN_TEST_ANDROID_TAG
|
||||
# DEBIAN_TEST_GL_TAG
|
||||
@@ -15,7 +17,7 @@ uncollapsed_section_start wayland "Building Wayland"
|
||||
# KERNEL_ROOTFS_TAG
|
||||
|
||||
export LIBWAYLAND_VERSION="1.21.0"
|
||||
-export WAYLAND_PROTOCOLS_VERSION="1.38"
|
||||
+export WAYLAND_PROTOCOLS_VERSION="1.41"
|
||||
|
||||
git clone https://gitlab.freedesktop.org/wayland/wayland
|
||||
cd wayland
|
||||
diff --git a/.gitlab-ci/image-tags.yml b/.gitlab-ci/image-tags.yml
|
||||
index 89909ed7912..b8423ef3d4f 100644
|
||||
--- a/.gitlab-ci/image-tags.yml
|
||||
+++ b/.gitlab-ci/image-tags.yml
|
||||
@@ -13,10 +13,10 @@
|
||||
|
||||
variables:
|
||||
DEBIAN_X86_64_BUILD_BASE_IMAGE: "debian/x86_64_build-base"
|
||||
- DEBIAN_BASE_TAG: "20250130-vvless"
|
||||
+ DEBIAN_BASE_TAG: "20250223-way-prot"
|
||||
|
||||
DEBIAN_X86_64_BUILD_IMAGE_PATH: "debian/x86_64_build"
|
||||
- DEBIAN_BUILD_TAG: "20250128-llvm19-up"
|
||||
+ DEBIAN_BUILD_TAG: "20250223-way-prot"
|
||||
|
||||
DEBIAN_X86_64_TEST_BASE_IMAGE: "debian/x86_64_test-base"
|
||||
DEBIAN_ARM64_TEST_BASE_IMAGE: "debian/arm64_test-base"
|
||||
@@ -27,17 +27,17 @@ variables:
|
||||
DEBIAN_ARM64_TEST_IMAGE_VK_PATH: "debian/arm64_test-vk"
|
||||
DEBIAN_X86_64_TEST_ANDROID_IMAGE_PATH: "debian/x86_64_test-android"
|
||||
|
||||
- DEBIAN_TEST_ANDROID_TAG: "20250130-vvless"
|
||||
- DEBIAN_TEST_GL_TAG: "20250327-piglit-250"
|
||||
- DEBIAN_TEST_VK_TAG: "20250327-piglit-250"
|
||||
- KERNEL_ROOTFS_TAG: "20250327-trace-250"
|
||||
+ DEBIAN_TEST_ANDROID_TAG: "20250223-way-prot"
|
||||
+ DEBIAN_TEST_GL_TAG: "20250223-way-prot"
|
||||
+ DEBIAN_TEST_VK_TAG: "20250223-way-prot"
|
||||
+ KERNEL_ROOTFS_TAG: "20250223-way-prot"
|
||||
|
||||
DEBIAN_PYUTILS_IMAGE: "debian/x86_64_pyutils"
|
||||
DEBIAN_PYUTILS_TAG: "20250129-lavacli"
|
||||
|
||||
- ALPINE_X86_64_BUILD_TAG: "20250128-llversionm"
|
||||
+ ALPINE_X86_64_BUILD_TAG: "20250223-way-prot"
|
||||
ALPINE_X86_64_LAVA_SSH_TAG: "20250124-spirv-tools"
|
||||
- FEDORA_X86_64_BUILD_TAG: "20250128-llversionm"
|
||||
+ FEDORA_X86_64_BUILD_TAG: "20250223-way-prot"
|
||||
|
||||
KERNEL_TAG: "v6.13-rc4-mesa-5e77"
|
||||
KERNEL_REPO: "gfx-ci/linux"
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 095aec5d9ea..ddde02c1755 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -2058,7 +2058,7 @@ if with_platform_wayland
|
||||
else
|
||||
wl_scanner_arg = 'code'
|
||||
endif
|
||||
- dep_wl_protocols = dependency('wayland-protocols', version : '>= 1.38', default_options: [ 'tests=false' ])
|
||||
+ dep_wl_protocols = dependency('wayland-protocols', version : '>= 1.41', default_options: [ 'tests=false' ])
|
||||
dep_wayland_client = dependency('wayland-client', version : '>=1.18')
|
||||
dep_wayland_server = dependency('wayland-server', version : '>=1.18')
|
||||
if with_egl
|
||||
diff --git a/subprojects/wayland-protocols.wrap b/subprojects/wayland-protocols.wrap
|
||||
index 61f306bdffd..c82fece01e3 100644
|
||||
--- a/subprojects/wayland-protocols.wrap
|
||||
+++ b/subprojects/wayland-protocols.wrap
|
||||
@@ -1,7 +1,7 @@
|
||||
[wrap-file]
|
||||
-directory = wayland-protocols-1.38
|
||||
-source_url = https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.38/downloads/wayland-protocols-1.38.tar.xz
|
||||
-source_filename = wayland-protocols-1.38.tar.xz
|
||||
+directory = wayland-protocols-1.41
|
||||
+source_url = https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.41/downloads/wayland-protocols-1.41.tar.xz
|
||||
+source_filename = wayland-protocols-1.41.tar.xz
|
||||
source_hash = ff17292c05159d2b20ce6cacfe42d7e31a28198fa1429a769b03af7c38581dbe
|
||||
|
||||
[provide]
|
||||
--
|
||||
2.47.0
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
From 7f749c41ba8d9918251c00eeb86d453cda5fbb7b Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Lee <benjamin.lee@collabora.com>
|
||||
Date: Tue, 25 Feb 2025 22:03:25 -0800
|
||||
Subject: [PATCH] meson: update wayland-protocols source_hash
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This was missed when updating to 1.41.
|
||||
|
||||
Signed-off-by: Benjamin Lee <benjamin.lee@collabora.com>
|
||||
Fixes: 53b40a40f46 ("increase required wayland-protocols version to 1.41")
|
||||
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33752>
|
||||
---
|
||||
subprojects/wayland-protocols.wrap | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/subprojects/wayland-protocols.wrap b/subprojects/wayland-protocols.wrap
|
||||
index c82fece01e3..c6686b4ae4a 100644
|
||||
--- a/subprojects/wayland-protocols.wrap
|
||||
+++ b/subprojects/wayland-protocols.wrap
|
||||
@@ -2,7 +2,7 @@
|
||||
directory = wayland-protocols-1.41
|
||||
source_url = https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.41/downloads/wayland-protocols-1.41.tar.xz
|
||||
source_filename = wayland-protocols-1.41.tar.xz
|
||||
-source_hash = ff17292c05159d2b20ce6cacfe42d7e31a28198fa1429a769b03af7c38581dbe
|
||||
+source_hash = 2786b6b1b79965e313f2c289c12075b9ed700d41844810c51afda10ee329576b
|
||||
|
||||
[provide]
|
||||
wayland-protocols = wayland_protocols
|
||||
--
|
||||
2.49.0
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
From 779c8d1669fa74b31e296519f6920e5479c19973 Mon Sep 17 00:00:00 2001
|
||||
From: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Date: Thu, 27 Feb 2025 14:56:06 +0100
|
||||
Subject: [PATCH] vulkan/wsi: don't use sRGB if the compositor doesn't support
|
||||
it
|
||||
|
||||
This could realistically happen if the compositor doesn't support parametric image
|
||||
descriptions at all, in which case we'd get a protocol error for trying to use it.
|
||||
|
||||
Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33804>
|
||||
---
|
||||
src/vulkan/wsi/wsi_common_wayland.c | 15 +++++++++++----
|
||||
1 file changed, 11 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
index 098ba9c80928e..3f636a5aad1a0 100644
|
||||
--- a/src/vulkan/wsi/wsi_common_wayland.c
|
||||
+++ b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
@@ -1139,8 +1139,14 @@ static const struct wp_image_description_v1_listener image_description_listener
|
||||
};
|
||||
|
||||
static bool
|
||||
-needs_color_surface(VkColorSpaceKHR colorspace)
|
||||
+needs_color_surface(struct wsi_wl_display *display, VkColorSpaceKHR colorspace)
|
||||
{
|
||||
+ if (colorspace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR) {
|
||||
+ /* we want to use a color surface to set sRGB if possible, but
|
||||
+ * only if the compositor actually supports sRGB */
|
||||
+ return vector_contains(&display->color_primaries, WP_COLOR_MANAGER_V1_PRIMARIES_SRGB)
|
||||
+ && vector_contains(&display->color_transfer_funcs, WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_SRGB);
|
||||
+ }
|
||||
return colorspace != VK_COLOR_SPACE_PASS_THROUGH_EXT;
|
||||
}
|
||||
|
||||
@@ -1199,8 +1205,8 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
}
|
||||
|
||||
bool new_color_surface = !surface->color.color_surface;
|
||||
- bool needs_color_surface_new = needs_color_surface(chain->color.colorspace);
|
||||
- bool needs_color_surface_old = needs_color_surface(surface->color.colorspace);
|
||||
+ bool needs_color_surface_new = needs_color_surface(display, chain->color.colorspace);
|
||||
+ bool needs_color_surface_old = needs_color_surface(display, surface->color.colorspace);
|
||||
if ((new_color_surface || !needs_color_surface_old) && needs_color_surface_new) {
|
||||
wsi_wl_surface_add_color_refcount(surface);
|
||||
} else if (needs_color_surface_old && !needs_color_surface_new) {
|
||||
@@ -3293,7 +3299,8 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain,
|
||||
wl_callback_destroy(chain->frame);
|
||||
if (chain->tearing_control)
|
||||
wp_tearing_control_v1_destroy(chain->tearing_control);
|
||||
- if (needs_color_surface(chain->color.colorspace) && wsi_wl_surface->color.color_surface) {
|
||||
+ if (needs_color_surface(wsi_wl_surface->display, chain->color.colorspace) &&
|
||||
+ wsi_wl_surface->color.color_surface) {
|
||||
wsi_wl_surface_remove_color_refcount(wsi_wl_surface);
|
||||
}
|
||||
|
||||
--
|
||||
GitLab
|
||||
|
||||
100
my-ostree-os/mesa/0001-vulkan-wsi-validate-hdr-metadata.patch
Normal file
100
my-ostree-os/mesa/0001-vulkan-wsi-validate-hdr-metadata.patch
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
From cb7726bb2cf7e25661c1401dbef2a6a597748ecd Mon Sep 17 00:00:00 2001
|
||||
From: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Date: Tue, 11 Mar 2025 13:48:31 +0100
|
||||
Subject: [PATCH] vulkan/wsi: validate HDR metadata to not cause protocol
|
||||
errors
|
||||
|
||||
If it would trigger a protocol error, we must not use it.
|
||||
|
||||
Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34000>
|
||||
---
|
||||
src/vulkan/wsi/wsi_common_wayland.c | 51 ++++++++++++++++++++++++-----
|
||||
1 file changed, 43 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
index ddfbd863c94b0..68254dc8610dc 100644
|
||||
--- a/src/vulkan/wsi/wsi_common_wayland.c
|
||||
+++ b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
@@ -1172,6 +1172,36 @@ wsi_wl_surface_remove_color_refcount(struct wsi_wl_surface *wsi_surface)
|
||||
}
|
||||
}
|
||||
|
||||
+struct wayland_hdr_metadata {
|
||||
+ uint32_t min_luminance;
|
||||
+ uint32_t max_luminance;
|
||||
+ uint32_t max_fall;
|
||||
+ uint32_t max_cll;
|
||||
+};
|
||||
+
|
||||
+#define MIN_LUM_FACTOR 10000
|
||||
+
|
||||
+static bool
|
||||
+is_hdr_metadata_legal(struct wayland_hdr_metadata *l)
|
||||
+{
|
||||
+ if (l->max_cll != 0) {
|
||||
+ if (l->max_cll * MIN_LUM_FACTOR < l->min_luminance)
|
||||
+ return false;
|
||||
+ if (l->max_cll > l->max_luminance)
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (l->max_fall != 0) {
|
||||
+ if (l->max_fall * MIN_LUM_FACTOR < l->min_luminance)
|
||||
+ return false;
|
||||
+ if (l->max_fall > l->max_luminance)
|
||||
+ return false;
|
||||
+ if (l->max_cll != 0 && l->max_fall > l->max_cll) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ return l->max_luminance * MIN_LUM_FACTOR > l->min_luminance;
|
||||
+}
|
||||
+
|
||||
static bool
|
||||
compare_hdr_metadata(struct VkHdrMetadataEXT *l, struct VkHdrMetadataEXT *r)
|
||||
{
|
||||
@@ -1215,7 +1245,14 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
wsi_wl_surface_remove_color_refcount(surface);
|
||||
}
|
||||
|
||||
- bool should_use_hdr_metadata = chain->color.has_hdr_metadata;
|
||||
+ struct wayland_hdr_metadata wayland_hdr_metadata = {
|
||||
+ .min_luminance = round(MIN_LUM_FACTOR * chain->color.hdr_metadata.minLuminance),
|
||||
+ .max_luminance = round(chain->color.hdr_metadata.maxLuminance),
|
||||
+ .max_fall = round(chain->color.hdr_metadata.maxFrameAverageLightLevel),
|
||||
+ .max_cll = round(chain->color.hdr_metadata.maxContentLightLevel),
|
||||
+ };
|
||||
+ bool should_use_hdr_metadata = chain->color.has_hdr_metadata
|
||||
+ && is_hdr_metadata_legal(&wayland_hdr_metadata);
|
||||
for (int i = 0; i < ARRAY_SIZE(colorspace_mapping); i++) {
|
||||
if (colorspace_mapping[i].colorspace == chain->color.colorspace) {
|
||||
should_use_hdr_metadata &= colorspace_mapping[i].should_use_hdr_metadata;
|
||||
@@ -1259,10 +1296,8 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
wp_image_description_creator_params_v1_set_primaries_named(creator, primaries);
|
||||
wp_image_description_creator_params_v1_set_tf_named(creator, tf);
|
||||
if (should_use_hdr_metadata) {
|
||||
- uint32_t max_cll = round(chain->color.hdr_metadata.maxContentLightLevel);
|
||||
- uint32_t max_fall = round(chain->color.hdr_metadata.maxFrameAverageLightLevel);
|
||||
- wp_image_description_creator_params_v1_set_max_cll(creator, max_cll);
|
||||
- wp_image_description_creator_params_v1_set_max_fall(creator, max_fall);
|
||||
+ wp_image_description_creator_params_v1_set_max_cll(creator, wayland_hdr_metadata.max_cll);
|
||||
+ wp_image_description_creator_params_v1_set_max_fall(creator, wayland_hdr_metadata.max_fall);
|
||||
if (display->color_features.mastering_display_primaries) {
|
||||
uint32_t red_x = round(chain->color.hdr_metadata.displayPrimaryRed.x * 1000000);
|
||||
uint32_t red_y = round(chain->color.hdr_metadata.displayPrimaryRed.y * 1000000);
|
||||
@@ -1276,9 +1311,9 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
green_x, green_y,
|
||||
blue_x, blue_y,
|
||||
white_x, white_y);
|
||||
- uint32_t min_lum = round(chain->color.hdr_metadata.minLuminance * 10000);
|
||||
- uint32_t max_lum = round(chain->color.hdr_metadata.maxLuminance);
|
||||
- wp_image_description_creator_params_v1_set_mastering_luminance(creator, min_lum, max_lum);
|
||||
+ wp_image_description_creator_params_v1_set_mastering_luminance(creator,
|
||||
+ wayland_hdr_metadata.min_luminance,
|
||||
+ wayland_hdr_metadata.max_luminance);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
GitLab
|
||||
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
From c2570055d5b45df6f2c10c2c1f2235c77db5641f Mon Sep 17 00:00:00 2001
|
||||
From: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
|
||||
Date: Mon, 7 Apr 2025 16:29:25 +0200
|
||||
Subject: [PATCH] vulkan/wsi/wayland: Avoid duplicate colorspace entry
|
||||
|
||||
The colorspace SRGB_NONLINEAR could be added twice when querying
|
||||
available formats, leading to duplicate entries and VulkanCTS WSI test
|
||||
failures.
|
||||
|
||||
Fixes: 789507c99c6 ("vulkan/wsi: implement the Wayland color management protocol")
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34410>
|
||||
---
|
||||
src/vulkan/wsi/wsi_common_wayland.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
index 6632522292798..ddfbd863c94b0 100644
|
||||
--- a/src/vulkan/wsi/wsi_common_wayland.c
|
||||
+++ b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
@@ -1033,7 +1033,9 @@ wsi_wl_display_determine_colorspaces(struct wsi_wl_display *display)
|
||||
|
||||
struct u_vector *tfs = &display->color_transfer_funcs;
|
||||
struct u_vector *primaries = &display->color_primaries;
|
||||
- for (int i = 0; i < ARRAY_SIZE(colorspace_mapping); i++) {
|
||||
+ /* Skip SRGB_NONLINEAR (i = 0), which has already been added above. */
|
||||
+ assert(colorspace_mapping[0].colorspace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR);
|
||||
+ for (int i = 1; i < ARRAY_SIZE(colorspace_mapping); i++) {
|
||||
if (!vector_contains(primaries, colorspace_mapping[i].primaries))
|
||||
continue;
|
||||
if (!vector_contains(tfs, colorspace_mapping[i].tf))
|
||||
--
|
||||
GitLab
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
From dc90e33ad2b693b1b97ba844a79d709d15c45a2d Mon Sep 17 00:00:00 2001
|
||||
From: llyyr <llyyr.public@gmail.com>
|
||||
Date: Thu, 3 Apr 2025 09:19:42 +0530
|
||||
Subject: [PATCH] vulkan/wsi/wayland: initialize surface colorspace with
|
||||
PASS_THROUGH_EXT
|
||||
|
||||
Starting with sRGB meant we would refcount to -1 if an application
|
||||
chooses PASS_THROUGH. Instead, just initialize with PASS_THROUGH so the
|
||||
initial refcount of 0 reflects reality.
|
||||
|
||||
Previously, we would segfault if an application chose PASS_THROUGH at
|
||||
swapchain initialization then switched to a color managed colorspace
|
||||
later in the runtime, because we would increment refcount from -1 -> 0
|
||||
and this would result in not creating a new color managed surface.
|
||||
|
||||
Fixes: 789507c99c67 ("vulkan/wsi: implement the Wayland color management protocol")
|
||||
Signed-off-by: llyyr <llyyr.public@gmail.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34353>
|
||||
---
|
||||
src/vulkan/wsi/wsi_common_wayland.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
index 3f636a5aad1a0..57436b12a9efc 100644
|
||||
--- a/src/vulkan/wsi/wsi_common_wayland.c
|
||||
+++ b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
@@ -2315,7 +2315,7 @@ wsi_CreateWaylandSurfaceKHR(VkInstance _instance,
|
||||
surface->surface = pCreateInfo->surface;
|
||||
|
||||
wsi_wl_surface->instance = instance;
|
||||
- wsi_wl_surface->color.colorspace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
|
||||
+ wsi_wl_surface->color.colorspace = VK_COLOR_SPACE_PASS_THROUGH_EXT;
|
||||
|
||||
*pSurface = VkIcdSurfaceBase_to_handle(&surface->base);
|
||||
|
||||
--
|
||||
GitLab
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
From 033ce1bae1505467fb69bf727377318421cb7731 Mon Sep 17 00:00:00 2001
|
||||
From: llyyr <llyyr.public@gmail.com>
|
||||
Date: Fri, 25 Apr 2025 10:41:06 +0530
|
||||
Subject: [PATCH] vulkan/wsi/wayland: make needs_color_surface_old check if
|
||||
surface exists
|
||||
|
||||
Otherwise we end up removing refcount even when we don't have a color
|
||||
surface already for applications going from SRGB_NONLINEAR to
|
||||
PASS_THROUGH dring runtime.
|
||||
|
||||
To reproduce the bug, start mpv with "--target-colorspace-hint=yes" then
|
||||
set it to "no" during runtime with a keybind
|
||||
|
||||
Fixes: 789507c99c67 ("vulkan/wsi: implement the Wayland color management protocol")
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34708>
|
||||
---
|
||||
src/vulkan/wsi/wsi_common_wayland.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
index 7c1efda1f274e..938a9cd7c181b 100644
|
||||
--- a/src/vulkan/wsi/wsi_common_wayland.c
|
||||
+++ b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
@@ -1238,8 +1238,9 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
|
||||
bool new_color_surface = !surface->color.color_surface;
|
||||
bool needs_color_surface_new = needs_color_surface(display, chain->color.colorspace);
|
||||
- bool needs_color_surface_old = needs_color_surface(display, surface->color.colorspace);
|
||||
- if ((new_color_surface || !needs_color_surface_old) && needs_color_surface_new) {
|
||||
+ bool needs_color_surface_old = surface->color.color_surface &&
|
||||
+ needs_color_surface(display, surface->color.colorspace);
|
||||
+ if (!needs_color_surface_old && needs_color_surface_new) {
|
||||
wsi_wl_surface_add_color_refcount(surface);
|
||||
} else if (needs_color_surface_old && !needs_color_surface_new) {
|
||||
wsi_wl_surface_remove_color_refcount(surface);
|
||||
--
|
||||
GitLab
|
||||
|
||||
|
|
@ -0,0 +1,614 @@
|
|||
From 5dd0635b31fcb6b12e9dcb3b908e501f153e7e8b Mon Sep 17 00:00:00 2001
|
||||
From: Colin Marc <hi@colinmarc.com>
|
||||
Date: Tue, 26 Mar 2024 11:12:28 +0100
|
||||
Subject: [PATCH 2/4] vulkan/wsi: implement the Wayland color management
|
||||
protocol
|
||||
|
||||
This allows applications to use color spaces other than sRGB, if the compositor
|
||||
supports them.
|
||||
|
||||
The color management surface is only created if a non-sRGB and non-passthrough
|
||||
colorspace is set on the surface, so applications can still use the protocol
|
||||
directly if they prefer.
|
||||
|
||||
Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
|
||||
Acked-by: Daniel Stone <daniels@collabora.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32038>
|
||||
---
|
||||
src/egl/wayland/wayland-drm/meson.build | 1 +
|
||||
src/vulkan/wsi/meson.build | 1 +
|
||||
src/vulkan/wsi/wsi_common_wayland.c | 421 ++++++++++++++++++++++--
|
||||
3 files changed, 400 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/src/egl/wayland/wayland-drm/meson.build b/src/egl/wayland/wayland-drm/meson.build
|
||||
index 59ce3442499..d3b6c15ddd2 100644
|
||||
--- a/src/egl/wayland/wayland-drm/meson.build
|
||||
+++ b/src/egl/wayland/wayland-drm/meson.build
|
||||
@@ -48,6 +48,7 @@ wp_protos = {
|
||||
'presentation-time': 'stable/presentation-time/presentation-time.xml',
|
||||
'tearing-control-v1': 'staging/tearing-control/tearing-control-v1.xml',
|
||||
'linux-drm-syncobj-v1': 'staging/linux-drm-syncobj/linux-drm-syncobj-v1.xml',
|
||||
+ 'color-management-v1': 'staging/color-management/color-management-v1.xml',
|
||||
}
|
||||
wp_files = {}
|
||||
foreach name, xml : wp_protos
|
||||
diff --git a/src/vulkan/wsi/meson.build b/src/vulkan/wsi/meson.build
|
||||
index 6933eb780c4..ba609ab3151 100644
|
||||
--- a/src/vulkan/wsi/meson.build
|
||||
+++ b/src/vulkan/wsi/meson.build
|
||||
@@ -22,6 +22,7 @@ if with_platform_wayland
|
||||
files_vulkan_wsi += wp_files['tearing-control-v1']
|
||||
links_vulkan_wsi += libloader_wayland_helper
|
||||
files_vulkan_wsi += wp_files['linux-drm-syncobj-v1']
|
||||
+ files_vulkan_wsi += wp_files['color-management-v1']
|
||||
endif
|
||||
|
||||
if with_platform_windows
|
||||
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
index d6c1b862324..d4b47c1f1b8 100644
|
||||
--- a/src/vulkan/wsi/wsi_common_wayland.c
|
||||
+++ b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "presentation-time-client-protocol.h"
|
||||
#include "linux-drm-syncobj-v1-client-protocol.h"
|
||||
#include "tearing-control-v1-client-protocol.h"
|
||||
+#include "color-management-v1-client-protocol.h"
|
||||
|
||||
#include <util/cnd_monotonic.h>
|
||||
#include <util/compiler.h>
|
||||
@@ -110,8 +111,13 @@ struct wsi_wl_display {
|
||||
struct wp_tearing_control_manager_v1 *tearing_control_manager;
|
||||
struct wp_linux_drm_syncobj_manager_v1 *wl_syncobj;
|
||||
|
||||
+ struct wp_color_manager_v1 *color_manager;
|
||||
+
|
||||
struct dmabuf_feedback_format_table format_table;
|
||||
|
||||
+ struct u_vector color_primaries;
|
||||
+ struct u_vector color_transfer_funcs;
|
||||
+
|
||||
/* users want per-chain wsi_wl_swapchain->present_ids.wp_presentation */
|
||||
struct wp_presentation *wp_presentation_notwrapped;
|
||||
uint32_t wp_presentation_version;
|
||||
@@ -125,6 +131,9 @@ struct wsi_wl_display {
|
||||
/* Formats populated by zwp_linux_dmabuf_v1 or wl_shm interfaces */
|
||||
struct u_vector formats;
|
||||
|
||||
+ /* Additional colorspaces returned by wp_color_management_v1. */
|
||||
+ struct u_vector colorspaces;
|
||||
+
|
||||
bool sw;
|
||||
|
||||
dev_t main_device;
|
||||
@@ -180,6 +189,11 @@ struct wsi_wl_surface {
|
||||
struct dmabuf_feedback dmabuf_feedback, pending_dmabuf_feedback;
|
||||
|
||||
struct wp_linux_drm_syncobj_surface_v1 *wl_syncobj_surface;
|
||||
+
|
||||
+ struct vk_instance *instance;
|
||||
+ struct wp_color_management_surface_v1 *color_surface;
|
||||
+ int color_surface_refcount;
|
||||
+ VkColorSpaceKHR colorspace;
|
||||
};
|
||||
|
||||
struct wsi_wl_swapchain {
|
||||
@@ -230,6 +244,8 @@ struct wsi_wl_swapchain {
|
||||
unsigned int refresh_nsec;
|
||||
} present_ids;
|
||||
|
||||
+ VkColorSpaceKHR colorspace;
|
||||
+
|
||||
struct wsi_wl_image images[0];
|
||||
};
|
||||
VK_DEFINE_NONDISP_HANDLE_CASTS(wsi_wl_swapchain, base.base, VkSwapchainKHR,
|
||||
@@ -885,6 +901,316 @@ static const struct wl_shm_listener shm_listener = {
|
||||
.format = shm_handle_format
|
||||
};
|
||||
|
||||
+static bool
|
||||
+vector_contains(struct u_vector *vec, unsigned int val)
|
||||
+{
|
||||
+ unsigned int *ptr;
|
||||
+
|
||||
+ u_vector_foreach(ptr, vec)
|
||||
+ if (*ptr == val)
|
||||
+ return true;
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+struct Colorspace {
|
||||
+ VkColorSpaceKHR colorspace;
|
||||
+ enum wp_color_manager_v1_primaries primaries;
|
||||
+ enum wp_color_manager_v1_transfer_function tf;
|
||||
+};
|
||||
+struct Colorspace colorspace_mapping[] = {
|
||||
+ {
|
||||
+ .colorspace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR,
|
||||
+ .primaries = WP_COLOR_MANAGER_V1_PRIMARIES_SRGB,
|
||||
+ .tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_SRGB,
|
||||
+ },
|
||||
+ {
|
||||
+ .colorspace = VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT,
|
||||
+ .primaries = WP_COLOR_MANAGER_V1_PRIMARIES_DISPLAY_P3,
|
||||
+ .tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_SRGB,
|
||||
+ },
|
||||
+ {
|
||||
+ .colorspace = VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT,
|
||||
+ .primaries = WP_COLOR_MANAGER_V1_PRIMARIES_SRGB,
|
||||
+ .tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR,
|
||||
+ },
|
||||
+ {
|
||||
+ .colorspace = VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT,
|
||||
+ .primaries = WP_COLOR_MANAGER_V1_PRIMARIES_DISPLAY_P3,
|
||||
+ .tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR,
|
||||
+ },
|
||||
+ {
|
||||
+ .colorspace = VK_COLOR_SPACE_BT709_LINEAR_EXT,
|
||||
+ .primaries = WP_COLOR_MANAGER_V1_PRIMARIES_SRGB,
|
||||
+ .tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR,
|
||||
+ },
|
||||
+ {
|
||||
+ .colorspace = VK_COLOR_SPACE_BT709_NONLINEAR_EXT,
|
||||
+ .primaries = WP_COLOR_MANAGER_V1_PRIMARIES_SRGB,
|
||||
+ .tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_BT1886,
|
||||
+ },
|
||||
+ {
|
||||
+ .colorspace = VK_COLOR_SPACE_BT2020_LINEAR_EXT,
|
||||
+ .primaries = WP_COLOR_MANAGER_V1_PRIMARIES_BT2020,
|
||||
+ .tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR,
|
||||
+ },
|
||||
+ {
|
||||
+ .colorspace = VK_COLOR_SPACE_HDR10_ST2084_EXT,
|
||||
+ .primaries = WP_COLOR_MANAGER_V1_PRIMARIES_BT2020,
|
||||
+ .tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_ST2084_PQ,
|
||||
+ },
|
||||
+ /* VK_COLOR_SPACE_DOLBYVISION_EXT is left out because it's deprecated */
|
||||
+ {
|
||||
+ .colorspace = VK_COLOR_SPACE_HDR10_HLG_EXT,
|
||||
+ .primaries = WP_COLOR_MANAGER_V1_PRIMARIES_BT2020,
|
||||
+ .tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_HLG,
|
||||
+ },
|
||||
+ {
|
||||
+ .colorspace = VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT,
|
||||
+ .primaries = WP_COLOR_MANAGER_V1_PRIMARIES_ADOBE_RGB,
|
||||
+ .tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR,
|
||||
+ },
|
||||
+ /* VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT is left out because there's no
|
||||
+ * exactly matching transfer function in the Wayland protocol */
|
||||
+ /* VK_COLOR_SPACE_PASS_THROUGH_EXT is handled elsewhere */
|
||||
+ {
|
||||
+ .colorspace = VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT,
|
||||
+ .primaries = WP_COLOR_MANAGER_V1_PRIMARIES_SRGB,
|
||||
+ .tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_SRGB,
|
||||
+ },
|
||||
+ /* VK_COLOR_SPACE_DISPLAY_NATIVE_AMD isn't supported */
|
||||
+ /* VK_COLORSPACE_SRGB_NONLINEAR_KHR is just an alias */
|
||||
+ /* VK_COLOR_SPACE_DCI_P3_LINEAR_EXT is just an alias */
|
||||
+};
|
||||
+
|
||||
+static int
|
||||
+wsi_wl_display_determine_colorspaces(struct wsi_wl_display *display)
|
||||
+{
|
||||
+ u_vector_finish(&display->colorspaces);
|
||||
+ if (!u_vector_init(&display->colorspaces, 8, sizeof(VkColorSpaceKHR)))
|
||||
+ return -1;
|
||||
+
|
||||
+ /* SRGB_NONLINEAR is always supported. */
|
||||
+ VkColorSpaceKHR *new_cs = u_vector_add(&display->colorspaces);
|
||||
+ if (!new_cs)
|
||||
+ return -1;
|
||||
+ *new_cs = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
|
||||
+
|
||||
+ /* as is PASS_THROUGH */
|
||||
+ new_cs = u_vector_add(&display->colorspaces);
|
||||
+ if (!new_cs)
|
||||
+ return -1;
|
||||
+ *new_cs = VK_COLOR_SPACE_PASS_THROUGH_EXT;
|
||||
+
|
||||
+ if (!display->color_manager)
|
||||
+ return 0;
|
||||
+
|
||||
+ struct u_vector *tfs = &display->color_transfer_funcs;
|
||||
+ struct u_vector *primaries = &display->color_primaries;
|
||||
+ for (int i = 0; i < ARRAY_SIZE(colorspace_mapping); i++) {
|
||||
+ if (!vector_contains(primaries, colorspace_mapping[i].primaries))
|
||||
+ continue;
|
||||
+ if (!vector_contains(tfs, colorspace_mapping[i].tf))
|
||||
+ continue;
|
||||
+ VkColorSpaceKHR *new_cs = u_vector_add(&display->colorspaces);
|
||||
+ if (!new_cs)
|
||||
+ return -1;
|
||||
+ *new_cs = colorspace_mapping[i].colorspace;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+color_management_handle_supported_intent(void *data,
|
||||
+ struct wp_color_manager_v1 *color_manager,
|
||||
+ unsigned int intent)
|
||||
+{
|
||||
+ /* We only use the perceptual rendering intent, which is always supported. */
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+color_management_handle_supported_features(void *data,
|
||||
+ struct wp_color_manager_v1 *color_manager,
|
||||
+ unsigned int feature)
|
||||
+{
|
||||
+ /* We don't use any non-default features yet. */
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+color_management_handle_supported_tf_named(void *data,
|
||||
+ struct wp_color_manager_v1 *color_manager,
|
||||
+ unsigned int tf)
|
||||
+{
|
||||
+ struct wsi_wl_display *display = data;
|
||||
+ unsigned int *new_tf = u_vector_add(&display->color_transfer_funcs);
|
||||
+ if (new_tf)
|
||||
+ *new_tf = tf;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+color_management_handle_supported_primaries_named(void *data,
|
||||
+ struct wp_color_manager_v1 *color_manager,
|
||||
+ unsigned int primaries)
|
||||
+{
|
||||
+ struct wsi_wl_display *display = data;
|
||||
+ unsigned int *new_primaries = u_vector_add(&display->color_primaries);
|
||||
+ if (new_primaries)
|
||||
+ *new_primaries = primaries;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+color_management_handle_done(void *data, struct wp_color_manager_v1 *color_manager)
|
||||
+{
|
||||
+ /* Intentionally left blank */
|
||||
+}
|
||||
+
|
||||
+static const struct wp_color_manager_v1_listener color_manager_listener = {
|
||||
+ .supported_intent = color_management_handle_supported_intent,
|
||||
+ .supported_feature = color_management_handle_supported_features,
|
||||
+ .supported_tf_named = color_management_handle_supported_tf_named,
|
||||
+ .supported_primaries_named = color_management_handle_supported_primaries_named,
|
||||
+ .done = color_management_handle_done,
|
||||
+};
|
||||
+
|
||||
+enum image_description_status {
|
||||
+ undefined,
|
||||
+ ready,
|
||||
+ failed,
|
||||
+};
|
||||
+
|
||||
+static void
|
||||
+color_management_handle_image_desc_failed(void *data,
|
||||
+ struct wp_image_description_v1 *desc,
|
||||
+ unsigned int cause,
|
||||
+ const char *msg)
|
||||
+{
|
||||
+ enum image_description_status *status = data;
|
||||
+ *status = failed;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+color_management_handle_image_desc_ready(void *data,
|
||||
+ struct wp_image_description_v1 *desc,
|
||||
+ unsigned int id)
|
||||
+{
|
||||
+ enum image_description_status *status = data;
|
||||
+ *status = ready;
|
||||
+}
|
||||
+
|
||||
+static const struct wp_image_description_v1_listener image_description_listener = {
|
||||
+ .failed = color_management_handle_image_desc_failed,
|
||||
+ .ready = color_management_handle_image_desc_ready,
|
||||
+};
|
||||
+
|
||||
+static bool
|
||||
+needs_color_surface(VkColorSpaceKHR colorspace)
|
||||
+{
|
||||
+ return colorspace != VK_COLOR_SPACE_PASS_THROUGH_EXT;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+wsi_wl_surface_add_color_refcount(struct wsi_wl_surface *wsi_surface)
|
||||
+{
|
||||
+ wsi_surface->color_surface_refcount++;
|
||||
+ if (wsi_surface->color_surface_refcount == 1) {
|
||||
+ wsi_surface->color_surface =
|
||||
+ wp_color_manager_v1_get_surface(wsi_surface->display->color_manager, wsi_surface->surface);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+wsi_wl_surface_remove_color_refcount(struct wsi_wl_surface *wsi_surface)
|
||||
+{
|
||||
+ wsi_surface->color_surface_refcount--;
|
||||
+ if (wsi_surface->color_surface_refcount == 0) {
|
||||
+ wp_color_management_surface_v1_destroy(wsi_surface->color_surface);
|
||||
+ wsi_surface->color_surface = NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static VkResult
|
||||
+wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
+{
|
||||
+ struct wsi_wl_surface *surface = chain->wsi_wl_surface;
|
||||
+ struct wsi_wl_display *display = surface->display;
|
||||
+
|
||||
+ /* we need the color management extension for
|
||||
+ * everything except sRGB and PASS_THROUGH */
|
||||
+ if (!display->color_manager) {
|
||||
+ if (chain->colorspace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR ||
|
||||
+ chain->colorspace == VK_COLOR_SPACE_PASS_THROUGH_EXT) {
|
||||
+ return VK_SUCCESS;
|
||||
+ } else {
|
||||
+ return VK_ERROR_SURFACE_LOST_KHR;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ bool new_color_surface = !surface->color_surface;
|
||||
+ bool needs_color_surface_new = needs_color_surface(chain->colorspace);
|
||||
+ bool needs_color_surface_old = needs_color_surface(surface->colorspace);
|
||||
+ if ((new_color_surface || !needs_color_surface_old) && needs_color_surface_new) {
|
||||
+ wsi_wl_surface_add_color_refcount(surface);
|
||||
+ } else if (needs_color_surface_old && !needs_color_surface_new) {
|
||||
+ wsi_wl_surface_remove_color_refcount(surface);
|
||||
+ }
|
||||
+
|
||||
+ if (!new_color_surface && surface->colorspace == chain->colorspace)
|
||||
+ return VK_SUCCESS;
|
||||
+
|
||||
+ /* failure is fatal, so this potentially being wrong
|
||||
+ in that case doesn't matter */
|
||||
+ surface->colorspace = chain->colorspace;
|
||||
+ if (!needs_color_surface_new)
|
||||
+ return VK_SUCCESS;
|
||||
+
|
||||
+ struct wp_image_description_creator_params_v1 *creator =
|
||||
+ wp_color_manager_v1_create_parametric_creator(display->color_manager);
|
||||
+
|
||||
+ if (!creator)
|
||||
+ return VK_ERROR_SURFACE_LOST_KHR;
|
||||
+
|
||||
+ unsigned int primaries = 0;
|
||||
+ unsigned int tf = 0;
|
||||
+ for (int i = 0; i < ARRAY_SIZE(colorspace_mapping); i++) {
|
||||
+ if (colorspace_mapping[i].colorspace == chain->colorspace) {
|
||||
+ primaries = colorspace_mapping[i].primaries;
|
||||
+ tf = colorspace_mapping[i].tf;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!primaries)
|
||||
+ return VK_ERROR_SURFACE_LOST_KHR;
|
||||
+
|
||||
+ wp_image_description_creator_params_v1_set_primaries_named(creator, primaries);
|
||||
+ wp_image_description_creator_params_v1_set_tf_named(creator, tf);
|
||||
+
|
||||
+ wl_proxy_set_queue((struct wl_proxy *) creator, display->queue);
|
||||
+
|
||||
+ struct wp_image_description_v1 *image_desc =
|
||||
+ wp_image_description_creator_params_v1_create(creator);
|
||||
+ if (!image_desc)
|
||||
+ return VK_ERROR_SURFACE_LOST_KHR;
|
||||
+
|
||||
+ enum image_description_status status = undefined;
|
||||
+ wp_image_description_v1_add_listener(image_desc, &image_description_listener, &status);
|
||||
+
|
||||
+ while (status == undefined) {
|
||||
+ int ret = wl_display_dispatch_queue(display->wl_display, display->queue);
|
||||
+ if (ret < 0)
|
||||
+ return VK_ERROR_OUT_OF_DATE_KHR;
|
||||
+ }
|
||||
+ if (status == failed)
|
||||
+ return VK_ERROR_SURFACE_LOST_KHR;
|
||||
+
|
||||
+ wp_color_management_surface_v1_set_image_description(chain->wsi_wl_surface->color_surface,
|
||||
+ image_desc,
|
||||
+ WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL);
|
||||
+ wp_image_description_v1_destroy(image_desc);
|
||||
+
|
||||
+ return VK_SUCCESS;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static void
|
||||
presentation_handle_clock_id(void* data, struct wp_presentation *wp_presentation, uint32_t clk_id)
|
||||
{
|
||||
@@ -942,6 +1268,17 @@ registry_handle_global(void *data, struct wl_registry *registry,
|
||||
display->commit_timing_manager =
|
||||
wl_registry_bind(registry, name, &wp_commit_timing_manager_v1_interface, 1);
|
||||
}
|
||||
+
|
||||
+ if (strcmp(interface, wp_color_manager_v1_interface.name) == 0) {
|
||||
+ display->color_manager =
|
||||
+ wl_registry_bind(registry, name, &wp_color_manager_v1_interface, 1);
|
||||
+
|
||||
+ u_vector_init(&display->color_primaries, 8, sizeof(uint32_t));
|
||||
+ u_vector_init(&display->color_transfer_funcs, 8, sizeof(uint32_t));
|
||||
+
|
||||
+ wp_color_manager_v1_add_listener(display->color_manager,
|
||||
+ &color_manager_listener, display);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -961,6 +1298,10 @@ wsi_wl_display_finish(struct wsi_wl_display *display)
|
||||
u_vector_foreach(f, &display->formats)
|
||||
u_vector_finish(&f->modifiers);
|
||||
u_vector_finish(&display->formats);
|
||||
+ u_vector_finish(&display->colorspaces);
|
||||
+ u_vector_finish(&display->color_primaries);
|
||||
+ u_vector_finish(&display->color_transfer_funcs);
|
||||
+
|
||||
if (display->wl_shm)
|
||||
wl_shm_destroy(display->wl_shm);
|
||||
if (display->wl_syncobj)
|
||||
@@ -975,6 +1316,8 @@ wsi_wl_display_finish(struct wsi_wl_display *display)
|
||||
wp_commit_timing_manager_v1_destroy(display->commit_timing_manager);
|
||||
if (display->tearing_control_manager)
|
||||
wp_tearing_control_manager_v1_destroy(display->tearing_control_manager);
|
||||
+ if (display->color_manager)
|
||||
+ wp_color_manager_v1_destroy(display->color_manager);
|
||||
if (display->wl_display_wrapper)
|
||||
wl_proxy_wrapper_destroy(display->wl_display_wrapper);
|
||||
if (display->queue)
|
||||
@@ -1066,9 +1409,14 @@ wsi_wl_display_init(struct wsi_wayland *wsi_wl,
|
||||
}
|
||||
}
|
||||
|
||||
- /* Round-trip again to get formats and modifiers */
|
||||
+ /* Round-trip again to get formats, modifiers and color properties */
|
||||
wl_display_roundtrip_queue(display->wl_display, display->queue);
|
||||
|
||||
+ if (wsi_wl_display_determine_colorspaces(display) < 0) {
|
||||
+ result = VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
if (wsi_wl->wsi->force_bgra8_unorm_first) {
|
||||
/* Find BGRA8_UNORM in the list and swap it to the first position if we
|
||||
* can find it. Some apps get confused if SRGB is first in the list.
|
||||
@@ -1358,6 +1706,8 @@ wsi_wl_surface_get_formats(VkIcdSurfaceBase *icd_surface,
|
||||
VkSurfaceFormatKHR* pSurfaceFormats)
|
||||
{
|
||||
VkIcdSurfaceWayland *surface = (VkIcdSurfaceWayland *)icd_surface;
|
||||
+ struct wsi_wl_surface *wsi_wl_surface =
|
||||
+ wl_container_of((VkIcdSurfaceWayland *)icd_surface, wsi_wl_surface, base);
|
||||
struct wsi_wayland *wsi =
|
||||
(struct wsi_wayland *)wsi_device->wsi[VK_ICD_WSI_PLATFORM_WAYLAND];
|
||||
|
||||
@@ -1369,18 +1719,22 @@ wsi_wl_surface_get_formats(VkIcdSurfaceBase *icd_surface,
|
||||
VK_OUTARRAY_MAKE_TYPED(VkSurfaceFormatKHR, out,
|
||||
pSurfaceFormats, pSurfaceFormatCount);
|
||||
|
||||
- struct wsi_wl_format *disp_fmt;
|
||||
- u_vector_foreach(disp_fmt, &display.formats) {
|
||||
- /* Skip formats for which we can't support both alpha & opaque
|
||||
- * formats.
|
||||
- */
|
||||
- if (!(disp_fmt->flags & WSI_WL_FMT_ALPHA) ||
|
||||
- !(disp_fmt->flags & WSI_WL_FMT_OPAQUE))
|
||||
- continue;
|
||||
+ VkColorSpaceKHR *cs;
|
||||
+ u_vector_foreach(cs, &display.colorspaces) {
|
||||
+ struct wsi_wl_format *disp_fmt;
|
||||
+ u_vector_foreach(disp_fmt, &display.formats) {
|
||||
+ /* Skip formats for which we can't support both alpha & opaque
|
||||
+ * formats.
|
||||
+ */
|
||||
+ if (!(disp_fmt->flags & WSI_WL_FMT_ALPHA) ||
|
||||
+ !(disp_fmt->flags & WSI_WL_FMT_OPAQUE)) {
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
- vk_outarray_append_typed(VkSurfaceFormatKHR, &out, out_fmt) {
|
||||
- out_fmt->format = disp_fmt->vk_format;
|
||||
- out_fmt->colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
|
||||
+ vk_outarray_append_typed(VkSurfaceFormatKHR, &out, out_fmt) {
|
||||
+ out_fmt->format = disp_fmt->vk_format;
|
||||
+ out_fmt->colorSpace = *cs;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1397,6 +1751,8 @@ wsi_wl_surface_get_formats2(VkIcdSurfaceBase *icd_surface,
|
||||
VkSurfaceFormat2KHR* pSurfaceFormats)
|
||||
{
|
||||
VkIcdSurfaceWayland *surface = (VkIcdSurfaceWayland *)icd_surface;
|
||||
+ struct wsi_wl_surface *wsi_wl_surface =
|
||||
+ wl_container_of((VkIcdSurfaceWayland *)icd_surface, wsi_wl_surface, base);
|
||||
struct wsi_wayland *wsi =
|
||||
(struct wsi_wayland *)wsi_device->wsi[VK_ICD_WSI_PLATFORM_WAYLAND];
|
||||
|
||||
@@ -1408,18 +1764,22 @@ wsi_wl_surface_get_formats2(VkIcdSurfaceBase *icd_surface,
|
||||
VK_OUTARRAY_MAKE_TYPED(VkSurfaceFormat2KHR, out,
|
||||
pSurfaceFormats, pSurfaceFormatCount);
|
||||
|
||||
- struct wsi_wl_format *disp_fmt;
|
||||
- u_vector_foreach(disp_fmt, &display.formats) {
|
||||
- /* Skip formats for which we can't support both alpha & opaque
|
||||
- * formats.
|
||||
- */
|
||||
- if (!(disp_fmt->flags & WSI_WL_FMT_ALPHA) ||
|
||||
- !(disp_fmt->flags & WSI_WL_FMT_OPAQUE))
|
||||
- continue;
|
||||
+ VkColorSpaceKHR *cs;
|
||||
+ u_vector_foreach(cs, &display.colorspaces) {
|
||||
+ struct wsi_wl_format *disp_fmt;
|
||||
+ u_vector_foreach(disp_fmt, &display.formats) {
|
||||
+ /* Skip formats for which we can't support both alpha & opaque
|
||||
+ * formats.
|
||||
+ */
|
||||
+ if (!(disp_fmt->flags & WSI_WL_FMT_ALPHA) ||
|
||||
+ !(disp_fmt->flags & WSI_WL_FMT_OPAQUE)) {
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
- vk_outarray_append_typed(VkSurfaceFormat2KHR, &out, out_fmt) {
|
||||
- out_fmt->surfaceFormat.format = disp_fmt->vk_format;
|
||||
- out_fmt->surfaceFormat.colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
|
||||
+ vk_outarray_append_typed(VkSurfaceFormat2KHR, &out, out_fmt) {
|
||||
+ out_fmt->surfaceFormat.format = disp_fmt->vk_format;
|
||||
+ out_fmt->surfaceFormat.colorSpace = *cs;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1515,6 +1875,9 @@ wsi_wl_surface_destroy(VkIcdSurfaceBase *icd_surface, VkInstance _instance,
|
||||
dmabuf_feedback_fini(&wsi_wl_surface->pending_dmabuf_feedback);
|
||||
}
|
||||
|
||||
+ if (wsi_wl_surface->color_surface)
|
||||
+ wp_color_management_surface_v1_destroy(wsi_wl_surface->color_surface);
|
||||
+
|
||||
if (wsi_wl_surface->surface)
|
||||
wl_proxy_wrapper_destroy(wsi_wl_surface->surface);
|
||||
|
||||
@@ -1837,6 +2200,9 @@ wsi_CreateWaylandSurfaceKHR(VkInstance _instance,
|
||||
surface->display = pCreateInfo->display;
|
||||
surface->surface = pCreateInfo->surface;
|
||||
|
||||
+ wsi_wl_surface->instance = instance;
|
||||
+ wsi_wl_surface->colorspace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
|
||||
+
|
||||
*pSurface = VkIcdSurfaceBase_to_handle(&surface->base);
|
||||
|
||||
return VK_SUCCESS;
|
||||
@@ -2459,6 +2825,10 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain,
|
||||
image->base.row_pitches[0] * chain->extent.height);
|
||||
}
|
||||
|
||||
+ VkResult ret = wsi_wl_swapchain_update_colorspace(chain);
|
||||
+ if (ret != VK_SUCCESS)
|
||||
+ return ret;
|
||||
+
|
||||
/* For EXT_swapchain_maintenance1. We might have transitioned from FIFO to MAILBOX.
|
||||
* In this case we need to let the FIFO request complete, before presenting MAILBOX. */
|
||||
while (!chain->legacy_fifo_ready) {
|
||||
@@ -2815,6 +3185,9 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain,
|
||||
wl_callback_destroy(chain->frame);
|
||||
if (chain->tearing_control)
|
||||
wp_tearing_control_v1_destroy(chain->tearing_control);
|
||||
+ if (needs_color_surface(chain->colorspace) && wsi_wl_surface->color_surface) {
|
||||
+ wsi_wl_surface_remove_color_refcount(wsi_wl_surface);
|
||||
+ }
|
||||
|
||||
/* Only unregister if we are the non-retired swapchain, or
|
||||
* we are a retired swapchain and memory allocation failed,
|
||||
@@ -2979,6 +3352,8 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
|
||||
WP_TEARING_CONTROL_V1_PRESENTATION_HINT_ASYNC);
|
||||
}
|
||||
|
||||
+ chain->colorspace = pCreateInfo->imageColorSpace;
|
||||
+
|
||||
enum wsi_wl_buffer_type buffer_type;
|
||||
struct wsi_base_image_params *image_params = NULL;
|
||||
struct wsi_cpu_image_params cpu_image_params;
|
||||
--
|
||||
2.49.0
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
From 0c1f2b90c97b46b6c0576643353f4c0a494e36a6 Mon Sep 17 00:00:00 2001
|
||||
From: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Date: Tue, 11 Mar 2025 14:11:23 +0100
|
||||
Subject: [PATCH] vulkan/wsi: warn once when HDR metadata is skipped because of
|
||||
protocol errors
|
||||
|
||||
Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34000>
|
||||
---
|
||||
src/vulkan/wsi/wsi_common_wayland.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
index 68254dc8610dc..6be46f49d1492 100644
|
||||
--- a/src/vulkan/wsi/wsi_common_wayland.c
|
||||
+++ b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
@@ -1251,8 +1251,12 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
.max_fall = round(chain->color.hdr_metadata.maxFrameAverageLightLevel),
|
||||
.max_cll = round(chain->color.hdr_metadata.maxContentLightLevel),
|
||||
};
|
||||
- bool should_use_hdr_metadata = chain->color.has_hdr_metadata
|
||||
- && is_hdr_metadata_legal(&wayland_hdr_metadata);
|
||||
+ bool should_use_hdr_metadata = chain->color.has_hdr_metadata;
|
||||
+ if (should_use_hdr_metadata) {
|
||||
+ should_use_hdr_metadata &= is_hdr_metadata_legal(&wayland_hdr_metadata);
|
||||
+ if (!should_use_hdr_metadata)
|
||||
+ mesa_log_once(MESA_LOG_WARN, "Not using HDR metadata to avoid protocol errors");
|
||||
+ }
|
||||
for (int i = 0; i < ARRAY_SIZE(colorspace_mapping); i++) {
|
||||
if (colorspace_mapping[i].colorspace == chain->color.colorspace) {
|
||||
should_use_hdr_metadata &= colorspace_mapping[i].should_use_hdr_metadata;
|
||||
--
|
||||
GitLab
|
||||
|
||||
|
|
@ -0,0 +1,496 @@
|
|||
From fbdd6fedb4af31db2f4dc0333751f8fd7779a841 Mon Sep 17 00:00:00 2001
|
||||
From: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Date: Tue, 5 Nov 2024 19:17:28 +0100
|
||||
Subject: [PATCH 3/4] vulkan/wsi: implement support for VK_EXT_hdr_metadata on
|
||||
Wayland
|
||||
|
||||
Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
|
||||
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
|
||||
Acked-by: Daniel Stone <daniels@collabora.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32038>
|
||||
---
|
||||
src/amd/vulkan/radv_physical_device.c | 1 +
|
||||
src/asahi/vulkan/hk_physical_device.c | 1 +
|
||||
src/freedreno/vulkan/tu_device.cc | 1 +
|
||||
src/gallium/frontends/lavapipe/lvp_device.c | 1 +
|
||||
src/intel/vulkan/anv_physical_device.c | 1 +
|
||||
src/nouveau/vulkan/nvk_physical_device.c | 1 +
|
||||
src/panfrost/vulkan/panvk_physical_device.c | 1 +
|
||||
src/vulkan/wsi/wsi_common.c | 12 ++
|
||||
src/vulkan/wsi/wsi_common_private.h | 2 +
|
||||
src/vulkan/wsi/wsi_common_wayland.c | 151 ++++++++++++++++----
|
||||
10 files changed, 146 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c
|
||||
index 0d3660e7064..4dc4f647593 100644
|
||||
--- a/src/amd/vulkan/radv_physical_device.c
|
||||
+++ b/src/amd/vulkan/radv_physical_device.c
|
||||
@@ -630,6 +630,7 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device
|
||||
.EXT_global_priority = true,
|
||||
.EXT_global_priority_query = true,
|
||||
.EXT_graphics_pipeline_library = !pdev->use_llvm && !(instance->debug_flags & RADV_DEBUG_NO_GPL),
|
||||
+ .EXT_hdr_metadata = true,
|
||||
.EXT_host_query_reset = true,
|
||||
.EXT_image_2d_view_of_3d = true,
|
||||
.EXT_image_compression_control = true,
|
||||
diff --git a/src/asahi/vulkan/hk_physical_device.c b/src/asahi/vulkan/hk_physical_device.c
|
||||
index 8dcbd15c2b7..d916d749a0d 100644
|
||||
--- a/src/asahi/vulkan/hk_physical_device.c
|
||||
+++ b/src/asahi/vulkan/hk_physical_device.c
|
||||
@@ -153,6 +153,7 @@ hk_get_device_extensions(const struct hk_instance *instance,
|
||||
.EXT_global_priority = true,
|
||||
.EXT_global_priority_query = true,
|
||||
.EXT_graphics_pipeline_library = true,
|
||||
+ .EXT_hdr_metadata = true,
|
||||
.EXT_host_query_reset = true,
|
||||
.EXT_host_image_copy = true,
|
||||
.EXT_image_2d_view_of_3d = true,
|
||||
diff --git a/src/freedreno/vulkan/tu_device.cc b/src/freedreno/vulkan/tu_device.cc
|
||||
index 7b18dcf24f9..41d15d64733 100644
|
||||
--- a/src/freedreno/vulkan/tu_device.cc
|
||||
+++ b/src/freedreno/vulkan/tu_device.cc
|
||||
@@ -274,6 +274,7 @@ get_device_extensions(const struct tu_physical_device *device,
|
||||
.EXT_global_priority = true,
|
||||
.EXT_global_priority_query = true,
|
||||
.EXT_graphics_pipeline_library = true,
|
||||
+ .EXT_hdr_metadata = true,
|
||||
.EXT_host_image_copy = true,
|
||||
.EXT_host_query_reset = true,
|
||||
.EXT_image_2d_view_of_3d = true,
|
||||
diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c
|
||||
index 934c501e231..260200e7d1c 100644
|
||||
--- a/src/gallium/frontends/lavapipe/lvp_device.c
|
||||
+++ b/src/gallium/frontends/lavapipe/lvp_device.c
|
||||
@@ -211,6 +211,7 @@ static const struct vk_device_extension_table lvp_device_extensions_supported =
|
||||
.EXT_extended_dynamic_state3 = true,
|
||||
.EXT_external_memory_host = true,
|
||||
.EXT_graphics_pipeline_library = true,
|
||||
+ .EXT_hdr_metadata = true,
|
||||
.EXT_host_image_copy = true,
|
||||
.EXT_host_query_reset = true,
|
||||
.EXT_image_2d_view_of_3d = true,
|
||||
diff --git a/src/intel/vulkan/anv_physical_device.c b/src/intel/vulkan/anv_physical_device.c
|
||||
index b2eda469415..8506790cd72 100644
|
||||
--- a/src/intel/vulkan/anv_physical_device.c
|
||||
+++ b/src/intel/vulkan/anv_physical_device.c
|
||||
@@ -282,6 +282,7 @@ get_device_extensions(const struct anv_physical_device *device,
|
||||
.EXT_global_priority_query = device->max_context_priority >=
|
||||
VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR,
|
||||
.EXT_graphics_pipeline_library = !debug_get_bool_option("ANV_NO_GPL", false),
|
||||
+ .EXT_hdr_metadata = true,
|
||||
.EXT_host_image_copy = !device->emu_astc_ldr,
|
||||
.EXT_host_query_reset = true,
|
||||
.EXT_image_2d_view_of_3d = true,
|
||||
diff --git a/src/nouveau/vulkan/nvk_physical_device.c b/src/nouveau/vulkan/nvk_physical_device.c
|
||||
index 9b05c1968aa..10ab3b6e488 100644
|
||||
--- a/src/nouveau/vulkan/nvk_physical_device.c
|
||||
+++ b/src/nouveau/vulkan/nvk_physical_device.c
|
||||
@@ -229,6 +229,7 @@ nvk_get_device_extensions(const struct nvk_instance *instance,
|
||||
.EXT_global_priority = true,
|
||||
.EXT_global_priority_query = true,
|
||||
.EXT_graphics_pipeline_library = true,
|
||||
+ .EXT_hdr_metadata = true,
|
||||
.EXT_host_query_reset = true,
|
||||
.EXT_host_image_copy = info->cls_eng3d >= TURING_A,
|
||||
.EXT_image_2d_view_of_3d = true,
|
||||
diff --git a/src/panfrost/vulkan/panvk_physical_device.c b/src/panfrost/vulkan/panvk_physical_device.c
|
||||
index dc3b371c3b0..4250d66bbb9 100644
|
||||
--- a/src/panfrost/vulkan/panvk_physical_device.c
|
||||
+++ b/src/panfrost/vulkan/panvk_physical_device.c
|
||||
@@ -231,6 +231,7 @@ get_device_extensions(const struct panvk_physical_device *device,
|
||||
.EXT_global_priority = true,
|
||||
.EXT_global_priority_query = true,
|
||||
.EXT_graphics_pipeline_library = true,
|
||||
+ .EXT_hdr_metadata = true,
|
||||
.EXT_host_query_reset = true,
|
||||
.EXT_image_drm_format_modifier = true,
|
||||
.EXT_image_robustness = true,
|
||||
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
|
||||
index d18ca4d9ebd..7f41e61639f 100644
|
||||
--- a/src/vulkan/wsi/wsi_common.c
|
||||
+++ b/src/vulkan/wsi/wsi_common.c
|
||||
@@ -2253,3 +2253,15 @@ wsi_device_supports_explicit_sync(struct wsi_device *device)
|
||||
(device->timeline_semaphore_export_handle_types &
|
||||
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT);
|
||||
}
|
||||
+
|
||||
+VKAPI_ATTR void VKAPI_CALL
|
||||
+wsi_SetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount,
|
||||
+ const VkSwapchainKHR* pSwapchains,
|
||||
+ const VkHdrMetadataEXT* pMetadata)
|
||||
+{
|
||||
+ for (uint32_t i = 0; i < swapchainCount; i++) {
|
||||
+ VK_FROM_HANDLE(wsi_swapchain, swapchain, pSwapchains[i]);
|
||||
+ if (swapchain->set_hdr_metadata)
|
||||
+ swapchain->set_hdr_metadata(swapchain, pMetadata);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/vulkan/wsi/wsi_common_private.h b/src/vulkan/wsi/wsi_common_private.h
|
||||
index 849bdc6715f..40db1a7c176 100644
|
||||
--- a/src/vulkan/wsi/wsi_common_private.h
|
||||
+++ b/src/vulkan/wsi/wsi_common_private.h
|
||||
@@ -223,6 +223,8 @@ struct wsi_swapchain {
|
||||
const uint32_t *indices);
|
||||
void (*set_present_mode)(struct wsi_swapchain *swap_chain,
|
||||
VkPresentModeKHR mode);
|
||||
+ void (*set_hdr_metadata)(struct wsi_swapchain *swap_chain,
|
||||
+ const VkHdrMetadataEXT* pMetadata);
|
||||
};
|
||||
|
||||
bool
|
||||
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
index d4b47c1f1b8..de12f524891 100644
|
||||
--- a/src/vulkan/wsi/wsi_common_wayland.c
|
||||
+++ b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
@@ -140,6 +140,11 @@ struct wsi_wl_display {
|
||||
bool same_gpu;
|
||||
|
||||
clockid_t presentation_clock_id;
|
||||
+
|
||||
+ struct {
|
||||
+ bool mastering_display_primaries;
|
||||
+ bool extended_target_volume;
|
||||
+ } color_features;
|
||||
};
|
||||
|
||||
struct wsi_wayland {
|
||||
@@ -191,9 +196,14 @@ struct wsi_wl_surface {
|
||||
struct wp_linux_drm_syncobj_surface_v1 *wl_syncobj_surface;
|
||||
|
||||
struct vk_instance *instance;
|
||||
- struct wp_color_management_surface_v1 *color_surface;
|
||||
- int color_surface_refcount;
|
||||
- VkColorSpaceKHR colorspace;
|
||||
+
|
||||
+ struct {
|
||||
+ struct wp_color_management_surface_v1 *color_surface;
|
||||
+ int color_surface_refcount;
|
||||
+ VkColorSpaceKHR colorspace;
|
||||
+ VkHdrMetadataEXT hdr_metadata;
|
||||
+ bool has_hdr_metadata;
|
||||
+ } color;
|
||||
};
|
||||
|
||||
struct wsi_wl_swapchain {
|
||||
@@ -244,7 +254,11 @@ struct wsi_wl_swapchain {
|
||||
unsigned int refresh_nsec;
|
||||
} present_ids;
|
||||
|
||||
- VkColorSpaceKHR colorspace;
|
||||
+ struct {
|
||||
+ VkColorSpaceKHR colorspace;
|
||||
+ VkHdrMetadataEXT hdr_metadata;
|
||||
+ bool has_hdr_metadata;
|
||||
+ } color;
|
||||
|
||||
struct wsi_wl_image images[0];
|
||||
};
|
||||
@@ -917,58 +931,69 @@ struct Colorspace {
|
||||
VkColorSpaceKHR colorspace;
|
||||
enum wp_color_manager_v1_primaries primaries;
|
||||
enum wp_color_manager_v1_transfer_function tf;
|
||||
+ bool should_use_hdr_metadata;
|
||||
};
|
||||
struct Colorspace colorspace_mapping[] = {
|
||||
{
|
||||
.colorspace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR,
|
||||
.primaries = WP_COLOR_MANAGER_V1_PRIMARIES_SRGB,
|
||||
.tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_SRGB,
|
||||
+ .should_use_hdr_metadata = false,
|
||||
},
|
||||
{
|
||||
.colorspace = VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT,
|
||||
.primaries = WP_COLOR_MANAGER_V1_PRIMARIES_DISPLAY_P3,
|
||||
.tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_SRGB,
|
||||
+ .should_use_hdr_metadata = false,
|
||||
},
|
||||
{
|
||||
.colorspace = VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT,
|
||||
.primaries = WP_COLOR_MANAGER_V1_PRIMARIES_SRGB,
|
||||
.tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR,
|
||||
+ .should_use_hdr_metadata = true,
|
||||
},
|
||||
{
|
||||
.colorspace = VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT,
|
||||
.primaries = WP_COLOR_MANAGER_V1_PRIMARIES_DISPLAY_P3,
|
||||
.tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR,
|
||||
+ .should_use_hdr_metadata = false,
|
||||
},
|
||||
{
|
||||
.colorspace = VK_COLOR_SPACE_BT709_LINEAR_EXT,
|
||||
.primaries = WP_COLOR_MANAGER_V1_PRIMARIES_SRGB,
|
||||
.tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR,
|
||||
+ .should_use_hdr_metadata = false,
|
||||
},
|
||||
{
|
||||
.colorspace = VK_COLOR_SPACE_BT709_NONLINEAR_EXT,
|
||||
.primaries = WP_COLOR_MANAGER_V1_PRIMARIES_SRGB,
|
||||
.tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_BT1886,
|
||||
+ .should_use_hdr_metadata = false,
|
||||
},
|
||||
{
|
||||
.colorspace = VK_COLOR_SPACE_BT2020_LINEAR_EXT,
|
||||
.primaries = WP_COLOR_MANAGER_V1_PRIMARIES_BT2020,
|
||||
.tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR,
|
||||
+ .should_use_hdr_metadata = false,
|
||||
},
|
||||
{
|
||||
.colorspace = VK_COLOR_SPACE_HDR10_ST2084_EXT,
|
||||
.primaries = WP_COLOR_MANAGER_V1_PRIMARIES_BT2020,
|
||||
.tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_ST2084_PQ,
|
||||
+ .should_use_hdr_metadata = true,
|
||||
},
|
||||
/* VK_COLOR_SPACE_DOLBYVISION_EXT is left out because it's deprecated */
|
||||
{
|
||||
.colorspace = VK_COLOR_SPACE_HDR10_HLG_EXT,
|
||||
.primaries = WP_COLOR_MANAGER_V1_PRIMARIES_BT2020,
|
||||
.tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_HLG,
|
||||
+ .should_use_hdr_metadata = true,
|
||||
},
|
||||
{
|
||||
.colorspace = VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT,
|
||||
.primaries = WP_COLOR_MANAGER_V1_PRIMARIES_ADOBE_RGB,
|
||||
.tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR,
|
||||
+ .should_use_hdr_metadata = false,
|
||||
},
|
||||
/* VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT is left out because there's no
|
||||
* exactly matching transfer function in the Wayland protocol */
|
||||
@@ -977,6 +1002,7 @@ struct Colorspace colorspace_mapping[] = {
|
||||
.colorspace = VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT,
|
||||
.primaries = WP_COLOR_MANAGER_V1_PRIMARIES_SRGB,
|
||||
.tf = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_SRGB,
|
||||
+ .should_use_hdr_metadata = true,
|
||||
},
|
||||
/* VK_COLOR_SPACE_DISPLAY_NATIVE_AMD isn't supported */
|
||||
/* VK_COLORSPACE_SRGB_NONLINEAR_KHR is just an alias */
|
||||
@@ -1033,7 +1059,17 @@ color_management_handle_supported_features(void *data,
|
||||
struct wp_color_manager_v1 *color_manager,
|
||||
unsigned int feature)
|
||||
{
|
||||
- /* We don't use any non-default features yet. */
|
||||
+ struct wsi_wl_display *display = data;
|
||||
+ switch (feature) {
|
||||
+ case WP_COLOR_MANAGER_V1_FEATURE_SET_MASTERING_DISPLAY_PRIMARIES:
|
||||
+ display->color_features.mastering_display_primaries = true;
|
||||
+ break;
|
||||
+ case WP_COLOR_MANAGER_V1_FEATURE_EXTENDED_TARGET_VOLUME:
|
||||
+ display->color_features.extended_target_volume = true;
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1111,9 +1147,9 @@ needs_color_surface(VkColorSpaceKHR colorspace)
|
||||
static void
|
||||
wsi_wl_surface_add_color_refcount(struct wsi_wl_surface *wsi_surface)
|
||||
{
|
||||
- wsi_surface->color_surface_refcount++;
|
||||
- if (wsi_surface->color_surface_refcount == 1) {
|
||||
- wsi_surface->color_surface =
|
||||
+ wsi_surface->color.color_surface_refcount++;
|
||||
+ if (wsi_surface->color.color_surface_refcount == 1) {
|
||||
+ wsi_surface->color.color_surface =
|
||||
wp_color_manager_v1_get_surface(wsi_surface->display->color_manager, wsi_surface->surface);
|
||||
}
|
||||
}
|
||||
@@ -1121,13 +1157,30 @@ wsi_wl_surface_add_color_refcount(struct wsi_wl_surface *wsi_surface)
|
||||
static void
|
||||
wsi_wl_surface_remove_color_refcount(struct wsi_wl_surface *wsi_surface)
|
||||
{
|
||||
- wsi_surface->color_surface_refcount--;
|
||||
- if (wsi_surface->color_surface_refcount == 0) {
|
||||
- wp_color_management_surface_v1_destroy(wsi_surface->color_surface);
|
||||
- wsi_surface->color_surface = NULL;
|
||||
+ wsi_surface->color.color_surface_refcount--;
|
||||
+ if (wsi_surface->color.color_surface_refcount == 0) {
|
||||
+ wp_color_management_surface_v1_destroy(wsi_surface->color.color_surface);
|
||||
+ wsi_surface->color.color_surface = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
+static bool
|
||||
+compare_hdr_metadata(struct VkHdrMetadataEXT *l, struct VkHdrMetadataEXT *r)
|
||||
+{
|
||||
+ return l->displayPrimaryRed.x == r->displayPrimaryRed.x
|
||||
+ && l->displayPrimaryRed.y == r->displayPrimaryRed.y
|
||||
+ && l->displayPrimaryGreen.x == r->displayPrimaryGreen.x
|
||||
+ && l->displayPrimaryGreen.y == r->displayPrimaryGreen.y
|
||||
+ && l->displayPrimaryBlue.x == r->displayPrimaryBlue.x
|
||||
+ && l->displayPrimaryBlue.y == r->displayPrimaryBlue.y
|
||||
+ && l->whitePoint.x == r->whitePoint.x
|
||||
+ && l->whitePoint.y == r->whitePoint.y
|
||||
+ && l->maxLuminance == r->maxLuminance
|
||||
+ && l->minLuminance == r->minLuminance
|
||||
+ && l->maxContentLightLevel == r->maxContentLightLevel
|
||||
+ && l->maxFrameAverageLightLevel == r->maxFrameAverageLightLevel;
|
||||
+}
|
||||
+
|
||||
static VkResult
|
||||
wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
{
|
||||
@@ -1137,29 +1190,43 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
/* we need the color management extension for
|
||||
* everything except sRGB and PASS_THROUGH */
|
||||
if (!display->color_manager) {
|
||||
- if (chain->colorspace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR ||
|
||||
- chain->colorspace == VK_COLOR_SPACE_PASS_THROUGH_EXT) {
|
||||
+ if (chain->color.colorspace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR ||
|
||||
+ chain->color.colorspace == VK_COLOR_SPACE_PASS_THROUGH_EXT) {
|
||||
return VK_SUCCESS;
|
||||
} else {
|
||||
return VK_ERROR_SURFACE_LOST_KHR;
|
||||
}
|
||||
}
|
||||
|
||||
- bool new_color_surface = !surface->color_surface;
|
||||
- bool needs_color_surface_new = needs_color_surface(chain->colorspace);
|
||||
- bool needs_color_surface_old = needs_color_surface(surface->colorspace);
|
||||
+ bool new_color_surface = !surface->color.color_surface;
|
||||
+ bool needs_color_surface_new = needs_color_surface(chain->color.colorspace);
|
||||
+ bool needs_color_surface_old = needs_color_surface(surface->color.colorspace);
|
||||
if ((new_color_surface || !needs_color_surface_old) && needs_color_surface_new) {
|
||||
wsi_wl_surface_add_color_refcount(surface);
|
||||
} else if (needs_color_surface_old && !needs_color_surface_new) {
|
||||
wsi_wl_surface_remove_color_refcount(surface);
|
||||
}
|
||||
|
||||
- if (!new_color_surface && surface->colorspace == chain->colorspace)
|
||||
+ bool should_use_hdr_metadata = chain->color.has_hdr_metadata;
|
||||
+ for (int i = 0; i < ARRAY_SIZE(colorspace_mapping); i++) {
|
||||
+ if (colorspace_mapping[i].colorspace == chain->color.colorspace) {
|
||||
+ should_use_hdr_metadata &= colorspace_mapping[i].should_use_hdr_metadata;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!new_color_surface &&
|
||||
+ surface->color.colorspace == chain->color.colorspace &&
|
||||
+ surface->color.has_hdr_metadata == should_use_hdr_metadata &&
|
||||
+ compare_hdr_metadata(&surface->color.hdr_metadata, &chain->color.hdr_metadata)) {
|
||||
return VK_SUCCESS;
|
||||
+ }
|
||||
|
||||
/* failure is fatal, so this potentially being wrong
|
||||
in that case doesn't matter */
|
||||
- surface->colorspace = chain->colorspace;
|
||||
+ surface->color.colorspace = chain->color.colorspace;
|
||||
+ surface->color.hdr_metadata = chain->color.hdr_metadata;
|
||||
+ surface->color.has_hdr_metadata = should_use_hdr_metadata;
|
||||
if (!needs_color_surface_new)
|
||||
return VK_SUCCESS;
|
||||
|
||||
@@ -1172,7 +1239,7 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
unsigned int primaries = 0;
|
||||
unsigned int tf = 0;
|
||||
for (int i = 0; i < ARRAY_SIZE(colorspace_mapping); i++) {
|
||||
- if (colorspace_mapping[i].colorspace == chain->colorspace) {
|
||||
+ if (colorspace_mapping[i].colorspace == chain->color.colorspace) {
|
||||
primaries = colorspace_mapping[i].primaries;
|
||||
tf = colorspace_mapping[i].tf;
|
||||
}
|
||||
@@ -1183,6 +1250,29 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
|
||||
wp_image_description_creator_params_v1_set_primaries_named(creator, primaries);
|
||||
wp_image_description_creator_params_v1_set_tf_named(creator, tf);
|
||||
+ if (should_use_hdr_metadata && display->color_features.extended_target_volume) {
|
||||
+ uint32_t max_cll = round(chain->color.hdr_metadata.maxContentLightLevel);
|
||||
+ uint32_t max_fall = round(chain->color.hdr_metadata.maxFrameAverageLightLevel);
|
||||
+ wp_image_description_creator_params_v1_set_max_cll(creator, max_cll);
|
||||
+ wp_image_description_creator_params_v1_set_max_fall(creator, max_fall);
|
||||
+ if (display->color_features.mastering_display_primaries) {
|
||||
+ uint32_t red_x = round(chain->color.hdr_metadata.displayPrimaryRed.x * 1000000);
|
||||
+ uint32_t red_y = round(chain->color.hdr_metadata.displayPrimaryRed.y * 1000000);
|
||||
+ uint32_t green_x = round(chain->color.hdr_metadata.displayPrimaryGreen.x * 1000000);
|
||||
+ uint32_t green_y = round(chain->color.hdr_metadata.displayPrimaryGreen.y * 1000000);
|
||||
+ uint32_t blue_x = round(chain->color.hdr_metadata.displayPrimaryBlue.x * 1000000);
|
||||
+ uint32_t blue_y = round(chain->color.hdr_metadata.displayPrimaryBlue.y * 1000000);
|
||||
+ uint32_t white_x = round(chain->color.hdr_metadata.whitePoint.x * 1000000);
|
||||
+ uint32_t white_y = round(chain->color.hdr_metadata.whitePoint.y * 1000000);
|
||||
+ wp_image_description_creator_params_v1_set_mastering_display_primaries(creator, red_x, red_y,
|
||||
+ green_x, green_y,
|
||||
+ blue_x, blue_y,
|
||||
+ white_x, white_y);
|
||||
+ uint32_t min_lum = round(chain->color.hdr_metadata.minLuminance * 10000);
|
||||
+ uint32_t max_lum = round(chain->color.hdr_metadata.maxLuminance);
|
||||
+ wp_image_description_creator_params_v1_set_mastering_luminance(creator, min_lum, max_lum);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
wl_proxy_set_queue((struct wl_proxy *) creator, display->queue);
|
||||
|
||||
@@ -1202,7 +1292,7 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
if (status == failed)
|
||||
return VK_ERROR_SURFACE_LOST_KHR;
|
||||
|
||||
- wp_color_management_surface_v1_set_image_description(chain->wsi_wl_surface->color_surface,
|
||||
+ wp_color_management_surface_v1_set_image_description(chain->wsi_wl_surface->color.color_surface,
|
||||
image_desc,
|
||||
WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL);
|
||||
wp_image_description_v1_destroy(image_desc);
|
||||
@@ -1210,6 +1300,14 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
+static void
|
||||
+wsi_wl_swapchain_set_hdr_metadata(struct wsi_swapchain *wsi_chain,
|
||||
+ const VkHdrMetadataEXT* pMetadata)
|
||||
+{
|
||||
+ struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain;
|
||||
+ chain->color.hdr_metadata = *pMetadata;
|
||||
+ chain->color.has_hdr_metadata = true;
|
||||
+}
|
||||
|
||||
static void
|
||||
presentation_handle_clock_id(void* data, struct wp_presentation *wp_presentation, uint32_t clk_id)
|
||||
@@ -1875,8 +1973,8 @@ wsi_wl_surface_destroy(VkIcdSurfaceBase *icd_surface, VkInstance _instance,
|
||||
dmabuf_feedback_fini(&wsi_wl_surface->pending_dmabuf_feedback);
|
||||
}
|
||||
|
||||
- if (wsi_wl_surface->color_surface)
|
||||
- wp_color_management_surface_v1_destroy(wsi_wl_surface->color_surface);
|
||||
+ if (wsi_wl_surface->color.color_surface)
|
||||
+ wp_color_management_surface_v1_destroy(wsi_wl_surface->color.color_surface);
|
||||
|
||||
if (wsi_wl_surface->surface)
|
||||
wl_proxy_wrapper_destroy(wsi_wl_surface->surface);
|
||||
@@ -2201,7 +2299,7 @@ wsi_CreateWaylandSurfaceKHR(VkInstance _instance,
|
||||
surface->surface = pCreateInfo->surface;
|
||||
|
||||
wsi_wl_surface->instance = instance;
|
||||
- wsi_wl_surface->colorspace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
|
||||
+ wsi_wl_surface->color.colorspace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
|
||||
|
||||
*pSurface = VkIcdSurfaceBase_to_handle(&surface->base);
|
||||
|
||||
@@ -3185,7 +3283,7 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain,
|
||||
wl_callback_destroy(chain->frame);
|
||||
if (chain->tearing_control)
|
||||
wp_tearing_control_v1_destroy(chain->tearing_control);
|
||||
- if (needs_color_surface(chain->colorspace) && wsi_wl_surface->color_surface) {
|
||||
+ if (needs_color_surface(chain->color.colorspace) && wsi_wl_surface->color.color_surface) {
|
||||
wsi_wl_surface_remove_color_refcount(wsi_wl_surface);
|
||||
}
|
||||
|
||||
@@ -3352,7 +3450,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
|
||||
WP_TEARING_CONTROL_V1_PRESENTATION_HINT_ASYNC);
|
||||
}
|
||||
|
||||
- chain->colorspace = pCreateInfo->imageColorSpace;
|
||||
+ chain->color.colorspace = pCreateInfo->imageColorSpace;
|
||||
|
||||
enum wsi_wl_buffer_type buffer_type;
|
||||
struct wsi_base_image_params *image_params = NULL;
|
||||
@@ -3426,6 +3524,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
|
||||
chain->base.wait_for_present = wsi_wl_swapchain_wait_for_present;
|
||||
chain->base.present_mode = present_mode;
|
||||
chain->base.image_count = num_images;
|
||||
+ chain->base.set_hdr_metadata = wsi_wl_swapchain_set_hdr_metadata;
|
||||
chain->extent = pCreateInfo->imageExtent;
|
||||
chain->vk_format = pCreateInfo->imageFormat;
|
||||
chain->buffer_type = buffer_type;
|
||||
--
|
||||
2.49.0
|
||||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
From 692057de05dcf90ea9ac180a23d4996ebc1e7206 Mon Sep 17 00:00:00 2001
|
||||
From: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Date: Thu, 7 Nov 2024 13:58:49 +0100
|
||||
Subject: [PATCH 4/4] vulkan/wsi: handle the compositor not supporting extended
|
||||
target volume better
|
||||
|
||||
Instead of unconditionally ignoring the HDR metadata, just attempt to create the image
|
||||
description, and if it fails, fall back to creating it without HDR metadata.
|
||||
|
||||
Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
|
||||
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
|
||||
Acked-by: Daniel Stone <daniels@collabora.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32038>
|
||||
---
|
||||
src/vulkan/wsi/wsi_common_wayland.c | 15 ++++++++++++---
|
||||
1 file changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
index de12f524891..4c364401226 100644
|
||||
--- a/src/vulkan/wsi/wsi_common_wayland.c
|
||||
+++ b/src/vulkan/wsi/wsi_common_wayland.c
|
||||
@@ -1250,7 +1250,7 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
|
||||
wp_image_description_creator_params_v1_set_primaries_named(creator, primaries);
|
||||
wp_image_description_creator_params_v1_set_tf_named(creator, tf);
|
||||
- if (should_use_hdr_metadata && display->color_features.extended_target_volume) {
|
||||
+ if (should_use_hdr_metadata) {
|
||||
uint32_t max_cll = round(chain->color.hdr_metadata.maxContentLightLevel);
|
||||
uint32_t max_fall = round(chain->color.hdr_metadata.maxFrameAverageLightLevel);
|
||||
wp_image_description_creator_params_v1_set_max_cll(creator, max_cll);
|
||||
@@ -1289,8 +1289,17 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
||||
if (ret < 0)
|
||||
return VK_ERROR_OUT_OF_DATE_KHR;
|
||||
}
|
||||
- if (status == failed)
|
||||
- return VK_ERROR_SURFACE_LOST_KHR;
|
||||
+ if (status == failed) {
|
||||
+ wp_image_description_v1_destroy(image_desc);
|
||||
+ if (!display->color_features.extended_target_volume && should_use_hdr_metadata) {
|
||||
+ /* VK_EXT_hdr_metadata doesn't specify if or how the metadata is used,
|
||||
+ * so it's fine to try again without it. */
|
||||
+ chain->color.has_hdr_metadata = false;
|
||||
+ return wsi_wl_swapchain_update_colorspace(chain);
|
||||
+ } else {
|
||||
+ return VK_ERROR_SURFACE_LOST_KHR;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
wp_color_management_surface_v1_set_image_description(chain->wsi_wl_surface->color.color_surface,
|
||||
image_desc,
|
||||
--
|
||||
2.49.0
|
||||
|
||||
117
my-ostree-os/mesa/Mesa-MLAA-License-Clarification-Email.txt
Normal file
117
my-ostree-os/mesa/Mesa-MLAA-License-Clarification-Email.txt
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
|
||||
Subject: RE: Question about Mesa MLAA license
|
||||
From: Jorge Jimenez <iryoku@gmail.com>
|
||||
Date: 01/08/2013 12:50 PM
|
||||
To: Tom Callaway <tcallawa@redhat.com>
|
||||
CC: "jorge@iryoku.com" <jorge@iryoku.com>
|
||||
|
||||
Yes to both questions.
|
||||
|
||||
Thanks,
|
||||
Jorge
|
||||
|
||||
From: Tom Callaway <tcallawa@redhat.com>
|
||||
Sent: January 8, 2013 6:49 PM
|
||||
To: Jorge Jimenez <iryoku@gmail.com>
|
||||
CC: jorge@iryoku.com
|
||||
Subject: Re: Question about Mesa MLAA license
|
||||
|
||||
On 01/08/2013 12:39 PM, Jorge Jimenez wrote:
|
||||
> Hi Tom,
|
||||
>
|
||||
> What we meant with that is that we made an exception for clause 2.
|
||||
> Instead of clause 2, in the case of the Mesa project, you have to name
|
||||
> the technique Jimenez's MLAA in the config options of Mesa. We did that
|
||||
> just to allow them to solve license issues. This exception should be for
|
||||
> the Mesa project, and any project using Mesa, like Fedora.
|
||||
>
|
||||
> We want to widespread usage of our MLAA, so we want to avoid any kind of
|
||||
> license complications. Hope current one is good for Fedora, if not
|
||||
> please tell, and we'll see what we can do!
|
||||
|
||||
Okay, a few more questions:
|
||||
|
||||
* If Fedora decides to simply reproduce the quoted statement:
|
||||
"Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia,
|
||||
Jose I. Echevarria, Fernando Navarro and Diego Gutierrez."
|
||||
|
||||
Specifically, if this is done as part of documentation included with
|
||||
Mesa, is that sufficient to meet clause 2 even if the Mesa config option
|
||||
is not set as described in your exception?
|
||||
|
||||
* Currently, the Mesa config option for MLAA says: "Morphological
|
||||
anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default
|
||||
quality". Is this in compliance with your exception?
|
||||
|
||||
Thanks again,
|
||||
|
||||
~tom
|
||||
|
||||
==
|
||||
Fedora Project
|
||||
|
||||
Subject: RE: Question about Mesa MLAA license
|
||||
From: Jorge Jimenez <iryoku@gmail.com>
|
||||
Date: 01/08/2013 12:39 PM
|
||||
To: "jorge@iryoku.com" <jorge@iryoku.com>, Tom Callaway <tcallawa@redhat.com>
|
||||
|
||||
Hi Tom,
|
||||
|
||||
What we meant with that is that we made an exception for clause 2.
|
||||
Instead of clause 2, in the case of the Mesa project, you have to name
|
||||
the technique Jimenez's MLAA in the config options of Mesa. We did that
|
||||
just to allow them to solve license issues. This exception should be for
|
||||
the Mesa project, and any project using Mesa, like Fedora.
|
||||
|
||||
We want to widespread usage of our MLAA, so we want to avoid any kind of
|
||||
license complications. Hope current one is good for Fedora, if not
|
||||
please tell, and we'll see what we can do!
|
||||
|
||||
Cheers,
|
||||
Jorge
|
||||
|
||||
From: Tom Callaway <tcallawa@redhat.com>
|
||||
Sent: January 8, 2013 6:30 PM
|
||||
To: jorge@iryoku.com
|
||||
Subject: Question about Mesa MLAA license
|
||||
|
||||
Jorge,
|
||||
|
||||
Thanks for all of your fantastic graphics work! I have been auditing
|
||||
Fedora (a popular distribution of Linux) for license compliance and I
|
||||
came across your MLAA code in Mesa.
|
||||
|
||||
The license says:
|
||||
|
||||
* 2. Redistributions in binary form must reproduce the following
|
||||
statement:
|
||||
*
|
||||
* "Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia,
|
||||
* Jose I. Echevarria, Fernando Navarro and Diego Gutierrez."
|
||||
*
|
||||
* Only for use in the Mesa project, this point 2 is filled by naming the
|
||||
* technique Jimenez's MLAA in the Mesa config options.
|
||||
|
||||
That wording is unclear. When you say "Only for use in the Mesa
|
||||
project...", it seems like you could either be saying:
|
||||
|
||||
- This code may only be used as part of Mesa.
|
||||
|
||||
OR
|
||||
|
||||
- In Mesa, you can comply with clause 2 by simply selecting "Jimenez's
|
||||
MLAA" in the Mesa config options.
|
||||
|
||||
*****
|
||||
|
||||
If the first item is true, then we may have to remove the MLAA code from
|
||||
Fedora's copy of Mesa. However, looking at the license on your SMAA
|
||||
code, I do not believe it to be the case. Please let me know either way!
|
||||
|
||||
Thanks in advance,
|
||||
|
||||
Tom Callaway
|
||||
Fedora Legal
|
||||
|
||||
==
|
||||
Fedora Project
|
||||
144
my-ostree-os/mesa/e4eb5e80c316c0af3fff310ca89e1175d81556c1.patch
Normal file
144
my-ostree-os/mesa/e4eb5e80c316c0af3fff310ca89e1175d81556c1.patch
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
From e4eb5e80c316c0af3fff310ca89e1175d81556c1 Mon Sep 17 00:00:00 2001
|
||||
From: Nikita Popov <npopov@redhat.com>
|
||||
Date: Thu, 27 Feb 2025 15:44:27 +0100
|
||||
Subject: [PATCH] clover: Don't include libclc headers
|
||||
|
||||
Per https://github.com/llvm/llvm-project/issues/119967 these
|
||||
headers are internal implementation details of libclc and were
|
||||
never supposed to be installed. They are not available anymore
|
||||
since LLVM 20. Instead opencl-c.h should be used.
|
||||
|
||||
There already ise a code path for including opencl-c.h, so always
|
||||
use it.
|
||||
|
||||
This didn't work for me out of the box, because the build system
|
||||
currently hardcodes the clang resource directory, which is incorrect
|
||||
for Fedora at least. Fix this by using GetResourcePath +
|
||||
CLANG_RESOURCE_DIR provided by clang instead. This is basically
|
||||
the same as what is done in clc_helper.c
|
||||
|
||||
I've still retained the old behavior as a fallback just in case
|
||||
(e.g. if clang is linked statically?)
|
||||
|
||||
Reviewed-by: Karol Herbst <kherbst@redhat.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33805>
|
||||
---
|
||||
.../frontends/clover/llvm/invocation.cpp | 53 +++++++++++++------
|
||||
src/gallium/frontends/clover/meson.build | 5 +-
|
||||
2 files changed, 39 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
|
||||
index 3cbb05baecf67..ca030b404d791 100644
|
||||
--- a/src/gallium/frontends/clover/llvm/invocation.cpp
|
||||
+++ b/src/gallium/frontends/clover/llvm/invocation.cpp
|
||||
@@ -24,6 +24,8 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
+#include <dlfcn.h>
|
||||
+
|
||||
#include <llvm/IR/DiagnosticPrinter.h>
|
||||
#include <llvm/IR/DiagnosticInfo.h>
|
||||
#include <llvm/IR/LLVMContext.h>
|
||||
@@ -39,6 +41,8 @@
|
||||
#include <clang/Frontend/TextDiagnosticBuffer.h>
|
||||
#include <clang/Frontend/TextDiagnosticPrinter.h>
|
||||
#include <clang/Basic/TargetInfo.h>
|
||||
+#include <clang/Config/config.h>
|
||||
+#include <clang/Driver/Driver.h>
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 20
|
||||
#include <llvm/Support/VirtualFileSystem.h>
|
||||
@@ -323,6 +327,30 @@ namespace {
|
||||
return c;
|
||||
}
|
||||
|
||||
+ std::string getResourceDirectory() {
|
||||
+ Dl_info info;
|
||||
+ if (dladdr((void *)clang::CompilerInvocation::CreateFromArgs, &info) == 0) {
|
||||
+ return FALLBACK_CLANG_RESOURCE_DIR;
|
||||
+ }
|
||||
+
|
||||
+ char *libclang_path = realpath(info.dli_fname, NULL);
|
||||
+ if (libclang_path == nullptr) {
|
||||
+ return FALLBACK_CLANG_RESOURCE_DIR;
|
||||
+ }
|
||||
+
|
||||
+ // GetResourcePath is a way to retrieve the actual libclang resource dir based on a given
|
||||
+ // binary or library.
|
||||
+ std::string clang_resource_dir =
|
||||
+#if LLVM_VERSION_MAJOR >= 20
|
||||
+ clang::driver::Driver::GetResourcesPath(std::string(libclang_path));
|
||||
+#else
|
||||
+ clang::driver::Driver::GetResourcesPath(std::string(libclang_path), CLANG_RESOURCE_DIR);
|
||||
+#endif
|
||||
+ free(libclang_path);
|
||||
+
|
||||
+ return clang_resource_dir;
|
||||
+ }
|
||||
+
|
||||
std::unique_ptr<Module>
|
||||
compile(LLVMContext &ctx, clang::CompilerInstance &c,
|
||||
const std::string &name, const std::string &source,
|
||||
@@ -331,25 +359,18 @@ namespace {
|
||||
c.getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly;
|
||||
c.getHeaderSearchOpts().UseBuiltinIncludes = true;
|
||||
c.getHeaderSearchOpts().UseStandardSystemIncludes = true;
|
||||
- c.getHeaderSearchOpts().ResourceDir = CLANG_RESOURCE_DIR;
|
||||
|
||||
- if (use_libclc) {
|
||||
- // Add libclc generic search path
|
||||
- c.getHeaderSearchOpts().AddPath(LIBCLC_INCLUDEDIR,
|
||||
- clang::frontend::Angled,
|
||||
- false, false);
|
||||
+ std::string clang_resource_dir = getResourceDirectory();
|
||||
+ c.getHeaderSearchOpts().ResourceDir = clang_resource_dir;
|
||||
|
||||
- // Add libclc include
|
||||
- c.getPreprocessorOpts().Includes.push_back("clc/clc.h");
|
||||
- } else {
|
||||
- // Add opencl-c generic search path
|
||||
- c.getHeaderSearchOpts().AddPath(CLANG_RESOURCE_DIR,
|
||||
- clang::frontend::Angled,
|
||||
- false, false);
|
||||
+ // Add opencl-c generic search path
|
||||
+ std::string clang_include_path = clang_resource_dir + "/include";
|
||||
+ c.getHeaderSearchOpts().AddPath(clang_include_path,
|
||||
+ clang::frontend::Angled,
|
||||
+ false, false);
|
||||
|
||||
- // Add opencl include
|
||||
- c.getPreprocessorOpts().Includes.push_back("opencl-c.h");
|
||||
- }
|
||||
+ // Add opencl include
|
||||
+ c.getPreprocessorOpts().Includes.push_back("opencl-c.h");
|
||||
|
||||
// Add definition for the OpenCL version
|
||||
const auto dev_version = dev.device_version();
|
||||
diff --git a/src/gallium/frontends/clover/meson.build b/src/gallium/frontends/clover/meson.build
|
||||
index e569b86a1bea7..56a9894f0dbb1 100644
|
||||
--- a/src/gallium/frontends/clover/meson.build
|
||||
+++ b/src/gallium/frontends/clover/meson.build
|
||||
@@ -10,7 +10,6 @@ clover_opencl_cpp_args = [
|
||||
'-DCL_USE_DEPRECATED_OPENCL_2_0_APIS',
|
||||
'-DCL_USE_DEPRECATED_OPENCL_2_1_APIS',
|
||||
'-DCL_USE_DEPRECATED_OPENCL_2_2_APIS',
|
||||
- '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'includedir')),
|
||||
'-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'libexecdir'))
|
||||
]
|
||||
clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux]
|
||||
@@ -43,9 +42,9 @@ libclllvm = static_library(
|
||||
cpp_args : [
|
||||
clover_cpp_args,
|
||||
clover_opencl_cpp_args,
|
||||
- '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
|
||||
+ '-DFALLBACK_CLANG_RESOURCE_DIR="@0@"'.format(join_paths(
|
||||
dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang',
|
||||
- dep_llvm.version(), 'include',
|
||||
+ dep_llvm.version()
|
||||
)),
|
||||
],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
--
|
||||
GitLab
|
||||
|
||||
11
my-ostree-os/mesa/gnome-shell-glthread-disable.patch
Normal file
11
my-ostree-os/mesa/gnome-shell-glthread-disable.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
diff -up mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf.dma mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf
|
||||
--- mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf.dma 2022-11-25 10:32:32.175879868 +1000
|
||||
+++ mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf 2022-11-25 10:32:43.743067470 +1000
|
||||
@@ -653,6 +653,7 @@ TODO: document the other workarounds.
|
||||
<application name="gnome-shell" executable="gnome-shell">
|
||||
<option name="adaptive_sync" value="false" />
|
||||
<option name="v3d_nonmsaa_texture_size_limit" value="true" />
|
||||
+ <option name="mesa_glthread" value="false"/>
|
||||
</application>
|
||||
<application name="Desktop — Plasma" executable="plasmashell">
|
||||
<option name="adaptive_sync" value="false" />
|
||||
738
my-ostree-os/mesa/mesa.spec
Normal file
738
my-ostree-os/mesa/mesa.spec
Normal file
|
|
@ -0,0 +1,738 @@
|
|||
%ifnarch s390x
|
||||
%global with_hardware 1
|
||||
%global with_radeonsi 1
|
||||
%global with_vmware 1
|
||||
%global with_vulkan_hw 1
|
||||
%global with_vdpau 1
|
||||
%global with_va 1
|
||||
%if !0%{?rhel}
|
||||
%global with_r300 1
|
||||
%global with_r600 1
|
||||
%global with_nine 1
|
||||
%if 0%{?with_vulkan_hw}
|
||||
%global with_nvk %{with_vulkan_hw}
|
||||
%endif
|
||||
%global with_opencl 1
|
||||
%endif
|
||||
%global base_vulkan %{?with_vulkan_hw:,amd}%{!?with_vulkan_hw:%{nil}}
|
||||
%endif
|
||||
|
||||
%ifnarch %{ix86}
|
||||
%if !0%{?rhel}
|
||||
%global with_teflon 1
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%ifarch %{ix86} x86_64
|
||||
%global with_crocus 1
|
||||
%global with_i915 1
|
||||
%global with_iris 1
|
||||
%global with_xa 1
|
||||
%global with_intel_clc 1
|
||||
%global intel_platform_vulkan %{?with_vulkan_hw:,intel,intel_hasvk}%{!?with_vulkan_hw:%{nil}}
|
||||
%endif
|
||||
%ifarch x86_64
|
||||
%if !0%{?with_vulkan_hw}
|
||||
%global with_intel_vk_rt 1
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%ifarch aarch64 x86_64 %{ix86}
|
||||
%global with_kmsro 1
|
||||
%if !0%{?rhel}
|
||||
%global with_lima 1
|
||||
%global with_vc4 1
|
||||
%global with_etnaviv 1
|
||||
%global with_tegra 1
|
||||
%endif
|
||||
%global with_freedreno 1
|
||||
%global with_panfrost 1
|
||||
%global with_v3d 1
|
||||
%global with_xa 1
|
||||
%global extra_platform_vulkan %{?with_vulkan_hw:,broadcom,freedreno,panfrost,imagination-experimental}%{!?with_vulkan_hw:%{nil}}
|
||||
%endif
|
||||
|
||||
%if !0%{?rhel}
|
||||
%global with_libunwind 1
|
||||
%global with_lmsensors 1
|
||||
%endif
|
||||
|
||||
%ifarch %{valgrind_arches}
|
||||
%bcond_without valgrind
|
||||
%else
|
||||
%bcond_with valgrind
|
||||
%endif
|
||||
|
||||
%global vulkan_drivers swrast,virtio%{?base_vulkan}%{?intel_platform_vulkan}%{?extra_platform_vulkan}%{?with_nvk:,nouveau}
|
||||
%global toolchain clang
|
||||
%define _disable_source_fetch 0
|
||||
|
||||
Name: mesa
|
||||
Summary: Mesa graphics libraries
|
||||
%global ver 25.0.7
|
||||
Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)}
|
||||
Release: 10.clang.skylake%{?dist}
|
||||
License: MIT AND BSD-3-Clause AND SGI-B-2.0
|
||||
URL: http://www.mesa3d.org
|
||||
|
||||
Source0: https://archive.mesa3d.org/mesa-%{ver}.tar.xz
|
||||
# src/gallium/auxiliary/postprocess/pp_mlaa* have an ... interestingly worded license.
|
||||
# Source1 contains email correspondence clarifying the license terms.
|
||||
# Fedora opts to ignore the optional part of clause 2 and treat that code as 2 clause BSD.
|
||||
Source1: Mesa-MLAA-License-Clarification-Email.txt
|
||||
|
||||
Patch10: gnome-shell-glthread-disable.patch
|
||||
|
||||
# Backport of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33805
|
||||
# to fix clover with libclc from LLVM 20.
|
||||
Patch20: e4eb5e80c316c0af3fff310ca89e1175d81556c1.patch
|
||||
|
||||
# Backport of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32038
|
||||
# and fixes: vulkan/wsi: implement the Wayland color management protocol
|
||||
Patch21: 0001-increase-required-wayland-protocols-version-to-1.41.patch
|
||||
Patch22: 0002-vulkan-wsi-implement-the-Wayland-color-management-pr.patch
|
||||
Patch23: 0003-vulkan-wsi-implement-support-for-VK_EXT_hdr_metadata.patch
|
||||
Patch24: 0004-vulkan-wsi-handle-the-compositor-not-supporting-exte.patch
|
||||
Patch25: 0001-meson-update-wayland-protocols-source_hash.patch
|
||||
Patch26: 0001-docs-features-add-VK_EXT_hdr_metadata.patch
|
||||
# Additional fixups for color management:
|
||||
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33804
|
||||
Patch27: 0001-vulkan-wsi-dont-use-srgb-if-the-compositor.patch
|
||||
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34000
|
||||
Patch28: 0001-vulkan-wsi-validate-hdr-metadata.patch
|
||||
Patch29: 0002-vulkan-wsi-warn-once-when-hdr-metadata-is-skipped.patch
|
||||
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34353
|
||||
Patch30: 0001-vulkan-wsi-wayland-initialize-surface-colorspace.patch
|
||||
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34410
|
||||
Patch31: 0001-vulkan-wsi-wayland-avoid-duplicate-colorspace-entry.patch
|
||||
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34708
|
||||
Patch32: 0001-vulkan-wsi-wayland-make-needs_color_surface_old_check_if.patch
|
||||
|
||||
# This patch makes Fedora CI fail and causes issues in QEMU. Revert it until
|
||||
# we find a fix.
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=2360851
|
||||
# https://gitlab.freedesktop.org/mesa/mesa/-/issues/13009
|
||||
Patch40: 0001-Revert-kopper-Explicitly-choose-zink.patch
|
||||
|
||||
BuildRequires: meson >= 1.3.0
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: clang
|
||||
BuildRequires: lld
|
||||
BuildRequires: gettext
|
||||
%if 0%{?with_hardware}
|
||||
BuildRequires: kernel-headers
|
||||
%endif
|
||||
# We only check for the minimum version of pkgconfig(libdrm) needed so that the
|
||||
# SRPMs for each arch still have the same build dependencies. See:
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1859515
|
||||
BuildRequires: pkgconfig(libdrm) >= 2.4.122
|
||||
%if 0%{?with_libunwind}
|
||||
BuildRequires: pkgconfig(libunwind)
|
||||
%endif
|
||||
BuildRequires: pkgconfig(expat)
|
||||
BuildRequires: pkgconfig(zlib) >= 1.2.3
|
||||
BuildRequires: pkgconfig(libzstd)
|
||||
BuildRequires: pkgconfig(libselinux)
|
||||
BuildRequires: pkgconfig(wayland-scanner)
|
||||
BuildRequires: pkgconfig(wayland-protocols) >= 1.34
|
||||
BuildRequires: pkgconfig(wayland-client) >= 1.11
|
||||
BuildRequires: pkgconfig(wayland-server) >= 1.11
|
||||
BuildRequires: pkgconfig(wayland-egl-backend) >= 3
|
||||
BuildRequires: pkgconfig(x11)
|
||||
BuildRequires: pkgconfig(xext)
|
||||
BuildRequires: pkgconfig(xdamage) >= 1.1
|
||||
BuildRequires: pkgconfig(xfixes)
|
||||
BuildRequires: pkgconfig(xcb-glx) >= 1.8.1
|
||||
BuildRequires: pkgconfig(xxf86vm)
|
||||
BuildRequires: pkgconfig(xcb)
|
||||
BuildRequires: pkgconfig(x11-xcb)
|
||||
BuildRequires: pkgconfig(xcb-dri2) >= 1.8
|
||||
BuildRequires: pkgconfig(xcb-dri3)
|
||||
BuildRequires: pkgconfig(xcb-present)
|
||||
BuildRequires: pkgconfig(xcb-sync)
|
||||
BuildRequires: pkgconfig(xshmfence) >= 1.1
|
||||
BuildRequires: pkgconfig(dri2proto) >= 2.8
|
||||
BuildRequires: pkgconfig(glproto) >= 1.4.14
|
||||
BuildRequires: pkgconfig(xcb-xfixes)
|
||||
BuildRequires: pkgconfig(xcb-randr)
|
||||
BuildRequires: pkgconfig(xrandr) >= 1.3
|
||||
BuildRequires: bison
|
||||
BuildRequires: flex
|
||||
%if 0%{?with_lmsensors}
|
||||
BuildRequires: lm_sensors-devel
|
||||
%endif
|
||||
%if 0%{?with_vdpau}
|
||||
BuildRequires: pkgconfig(vdpau) >= 1.1
|
||||
%endif
|
||||
%if 0%{?with_va}
|
||||
BuildRequires: pkgconfig(libva) >= 0.38.0
|
||||
%endif
|
||||
BuildRequires: pkgconfig(libelf)
|
||||
BuildRequires: pkgconfig(libglvnd) >= 1.3.2
|
||||
BuildRequires: llvm-devel >= 7.0.0
|
||||
%if 0%{?with_teflon}
|
||||
BuildRequires: flatbuffers-devel
|
||||
BuildRequires: flatbuffers-compiler
|
||||
BuildRequires: xtensor-devel
|
||||
%endif
|
||||
%if 0%{?with_opencl} || 0%{?with_nvk} || 0%{?with_intel_clc}
|
||||
BuildRequires: clang-devel
|
||||
BuildRequires: pkgconfig(libclc)
|
||||
BuildRequires: pkgconfig(SPIRV-Tools)
|
||||
BuildRequires: pkgconfig(LLVMSPIRVLib)
|
||||
%endif
|
||||
%if 0%{?with_opencl} || 0%{?with_nvk}
|
||||
BuildRequires: bindgen
|
||||
BuildRequires: rust-packaging
|
||||
%endif
|
||||
%if 0%{?with_nvk}
|
||||
BuildRequires: cbindgen
|
||||
BuildRequires: (crate(paste) >= 1.0.14 with crate(paste) < 2)
|
||||
BuildRequires: (crate(proc-macro2) >= 1.0.56 with crate(proc-macro2) < 2)
|
||||
BuildRequires: (crate(quote) >= 1.0.25 with crate(quote) < 2)
|
||||
BuildRequires: (crate(syn/clone-impls) >= 2.0.15 with crate(syn/clone-impls) < 3)
|
||||
BuildRequires: (crate(unicode-ident) >= 1.0.6 with crate(unicode-ident) < 2)
|
||||
%endif
|
||||
%if %{with valgrind}
|
||||
BuildRequires: pkgconfig(valgrind)
|
||||
%endif
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-mako
|
||||
%if 0%{?with_intel_clc}
|
||||
BuildRequires: python3-ply
|
||||
%endif
|
||||
BuildRequires: python3-pycparser
|
||||
BuildRequires: python3-pyyaml
|
||||
BuildRequires: vulkan-headers
|
||||
BuildRequires: glslang
|
||||
%if 0%{?with_vulkan_hw}
|
||||
BuildRequires: pkgconfig(vulkan)
|
||||
%endif
|
||||
|
||||
%description
|
||||
%{summary}.
|
||||
|
||||
%package filesystem
|
||||
Summary: Mesa driver filesystem
|
||||
Provides: mesa-dri-filesystem = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Obsoletes: mesa-omx-drivers < %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
|
||||
%description filesystem
|
||||
%{summary}.
|
||||
|
||||
%package libGL
|
||||
Summary: Mesa libGL runtime libraries
|
||||
Requires: libglvnd-glx%{?_isa} >= 1:1.3.2
|
||||
Requires: %{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
|
||||
%description libGL
|
||||
%{summary}.
|
||||
|
||||
%package libGL-devel
|
||||
Summary: Mesa libGL development package
|
||||
Requires: (%{name}-libGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} if %{name}-libGL%{?_isa})
|
||||
Requires: libglvnd-devel%{?_isa} >= 1:1.3.2
|
||||
Provides: libGL-devel
|
||||
Provides: libGL-devel%{?_isa}
|
||||
Recommends: gl-manpages
|
||||
|
||||
%description libGL-devel
|
||||
%{summary}.
|
||||
|
||||
%package libEGL
|
||||
Summary: Mesa libEGL runtime libraries
|
||||
Requires: libglvnd-egl%{?_isa} >= 1:1.3.2
|
||||
Requires: %{name}-libgbm%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Requires: %{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
|
||||
%description libEGL
|
||||
%{summary}.
|
||||
|
||||
%package libEGL-devel
|
||||
Summary: Mesa libEGL development package
|
||||
Requires: (%{name}-libEGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} if %{name}-libEGL%{?_isa})
|
||||
Requires: libglvnd-devel%{?_isa} >= 1:1.3.2
|
||||
Requires: %{name}-khr-devel%{?_isa}
|
||||
Provides: libEGL-devel
|
||||
Provides: libEGL-devel%{?_isa}
|
||||
|
||||
%description libEGL-devel
|
||||
%{summary}.
|
||||
|
||||
%package dri-drivers
|
||||
Summary: Mesa-based DRI drivers
|
||||
Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%if 0%{?with_va}
|
||||
Recommends: %{name}-va-drivers%{?_isa}
|
||||
%endif
|
||||
Obsoletes: %{name}-libglapi < 25.0.0~rc2-1
|
||||
|
||||
%description dri-drivers
|
||||
%{summary}.
|
||||
|
||||
%if 0%{?with_va}
|
||||
%package va-drivers
|
||||
Summary: Mesa-based VA-API video acceleration drivers
|
||||
Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Obsoletes: %{name}-vaapi-drivers < 22.2.0-5
|
||||
|
||||
%description va-drivers
|
||||
%{summary}.
|
||||
%endif
|
||||
|
||||
%if 0%{?with_vdpau}
|
||||
%package vdpau-drivers
|
||||
Summary: Mesa-based VDPAU drivers
|
||||
Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
|
||||
%description vdpau-drivers
|
||||
%{summary}.
|
||||
%endif
|
||||
|
||||
%package libOSMesa
|
||||
Summary: Mesa offscreen rendering libraries
|
||||
Provides: libOSMesa
|
||||
Provides: libOSMesa%{?_isa}
|
||||
|
||||
%description libOSMesa
|
||||
%{summary}.
|
||||
|
||||
%package libOSMesa-devel
|
||||
Summary: Mesa offscreen rendering development package
|
||||
Requires: %{name}-libOSMesa%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
|
||||
%description libOSMesa-devel
|
||||
%{summary}.
|
||||
|
||||
%package libgbm
|
||||
Summary: Mesa gbm runtime library
|
||||
Provides: libgbm
|
||||
Provides: libgbm%{?_isa}
|
||||
Recommends: %{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
# If mesa-dri-drivers are installed, they must match in version. This is here to prevent using
|
||||
# older mesa-dri-drivers together with a newer mesa-libgbm and its dependants.
|
||||
# See https://bugzilla.redhat.com/show_bug.cgi?id=2193135 .
|
||||
Requires: (%{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} if %{name}-dri-drivers%{?_isa})
|
||||
|
||||
%description libgbm
|
||||
%{summary}.
|
||||
|
||||
%package libgbm-devel
|
||||
Summary: Mesa libgbm development package
|
||||
Requires: %{name}-libgbm%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Provides: libgbm-devel
|
||||
Provides: libgbm-devel%{?_isa}
|
||||
|
||||
%description libgbm-devel
|
||||
%{summary}.
|
||||
|
||||
%if 0%{?with_xa}
|
||||
%package libxatracker
|
||||
Summary: Mesa XA state tracker
|
||||
Provides: libxatracker
|
||||
Provides: libxatracker%{?_isa}
|
||||
|
||||
%description libxatracker
|
||||
%{summary}.
|
||||
|
||||
%package libxatracker-devel
|
||||
Summary: Mesa XA state tracker development package
|
||||
Requires: %{name}-libxatracker%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Provides: libxatracker-devel
|
||||
Provides: libxatracker-devel%{?_isa}
|
||||
|
||||
%description libxatracker-devel
|
||||
%{summary}.
|
||||
%endif
|
||||
|
||||
%if 0%{?with_opencl}
|
||||
%package libOpenCL
|
||||
Summary: Mesa OpenCL runtime library
|
||||
Requires: (ocl-icd%{?_isa} or OpenCL-ICD-Loader%{?_isa})
|
||||
Requires: libclc%{?_isa}
|
||||
Requires: %{name}-libgbm%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Requires: opencl-filesystem
|
||||
|
||||
%description libOpenCL
|
||||
%{summary}.
|
||||
|
||||
%package libOpenCL-devel
|
||||
Summary: Mesa OpenCL development package
|
||||
Requires: %{name}-libOpenCL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
|
||||
%description libOpenCL-devel
|
||||
%{summary}.
|
||||
%endif
|
||||
|
||||
%if 0%{?with_teflon}
|
||||
%package libTeflon
|
||||
Summary: Mesa TensorFlow Lite delegate
|
||||
|
||||
%description libTeflon
|
||||
%{summary}.
|
||||
%endif
|
||||
|
||||
%if 0%{?with_nine}
|
||||
%package libd3d
|
||||
Summary: Mesa Direct3D9 state tracker
|
||||
|
||||
%description libd3d
|
||||
%{summary}.
|
||||
|
||||
%package libd3d-devel
|
||||
Summary: Mesa Direct3D9 state tracker development package
|
||||
Requires: %{name}-libd3d%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
|
||||
%description libd3d-devel
|
||||
%{summary}.
|
||||
%endif
|
||||
|
||||
%package vulkan-drivers
|
||||
Summary: Mesa Vulkan drivers
|
||||
Requires: vulkan%{_isa}
|
||||
Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Obsoletes: mesa-vulkan-devel < %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
|
||||
%description vulkan-drivers
|
||||
The drivers with support for the Vulkan API.
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{ver} -p1
|
||||
cp %{SOURCE1} docs/
|
||||
|
||||
%build
|
||||
# ensure standard Rust compiler flags are set
|
||||
export RUSTFLAGS="%build_rustflags -C lto=thin -C linker-plugin-lto -C target-cpu=skylake -C link-arg=-fuse-ld=lld"
|
||||
|
||||
%if 0%{?with_nvk}
|
||||
export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/"
|
||||
# So... Meson can't actually find them without tweaks
|
||||
%define inst_crate_nameversion() %(basename %{cargo_registry}/%{1}-*)
|
||||
%define rewrite_wrap_file() sed -e "/source.*/d" -e "s/%{1}-.*/%{inst_crate_nameversion %{1}}/" -i subprojects/%{1}.wrap
|
||||
|
||||
%rewrite_wrap_file proc-macro2
|
||||
%rewrite_wrap_file quote
|
||||
%rewrite_wrap_file syn
|
||||
%rewrite_wrap_file unicode-ident
|
||||
%rewrite_wrap_file paste
|
||||
%endif
|
||||
|
||||
CFLAGS="$CFLAGS -march=skylake -mtune=skylake -O3" CXXFLAGS="$CXXFLAGS -march=skylake -mtune=skylake -O3" %meson \
|
||||
-Dplatforms=x11,wayland \
|
||||
-Dosmesa=true \
|
||||
--buildtype=release \
|
||||
%if 0%{?with_hardware}
|
||||
-Dgallium-drivers=llvmpipe,virgl,nouveau%{?with_r300:,r300}%{?with_crocus:,crocus}%{?with_i915:,i915}%{?with_iris:,iris}%{?with_vmware:,svga}%{?with_radeonsi:,radeonsi}%{?with_r600:,r600}%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_v3d:,v3d}%{?with_lima:,lima}%{?with_panfrost:,panfrost}%{?with_vulkan_hw:,zink} \
|
||||
%else
|
||||
-Dgallium-drivers=llvmpipe,virgl \
|
||||
%endif
|
||||
-Dgallium-vdpau=%{?with_vdpau:enabled}%{!?with_vdpau:disabled} \
|
||||
-Dgallium-va=%{?with_va:enabled}%{!?with_va:disabled} \
|
||||
-Dgallium-xa=%{?with_xa:enabled}%{!?with_xa:disabled} \
|
||||
-Dgallium-nine=%{?with_nine:true}%{!?with_nine:false} \
|
||||
-Dteflon=%{?with_teflon:true}%{!?with_teflon:false} \
|
||||
-Dgallium-opencl=%{?with_opencl:icd}%{!?with_opencl:disabled} \
|
||||
%if 0%{?with_opencl}
|
||||
-Dgallium-rusticl=true \
|
||||
%endif
|
||||
-Dvulkan-drivers=%{?vulkan_drivers} \
|
||||
-Dvideo-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec,vp9dec \
|
||||
-Dvulkan-layers=device-select \
|
||||
-Dshared-glapi=enabled \
|
||||
-Dgles1=enabled \
|
||||
-Dgles2=enabled \
|
||||
-Dopengl=true \
|
||||
-Dgbm=enabled \
|
||||
-Dglx=dri \
|
||||
-Degl=enabled \
|
||||
-Dglvnd=enabled \
|
||||
%if 0%{?with_intel_clc}
|
||||
-Dintel-clc=enabled \
|
||||
%endif
|
||||
-Dintel-rt=%{?with_intel_vk_rt:enabled}%{!?with_intel_vk_rt:disabled} \
|
||||
-Dmicrosoft-clc=disabled \
|
||||
-Dllvm=enabled \
|
||||
-Dshared-llvm=enabled \
|
||||
-Dvalgrind=%{?with_valgrind:enabled}%{!?with_valgrind:disabled} \
|
||||
-Dbuild-tests=false \
|
||||
-Dselinux=true \
|
||||
%if !0%{?with_libunwind}
|
||||
-Dlibunwind=disabled \
|
||||
%endif
|
||||
%if !0%{?with_lmsensors}
|
||||
-Dlmsensors=disabled \
|
||||
%endif
|
||||
-Dandroid-libbacktrace=disabled \
|
||||
%ifarch %{ix86}
|
||||
-Dglx-read-only-text=true \
|
||||
%endif
|
||||
%{nil}
|
||||
%meson_build
|
||||
|
||||
%install
|
||||
%meson_install
|
||||
|
||||
# libvdpau opens the versioned name, don't bother including the unversioned
|
||||
rm -vf %{buildroot}%{_libdir}/vdpau/*.so
|
||||
# likewise glvnd
|
||||
rm -vf %{buildroot}%{_libdir}/libGLX_mesa.so
|
||||
rm -vf %{buildroot}%{_libdir}/libEGL_mesa.so
|
||||
# XXX can we just not build this
|
||||
rm -vf %{buildroot}%{_libdir}/libGLES*
|
||||
|
||||
# glvnd needs a default provider for indirect rendering where it cannot
|
||||
# determine the vendor
|
||||
ln -s %{_libdir}/libGLX_mesa.so.0 %{buildroot}%{_libdir}/libGLX_system.so.0
|
||||
|
||||
# this keeps breaking, check it early. note that the exit from eu-ftr is odd.
|
||||
pushd %{buildroot}%{_libdir}
|
||||
for i in libOSMesa*.so libGL.so ; do
|
||||
eu-findtextrel $i && exit 1
|
||||
done
|
||||
popd
|
||||
|
||||
%files filesystem
|
||||
%doc docs/Mesa-MLAA-License-Clarification-Email.txt
|
||||
%dir %{_libdir}/dri
|
||||
%dir %{_datadir}/drirc.d
|
||||
|
||||
%files libGL
|
||||
%{_libdir}/libGLX_mesa.so.0*
|
||||
%{_libdir}/libGLX_system.so.0*
|
||||
%files libGL-devel
|
||||
%dir %{_includedir}/GL
|
||||
%dir %{_includedir}/GL/internal
|
||||
%{_includedir}/GL/internal/dri_interface.h
|
||||
%{_libdir}/pkgconfig/dri.pc
|
||||
|
||||
%files libEGL
|
||||
%{_datadir}/glvnd/egl_vendor.d/50_mesa.json
|
||||
%{_libdir}/libEGL_mesa.so.0*
|
||||
%files libEGL-devel
|
||||
%dir %{_includedir}/EGL
|
||||
%{_includedir}/EGL/eglext_angle.h
|
||||
%{_includedir}/EGL/eglmesaext.h
|
||||
|
||||
%files libOSMesa
|
||||
%{_libdir}/libOSMesa.so.8*
|
||||
%files libOSMesa-devel
|
||||
%dir %{_includedir}/GL
|
||||
%{_includedir}/GL/osmesa.h
|
||||
%{_libdir}/libOSMesa.so
|
||||
%{_libdir}/pkgconfig/osmesa.pc
|
||||
|
||||
%files libgbm
|
||||
%{_libdir}/libgbm.so.1
|
||||
%{_libdir}/libgbm.so.1.*
|
||||
%files libgbm-devel
|
||||
%{_libdir}/libgbm.so
|
||||
%{_includedir}/gbm.h
|
||||
%{_libdir}/pkgconfig/gbm.pc
|
||||
|
||||
%if 0%{?with_xa}
|
||||
%files libxatracker
|
||||
%if 0%{?with_hardware}
|
||||
%{_libdir}/libxatracker.so.2
|
||||
%{_libdir}/libxatracker.so.2.*
|
||||
%endif
|
||||
|
||||
%files libxatracker-devel
|
||||
%if 0%{?with_hardware}
|
||||
%{_libdir}/libxatracker.so
|
||||
%{_includedir}/xa_tracker.h
|
||||
%{_includedir}/xa_composite.h
|
||||
%{_includedir}/xa_context.h
|
||||
%{_libdir}/pkgconfig/xatracker.pc
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if 0%{?with_teflon}
|
||||
%files libTeflon
|
||||
%{_libdir}/libteflon.so
|
||||
%endif
|
||||
|
||||
%if 0%{?with_opencl}
|
||||
%files libOpenCL
|
||||
%{_libdir}/libMesaOpenCL.so.*
|
||||
%{_libdir}/libRusticlOpenCL.so.*
|
||||
%{_sysconfdir}/OpenCL/vendors/mesa.icd
|
||||
%{_sysconfdir}/OpenCL/vendors/rusticl.icd
|
||||
|
||||
%files libOpenCL-devel
|
||||
%{_libdir}/libMesaOpenCL.so
|
||||
%{_libdir}/libRusticlOpenCL.so
|
||||
%endif
|
||||
|
||||
%if 0%{?with_nine}
|
||||
%files libd3d
|
||||
%dir %{_libdir}/d3d/
|
||||
%{_libdir}/d3d/*.so.*
|
||||
|
||||
%files libd3d-devel
|
||||
%{_libdir}/pkgconfig/d3d.pc
|
||||
%{_includedir}/d3dadapter/
|
||||
%{_libdir}/d3d/*.so
|
||||
%endif
|
||||
|
||||
%files dri-drivers
|
||||
%{_datadir}/drirc.d/00-mesa-defaults.conf
|
||||
%{_libdir}/libgallium-*.so
|
||||
%{_libdir}/gbm/dri_gbm.so
|
||||
%{_libdir}/dri/kms_swrast_dri.so
|
||||
%{_libdir}/dri/libdril_dri.so
|
||||
%{_libdir}/dri/swrast_dri.so
|
||||
%{_libdir}/dri/virtio_gpu_dri.so
|
||||
|
||||
%if 0%{?with_hardware}
|
||||
%if 0%{?with_r300}
|
||||
%{_libdir}/dri/r300_dri.so
|
||||
%endif
|
||||
%if 0%{?with_radeonsi}
|
||||
%if 0%{?with_r600}
|
||||
%{_libdir}/dri/r600_dri.so
|
||||
%endif
|
||||
%{_libdir}/dri/radeonsi_dri.so
|
||||
%endif
|
||||
%ifarch %{ix86} x86_64
|
||||
%{_libdir}/dri/crocus_dri.so
|
||||
%{_libdir}/dri/i915_dri.so
|
||||
%{_libdir}/dri/iris_dri.so
|
||||
%endif
|
||||
%ifarch aarch64 x86_64 %{ix86}
|
||||
%{_libdir}/dri/ingenic-drm_dri.so
|
||||
%{_libdir}/dri/imx-drm_dri.so
|
||||
%{_libdir}/dri/imx-lcdif_dri.so
|
||||
%{_libdir}/dri/kirin_dri.so
|
||||
%{_libdir}/dri/komeda_dri.so
|
||||
%{_libdir}/dri/mali-dp_dri.so
|
||||
%{_libdir}/dri/mcde_dri.so
|
||||
%{_libdir}/dri/mxsfb-drm_dri.so
|
||||
%{_libdir}/dri/rcar-du_dri.so
|
||||
%{_libdir}/dri/stm_dri.so
|
||||
%endif
|
||||
%if 0%{?with_vc4}
|
||||
%{_libdir}/dri/vc4_dri.so
|
||||
%endif
|
||||
%if 0%{?with_v3d}
|
||||
%{_libdir}/dri/v3d_dri.so
|
||||
%endif
|
||||
%if 0%{?with_freedreno}
|
||||
%{_libdir}/dri/kgsl_dri.so
|
||||
%{_libdir}/dri/msm_dri.so
|
||||
%endif
|
||||
%if 0%{?with_etnaviv}
|
||||
%{_libdir}/dri/etnaviv_dri.so
|
||||
%endif
|
||||
%if 0%{?with_tegra}
|
||||
%{_libdir}/dri/tegra_dri.so
|
||||
%endif
|
||||
%if 0%{?with_lima}
|
||||
%{_libdir}/dri/lima_dri.so
|
||||
%endif
|
||||
%if 0%{?with_panfrost}
|
||||
%{_libdir}/dri/panfrost_dri.so
|
||||
%{_libdir}/dri/panthor_dri.so
|
||||
%endif
|
||||
%{_libdir}/dri/nouveau_dri.so
|
||||
%if 0%{?with_vmware}
|
||||
%{_libdir}/dri/vmwgfx_dri.so
|
||||
%endif
|
||||
%endif
|
||||
%if 0%{?with_opencl}
|
||||
%dir %{_libdir}/gallium-pipe
|
||||
%{_libdir}/gallium-pipe/*.so
|
||||
%endif
|
||||
%if 0%{?with_kmsro}
|
||||
%{_libdir}/dri/armada-drm_dri.so
|
||||
%{_libdir}/dri/exynos_dri.so
|
||||
%{_libdir}/dri/gm12u320_dri.so
|
||||
%{_libdir}/dri/hdlcd_dri.so
|
||||
%{_libdir}/dri/hx8357d_dri.so
|
||||
%{_libdir}/dri/ili9163_dri.so
|
||||
%{_libdir}/dri/ili9225_dri.so
|
||||
%{_libdir}/dri/ili9341_dri.so
|
||||
%{_libdir}/dri/ili9486_dri.so
|
||||
%{_libdir}/dri/imx-dcss_dri.so
|
||||
%{_libdir}/dri/mediatek_dri.so
|
||||
%{_libdir}/dri/meson_dri.so
|
||||
%{_libdir}/dri/mi0283qt_dri.so
|
||||
%{_libdir}/dri/panel-mipi-dbi_dri.so
|
||||
%{_libdir}/dri/pl111_dri.so
|
||||
%{_libdir}/dri/repaper_dri.so
|
||||
%{_libdir}/dri/rockchip_dri.so
|
||||
%{_libdir}/dri/rzg2l-du_dri.so
|
||||
%{_libdir}/dri/ssd130x_dri.so
|
||||
%{_libdir}/dri/st7586_dri.so
|
||||
%{_libdir}/dri/st7735r_dri.so
|
||||
%{_libdir}/dri/sti_dri.so
|
||||
%{_libdir}/dri/sun4i-drm_dri.so
|
||||
%{_libdir}/dri/udl_dri.so
|
||||
%{_libdir}/dri/vkms_dri.so
|
||||
%{_libdir}/dri/zynqmp-dpsub_dri.so
|
||||
%endif
|
||||
%if 0%{?with_vulkan_hw}
|
||||
%{_libdir}/dri/zink_dri.so
|
||||
%endif
|
||||
|
||||
%if 0%{?with_va}
|
||||
%files va-drivers
|
||||
%{_libdir}/dri/nouveau_drv_video.so
|
||||
%if 0%{?with_r600}
|
||||
%{_libdir}/dri/r600_drv_video.so
|
||||
%endif
|
||||
%if 0%{?with_radeonsi}
|
||||
%{_libdir}/dri/radeonsi_drv_video.so
|
||||
%endif
|
||||
%{_libdir}/dri/virtio_gpu_drv_video.so
|
||||
%endif
|
||||
|
||||
%if 0%{?with_vdpau}
|
||||
%files vdpau-drivers
|
||||
%dir %{_libdir}/vdpau
|
||||
%{_libdir}/vdpau/libvdpau_nouveau.so.1*
|
||||
%if 0%{?with_r600}
|
||||
%{_libdir}/vdpau/libvdpau_r600.so.1*
|
||||
%endif
|
||||
%if 0%{?with_radeonsi}
|
||||
%{_libdir}/vdpau/libvdpau_radeonsi.so.1*
|
||||
%endif
|
||||
%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1*
|
||||
%endif
|
||||
|
||||
%files vulkan-drivers
|
||||
%{_libdir}/libvulkan_lvp.so
|
||||
%{_datadir}/vulkan/icd.d/lvp_icd.*.json
|
||||
%{_libdir}/libvulkan_virtio.so
|
||||
%{_datadir}/vulkan/icd.d/virtio_icd.*.json
|
||||
%{_libdir}/libVkLayer_MESA_device_select.so
|
||||
%{_datadir}/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json
|
||||
%if 0%{?with_vulkan_hw}
|
||||
%{_libdir}/libvulkan_radeon.so
|
||||
%{_datadir}/drirc.d/00-radv-defaults.conf
|
||||
%{_datadir}/vulkan/icd.d/radeon_icd.*.json
|
||||
%if 0%{?with_nvk}
|
||||
%{_libdir}/libvulkan_nouveau.so
|
||||
%{_datadir}/vulkan/icd.d/nouveau_icd.*.json
|
||||
%endif
|
||||
%ifarch %{ix86} x86_64
|
||||
%{_libdir}/libvulkan_intel.so
|
||||
%{_datadir}/vulkan/icd.d/intel_icd.*.json
|
||||
%{_libdir}/libvulkan_intel_hasvk.so
|
||||
%{_datadir}/vulkan/icd.d/intel_hasvk_icd.*.json
|
||||
%endif
|
||||
%ifarch aarch64 x86_64 %{ix86}
|
||||
%{_libdir}/libvulkan_broadcom.so
|
||||
%{_datadir}/vulkan/icd.d/broadcom_icd.*.json
|
||||
%{_libdir}/libvulkan_freedreno.so
|
||||
%{_datadir}/vulkan/icd.d/freedreno_icd.*.json
|
||||
%{_libdir}/libvulkan_panfrost.so
|
||||
%{_datadir}/vulkan/icd.d/panfrost_icd.*.json
|
||||
%{_libdir}/libpowervr_rogue.so
|
||||
%{_libdir}/libvulkan_powervr_mesa.so
|
||||
%{_datadir}/vulkan/icd.d/powervr_mesa_icd.*.json
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
Summary: Xwayland
|
||||
Name: xorg-x11-server-Xwayland
|
||||
Version: 24.1.5
|
||||
Release: 15.clang.skylake%{?dist}
|
||||
Version: 24.1.6
|
||||
Release: 10.clang.skylake%{?dist}
|
||||
|
||||
URL: http://www.x.org
|
||||
%if 0%{?gitdate}
|
||||
|
|
@ -138,6 +138,14 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
|
|||
%{_libdir}/pkgconfig/xwayland.pc
|
||||
|
||||
%changelog
|
||||
* Wed Feb 26 2025 Olivier Fourdan <ofourdan@redhat.com> - 24.1.6-1
|
||||
- xwayland 24.1.6 (#2343992)
|
||||
- CVE fix for: CVE-2025-26594, CVE-2025-26595, CVE-2025-26596, CVE-2025-26597,
|
||||
CVE-2025-26598, CVE-2025-26599, CVE-2025-26600, CVE-2025-26601
|
||||
|
||||
* Tue Feb 11 2025 Olivier Fourdan <ofourdan@redhat.com> - 24.1.5-2
|
||||
- Fix a regression with keyboard modifiers due to a bug in gamescope
|
||||
|
||||
* Wed Feb 5 2025 Olivier Fourdan <ofourdan@redhat.com> - 24.1.5-1
|
||||
- xwayland 24.1.5
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue