Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mesa: restructure driver selection to be more architecture-neutral #45474

Merged
merged 3 commits into from May 9, 2019

Conversation

CrystalGamma
Copy link
Contributor

Motivation for this change

Allows Mesa to build on non-x86, non-ARM platforms like ppc64(le).
Part of my roadmap to bring NixOS to OpenPower platforms.

The new logic should be logically equivalent for x86 and ARM platforms (but might cause rebuilds due to reordered list elements).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

This allows Mesa to also build on ppc64le.
@dezgeg
Copy link
Contributor

dezgeg commented Aug 22, 2018

I don't see this very readable.

What you could do is just a separate case for x86 and then an else case which just adds the safest option (which is presumably only virgl).

@CrystalGamma
Copy link
Contributor Author

The point was that "generic" architectures (like Power) that have PCIe support but no integrated GPUs get all drivers for GPUs widely available as PCIe cards by default, while drivers for integrated GPUs are only built for their platforms (ARM ⇒ freedreno, etnaviv, x86 ⇒ Intel drivers), so when following your suggestion I would need to add a specific path for ppc64(le) for each variable …

@dezgeg
Copy link
Contributor

dezgeg commented Aug 22, 2018

Makes sense. Maybe have the else case then just list all the drivers for the PCI(-E) cards.

@edolstra
Copy link
Member

Note that adding support for a new platform is something that should go through the RFC process (since it may introduce a non-trivial maintenance burden for other contributors).

@CrystalGamma
Copy link
Contributor Author

New design that more clearly shows the reasoning.

@CrystalGamma
Copy link
Contributor Author

@edolstra Where can I access that process? FWIW, the initial platform enablement PR was marked as [RFC] …

@edolstra
Copy link
Member

@CrystalGamma
Copy link
Contributor Author

I see discussion on NixOS/rfcs#31 has largely concluded without major unaddressed objections …
Maybe we should just (squash &) merge this (even though the RFC hasn't been merged)?

@matthewbauer
Copy link
Member

I still think this is helpful - the old way basically just had static lists for each system. We should think more in capabilities - what driver works and doesn't work with each system.

@matthewbauer
Copy link
Member

@GrahamcOfBorg build mesa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants