[Pkg-fglrx-devel] Bug#829036: patch for compiling with kernel 4.7

Amit Aronovitch aronovitch at gmail.com
Thu Sep 8 13:17:31 UTC 2016


An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-fglrx-devel/attachments/20160908/822e3ff5/attachment.html>
-------------- next part --------------
diff -ru fglrx-15.12/firegl_public.c fglrx-15.12_orig/firegl_public.c
--- fglrx-15.12/firegl_public.c	2016-09-07 23:08:08.443542397 +0300
+++ fglrx-15.12_orig/firegl_public.c	2016-01-23 02:24:25.000000000 +0200
@@ -3228,11 +3228,7 @@
     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;
@@ -3250,11 +3246,7 @@
     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;
@@ -3265,11 +3257,7 @@
     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
     }
 }
 
@@ -4547,7 +4535,7 @@
     write_cr0(cr0);
     wbinvd();
 
-    if (boot_cpu_has(X86_FEATURE_PGE))
+    if (cpu_has_pge)
     {
         cr4 = READ_CR4();
         WRITE_CR4(cr4 & ~X86_CR4_PGE);
@@ -4561,7 +4549,7 @@
     wbinvd();
     __flush_tlb();
     write_cr0(cr0 & 0xbfffffff);
-    if (boot_cpu_has(X86_FEATURE_PGE))
+    if (cpu_has_pge)
     {
         WRITE_CR4(cr4);
     }
@@ -4588,7 +4576,7 @@
     write_cr0(cr0);
     wbinvd();
 
-    if (boot_cpu_has(X86_FEATURE_PGE))
+    if (cpu_has_pge)
     {
         cr4 = READ_CR4();
         WRITE_CR4(cr4 & ~X86_CR4_PGE);
@@ -4601,7 +4589,7 @@
     wbinvd();
     __flush_tlb();
     write_cr0(cr0 & 0xbfffffff);
-    if (boot_cpu_has(X86_FEATURE_PGE))
+    if (cpu_has_pge)
     {
         WRITE_CR4(cr4);
     }
Only in fglrx-15.12: firegl_public.c.orig
diff -ru fglrx-15.12/firegl_public.h fglrx-15.12_orig/firegl_public.h
--- fglrx-15.12/firegl_public.h	2016-09-07 23:08:08.443542397 +0300
+++ fglrx-15.12_orig/firegl_public.h	2015-12-18 20:47:41.000000000 +0200
@@ -650,8 +650,8 @@
 #define cpu_has_pat  test_bit(X86_FEATURE_PAT, (void *) &boot_cpu_data.x86_capability)
 #endif
 
-#ifndef boot_cpu_has(X86_FEATURE_PGE)
-#define boot_cpu_has(X86_FEATURE_PGE) test_bit(X86_FEATURE_PGE, &boot_cpu_data.x86_capability)
+#ifndef cpu_has_pge
+#define cpu_has_pge test_bit(X86_FEATURE_PGE, &boot_cpu_data.x86_capability)
 #endif
 
 /* 2.6.29 defines pgprot_writecombine as a macro which resolves to a


More information about the Pkg-fglrx-devel mailing list