commit d161c69a5333c3423c85b4a476ac4f2399d8d45b
Author: Henrik Nordström <henrik(a)hno.se>
Date: Sat Jan 29 03:40:12 2022 +0100
Update to 390.147
Also refreshed patches from Debian
0001-backport-error-on-unknown-conftests.patch | 59 ++++++++++++++++++++++
...kport-error-on-unknown-conftests-uvm-part.patch | 25 +++++++++
arm-outer-sync.patch | 2 +-
bashisms.patch | 14 +++++
cc_version_check-gcc5.patch | 2 +-
conftest-verbose.patch | 6 +--
ignore_xen_on_arm.patch | 2 +-
include-swiotlb-header-on-arm.patch | 2 +-
kernel-5.7.0-set-memory-array.patch | 12 ++---
nvidia-390xx-kmod.spec | 29 +++++++----
nvidia-drm-arm-cflags.patch | 2 +-
use-kbuild-flags.patch | 8 +--
use-kbuild-gcc-plugins.patch | 2 +-
13 files changed, 136 insertions(+), 29 deletions(-)
---
diff --git a/0001-backport-error-on-unknown-conftests.patch
b/0001-backport-error-on-unknown-conftests.patch
new file mode 100644
index 0000000..6ef460c
--- /dev/null
+++ b/0001-backport-error-on-unknown-conftests.patch
@@ -0,0 +1,59 @@
+From 5b446ec6cf9c37a5a0865cc98367b1f70a402c59 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe(a)debian.org>
+Date: Wed, 22 Sep 2021 08:49:14 +0200
+Subject: [PATCH 1/2] backport error on unknown conftests
+
+for easier backporting of future conftest.sh changes
+---
+ conftest.sh | 12 ++++++++++++
+ nvidia/nvidia.Kbuild | 4 ++--
+ 2 files changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/conftest.sh b/conftest.sh
+index abbb636..a965b14 100755
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -4516,6 +4516,18 @@ compile_test() {
+
+ compile_check_conftest "$CODE" "NV_DRM_DEVICE_HAS_PDEV"
"" "types"
+ ;;
++
++ # When adding a new conftest entry, please use the correct format for
++ # specifying the relevant upstream Linux kernel commit.
++ #
++ # <function> was added|removed|etc by commit <sha> ("<commit
message")
++ # in <kernel-version> (<commit date>).
++
++ *)
++ # Unknown test name given
++ echo "Error: unknown conftest '$1' requested" >&2
++ exit 1
++ ;;
+ esac
+ }
+
+diff --git a/nvidia/nvidia.Kbuild b/nvidia/nvidia.Kbuild
+index 185d3b5..9375ebb 100644
+--- a/nvidia/nvidia.Kbuild
++++ b/nvidia/nvidia.Kbuild
+@@ -105,7 +105,7 @@ NV_OBJECTS_DEPEND_ON_CONFTEST += $(NVIDIA_OBJECTS)
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += remap_pfn_range
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += hash__remap_4k_pfn
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += follow_pfn
+-NV_CONFTEST_FUNCTION_COMPILE_TESTS += vmap
++#NV_CONFTEST_FUNCTION_COMPILE_TESTS += vmap
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += set_pages_uc
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += list_is_first
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += set_memory_uc
+@@ -127,7 +127,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_walk_namespace
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_domain_nr
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_dma_mapping_error
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += sg_alloc_table
+-NV_CONFTEST_FUNCTION_COMPILE_TESTS += sg_init_table
++#NV_CONFTEST_FUNCTION_COMPILE_TESTS += sg_init_table
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_get_domain_bus_and_slot
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += get_num_physpages
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += efi_enabled
+--
+2.20.1
+
diff --git a/0002-backport-error-on-unknown-conftests-uvm-part.patch
b/0002-backport-error-on-unknown-conftests-uvm-part.patch
new file mode 100644
index 0000000..d941007
--- /dev/null
+++ b/0002-backport-error-on-unknown-conftests-uvm-part.patch
@@ -0,0 +1,25 @@
+From c2a0cf09fed824a739f32dcb0bfc28e5df116fde Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe(a)debian.org>
+Date: Wed, 22 Dec 2021 18:06:40 +0100
+Subject: [PATCH 2/2] backport error on unknown conftests (uvm part)
+
+---
+ nvidia-uvm/nvidia-uvm.Kbuild | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/nvidia-uvm/nvidia-uvm.Kbuild b/nvidia-uvm/nvidia-uvm.Kbuild
+index d447e23..27e33c1 100644
+--- a/nvidia-uvm/nvidia-uvm.Kbuild
++++ b/nvidia-uvm/nvidia-uvm.Kbuild
+@@ -91,7 +91,7 @@ endif
+
+ NV_OBJECTS_DEPEND_ON_CONFTEST += $(NVIDIA_UVM_OBJECTS)
+
+-NV_CONFTEST_FUNCTION_COMPILE_TESTS += remap_page_range
++#NV_CONFTEST_FUNCTION_COMPILE_TESTS += remap_page_range
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += remap_pfn_range
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += vm_insert_page
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += kmem_cache_create
+--
+2.20.1
+
diff --git a/arm-outer-sync.patch b/arm-outer-sync.patch
index c2cfb88..69b25d0 100644
--- a/arm-outer-sync.patch
+++ b/arm-outer-sync.patch
@@ -5,7 +5,7 @@ Description: Redefine WRITE_COMBINE_FLUSH on ARM on kernel >= 4.3
is defined. Fall back to no memory barrier at all if that is not configured.
--- a/common/inc/nv-linux.h
+++ b/common/inc/nv-linux.h
-@@ -470,7 +470,13 @@ extern int nv_pat_mode;
+@@ -469,7 +469,13 @@ extern int nv_pat_mode;
#if defined(CONFIG_OUTER_CACHE)
#define OUTER_FLUSH_RANGE(start, end) outer_flush_range((start),(end))
#endif
diff --git a/bashisms.patch b/bashisms.patch
new file mode 100644
index 0000000..be38881
--- /dev/null
+++ b/bashisms.patch
@@ -0,0 +1,14 @@
+Author: Andreas Beckmann <anbe(a)debian.org>
+Description: fix bashisms in conftest.sh
+
+--- a/conftest.sh
++++ b/conftest.sh
+@@ -4858,7 +4858,7 @@
+
+ if [ -n "$VGX_BUILD" ]; then
+ if [ -f /proc/xen/capabilities ]; then
+- if [ "`cat /proc/xen/capabilities`" == "control_d"
]; then
++ if [ "`cat /proc/xen/capabilities`" = "control_d" ];
then
+ exit 0
+ fi
+ else
diff --git a/cc_version_check-gcc5.patch b/cc_version_check-gcc5.patch
index 88a5249..dba5435 100644
--- a/cc_version_check-gcc5.patch
+++ b/cc_version_check-gcc5.patch
@@ -5,7 +5,7 @@ Description: ignore __GNUC_MINOR__ from GCC 5 onwards
--- a/conftest.sh
+++ b/conftest.sh
-@@ -4442,7 +4442,7 @@ case "$6" in
+@@ -4616,7 +4616,7 @@
kernel_cc_minor=`echo ${kernel_cc_version} | cut -d '.' -f 2`
echo "
diff --git a/conftest-verbose.patch b/conftest-verbose.patch
index 4fae8ce..10cc577 100644
--- a/conftest-verbose.patch
+++ b/conftest-verbose.patch
@@ -3,7 +3,7 @@ Description: dump the generated conftest headers
--- a/Kbuild
+++ b/Kbuild
-@@ -117,6 +117,16 @@ NV_CONFTEST_HEADERS += $(obj)/conftest/h
+@@ -115,6 +115,16 @@
NV_CONFTEST_HEADERS += $(NV_CONFTEST_COMPILE_TEST_HEADERS)
@@ -20,7 +20,7 @@ Description: dump the generated conftest headers
#
# Generate a header file for a single conftest compile test. Each compile test
# header depends on conftest.sh, as well as the generated conftest/headers.h
-@@ -141,6 +151,8 @@ define NV_GENERATE_COMPILE_TEST_HEADER
+@@ -139,6 +149,8 @@
@mkdir -p $(obj)/conftest
@# concatenate /dev/null to prevent cat from hanging when $$^ is empty
@cat $$^ /dev/null > $$@
@@ -29,7 +29,7 @@ Description: dump the generated conftest headers
endef
#
-@@ -160,13 +172,17 @@ $(eval $(call NV_GENERATE_COMPILE_TEST_H
+@@ -158,13 +170,17 @@
$(eval $(call
NV_GENERATE_COMPILE_TEST_HEADER,symbols,$(NV_CONFTEST_SYMBOL_COMPILE_TESTS)))
$(eval $(call NV_GENERATE_COMPILE_TEST_HEADER,types,$(NV_CONFTEST_TYPE_COMPILE_TESTS)))
diff --git a/ignore_xen_on_arm.patch b/ignore_xen_on_arm.patch
index fa28dba..150aa69 100644
--- a/ignore_xen_on_arm.patch
+++ b/ignore_xen_on_arm.patch
@@ -24,7 +24,7 @@ Description: Undef CONFIG_XEN and CONFIG_XEN_DOM0 if building on ARM
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9)
#error "This driver does not support kernels older than 2.6.9!"
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 7, 0)
-@@ -285,7 +290,7 @@ NV_STATUS nvos_forward_error_to_cray(str
+@@ -284,7 +289,7 @@ NV_STATUS nvos_forward_error_to_cray(str
* NVIDIA graphics driver has no way of knowing and is unlikely
* to work correctly.
*/
diff --git a/include-swiotlb-header-on-arm.patch b/include-swiotlb-header-on-arm.patch
index 88357d2..6ea5a4e 100644
--- a/include-swiotlb-header-on-arm.patch
+++ b/include-swiotlb-header-on-arm.patch
@@ -6,7 +6,7 @@ Description: Include linux/swiotlb.h if CONFIG_ARM is defined
--- a/common/inc/nv-linux.h
+++ b/common/inc/nv-linux.h
-@@ -182,7 +182,7 @@ static inline uid_t __kuid_val(kuid_t ui
+@@ -181,7 +181,7 @@ static inline uid_t __kuid_val(kuid_t ui
#endif
#endif
diff --git a/kernel-5.7.0-set-memory-array.patch b/kernel-5.7.0-set-memory-array.patch
index 5c50840..ed9cae8 100644
--- a/kernel-5.7.0-set-memory-array.patch
+++ b/kernel-5.7.0-set-memory-array.patch
@@ -27,7 +27,7 @@ Bug-Debian:
https://bugs.debian.org/960735
--- a/conftest.sh
+++ b/conftest.sh
-@@ -428,6 +428,8 @@ compile_test() {
+@@ -429,6 +429,8 @@
# Determine if the set_memory_uc() function is present.
#
CODE="
@@ -36,7 +36,7 @@ Bug-Debian:
https://bugs.debian.org/960735
#if defined(NV_ASM_SET_MEMORY_H_PRESENT)
#if defined(NV_ASM_PGTABLE_TYPES_H_PRESENT)
#include <asm/pgtable_types.h>
-@@ -448,6 +450,8 @@ compile_test() {
+@@ -449,6 +451,8 @@
# Determine if the set_memory_array_uc() function is present.
#
CODE="
@@ -45,7 +45,7 @@ Bug-Debian:
https://bugs.debian.org/960735
#if defined(NV_ASM_SET_MEMORY_H_PRESENT)
#if defined(NV_ASM_PGTABLE_TYPES_H_PRESENT)
#include <asm/pgtable_types.h>
-@@ -503,6 +507,8 @@ compile_test() {
+@@ -504,6 +508,8 @@
# Determine if the set_pages_uc() function is present.
#
CODE="
@@ -54,7 +54,7 @@ Bug-Debian:
https://bugs.debian.org/960735
#if defined(NV_ASM_SET_MEMORY_H_PRESENT)
#if defined(NV_ASM_PGTABLE_TYPES_H_PRESENT)
#include <asm/pgtable_types.h>
-@@ -1881,7 +1887,7 @@ compile_test() {
+@@ -1870,7 +1876,7 @@
# Determine if atomic_long_t and associated functions are defined
# Added in 2.6.16 2006-01-06 d3cb487149bd706aa6aeb02042332a450978dc1c
CODE="
@@ -63,7 +63,7 @@ Bug-Debian:
https://bugs.debian.org/960735
void conftest_atomic_long(void) {
atomic_long_t data;
atomic_long_read(&data);
-@@ -1895,7 +1901,7 @@ compile_test() {
+@@ -1884,7 +1890,7 @@
atomic64_type)
# Determine if atomic64_t and associated functions are defined
CODE="
@@ -72,7 +72,7 @@ Bug-Debian:
https://bugs.debian.org/960735
void conftest_atomic64(void) {
atomic64_t data;
atomic64_read(&data);
-@@ -3585,7 +3591,7 @@ compile_test() {
+@@ -3585,7 +3591,7 @@
# 2008-01-25 9ee85241fdaab358dff1d8647f20a478cfa512a1
#
CODE="
diff --git a/nvidia-390xx-kmod.spec b/nvidia-390xx-kmod.spec
index 8bec6a8..625634d 100644
--- a/nvidia-390xx-kmod.spec
+++ b/nvidia-390xx-kmod.spec
@@ -16,9 +16,9 @@
Name: nvidia-390xx-kmod
Epoch: 3
-Version: 390.144
+Version: 390.147
# Taken over by kmodtool
-Release: 3%{?dist}
+Release: 1%{?dist}
Summary: NVIDIA 390xx display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -33,10 +33,12 @@ Source11: nvidia-390xx-kmodtool-excludekernel-filterfile
# openSUSE
https://build.opensuse.org/package/show/home:luc14n0:nvidia/nvidia-gfxG04
# kernel support
-Patch10: do-div-cast.patch
-Patch11: kernel-5.12.patch
-Patch12:
https://gitlab.com/herecura/packages/nvidia-390xx-dkms/-/raw/herecura/ker...
-Patch13:
https://build.opensuse.org/source/home:luc14n0:nvidia/nvidia-gfxG04/kerne...
+Patch10: 0001-backport-error-on-unknown-conftests.patch
+Patch11: 0002-backport-error-on-unknown-conftests-uvm-part.patch
+Patch12: do-div-cast.patch
+Patch13: kernel-5.7.0-set-memory-array.patch
+Patch14: kernel-5.12.patch
+Patch15:
https://gitlab.com/herecura/packages/nvidia-390xx-dkms/-/raw/herecura/ker...
# build system updates
Patch30: use-kbuild-compiler.patch
@@ -44,6 +46,7 @@ Patch31: use-kbuild-flags.patch
Patch32: use-kbuild-gcc-plugins.patch
Patch33: conftest-verbose.patch
Patch34: cc_version_check-gcc5.patch
+Patch35: bashisms.patch
#These are Debian specific. Dones not apply to Fedora
#Patch35: nvidia-use-ARCH.o_binary.patch
#Patch36: nvidia-modeset-use-ARCH.o_binary.patch
@@ -77,18 +80,21 @@ kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name}
--filterf
tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{version}-%{_target_cpu}.tar.xz
# Apply patches
%patch10 -p1 -b 10 -d kernel
-%patch11 -p2 -b 11 -d kernel
-%patch12 -p2 -b 12 -d kernel
-%patch13 -p2 -b 12 -d kernel
+%patch11 -p1 -b 11 -d kernel
+%patch12 -p1 -b 12 -d kernel
+%patch13 -p1 -b 13 -d kernel
+%patch14 -p2 -b 14 -d kernel
+%patch15 -p2 -b 15 -d kernel
%patch30 -p1 -b 30 -d kernel
%patch31 -p1 -b 31 -d kernel
%patch32 -p1 -b 32 -d kernel
%patch33 -p1 -b 33 -d kernel
%patch34 -p1 -b 34 -d kernel
+%patch35 -p1 -b 35 -d kernel
%patch40 -p1 -b 40 -d kernel
%patch41 -p1 -b 41 -d kernel
%patch42 -p1 -b 42 -d kernel
-%patch43 -p1 -b 42 -d kernel
+%patch43 -p1 -b 43 -d kernel
for kernel_version in %{?kernel_versions} ; do
cp -a kernel _kmod_build_${kernel_version%%___*}
@@ -115,6 +121,9 @@ done
%changelog
+* Sat Jan 29 2022 Henrik Nordstrom <henrik(a)henriknordstrom.net> - 390.147-1
+- Update to 390.147
+
* Wed Sep 22 2021 Henrik Nordstrom <henrik(a)henriknordstrom.net> - 390.144-3
- Kernel 5.14 patch taken from openSUSE
diff --git a/nvidia-drm-arm-cflags.patch b/nvidia-drm-arm-cflags.patch
index 0c1b59b..36cc4df 100644
--- a/nvidia-drm-arm-cflags.patch
+++ b/nvidia-drm-arm-cflags.patch
@@ -9,7 +9,7 @@ Description: Add -Wa,-mimplicit-it=thumb to CFLAGS if building on ARM
--- a/conftest.sh
+++ b/conftest.sh
-@@ -194,7 +194,7 @@ build_cflags() {
+@@ -195,7 +195,7 @@
done
if [ "$ARCH" = "arm" ]; then
diff --git a/use-kbuild-flags.patch b/use-kbuild-flags.patch
index 9033258..ecda018 100644
--- a/use-kbuild-flags.patch
+++ b/use-kbuild-flags.patch
@@ -5,7 +5,7 @@ Description: use KBUILD_CFLAGS and (KBUILD_)LDFLAGS
--- a/Kbuild
+++ b/Kbuild
-@@ -104,6 +104,7 @@ NV_CONFTEST_CMD := /bin/sh $(NV_CONFTEST
+@@ -102,6 +102,7 @@
"$(CC)" "$(HOST_CC)" $(ARCH) $(NV_KERNEL_SOURCES)
$(NV_KERNEL_OUTPUT)
NV_CONFTEST_CFLAGS := $(shell $(NV_CONFTEST_CMD) build_cflags)
@@ -15,7 +15,7 @@ Description: use KBUILD_CFLAGS and (KBUILD_)LDFLAGS
NV_CONFTEST_COMPILE_TEST_HEADERS += $(obj)/conftest/functions.h
--- a/nvidia/nvidia.Kbuild
+++ b/nvidia/nvidia.Kbuild
-@@ -88,7 +88,7 @@ NVIDIA_INTERFACE := nvidia/nv-interface.
+@@ -93,7 +93,7 @@
always-y += $(NVIDIA_INTERFACE)
$(obj)/$(NVIDIA_INTERFACE): $(addprefix $(obj)/,$(NVIDIA_OBJECTS))
@@ -26,7 +26,7 @@ Description: use KBUILD_CFLAGS and (KBUILD_)LDFLAGS
#
--- a/Makefile
+++ b/Makefile
-@@ -111,7 +111,7 @@ else
+@@ -111,7 +111,7 @@
# cannot be defined in the *Kbuild files, which are only used during stage 1.
%-linux.o: modules
@@ -37,7 +37,7 @@ Description: use KBUILD_CFLAGS and (KBUILD_)LDFLAGS
# Kbuild's "clean" rule won't clean up the conftest headers on its
own, and
--- a/nvidia-modeset/nvidia-modeset.Kbuild
+++ b/nvidia-modeset/nvidia-modeset.Kbuild
-@@ -70,7 +70,7 @@ NVIDIA_MODESET_INTERFACE := nvidia-modes
+@@ -75,7 +75,7 @@
always-y += $(NVIDIA_MODESET_INTERFACE)
$(obj)/$(NVIDIA_MODESET_INTERFACE): $(addprefix $(obj)/,$(NVIDIA_MODESET_OBJECTS))
diff --git a/use-kbuild-gcc-plugins.patch b/use-kbuild-gcc-plugins.patch
index 65e18e1..5def1a6 100644
--- a/use-kbuild-gcc-plugins.patch
+++ b/use-kbuild-gcc-plugins.patch
@@ -4,7 +4,7 @@ Description: ignore GCC plugins
CONFIG_GCC_PLUGIN_STRUCTLEAK and CONFIG_GCC_PLUGIN_RANDSTRUCT.
--- a/Kbuild
+++ b/Kbuild
-@@ -104,7 +104,7 @@ NV_CONFTEST_CMD := /bin/sh $(NV_CONFTEST
+@@ -102,7 +102,7 @@
"$(CC)" "$(HOST_CC)" $(ARCH) $(NV_KERNEL_SOURCES)
$(NV_KERNEL_OUTPUT)
NV_CONFTEST_CFLAGS := $(shell $(NV_CONFTEST_CMD) build_cflags)