From 320704eb020b43a1f1cbf49f7aca5bc281f6cc0b Mon Sep 17 00:00:00 2001 From: Rmys Date: Fri, 13 Jul 2018 15:15:16 +0300 Subject: [PATCH] nvidia-340 --- kernel/drivers/module-nvidia340/actions.py | 2 +- .../module-nvidia340/files/kernel-4.11.patch | 38 +++++++++++++++++++ kernel/drivers/module-nvidia340/pspec.xml | 8 ++-- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 kernel/drivers/module-nvidia340/files/kernel-4.11.patch diff --git a/kernel/drivers/module-nvidia340/actions.py b/kernel/drivers/module-nvidia340/actions.py index e17368d11f..128bd81b50 100644 --- a/kernel/drivers/module-nvidia340/actions.py +++ b/kernel/drivers/module-nvidia340/actions.py @@ -38,7 +38,7 @@ def setup(): shelltools.echo("ld.so.conf", nvlibdir) shelltools.echo("XvMCConfig", "%s/libXvMCNVIDIA.so" % nvlibdir) - #shelltools.system("patch -p1 < linux-4.6.patch") + shelltools.system("patch -p0 < kernel-4.11.patch") def build(): # We don't need kernel module for emul32 build diff --git a/kernel/drivers/module-nvidia340/files/kernel-4.11.patch b/kernel/drivers/module-nvidia340/files/kernel-4.11.patch new file mode 100644 index 0000000000..b2b3a7a9d9 --- /dev/null +++ b/kernel/drivers/module-nvidia340/files/kernel-4.11.patch @@ -0,0 +1,38 @@ +--- kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:50:46.334075042 +0200 ++++ kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:56:06.358041280 +0200 +@@ -818,7 +818,11 @@ + } + + #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + int _fault(struct vm_area_struct *vma, struct vm_fault *vmf) ++#else ++int _fault(struct vm_fault *vmf) ++#endif + { + #if defined(NV_VM_FAULT_HAS_ADDRESS) + unsigned long vaddr = vmf->address; +@@ -828,7 +832,11 @@ + struct page *page = NULL; + int retval; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + retval = _fault_common(vma, vaddr, &page, vmf->flags); ++#else ++ retval = _fault_common(NULL, vaddr, &page, vmf->flags); ++#endif + + vmf->page = page; + +@@ -866,7 +874,11 @@ + // it's dealing with anonymous mapping (see handle_pte_fault). + // + #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf) ++#else ++int _sigbus_fault(struct vm_fault *vmf) ++#endif + { + vmf->page = NULL; + return VM_FAULT_SIGBUS; diff --git a/kernel/drivers/module-nvidia340/pspec.xml b/kernel/drivers/module-nvidia340/pspec.xml index fbb0a9241f..2c0e1b7293 100644 --- a/kernel/drivers/module-nvidia340/pspec.xml +++ b/kernel/drivers/module-nvidia340/pspec.xml @@ -11,10 +11,10 @@ NVIDIA NVIDIA drivers for GeForce 6xxx and newer GPUs NVIDIA graphics drivers provide optimized 2D/3D performance. - http://http.download.nvidia.com/XFree86/Linux-x86/340.106/NVIDIA-Linux-x86-340.106.run - http://http.download.nvidia.com/XFree86/Linux-x86_64/340.106/NVIDIA-Linux-x86_64-340.106.run + http://http.download.nvidia.com/XFree86/Linux-x86/340.107/NVIDIA-Linux-x86-340.107.run + http://http.download.nvidia.com/XFree86/Linux-x86_64/340.107/NVIDIA-Linux-x86_64-340.107.run - + kernel-4.11.patch kernel-module-headers @@ -99,7 +99,7 @@ 2018-07-13 - 340.106 + 340.107 Rebuild for new kernel. Mustafa Cinasal muscnsl@gmail.com