forked from mirrors/nixpkgs
Merge pull request #45474 from CrystalGamma/mesa_3
mesa: restructure driver selection to be more architecture-neutral
This commit is contained in:
commit
9d3d5e98bc
|
@ -26,26 +26,26 @@
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
if ! elem stdenv.hostPlatform.system platforms.mesaPlatforms then
|
if ! elem stdenv.hostPlatform.system platforms.mesaPlatforms then
|
||||||
throw "unsupported platform for Mesa"
|
throw "${stdenv.system}: unsupported platform for Mesa"
|
||||||
else
|
else
|
||||||
|
|
||||||
let
|
let
|
||||||
defaultGalliumDrivers =
|
# platforms that have PCIe slots and thus can use most non-integrated GPUs
|
||||||
optionals (elem "drm" eglPlatforms)
|
pciePlatform = !stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64;
|
||||||
(if stdenv.isAarch32
|
defaultGalliumDrivers = optionals (elem "drm" eglPlatforms) ([ "virgl" ]
|
||||||
then ["virgl" "nouveau" "freedreno" "vc4" "etnaviv" "imx"]
|
++ lib.optionals pciePlatform [ "r300" "r600" "radeonsi" ]
|
||||||
else if stdenv.isAarch64
|
++ lib.optionals (pciePlatform || stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) [ "nouveau" ]
|
||||||
then ["virgl" "nouveau" "vc4" ]
|
++ lib.optionals stdenv.hostPlatform.isx86 [ "i915" "svga" ]
|
||||||
else ["virgl" "svga" "i915" "r300" "r600" "radeonsi" "nouveau"]);
|
++ lib.optionals (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) [ "vc4" ]
|
||||||
defaultDriDrivers =
|
++ lib.optionals stdenv.hostPlatform.isAarch64 [ "freedreno" "etnaviv" "imx" ]
|
||||||
optionals (elem "drm" eglPlatforms)
|
);
|
||||||
(if (stdenv.isAarch32 || stdenv.isAarch64)
|
defaultDriDrivers = optionals (elem "drm" eglPlatforms) ([ ]
|
||||||
then ["nouveau"]
|
++ lib.optionals pciePlatform [ "radeon" "r200" ]
|
||||||
else ["i915" "i965" "nouveau" "radeon" "r200"]);
|
++ lib.optionals (pciePlatform || stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) [ "nouveau" ]
|
||||||
defaultVulkanDrivers =
|
++ lib.optionals stdenv.hostPlatform.isx86 [ "i915" "i965" ]);
|
||||||
optionals stdenv.isLinux (if (stdenv.isAarch32 || stdenv.isAarch64)
|
defaultVulkanDrivers = optionals stdenv.hostPlatform.isLinux ([ ]
|
||||||
then []
|
++ lib.optional stdenv.hostPlatform.isx86 "intel"
|
||||||
else ["intel"] ++ lib.optional enableRadv "radeon");
|
++ lib.optional enableRadv "radeon");
|
||||||
in
|
in
|
||||||
|
|
||||||
let gallium_ = galliumDrivers; dri_ = driDrivers; vulkan_ = vulkanDrivers; in
|
let gallium_ = galliumDrivers; dri_ = driDrivers; vulkan_ = vulkanDrivers; in
|
||||||
|
|
Loading…
Reference in a new issue