summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorDaniel Fox Franke <dfoxfranke@gmail.com>2015-08-03 00:14:36 -0400
committerDaniel Fox Franke <dfoxfranke@gmail.com>2015-08-03 00:14:36 -0400
commit1d3207b27b178ea88f413dd47b195445a14adc6a (patch)
tree99c4e7e3dae70b4e76c5cbe9c83334dff113222c /pkgs/os-specific
parent9cd4763e9c6aafe71cccee24fee51dea8242b449 (diff)
downloadnixpkgs-1d3207b27b178ea88f413dd47b195445a14adc6a.tar
nixpkgs-1d3207b27b178ea88f413dd47b195445a14adc6a.tar.gz
nixpkgs-1d3207b27b178ea88f413dd47b195445a14adc6a.tar.bz2
nixpkgs-1d3207b27b178ea88f413dd47b195445a14adc6a.tar.lz
nixpkgs-1d3207b27b178ea88f413dd47b195445a14adc6a.tar.xz
nixpkgs-1d3207b27b178ea88f413dd47b195445a14adc6a.tar.zst
nixpkgs-1d3207b27b178ea88f413dd47b195445a14adc6a.zip
ati-drivers: update to Catalyst 15.7 and fix build with recent kernels
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/ati-drivers/builder.sh5
-rw-r--r--pkgs/os-specific/linux/ati-drivers/default.nix8
-rw-r--r--pkgs/os-specific/linux/ati-drivers/fglrx_3.17rc6-no_hotplug.patch31
-rw-r--r--pkgs/os-specific/linux/ati-drivers/fglrx_3.18.19-no_hotplug_underscore_cr4.patch58
4 files changed, 66 insertions, 36 deletions
diff --git a/pkgs/os-specific/linux/ati-drivers/builder.sh b/pkgs/os-specific/linux/ati-drivers/builder.sh
index 8df03910146..520f20e2ed6 100644
--- a/pkgs/os-specific/linux/ati-drivers/builder.sh
+++ b/pkgs/os-specific/linux/ati-drivers/builder.sh
@@ -7,8 +7,11 @@ set -x
 die(){ echo $@; exit 1; }
 
 # custom unpack:
+mkdir fglrx
+cd fglrx
 unzip $src
-run_file=$(echo fglrx-*/amd-driver-installer-*)
+cd ..
+run_file=$(echo fglrx/amd-driver-installer-*)
 sh $run_file --extract .
 
 eval "$patchPhase"
