summary refs log tree commit diff
path: root/pkgs/os-specific/linux/ati-drivers
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-09-17 01:24:34 +0200
committerVladimír Čunát <vcunat@gmail.com>2016-09-17 01:29:27 +0200
commit12a45a8496b950f7bb289cbdf7245f452a8908a7 (patch)
tree7c15b12ee56dae64deff635a97d9bacf058c4686 /pkgs/os-specific/linux/ati-drivers
parent5ade8fff793908dbfed7c4b4f5ae904ae6326bfc (diff)
parent7bc91ffe41d6c4adaa2a778dcf1526caa0f8677b (diff)
downloadnixpkgs-12a45a8496b950f7bb289cbdf7245f452a8908a7.tar
nixpkgs-12a45a8496b950f7bb289cbdf7245f452a8908a7.tar.gz
nixpkgs-12a45a8496b950f7bb289cbdf7245f452a8908a7.tar.bz2
nixpkgs-12a45a8496b950f7bb289cbdf7245f452a8908a7.tar.lz
nixpkgs-12a45a8496b950f7bb289cbdf7245f452a8908a7.tar.xz
nixpkgs-12a45a8496b950f7bb289cbdf7245f452a8908a7.tar.zst
nixpkgs-12a45a8496b950f7bb289cbdf7245f452a8908a7.zip
Merge #18237: ati_drivers_x11: patch for kernel 4.6
Diffstat (limited to 'pkgs/os-specific/linux/ati-drivers')
-rw-r--r--pkgs/os-specific/linux/ati-drivers/default.nix7
-rw-r--r--pkgs/os-specific/linux/ati-drivers/patches/kernel-4.6-get_user_pages.patch25
-rw-r--r--pkgs/os-specific/linux/ati-drivers/patches/kernel-4.6-page_cache_release-put_page.patch16
3 files changed, 46 insertions, 2 deletions
diff --git a/pkgs/os-specific/linux/ati-drivers/default.nix b/pkgs/os-specific/linux/ati-drivers/default.nix
index 902f0e37e35..3bfd59de7ed 100644
--- a/pkgs/os-specific/linux/ati-drivers/default.nix
+++ b/pkgs/os-specific/linux/ati-drivers/default.nix
@@ -73,8 +73,11 @@ stdenv.mkDerivation rec {
     ./patches/15.9-kcl_str.patch
     ./patches/15.9-mtrr.patch
     ./patches/15.9-preempt.patch
-    ./patches/15.9-sep_printf.patch
-  ];
+    ./patches/15.9-sep_printf.patch ]
+  ++ optionals ( kernel != null &&
+                 (builtins.compareVersions kernel.version "4.6") >= 0 )
+               [ ./patches/kernel-4.6-get_user_pages.patch
+                 ./patches/kernel-4.6-page_cache_release-put_page.patch ];
 
   buildInputs =
     [ xorg.libXrender xorg.libXext xorg.libX11 xorg.libXinerama xorg.libSM
diff --git a/pkgs/os-specific/linux/ati-drivers/patches/kernel-4.6-get_user_pages.patch b/pkgs/os-specific/linux/ati-drivers/patches/kernel-4.6-get_user_pages.patch
new file mode 100644
index 00000000000..1e7209ed5ed
--- /dev/null
+++ b/pkgs/os-specific/linux/ati-drivers/patches/kernel-4.6-get_user_pages.patch
@@ -0,0 +1,25 @@
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index 9c70211..b2242af 100755
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -3220,7 +3220,7 @@ int ATI_API_CALL KCL_LockUserPages(unsigned long vaddr, unsigned long* page_list
+     int ret;
+ 
+     down_read(&current->mm->mmap_sem);
+-    ret = get_user_pages(current, current->mm, vaddr, page_cnt, 1, 0, (struct page **)page_list, NULL);
++    ret = get_user_pages(vaddr, page_cnt, 1, 0, (struct page **)page_list, NULL);
+     up_read(&current->mm->mmap_sem);
+ 
+     return ret;
+@@ -3238,7 +3238,7 @@ int ATI_API_CALL KCL_LockReadOnlyUserPages(unsigned long vaddr, unsigned long* p
+     int ret;
+ 
+     down_read(&current->mm->mmap_sem);
+-    ret = get_user_pages(current, current->mm, vaddr, page_cnt, 0, 0, (struct page **)page_list, NULL);
++    ret = get_user_pages(vaddr, page_cnt, 0, 0, (struct page **)page_list, NULL);
+     up_read(&current->mm->mmap_sem);
+ 
+     return ret;
+-- 
+2.9.2
+
diff --git a/pkgs/os-specific/linux/ati-drivers/patches/kernel-4.6-page_cache_release-put_page.patch b/pkgs/os-specific/linux/ati-drivers/patches/kernel-4.6-page_cache_release-put_page.patch
new file mode 100644
index 00000000000..28820790e49
--- /dev/null
+++ b/pkgs/os-specific/linux/ati-drivers/patches/kernel-4.6-page_cache_release-put_page.patch
@@ -0,0 +1,16 @@
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index b2242af..586129c 100755
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -3249,7 +3249,7 @@ void ATI_API_CALL KCL_UnlockUserPages(unsigned long* page_list, unsigned int pag
+     unsigned int i;
+     for (i=0; i<page_cnt; i++)
+     {
+-        page_cache_release((struct page*)page_list[i]);
++        put_page((struct page*)page_list[i]);
+     }
+ }
+ 
+-- 
+2.9.2
+