[Pkg-fglrx-devel] Fwd: [PATCH] fglrx-modules-dkms / fglrx-modules-src: Linux 3.5 support

Andreas Beckmann debian at abeckmann.de
Fri Jul 27 09:56:11 UTC 2012


I had asked the submitter to create a bug report, but got no response ...

-------- Original Message --------
Subject: [PATCH] fglrx-modules-dkms / fglrx-modules-src: Linux 3.5 support
Date: Sun, 22 Jul 2012 22:50:48 +0200
From: Hans-Frieder Vogt <hfvogt at gmx.net>
To: debian at abeckmann.de

Andreas,
please find attached a patch to support linux 3.5 with the fglrx driver
12-6. Thanks for your effort in creating debian
packages of the ATI/AMD driver.

Best regards,
Hans-Frieder

Patch for fglrx 12-6 kernel module source to support linux 3.5. Tested
with various release candidates and with the final
version 3.5.

Signed-off-by: Hans-Frieder Vogt <hfvogt at gmx.net>

 firegl_public.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

--- a/firegl_public.c	2012-06-30 21:26:40.000000000 +0200
+++ b/firegl_public.c	2012-07-08 10:05:36.109924741 +0200
@@ -2123,9 +2123,13 @@ unsigned long ATI_API_CALL KCL_MEM_Alloc
     flags = MAP_SHARED;
     prot  = PROT_READ|PROT_WRITE;

+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+    vaddr = (void *) vm_mmap(file, 0, len, prot, flags, pgoff);
+#else
     down_write(&current->mm->mmap_sem);
     vaddr = (void *) do_mmap(file, 0, len, prot, flags, pgoff);
     up_write(&current->mm->mmap_sem);
+#endif
     if (IS_ERR(vaddr))
        return 0;
     else
@@ -2136,18 +2140,27 @@ int ATI_API_CALL KCL_MEM_ReleaseLinearAd
 {
     int retcode = 0;

+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
     down_write(&current->mm->mmap_sem);
+#endif
 #ifdef FGL_LINUX_RHEL_MUNMAP_API
     retcode = do_munmap(current->mm,
                         addr,
                         len,
                         1);
 #else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+    retcode = vm_munmap(addr,
+                        len);
+#else
     retcode = do_munmap(current->mm,
                         addr,
                         len);
 #endif
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
     up_write(&current->mm->mmap_sem);
+#endif
     return retcode;
 }


Hans-Frieder Vogt                       e-mail: hfvogt <at> gmx .dot. net



More information about the Pkg-fglrx-devel mailing list