HDMI output progress report (bad news) (Patreon)
Content
As you all know, the built-in display of the GPD Win / Pocket is a portrait-style screen that's been mounted 270° rotated into the chassis.
This causes a rather odd phenomenon where the display framebuffer's real resolution is portrait-styled as well (720x1280 instead of 1280x720).
This in itself wouldn't be a problem as Android's userspace takes care of properly rotating its content to accommodate for this (although that also took a few patches of its own before it started to work right).
The real problem stems from Android's external monitor mirror code, which operates outside of this whole construct and blindly centers and copies the main monitor's display framebuffer into the external monitor's framebuffer.
This causes the 90° rotated display we are currently seeing on external monitors, and the only way to fix this issue on that layer is to rotate the framebuffer per-pixel...
I've coded 3 different implementations of this code so far, and sadly, all of them (although they work) are way too slow to be of proper use...
The fastest implementation I could come up with for this renders at about 12FPS, and they all run entirely on the CPU, aka. are extreme resource hogs, causing not only battery drain but also slowdowns in the system.
Sadly, our cherrytrail chipset doesn't support hardware rotations other than 180°, thus there is no easy way to hardware-accelerate this operation.
If anyone knows their way around the i915 Linux driver or Android's drm_gralloc / drm_hwcomposer code, feel free to get in touch with me.
I'll gladly share the bits and pieces I've managed to work out so far.