Mir and Chromium

Ubuntu’s Display Server Mir is gaining more and more traction and the team is making good progress on the platforms that are at the core of Ubuntu.

Mir is proving itself everyday to be the exact technology that Ubuntu needs to power mobile devices. Mir’s features are on par with the requirements that we put out to run Ubuntu on mobile devices. A few recent highlights include the screencasting API, Sidestage and improved right edge navigation (in concert with Unity 8).

Mir’s traction can be measured by the adoption or enablement rate of other non-Ubuntu consumers. As such, it was exciting to see Mir support land in SDL upstream as this will automatically enable a wide array of applications to be run on top of Mir.

In order to further drive traction, I challenged the team to pick another project that would bring Mir to a large number of users immediately. The chosen project was Chromium, due to our good relationship with the teams at Google, but also because a browser is so central to what most of us do on a computer every single day.

The birth of Chro-mir-ium

Robert Carr accepted the challenge, dug himself into all relevant code and it didn’t take him too long to return with first proof of concepts. His approach was inspired by the work that the Ozone/Wayland project has leveraged before.

I am calling it ‘proof of concept’ not because of the quality of the code, but because there is more work to do to fully integrate Chromium with Mir, e.g. Mir does not provide Window Management, so Chromium will excel to its fullest extend only on Unity 8 on Mir.

However, the progress is so good, that I plan to use Chromium on Mir for my regular work in a dogfooding attempt in the not so distant future. But see for yourself:

Find Robert’s G+ post with all technical details here.

Chromium introduced Ozone in June 2013. Ozone is an abstraction layer that allows Display Systems such as Mir and Wayland to provide the necessary backend support without having to pull the code directly into Chromium. Check out the Ozone documentation for more information and API description.

With Mir and Wayland sharing some key concepts, such as the EGL/GLES driver model, it wasn’t surprising to see that there were commonalities between the Ozone/Mir and Ozone/Wayland implementation, for example the initialization and acquisition of EGL displays.

Doing the right thing

Regardless of the fact that some might consider the relationship between the Mir and Wayland project as “it’s complicated”, Robert went the extra mile of doing what’s right from a Software Architecture perspective and started to abstract those common components, so that unnecessary code duplication in the Ozone/Mir and Ozone/Wayland implementation is avoided. Check the github repository for implementation details. This step is not necessary to enable Chromium on Mir but Robert’s standards for a proof of concept are not to provide a shortcut that is harder to maintain in the long run.

Moving forward

We acknowledge that given the “complicated” relationship status of Mir and Wayland, the dynamics of this undertaking are getting interesting when you look at possible future steps. However, instead of looking back we are looking ahead, and here are the most likely outcomes:

  • At the very least, the implementations of Ozone/Mir and Ozone/Wayland will simply coexist with an unaltered Ozone API as it exists today.

  • Taking it one step further, the Chromium project could alternatively adopt a simplified EGL API that would build on Robert’s work and cater to any EGL based display server

We have proposed our work with the respective upstreams in private conversations and are sharing the code also publicly in order to support a technical conversation on that subject.

For the more adventurous and early Mir adopters, rest assured that we are also working on making the Chromium/Mir build available via a PPA and we’ll update you when it is available.