diff options
author | Vasiliy Stelmachenok | 2021-10-10 21:52:09 +0300 |
---|---|---|
committer | Vasiliy Stelmachenok | 2021-10-10 21:52:09 +0300 |
commit | d4a10b589e00f7ab666e2b144b4b20d5f4352f1a (patch) | |
tree | 40796dcb2f1005eab01fa145580663ba933ffa93 | |
parent | a246bf1d70c4ae6d6e14e68bcd492cae7853b2e9 (diff) | |
download | aur-d4a10b589e00f7ab666e2b144b4b20d5f4352f1a.tar.gz |
EnableBrightnessControl=1 by default and clang support
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 39 |
2 files changed, 28 insertions, 16 deletions
@@ -1,6 +1,6 @@ pkgbase = nvidia-dkms-performance pkgver = 470.74 - pkgrel = 6 + pkgrel = 7 url = https://www.nvidia.com/ arch = x86_64 arch = aarch64 @@ -55,6 +55,9 @@ pkgname = nvidia-dkms-performance depends = dkms depends = nvidia-utils-performance=470.74 depends = libglvnd + depends = llvm + depends = clang + depends = lld provides = nvidia=470.74 provides = nvidia-dkms=470.74 provides = nvidia-dkms-performance=470.74 @@ -27,7 +27,6 @@ _nvidia_patch= # 1 - Static strategy with maximum performance for AC operation and maximum power savings for the battery # 2 - Static strategy with maximum performance for AC operation, but an adaptive strategy for battery operation. # 3 - Adaptive strategy for AC operation, but static strategy with maximum power saving for the battery. -# 4 - Adaptive strategy for all (This is the default, right? # # Note: Setting up the PowerMizer circuitry is not overclocking the GPU and assumes safe use for your hardware. # However, you can reassign the behavior of the power scheme through the Xorg option "RegistryDwords". @@ -51,6 +50,12 @@ _powermizer_scheme= # Warning: Works only for laptops. _override_max_perf= +# Forced use of the clang compiler to build DKMS modules +# Works only for kernels built by clang +# Note: This is experimental and not officially supported by driver/DKMS. +# Please do not send bug reports to NVIDIA with this option enabled. +_force_clang_usage= + pkgbase=nvidia-dkms-performance if [ $CARCH != 'aarch64' ]; then pkgname=(nvidia-dkms-performance nvidia-settings-performance nvidia-utils-performance opencl-nvidia-performance @@ -59,7 +64,7 @@ else pkgname=(nvidia-dkms-performance nvidia-settings-performance nvidia-utils-performance opencl-nvidia-performance) fi pkgver=470.74 -pkgrel=6 +pkgrel=7 arch=('x86_64' 'aarch64') url='https://www.nvidia.com/' license=('custom') @@ -148,22 +153,17 @@ prepare() { fi fi + registrydwords='"EnableBrightnessControl=1' if [ ! -z $_powermizer_scheme ] && [ -z $_override_max_perf ]; then echo "You have selected the powermizer scheme: $_powermizer_scheme" echo "If you don't like it in time you can change it with the Xorg "RegistryDwords" option (in the bit value)" echo "or rebuild it with the new value." if [ "$_powermizer_scheme" = "1" ]; then - sed -i 's/__NV_REGISTRY_DWORDS, NULL/__NV_REGISTRY_DWORDS, "PowerMizerEnable=0x1;PerfLevelSrc=0x2222;PowerMizerDefault=0x3;PowerMizerDefaultAC=0x1"/' \ - kernel/nvidia/nv-reg.h + registrydwords+=';PowerMizerEnable=0x1;PerfLevelSrc=0x2222;PowerMizerDefault=0x3;PowerMizerDefaultAC=0x1"' elif [ "$_powermizer_scheme" = "2" ]; then - sed -i 's/__NV_REGISTRY_DWORDS, NULL/__NV_REGISTRY_DWORDS, "PowerMizerEnable=0x1;PerfLevelSrc=0x2233;PowerMizerDefault=0x3"/' \ - kernel/nvidia/nv-reg.h + registrydwords+=';PowerMizerEnable=0x1;PerfLevelSrc=0x2233;PowerMizerDefault=0x3"' elif [ "$_powermizer_scheme" = "3" ]; then - sed -i 's/__NV_REGISTRY_DWORDS, NULL/__NV_REGISTRY_DWORDS, "PowerMizerEnable=0x1;PerfLevelSrc=0x2233;PowerMizerDefault=0x3"/' \ - kernel/nvidia/nv-reg.h - elif [ "$_powermizer_scheme" = "4" ]; then - sed -i 's/__NV_REGISTRY_DWORDS, NULL/__NV_REGISTRY_DWORDS, "PowerMizerEnable=0x1;PerfLevelSrc=0x3333"/' \ - kernel/nvidia/nv-reg.h + registrydwords+=';PowerMizerEnable=0x1;PerfLevelSrc=0x2233;PowerMizerDefault=0x3"' else echo "You have selected the wrong powermizer scheme, please reread the option description in PKGBUILD." fi @@ -174,21 +174,30 @@ prepare() { echo "If you don't like it in time you can change it with the Xorg "OverrideMaxPerf" option (in the bit value)" echo "or rebuild it with the new value." if [ "$_override_max_perf" = "1" ]; then - sed -i 's/__NV_REGISTRY_DWORDS, NULL/__NV_REGISTRY_DWORDS, "OverrideMaxPerf=0x2"/' \ - kernel/nvidia/nv-reg.h + registrydwords+=';OverrideMaxPerf=0x2"' elif [ "$_override_max_perf" = "2" ]; then - sed -i 's/__NV_REGISTRY_DWORDS, NULL/__NV_REGISTRY_DWORDS, "OverrideMaxPerf=0x3"/' \ - kernel/nvidia/nv-reg.h + registrydwords+=';OverrideMaxPerf=0x3"' else echo "You selected the wrong value for the performance level forcing. Please reread the option description in PKGBUILD." fi fi + + sed -i "s/__NV_REGISTRY_DWORDS, NULL/__NV_REGISTRY_DWORDS, ${registrydwords}/" \ + kernel/nvidia/nv-reg.h + + # workaround for dkms+clang + if [[ ! -z $_force_clang_usage ]]; then + sed -i "s/'make'/'make' LLVM=1 CC=clang CXX=clang++ LD=ld.lld AS=llvm-as AR=llvm-ar NM=llvm-nm OBJCOPY=llvm-objcopy OBJSIZE=llvm-size STRIP=llvm-strip/" kernel/dkms.conf + fi } package_nvidia-dkms-performance() { pkgdesc='NVIDIA driver sources for linux with some optimizations' arch=('x86_64' 'aarch64') depends=('dkms' "nvidia-utils-performance=${pkgver}" 'libglvnd') + if [[ ! -z $_force_clang_usage ]]; then + depends+=('llvm' 'clang' 'lld') + fi provides=("nvidia=${pkgver}" "nvidia-dkms=${pkgver}" "nvidia-dkms-performance=${pkgver}" 'NVIDIA-MODULE') conflicts=('nvidia' 'nvidia-dkms') |