December 17, 2018
In the beginning, Android did not really have a graphics stack. It was just pushing frames directly to framebuffers and hoping for the best, the approach worked for quite some time.
However, over time, the usecases became more and more complex and a new graphics stack was necessary. About 6 years ago the Android team conducted a lot of research and quickly realized that the mainline kernel was far from being up to the job - it was lacking Atomic screen updates, explicit syncronization and support for low power hardware, among other things. Google was left with no other choice than to design their own graphic stack: Atomic Display Framework (ADF).
That was another piece of the mainline linux kernel that Android forked, but it allowed Google to overcome the challenges brought on by the new needs of industry and customers.
The mainline graphics stack had a number of problems and the API was outdated and not keeping pace with the industry. The mainline graphics community knew it was time for an upgrade!
The addition of Kernel Modeset (KMS) around 2008 was a revolution in itself, but as time passed, new needs arose and a new API was required. That lead to a situation where we had different syscalls to update every single buffer on the screen. In order to update the whole screen, for example, one would need to make a couple of syscalls and hope they would all be applied to the display hardware before the next vsync signal, otherwise some user noticeable flickering could happen. Unfortunately, such flickering was happening quite often.
Led by Daniel Vetter (Intel), the introduction of Atomic Modesetting on top of KMS in 2015 added a new system call that would contain *all* the information to update all buffers in all screens in a single commit transaction, fixing the issues that plagued the previous API. The Direct Rendering Manager (DRM) Core went through a comprehensive refactoring process, and drivers became much easier to write, allowing for all the major drivers to be eventually ported to atomic modesetting, and many more added as well, some of them with Collabora's help.
Atomic Modeset was a giant step but there was still one piece missing: Explicit Synchronization. To avoid screen stalls and lack of knowledge about the current state of a buffer, ADF from Android introduced sync fences to keep track of buffer state and signal when GPU or Display is done filling or scanning it out.
In work led by Collabora, the Android Sync Framework was refactored and added to the mainline kernel, and Explicit Synchronization support was coded into DRM Atomic Modeset. The kernel now had all the pieces to support Android running on DRM/KMS.
The dream finally came true in 2018 with the release of the Google Pixel 3, the first Android phone running with the mainline graphics stack. A feat that was deemed impossible 10 years ago is now a reality thanks to a lot of hard work from the entire community.
Google ChromeOS also benefited from Explicit Synchronization to improve support for Android apps on Chromebooks, and now the Chrome Browser also has Explicit Synchronization support.
As more vendors start to push their code to mainline, and follow upstream closely, we expect others Android phone vendors to switch to DRM/KMS too in the future. The upstream stack is now quite modern and robust, and the benefits of using it is becoming clear!
With the code base of the Linux kernel constantly changing and deployed in devices around the world, performing proper testing is crucial.…
GStreamer relies on multiple repositories such as base and good to build its ecosystem, and now owns more than 30 projects in Gitlab. So,…
Here at Collabora, we trust our people to work remotely, we give them full responsibility for their output, and we believe it helps creating…
PipeWire 0.3 was released a few days ago, marking a big step forward in the effort of making this emerging media service the core layer…
Panfrost's ES 3.0 support has landed in upstream Mesa and works with a mainline Linux kernel. The support is still early, but if you're…
When a bug surprises you when doing Apertis packaging of a typical vendor code signing tool, it's time to debug it using the compiler's…