There are some interesting recent developments on the Mir’s
main branch, we’ve been reworking the “graphics platform” APIs to enable a raft of new functionality.
Mir has an abstract idea of what graphics support it needs and provides implementations of that support based on different driver/hardware stacks. Here’s a diagram that provides an overview:
This shows how the platform API relates to the rest of Mir and to the graphics drivers (and hardware).
There are a number of things that we needed to change:
The note that says “Select the best platform” reflects what the code did and implies that there can be only one platform and that doesn’t reflect the reality of hybrid graphics.
We had also made assumptions that meant that the graphics for output and the graphics for rendering both needed to run on the same graphics card.
By reworking the APIs we have come up with an approach that allows multiple graphics stacks to work at the same time, and for rendering to occur on a different graphics card to the display output.
Over the last week we landed the major part of this design rework.
As there is still some work to do that deals with corner cases the hybrid graphics part is hidden by a feature flag (defining a
MIR_EXPERIMENTAL_HYBRID_GRAPHICS environment variable enables it).
But, even without multiple platforms we can already run compositing on a different card than we render on. This means, for instance that I can use an integrated GPU to render and display via a dock using DisplayLink. (DisplayLink creates a virtual evdi “card” that doesn’t support rendering.)
This is the Miriway snap from the
edge channel (which has the development version of Mir).
We’ve problems in some hybrid cases that need fixing. The PR to watch is Sharing CpuAdressableDisplayProvider between eglstreams and gbm platforms.
Discussions of the PR also identified some opportunities for more descriptive naming.
After that, and some more testing, we should be able to remove the feature flag to make hybrid graphics generally available ready for the next Mir release.