summary refs log tree commit diff
path: root/pkgs/development/libraries/mesa
diff options
context:
space:
mode:
authorJona Stubbe <nixos@crystalgamma.de>2018-08-22 23:48:38 +0200
committerJona Stubbe <nixos@crystalgamma.de>2018-08-22 23:48:38 +0200
commit4688f4078fa655fa3e56a8a4b2591fb195a7eceb (patch)
treeba6ed1f2de90af77c2156a5234ff927d1af13e41 /pkgs/development/libraries/mesa
parenta1f57027551caac627c56f085233744533576f11 (diff)
downloadnixpkgs-4688f4078fa655fa3e56a8a4b2591fb195a7eceb.tar
nixpkgs-4688f4078fa655fa3e56a8a4b2591fb195a7eceb.tar.gz
nixpkgs-4688f4078fa655fa3e56a8a4b2591fb195a7eceb.tar.bz2
nixpkgs-4688f4078fa655fa3e56a8a4b2591fb195a7eceb.tar.lz
nixpkgs-4688f4078fa655fa3e56a8a4b2591fb195a7eceb.tar.xz
nixpkgs-4688f4078fa655fa3e56a8a4b2591fb195a7eceb.tar.zst
nixpkgs-4688f4078fa655fa3e56a8a4b2591fb195a7eceb.zip
restructure driver selection to show conditions for which each driver is selected
Diffstat (limited to 'pkgs/development/libraries/mesa')
-rw-r--r--pkgs/development/libraries/mesa/default.nix22
1 files changed, 12 insertions, 10 deletions
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index 2f8a4bda88a..6787a4dddbb 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -29,16 +29,18 @@ else
 
 let
   inherit (stdenv) hostPlatform;
-  defaultGalliumDrivers = [ "virgl" "nouveau" ]
-    ++ (if hostPlatform.isAarch32 || hostPlatform.isAarch64 then
-      [ "vc4" ]
-      ++ lib.optionals hostPlatform.isAarch64 [ "freedreno" "etnaviv" "imx" ]
-    else
-      [ "r300" "r600" "radeonsi"]
-      ++ lib.optionals hostPlatform.isx86 [ "i915" "svga" ]
-    );
-  defaultDriDrivers = [ "nouveau" ]
-    ++ lib.optionals (!hostPlatform.isAarch32 && !hostPlatform.isAarch64) [ "radeon" "r200" ]
+  # platforms that have PCIe slots and thus can use most non-integrated GPUs
+  pciePlatform = !hostPlatform.isAarch32 && !hostPlatform.isAarch64;
+  defaultGalliumDrivers = [ "virgl" ]
+    ++ lib.optionals pciePlatform [ "r300" "r600" "radeonsi" ]
+    ++ lib.optionals (pciePlatform || hostPlatform.isAarch32 || hostPlatform.isAarch64) [ "nouveau" ]
+    ++ lib.optionals hostPlatform.isx86 [ "i915" "svga" ]
+    ++ lib.optionals (hostPlatform.isAarch32 || hostPlatform.isAarch64) [ "vc4" ]
+    ++ lib.optionals hostPlatform.isAarch64 [ "freedreno" "etnaviv" "imx" ]
+  ;
+  defaultDriDrivers = [ ]
+    ++ lib.optionals pciePlatform [ "radeon" "r200" ]
+    ++ lib.optionals (pciePlatform || hostPlatform.isAarch32 || hostPlatform.isAarch64) [ "nouveau" ]
     ++ lib.optionals hostPlatform.isx86 [ "i915" "i965" ];
   defaultVulkanDrivers =
     lib.optional hostPlatform.isx86 "intel"