void-packages/srcpkgs/catalyst/files/4.6-void-user_page.patch
2016-06-10 13:43:02 +02:00

39 lines
1.4 KiB
Diff

diff --git a/firegl_public.c b/firegl_public.c
--- 15.201/common/lib/modules/fglrx/build_mod/firegl_public.c
+++ 15.201b/common/lib/modules/fglrx/build_mod/firegl_public.c
@@ -3225,7 +3225,11 @@ int ATI_API_CALL KCL_LockUserPages(unsigned long vaddr, unsigned long* page_list
int ret;
down_read(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+ ret = get_user_pages(vaddr, page_cnt, 1, 0, (struct page **)page_list, NULL);
+#else
ret = get_user_pages(current, current->mm, vaddr, page_cnt, 1, 0, (struct page **)page_list, NULL);
+#endif
up_read(&current->mm->mmap_sem);
return ret;
@@ -3243,7 +3247,11 @@ int ATI_API_CALL KCL_LockReadOnlyUserPages(unsigned long vaddr, unsigned long* p
int ret;
down_read(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+ ret = get_user_pages(vaddr, page_cnt, 0, 0, (struct page **)page_list, NULL);
+#else
ret = get_user_pages(current, current->mm, vaddr, page_cnt, 0, 0, (struct page **)page_list, NULL);
+#endif
up_read(&current->mm->mmap_sem);
return ret;
@@ -3254,7 +3262,11 @@ void ATI_API_CALL KCL_UnlockUserPages(unsigned long* page_list, unsigned int pag
unsigned int i;
for (i=0; i<page_cnt; i++)
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+ put_page((struct page*)page_list[i]);
+#else
page_cache_release((struct page*)page_list[i]);
+#endif
}
}