Skip to content

Chromium Ozone Web Engines Hackfest 2021

Manuel Rego Casasnovas edited this page May 7, 2021 · 3 revisions

Chromium Ozone - Web Engines Hackfest 2021

[Alex Dunaev] Introduces himself: Igalia employee for a couple years, working on Ozone for Linux platforms. Starts presenting.

[Eric] Was Ozone new to you when you started?

[Alex] It was like building an entire new platform! Started with small tasks, tests, it was completely new.

[Eric] Does it look like a well-designed system?

[A] It seems 'inevitable', so to say [laughs]

[Jacobo] Ozone is also great for embedding cases, it provides a stable abstraction you can rely upon when implementing a specific backend for your device, maybe using lower-level libraries and not a window manager for example. You can only implement the bare minimum you need for your use case, and the Ozone abstraction eases maintenance.

[Nick] The first Ozone/Wayland implementation was actually maintained off-tree by Intel, so it's possible to have proprietary implementations off-tree.

[Alex] I could be wrong, but I thought this actually kind of started in the embedded world. I think it started with chromeos and wanting to separate multiple device-specific implementations...

[Eric] Are there Ozone implementations for Windows, OS X?

[Maksim] No, there are stubs for them but nothing working. When we started this, we looked at how windows and mac used things and created things so that it should be easy (not free, but easy) to port to windows and mac. There could be interest, maybe from Google, after we ship on Linux. Now it's starting to arrive to users, 50% of installations from the dev channel have it enabled by default, after this field test goes through it will go to beta, etc.

[Eric] Is the idea to retire X11?

[Maksim] The plan is to retire the old X11 code path and always use Ozone, with Ozone you can switch between X11 and Wayland in runtime, we will even be able to select the best choice based on what we detect for users.

[Julie] This is Julie from Igalia. About the experience enabling Ozone on Linux, she thinks it's great to change backends in runtime. What do you think it was the most complicated task?

[Alex] The most complicated in which platform?

[Maksim] Wayland was way more complicated. There are things we are still working on, like HiDPI... Also we want Chromium to delegate compositing to Wayland and that required deep changes... It was time consuming. There were also the events, it was a lot of work, Nick worked on that...

[Nick Diego] There are different complexities involved, in X11 the work was time-consuming but not complex, it required big refactorings that touched a lot of files. In the case of Wayland, there were assumptions in Chrome that didn't fit Wayland, like absolute screen coordinates and that was complicated in a different way, because there are shared components used by other platforms and we can't have any regressions. It was also complex to make sure that things worked with every Wayland compositor out there, check if it was a bug on Chrome or in the compositor... Depending on some requirements supported by the platform, in some cases we had to come up with wayland protocol extensions and upstreaming to Wayland, which is of course slow to get that out to all Wayland compositors that are out there, and that is a bit outside of our scope.

[Alex] I remember drag&drop and clipboard was particularly complex. The original design didn't fit well.

[Daniel Stone] Is there anything we could do upstream, in Wayland development, to help Chromium? But we are not going to implement global co-ordinates, I tell you now! [laughs]

[Robert Kroeger] I work on Chrome graphics at Google. It was interesting to exercise the protocol with a complex application like Chromium, and found things that were not conformant across implementations, e.g. how buffers must be released. A conformance suite for Wayland similar to the Web Platform Tests would be super helpful. Our experience is that the biggest challenges are when one compositor works, and another doesn’t.

[Brian Kardell] The history of the web was very much like that initially, where everything was impossibly difficult to harmonize. The changing quality that came as we got a shared test suite was jarring, and a suite here seems like a great idea.

[Daniel] There are sometimes an infinite range of possible, correct behaviors [e.g. 'when should a buffer be released to the client?']. We have a cross-compositor test suite (Canonical's WLCS) implementation but it's GPL v3 and that doesn't suit everyone. I don't expect this to happen shortly but it's high in the list of priorities.

[Eric] Test suites are a really great idea :)

[Peter Kvitek] Suppose you want to start your own Ozone backend impelemntation, what are the top three questions should you answer before starting to know if you should go/not go ahead.

[Alex] Probably will be answerer by Maksim's presentation! I think first question should be, can you go with existing platform.

[Maksim] I can answer from the terms of what you need, but whether to go with Ozone or not is a good question.

[Alex] Maybe I have some ideas. You have to decide how much investment you can afford, because depending on complexity, it can be a very expensive effort. We've been working on Wayland for five years.

