As discussed on irc, this reworks how we choose the primary GPU. The logic is basically the same, we just delay it and call it from the renderer so that we can add the "is hw accelerated" logic to make the decision.
- This depends on MR !237 (merged)
- The primary GPU gets its secondary initialized (that happens for every GPU to check the renderer, then one of them gets chosen as primary). Should we destroy that for the primary?
- The primary GPU is now chosen based on the qualities that we want first, rather than relaying on the ordering given to us by GUdev.
- Since we will now choose any GPU as primary, we could remove the "prefer a platform device" logic. AFAICS that was added in ca7c1d5e to allow a platform device to be primary, but we do that now without having to special case it.
- I have tested this with llvmpipe, but added swrast and softpipe for completion.
- I added a commit to fall back to CPU copy path on a secondary GPU with a sw renderer, which gives me much better results (the GPU copy path has performance issues and rendering artifacts due to lack of synchronization). If you prefer I could remove that one from this MR and we can discuss it separately.