I'm working on an Android app compatibility project which involves having two compositors draw to 2 different framebuffers, the main compositor (Lipstick, a wayland compositor) draws to fb0. Surfaceflinger after an fb swap with /dev/graphics/fb0 pointing to fb1, draws to fb1. I would like to create an application which gets the contents of fb1 and draws it to the screen, possibly with SDL. But I don't know how this can be done.
Asked
Active
Viewed 559 times
1
-
If you're using your own compositor with /dev/graphics/fb, how is SurfaceFlinger involved? Also, modern Android uses Hardware Composer rather than fbdev (except possibly for the recovery UI). – fadden Nov 02 '15 at 23:41
-
turning off HW overlays in the android developer settings reverts everything to go through surfaceflinger (as far as I know) and starting Surfaceflinger after the fb swap is done while the Lipstick compositor is running means that Surfaceflinger draws to fb1 (or runs in the background or something (while it still reads input). While fb0 is still used by the Lipstick compositor. – nh1402 Nov 03 '15 at 20:22
-
The setting disables hardware overlays, which means SurfaceFlinger does all the composition on the GPU. It doesn't disable HardwareComposer or cause SurfaceFlinger to switch to /dev/fb -- that's a startup-time decision in https://android.googlesource.com/platform/frameworks/native/+/marshmallow-release/services/surfaceflinger/DisplayHardware/HWComposer.cpp . It sounds like your overlay planes and fbdev entries interact; I don't know if that's expected or coincidental. In any event, you can copy from a GLES framebuffer starting in GLES 3. – fadden Nov 03 '15 at 21:39