diff -Nru fglrx-installer-updates-15.200/debian/changelog fglrx-installer-updates-15.200/debian/changelog --- fglrx-installer-updates-15.200/debian/changelog 2015-07-06 10:25:33.000000000 +0000 +++ fglrx-installer-updates-15.200/debian/changelog 2015-08-17 15:02:50.000000000 +0000 @@ -1,3 +1,15 @@ +fglrx-installer-updates (2:15.200-0ubuntu0.5) trusty-proposed; urgency=medium + + * debian/dkms.conf.in, + debian/dkms/patches/buildfix_kernel_4.0.patch, + debian/dkms/patches/buildfix_kernel_4.1.patch, + debian/dkms/patches/buildfix_kernel_4.2.patch: + - Add support for Linux 4.0, 4.1, 4.2. + - Work around the GPL only pci_ignore_hotplug() in + Linux 3.19.0-26 (LP: #1479913). + + -- Alberto Milone Mon, 17 Aug 2015 17:02:32 +0200 + fglrx-installer-updates (2:15.200-0ubuntu0.4) trusty-proposed; urgency=medium * debian/rules: diff -Nru fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.0.patch fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.0.patch --- fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.0.patch 1970-01-01 00:00:00.000000000 +0000 +++ fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.0.patch 2015-08-17 15:01:40.000000000 +0000 @@ -0,0 +1,44 @@ +From 9029e189f8431a39146ac3477c7e4491e06c6f4b Mon Sep 17 00:00:00 2001 +From: Alberto Milone +Date: Thu, 4 Jun 2015 18:03:39 +0200 +Subject: [PATCH 1/1] Add support for Linux 4.0 + +--- + firegl_public.c | 5 +++++ + kcl_str.c | 4 ++++ + 2 files changed, 9 insertions(+) + +diff --git a/firegl_public.c b/firegl_public.c +index eccbc1c..f218b3d 100755 +--- a/firegl_public.c ++++ b/firegl_public.c +@@ -275,6 +275,11 @@ MODULE_LICENSE("Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY"); + MODULE_DEVICE_TABLE(pci, fglrx_pci_table); + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0) ++#define read_cr4() __read_cr4() ++#define write_cr4(cr4) __write_cr4(cr4) ++#endif ++ + /* globals constants */ + const char* KCL_SYSINFO_OsVersionString = UTS_RELEASE; + const unsigned int KCL_SYSINFO_PageSize = PAGE_SIZE; +diff --git a/kcl_str.c b/kcl_str.c +index 2d89eb0..bacdb69 100755 +--- a/kcl_str.c ++++ b/kcl_str.c +@@ -42,6 +42,10 @@ + #include "kcl_type.h" + #include "kcl_str.h" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0) ++#define strnicmp strncasecmp ++#endif ++ + /** \brief Fill memory with a constant byte + * \param s Pointer to memory + * \param c Initializing value +-- +1.9.1 + diff -Nru fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.1.patch fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.1.patch --- fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.1.patch 1970-01-01 00:00:00.000000000 +0000 +++ fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.1.patch 2015-08-17 15:01:53.000000000 +0000 @@ -0,0 +1,64 @@ +From d5cf55ba203f5709bdc29d980b054bf9971c5e59 Mon Sep 17 00:00:00 2001 +From: Alberto Milone +Date: Thu, 13 Aug 2015 16:15:47 +0200 +Subject: [PATCH 1/1] Add support for Linux 4.1 + +Drop the IRQF_DISABLED flag, as it was removed in Linux 4.1 + +Note: this was also backported to 3.19.0-26 in Ubuntu +--- + firegl_public.c | 4 +++- + kcl_acpi.c | 11 +++++++++++ + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/firegl_public.c b/firegl_public.c +index f218b3d..b687c4d 100755 +--- a/firegl_public.c ++++ b/firegl_public.c +@@ -3498,10 +3498,12 @@ int ATI_API_CALL KCL_InstallInterruptHandler( + KCL_PUB_InterruptHandlerWrap, + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) + ((useMSI) ? (SA_INTERRUPT) : (SA_SHIRQ)), +-#else ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) + //when MSI enabled. keep irq disabled when calling the action handler, + //exclude this IRQ from irq balancing (only on one CPU) + ((useMSI) ? (IRQF_DISABLED | IRQF_NOBALANCING) : (IRQF_SHARED)), ++#else ++ ((useMSI) ? (0x0) : (IRQF_SHARED)), + #endif + dev_name, + context); +diff --git a/kcl_acpi.c b/kcl_acpi.c +index 3a80984..48f8d64 100755 +--- a/kcl_acpi.c ++++ b/kcl_acpi.c +@@ -34,6 +34,10 @@ + + #include + ++#ifndef UTS_RELEASE ++#include ++#endif ++ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) + + #if defined(CONFIG_ACPI_INTERPRETER) && defined(CONFIG_ACPI_BOOT) && defined(CONFIG_ACPI_BUS) +@@ -861,7 +865,14 @@ void ATI_API_CALL KCL_ACPI_No_Hotplug(void* dev) + #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) + if(pdev) + { ++#ifndef UTS_UBUNTU_RELEASE_ABI ++#define UTS_UBUNTU_RELEASE_ABI -1 ++#endif ++#if (UTS_UBUNTU_RELEASE_ABI < 0 && LINUX_VERSION_CODE < KERNEL_VERSION(4,1,3)) || (UTS_UBUNTU_RELEASE_ABI >= 0 && UTS_UBUNTU_RELEASE_ABI < 26 && LINUX_VERSION_CODE <= KERNEL_VERSION(3,19,8)) + pci_ignore_hotplug(pdev); ++#else ++ pdev->ignore_hotplug = 1; ++#endif + } + #endif + } +-- +1.9.1 + diff -Nru fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.2.patch fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.2.patch --- fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.2.patch 1970-01-01 00:00:00.000000000 +0000 +++ fglrx-installer-updates-15.200/debian/dkms/patches/buildfix_kernel_4.2.patch 2015-08-17 15:01:07.000000000 +0000 @@ -0,0 +1,109 @@ +From d64db7a525ce02df328287f7a536f34edc3752cf Mon Sep 17 00:00:00 2001 +From: Alberto Milone +Date: Tue, 14 Jul 2015 12:56:37 +0200 +Subject: [PATCH 2/2] Add support for Linux 4.2 + +Deal with the FPU code renaming +--- + firegl_public.c | 35 +++++++++++++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) + +diff --git a/firegl_public.c b/firegl_public.c +index 1a39fb7..ed85dce 100755 +--- a/firegl_public.c ++++ b/firegl_public.c +@@ -191,9 +191,17 @@ + #include + #include + #include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) + #include "asm/i387.h" ++#else ++#include ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) + #include ++#else ++#include ++#endif + #endif + + #include "firegl_public.h" +@@ -1734,7 +1742,11 @@ unsigned long ATI_API_CALL kcl__cmpxchg(volatile void *ptr, unsigned long old, + unsigned long new, int size) + { + #ifndef __HAVE_ARCH_CMPXCHG ++#if defined(__i386__) + return __fgl_cmpxchg(ptr,old,new,size); ++#elif defined(__x86_64__) ++ return cmpxchg((unsigned long*)ptr,old,new); ++#endif + #else + /* On kernel version 2.6.34 passing a variable or unsupported size + * argument to the __cmpxchg macro causes the default-clause of a +@@ -6430,21 +6442,36 @@ static int KCL_fpu_save_init(struct task_struct *tsk) + struct fpu *fpu = &tsk->thread.fpu; + + if(static_cpu_has(X86_FEATURE_XSAVE)) { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) + fpu_xsave(fpu); + if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP)) ++#else ++ copy_xregs_to_kernel(&fpu->state.xsave); ++ if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP)) ++#endif + return 1; + } else if (static_cpu_has(X86_FEATURE_FXSR)) { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) + fpu_fxsave(fpu); ++#else ++ copy_fxregs_to_kernel(fpu); ++#endif + } else { + asm volatile("fnsave %[fx]; fwait" ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) + : [fx] "=m" (fpu->state->fsave)); ++#else ++ : [fx] "=m" (fpu->state.fsave)); ++#endif + return 0; + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) + if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES)) { + asm volatile("fnclex"); + return 0; + } ++#endif + return 1; + } + #endif +@@ -6456,8 +6483,12 @@ static int KCL_fpu_save_init(struct task_struct *tsk) + void ATI_API_CALL KCL_fpu_begin(void) + { + #ifdef CONFIG_X86_64 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) + kernel_fpu_begin(); + #else ++ __kernel_fpu_begin(); ++#endif ++#else + #ifdef TS_USEDFPU + struct thread_info *cur_thread = current_thread_info(); + struct task_struct *cur_task = get_current(); +@@ -6502,7 +6533,11 @@ void ATI_API_CALL KCL_fpu_begin(void) + */ + void ATI_API_CALL KCL_fpu_end(void) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) + kernel_fpu_end(); ++#else ++ __kernel_fpu_end(); ++#endif + } + + /** Create new directory entry under "/proc/...." +-- +1.9.1 + diff -Nru fglrx-installer-updates-15.200/debian/dkms.conf.in fglrx-installer-updates-15.200/debian/dkms.conf.in --- fglrx-installer-updates-15.200/debian/dkms.conf.in 2015-07-06 10:05:32.000000000 +0000 +++ fglrx-installer-updates-15.200/debian/dkms.conf.in 2015-08-17 15:00:47.000000000 +0000 @@ -7,7 +7,9 @@ MAKE[0]="cd ${dkms_tree}/fglrx/#CVERSION#/build; sh make.sh --nohints --uname_r=$kernelver --norootcheck" DEST_MODULE_LOCATION[0]="/kernel/drivers/char/drm" AUTOINSTALL="yes" -#PATCH[0]="buildfix_kernel_3.17.patch" +PATCH[0]="buildfix_kernel_4.0.patch" +PATCH[1]="buildfix_kernel_4.1.patch" +PATCH[2]="buildfix_kernel_4.2.patch" #PATCH[0]="buildfix_kernel_3.19.patch" #PATCH_MATCH[0]="^3.1[0-2]" #PATCH[0]="buildfix_kernel_3.12.patch"