[Maksim] It's a good answer! Maybe you should first check if one of the existing platforms is good for you. In the case of [current Chromium Ozone implementations] we are saving up on future maintenance because we are unifying code paths.

[Peter] Does it get any easier the more Ozone implemntations there are available?

[Maksim] It increases in complexity but at the same time I think it gets easier, because you don't need to figure out which new interfaces you may need (or whether they are necessary). You will have many interfaces documented with what you need to do to guide your Ozone implementation. In the beginning we did quite a lot of research for the Wayland implementation and the X11 was easier.

[Nick] My answer is fully yes, at least in the context of these desktop platforms we had to add a bunch of new interfaces, I remember for example the ones related with the clipboard... In the beginning Ozone was only used on ChromeOS, there is e.g. an implementation for DRM... These platforms are lower-level and the integration is very different, we had to add support for higher level abstractions like clipboard for our Wayland and X11 implementations.

[Eric] There is at least one Ozone implementation that it's not in Chromium tree [missed a bit]

[Maksim Presents]

[Eric] How long did it take this implementation?

[Maksim] About 5 hours for this talk, it could take one hour if you knew the platform very well.

[Eric] Is there anything you left out of the talk? Anything to comment?

[Maksim] It was also a surprise to me that not much things are needed to get a basic ozone platform running, four classes cover the basic stuff. I got some questions about whether was possible to use Ozone as an standalone library to reuse Ozone implementations on different pieces of software. Maybe in the future we could figure out if it's possible to build Chromium as a standalone library.

[Alex] There is an off-tree implementation of Ozone so it's possible. [something about Qt?]

[Maksim] ?

[Peter] What are your primary debugging tools?

[Maksim] Most of the time is just basic logging! Also GDB, stacktrace printing... But most of the time, frankly, is logging [laughs]

[Peter] Do you have tests?

[Maksim] We have Ozone unit tests, for Wayland, X11, DRM, not sure if for headless we have any... No, we don't.

[Eric] It seems we don't have more questions! Thanks everyone, hope to see you in the session tomorrow!

Jitsi chat excerpts

[Peter Kvitek] Are there any other Ozone platform implementations available outside of Chromium code base?

[Daniel Stone] don't implement your own backend, just use Wayland 😉

[Robert Kroeger] there is at least one ozone platform implementation not in chromium. the ozone api was originally set up to permit this

[Alex Dunaev] Do you mean some other implementation than the Intel's Wayland one?

[Robert Kroeger] yes

[Alex Dunaev] Ah, not in Chromium! So it's completely outside/

[Robert Kroeger] yes

[Alex Dunaev] It would be really interesting to know more about that.

[in reply to request to scale up code windows]

[msisov] https://chromium-review.googlesource.com/c/chromium/src/+/2859955 you can check the code from here

IRC chat excerpts

[Nick Diego] this is the protocol extension I mentioned earlier, neede to impl Chrome's tab drag features: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/46

[Daniel Stone] nickdiego: thanks for the pointer :) I'm much much more of a backend person so I've not been trying to pretend like I understand desktop things jadahl is definitely the best reviewer there

[Nick] :D Right, I actually have been talking to him as well as emersion@, in theory the review should start soon but something I'm still not sure is "how many" compositor impls are needed to get it actually reviewed/upstreamed

daniels: question: So, having it implemented in Weston, for example, is a requirement to get it upstreamed? (for now we have it implemented only in Exo compositor)

[Daniel] nickdiego: the rule is three implementations, at least one compositor and at least one client, where all three are actually meaningful - like real projects rather than test-client.c so for that, Exo + Weston + Chromium-client would be totally acceptable for landing it tbh (and it pains me to say this), you almost certainly want that middle implementation to not be Weston though, since we ... don't have a particularly commanding desktop userbase Mutter would probably be the best target since it's the most widely-used desktop and it's pretty well staffed with both RH + Canonical being motivated to make Chrome work well wlroots would be my second suggestion as it has the second-biggest desktop userbase AFAICT, but on the other hand I suspect the intersection of people who love tiled window managers and people who want to do cross-window multi-tab drags is probably quite low?

[Nick] Makes sense. I recently talked with some Firefox folks, and they seem to have the same issues (addressed by this extension).. Mutter seems like an interesting option, or maybe wlroots

[Daniel] jadahl is also Mr. Mutter, so that could work well :)

[Nick] daniels: yeah, will keep in touch with simon and jonas to try to move that forward ok thanks for the feedback

[Daniel] awesome :) np! best of luck

Clone this wiki locally