diff --git a/pkgs/os-specific/linux/ati-drivers/default.nix b/pkgs/os-specific/linux/ati-drivers/default.nix
index 179166bbc79..e61237fcb7c 100644
--- a/pkgs/os-specific/linux/ati-drivers/default.nix
+++ b/pkgs/os-specific/linux/ati-drivers/default.nix
@@ -31,7 +31,7 @@ assert (!libsOnly) -> kernel != null;
 with stdenv.lib;
 
 stdenv.mkDerivation {
-  name = "ati-drivers-14.12" + (optionalString (!libsOnly) "-${kernel.version}");
+  name = "ati-drivers-15.7" + (optionalString (!libsOnly) "-${kernel.version}");
 
   builder = ./builder.sh;
 
@@ -39,12 +39,12 @@ stdenv.mkDerivation {
   gcc = stdenv.cc.cc;
 
   src = fetchurl {
-    url = http://www2.ati.com/drivers/linux/amd-catalyst-omega-14.12-linux-run-installers.zip;
-    sha256 = "0jd2scrdlyapynxfjdrarnwcdzxjqrk5fg5i10g3bm0ay8v9hrk8";
+    url = "http://www2.ati.com/drivers/linux/amd-driver-installer-15.20.1046-x86.x86_64.zip";
+    sha256 = "ffde64203f49d9288eaa25f4d744187b6f4f14a87a444bab6a001d822b327a9d";
     curlOpts = "--referer http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64";
   };
 
-  patchPhase = "patch -p1 < ${./fglrx_3.17rc6-no_hotplug.patch}";
+  patchPhase = "patch -p1 < ${./fglrx_3.18.19-no_hotplug_underscore_cr4.patch}";
   patchPhaseSamples = "patch -p2 < ${./patch-samples.patch}";
 
   buildInputs =
diff --git a/pkgs/os-specific/linux/ati-drivers/fglrx_3.17rc6-no_hotplug.patch b/pkgs/os-specific/linux/ati-drivers/fglrx_3.17rc6-no_hotplug.patch
deleted file mode 100644
index 7afd54a59c5..00000000000
--- a/pkgs/os-specific/linux/ati-drivers/fglrx_3.17rc6-no_hotplug.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-source: https://aur.archlinux.org/packages/catalyst/
-
-diff -uNr 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c
---- 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c	2014-09-09 16:10:17.000000000 +0200
-+++ 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c	2014-09-26 19:01:44.000000000 +0200
-@@ -1093,6 +1093,9 @@
-     // directly here to allow suspend/resume without X server start. 
-         firegl_pci_save_state((KCL_PCI_DevHandle)pdev, privdev);
-         pci_disable_device(pdev);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
-+	pci_ignore_hotplug(pdev);
-+#endif
-         PMSG_EVENT(pdev->dev.power.power_state) = state;
-     }
-     else
-diff -uNr 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c
---- 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c	2014-09-09 16:10:17.000000000 +0200
-+++ 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c	2014-09-26 18:57:27.000000000 +0200
-@@ -840,10 +840,12 @@
-    if(tdev != NULL)
-    {
-       device = (acpi_device_adr(tdev) >> 16) & 0xffff;
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
-       if(PCI_SLOT(pdev->devfn) == device)
-       {
-          tdev->flags.no_hotplug = true;
-       }
-+#endif
-    }
- #endif
-    return 0;
diff --git a/pkgs/os-specific/linux/ati-drivers/fglrx_3.18.19-no_hotplug_underscore_cr4.patch b/pkgs/os-specific/linux/ati-drivers/fglrx_3.18.19-no_hotplug_underscore_cr4.patch
new file mode 100644
index 00000000000..0d6839a1012
--- /dev/null
+++ b/pkgs/os-specific/linux/ati-drivers/fglrx_3.18.19-no_hotplug_underscore_cr4.patch
@@ -0,0 +1,58 @@
+diff -Nru 15.7/common/lib/modules/fglrx/build_mod/firegl_public.c 15.7.new/common/lib/modules/fglrx/build_mod/firegl_public.c
+--- 15.7/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-07-04 10:31:23.000000000 -0400
++++ 15.7.new/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-08-02 19:47:04.123014897 -0400
+@@ -4498,8 +4498,8 @@
+ 
+     if (cpu_has_pge)
+     {
+-        cr4 = read_cr4();
+-        write_cr4(cr4 & ~X86_CR4_PGE);
++        cr4 = __read_cr4();
++        __write_cr4(cr4 & ~X86_CR4_PGE);
+     }
+      __flush_tlb();
+ 
+@@ -4512,7 +4512,7 @@
+     write_cr0(cr0 & 0xbfffffff);
+     if (cpu_has_pge)
+     {
+-        write_cr4(cr4);
++        __write_cr4(cr4);
+     }
+     local_irq_restore(flags);
+ 
+@@ -4539,8 +4539,8 @@
+ 
+     if (cpu_has_pge)
+     {
+-        cr4 = read_cr4();
+-        write_cr4(cr4 & ~X86_CR4_PGE);
++        cr4 = __read_cr4();
++        __write_cr4(cr4 & ~X86_CR4_PGE);
+     }
+      __flush_tlb();
+   
+@@ -4552,7 +4552,7 @@
+     write_cr0(cr0 & 0xbfffffff);
+     if (cpu_has_pge)
+     {
+-        write_cr4(cr4);
++        __write_cr4(cr4);
+     }
+     local_irq_restore(flags);
+ 
+diff -Nru 15.7/common/lib/modules/fglrx/build_mod/kcl_acpi.c 15.7.new/common/lib/modules/fglrx/build_mod/kcl_acpi.c
+--- 15.7/common/lib/modules/fglrx/build_mod/kcl_acpi.c	2015-07-04 10:31:23.000000000 -0400
++++ 15.7.new/common/lib/modules/fglrx/build_mod/kcl_acpi.c	2015-08-02 19:59:54.797911610 -0400
+@@ -861,7 +861,10 @@
+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+     if(pdev)
+     {
+-       pci_ignore_hotplug(pdev);
++      struct pci_dev *bridge = pdev->bus->self;
++
++      pdev->ignore_hotplug = 1;
++      if(bridge) bridge->ignore_hotplug = 1; 
+     }
+ #endif
+ }