From: Jan Rękorajski Date: Sun, 5 Apr 2020 23:47:45 +0000 (+0200) Subject: - fix patching on i686 X-Git-Tag: auto/th/xorg-driver-video-nvidia-legacy-390xx-390.132-6~1 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fxorg-driver-video-nvidia-legacy-390xx.git;a=commitdiff_plain;h=23759ce - fix patching on i686 --- diff --git a/kernel-5.6-x8664.patch b/kernel-5.6-x8664.patch new file mode 100644 index 0000000..f11819b --- /dev/null +++ b/kernel-5.6-x8664.patch @@ -0,0 +1,31 @@ +diff --git a/kernel/nvidia-uvm/uvm_linux.h b/kernel/nvidia-uvm/uvm_linux.h +index 8784a82..c256cdb 100644 +--- a/kernel/nvidia-uvm/uvm_linux.h ++++ b/kernel/nvidia-uvm/uvm_linux.h +@@ -329,7 +329,16 @@ static inline uint64_t NV_DIV64(uint64_t dividend, uint64_t divisor, uint64_t *r + } + #endif + +-#if defined(CLOCK_MONOTONIC_RAW) ++#if defined(NV_KTIME_GET_RAW_TS64_PRESENT) ++static inline NvU64 NV_GETTIME(void) ++{ ++ struct timespec64 ts64 = {0}; ++ ++ ktime_get_raw_ts64(&ts64); ++ ++ return (ts64.tv_sec * 1000000000ULL + ts64.tv_nsec); ++} ++#elif defined(CLOCK_MONOTONIC_RAW) + /* Return a nanosecond-precise value */ + static inline NvU64 NV_GETTIME(void) + { +@@ -345,7 +354,7 @@ static inline NvU64 NV_GETTIME(void) + * available non-GPL symbols. */ + static inline NvU64 NV_GETTIME(void) + { +- struct timeval tv = {0}; ++ struct nv_timeval tv = {0}; + + nv_gettimeofday(&tv); + diff --git a/kernel-5.6.patch b/kernel-5.6.patch index f29a06e..fd9875a 100644 --- a/kernel-5.6.patch +++ b/kernel-5.6.patch @@ -181,37 +181,6 @@ index d42aabb..f0404fb 100644 nv_gettimeofday(&tv); -diff --git a/kernel/nvidia-uvm/uvm_linux.h b/kernel/nvidia-uvm/uvm_linux.h -index 8784a82..c256cdb 100644 ---- a/kernel/nvidia-uvm/uvm_linux.h -+++ b/kernel/nvidia-uvm/uvm_linux.h -@@ -329,7 +329,16 @@ static inline uint64_t NV_DIV64(uint64_t dividend, uint64_t divisor, uint64_t *r - } - #endif - --#if defined(CLOCK_MONOTONIC_RAW) -+#if defined(NV_KTIME_GET_RAW_TS64_PRESENT) -+static inline NvU64 NV_GETTIME(void) -+{ -+ struct timespec64 ts64 = {0}; -+ -+ ktime_get_raw_ts64(&ts64); -+ -+ return (ts64.tv_sec * 1000000000ULL + ts64.tv_nsec); -+} -+#elif defined(CLOCK_MONOTONIC_RAW) - /* Return a nanosecond-precise value */ - static inline NvU64 NV_GETTIME(void) - { -@@ -345,7 +354,7 @@ static inline NvU64 NV_GETTIME(void) - * available non-GPL symbols. */ - static inline NvU64 NV_GETTIME(void) - { -- struct timeval tv = {0}; -+ struct nv_timeval tv = {0}; - - nv_gettimeofday(&tv); - diff --git a/kernel/nvidia/nv-procfs.c b/kernel/nvidia/nv-procfs.c index 5808a88..bc60a08 100644 --- a/kernel/nvidia/nv-procfs.c diff --git a/xorg-driver-video-nvidia-legacy-390xx.spec b/xorg-driver-video-nvidia-legacy-390xx.spec index 7250879..cebdf4a 100644 --- a/xorg-driver-video-nvidia-legacy-390xx.spec +++ b/xorg-driver-video-nvidia-legacy-390xx.spec @@ -57,6 +57,7 @@ Patch0: X11-driver-nvidia-GL.patch Patch1: X11-driver-nvidia-desktop.patch Patch2: kernel-5.5.patch Patch3: kernel-5.6.patch +Patch4: kernel-5.6-x8664.patch URL: http://www.nvidia.com/object/unix.html BuildRequires: rpmbuild(macros) >= 1.701 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}} @@ -265,6 +266,9 @@ rm -rf NVIDIA-Linux-x86*-%{version}* %patch1 -p1 %patch2 -p1 %patch3 -p1 +%ifarch %{x8664} +%patch4 -p1 +%endif echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> kernel/Makefile.kbuild %build