nvidia-340xx/kernel-5.1.patch
2019-10-14 16:08:54 -04:00

43 lines
1.4 KiB
Diff

diff --git kernel/uvm/nvidia_uvm_lite.c kernel/uvm/nvidia_uvm_lite.c
index 65b9a4d..f5ea5d7 100644
--- kernel/uvm/nvidia_uvm_lite.c
+++ kernel/uvm/nvidia_uvm_lite.c
@@ -830,8 +830,10 @@ done:
#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)
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
+int _fault(struct vm_fault *vmf)
+#else
+vm_fault_t _fault(struct vm_fault *vmf)
#endif
{
#if defined(NV_VM_FAULT_HAS_ADDRESS)
@@ -886,8 +888,10 @@ static struct vm_operations_struct uvmlite_vma_ops =
#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
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
int _sigbus_fault(struct vm_fault *vmf)
+#else
+vm_fault_t _sigbus_fault(struct vm_fault *vmf)
#endif
{
vmf->page = NULL;
diff --git kernel/nv-drm.c kernel/nv-drm.c
index 122ba7d..1be5733 100644
--- kernel/nv-drm.c
+++ kernel/nv-drm.c
@@ -146,7 +146,7 @@ static const struct file_operations nv_drm_fops = {
};
static struct drm_driver nv_drm_driver = {
-#if defined(DRIVER_LEGACY)
+#if defined(DRIVER_LEGACY) || LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
.driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
#else
.driver_features = DRIVER_GEM | DRIVER_PRIME,