From 9ad481f896d10d169548ccb17533cafbc1299afa Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 23 Jul 2012 14:37:24 +0200 Subject: [PATCH] xf86-video-fglrx: add patches to build with newer kernels Signed-off-by: Stephan Raue --- .../patches.upstream/3.4.patch | 40 +++++++++++++++ .../patches.upstream/3.5-do_mmap.patch | 50 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 packages/x11/driver/xf86-video-fglrx/patches.upstream/3.4.patch create mode 100644 packages/x11/driver/xf86-video-fglrx/patches.upstream/3.5-do_mmap.patch diff --git a/packages/x11/driver/xf86-video-fglrx/patches.upstream/3.4.patch b/packages/x11/driver/xf86-video-fglrx/patches.upstream/3.4.patch new file mode 100644 index 0000000000..64ab53e123 --- /dev/null +++ b/packages/x11/driver/xf86-video-fglrx/patches.upstream/3.4.patch @@ -0,0 +1,40 @@ +--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2012-05-26 18:33:25.044695179 +0200 ++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2012-05-26 18:28:39.692699095 +0200 +@@ -188,6 +188,12 @@ + #include + #include "asm/i387.h" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0) ++#ifdef CONFIG_X86_32 ++#include "asm/fpu-internal.h" ++#endif ++#endif ++ + #include "firegl_public.h" + #include "kcl_osconfig.h" + #include "kcl_io.h" +@@ -4154,7 +4160,11 @@ static int kasInitExecutionLevels(unsign + { + unsigned int p; + KCL_DEBUG5(FN_FIREGL_KAS, "%d\n", level_init); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0) ++ for_each_possible_cpu(p) ++#else + for_each_cpu_mask(p, cpu_possible_map) ++#endif + { + KCL_DEBUG1(FN_FIREGL_KAS,"Setting initial execution level for CPU # %d\n", p); + preempt_disable(); +--- a/common/lib/modules/fglrx/build_mod/kcl_ioctl.c 2012-05-26 19:11:03.402987821 +0200 ++++ b/common/lib/modules/fglrx/build_mod/kcl_ioctl.c 2012-05-26 19:13:00.273986422 +0200 +@@ -217,6 +217,10 @@ + * \param size [in] Number of bytes to allocate + * \return Pointer to allocated memory + */ ++#ifndef CONFIG_X86_X32 ++DEFINE_PER_CPU(unsigned long, old_rsp); ++#endif ++ + void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size) + { + void __user *ret = COMPAT_ALLOC_USER_SPACE(size); \ No newline at end of file diff --git a/packages/x11/driver/xf86-video-fglrx/patches.upstream/3.5-do_mmap.patch b/packages/x11/driver/xf86-video-fglrx/patches.upstream/3.5-do_mmap.patch new file mode 100644 index 0000000000..04248eb7bc --- /dev/null +++ b/packages/x11/driver/xf86-video-fglrx/patches.upstream/3.5-do_mmap.patch @@ -0,0 +1,50 @@ +--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2012-06-15 18:30:13.483762070 +0200 ++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2012-06-17 17:47:36.543041869 +0200 +@@ -2106,6 +2106,12 @@ + } + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0) ++# define NO_DO_MMAP ++# define do_mmap(a,b,c,d,e,f) vm_mmap(a, b, c, d, e, f) ++# define do_munmap(a,b,c) vm_munmap(b, c) ++#endif ++ + unsigned long ATI_API_CALL KCL_MEM_AllocLinearAddrInterval( + KCL_IO_FILE_Handle file, + unsigned long addr, +@@ -2117,10 +2123,13 @@ + + flags = MAP_SHARED; + prot = PROT_READ|PROT_WRITE; +- ++#ifdef NO_DO_MMAP ++ vaddr = (void *) vm_mmap(file, 0, len, prot, flags, pgoff); ++#else + down_write(¤t->mm->mmap_sem); + vaddr = (void *) do_mmap(file, 0, len, prot, flags, pgoff); + up_write(¤t->mm->mmap_sem); ++#endif + if (IS_ERR(vaddr)) + return 0; + else +@@ -2131,7 +2140,9 @@ + { + int retcode = 0; + ++#ifndef NO_DO_MMAP + down_write(¤t->mm->mmap_sem); ++#endif + #ifdef FGL_LINUX_RHEL_MUNMAP_API + retcode = do_munmap(current->mm, + addr, +@@ -2142,7 +2153,9 @@ + addr, + len); + #endif ++#ifndef NO_DO_MMAP + up_write(¤t->mm->mmap_sem); ++#endif + return retcode; + } +