]> git.pld-linux.org Git - packages/xorg-driver-video-nvidia-legacy-304xx.git/blob - linux-4.6.patch
- fix building with linux 4.6
[packages/xorg-driver-video-nvidia-legacy-304xx.git] / linux-4.6.patch
1 --- NVIDIA-Linux-x86_64-304.131-no-compat32/kernel/nv-mlock.c~  2015-11-09 06:43:39.000000000 +0100
2 +++ NVIDIA-Linux-x86_64-304.131-no-compat32/kernel/nv-mlock.c   2016-06-19 18:34:23.039063568 +0200
3 @@ -49,7 +49,11 @@
4      }
5  
6      down_read(&mm->mmap_sem);
7 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
8 +    ret = get_user_pages((unsigned long)address,
9 +#else
10      ret = get_user_pages(current, mm, (unsigned long)address,
11 +#endif
12              page_count, write, force, user_pages, NULL);
13      up_read(&mm->mmap_sem);
14      pinned = ret;
15 @@ -62,7 +66,11 @@
16      else if (pinned < page_count)
17      {
18          for (i = 0; i < pinned; i++)
19 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
20 +            put_page(user_pages[i]);
21 +#else
22              page_cache_release(user_pages[i]);
23 +#endif
24          os_free_mem(user_pages);
25          return RM_ERR_INVALID_ADDRESS;
26      }
27 @@ -88,7 +88,11 @@
28              {
29                  pci_unmap_page(dev, pte_array[j],
30                          PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
31 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
32 +                put_page(user_pages[j]);
33 +#else
34                  page_cache_release(user_pages[j]);
35 +#endif
36              }
37              os_free_mem(user_pages);
38              return RM_ERR_OPERATING_SYSTEM;
39 @@ -122,7 +126,11 @@
40                  PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
41          if (write)
42              set_page_dirty_lock(user_pages[i]);
43 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
44 +        put_page(user_pages[i]);
45 +#else
46          page_cache_release(user_pages[i]);
47 +#endif
48      }
49  
50      os_free_mem(user_pages);
This page took 0.03951 seconds and 3 git commands to generate.