93b5e13308
This changes how we synchronize through vsync. We use a mutex and a wait condition to synchronize the threads. When presenting the frame our main gui thread blocks and will be woken up by the vsync event (or a timeout of max 1 frame time slot). In order to minimize the blocked time we use the blocksForRetrace functionality from the GLX compositor. Given this change we no longer need to tell the compositor that we are swapping the frame, it's blocked anyway. Also we don't need the failsafe QTimer anymore. With this change applied on a Nexus 5 it's succeeding the "Martin tortures phone test". It doesn't tear anymore and has a smooth experience. I'm rather disappointed by the fact that we need to block in order to get vsync. This means Android/hwcomposer is as bad as GLX. So much for the "Android stack is so awesome", in fact it's not. Anybody thinking it's awesome should compare to DRM/KMS and especially atomic modesetting. Yes it's possible to present frames without tearing and without having to block the rendering thread. Reviewed-By: Marco Martin and Bhushan Shah |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
egl_hwcomposer_backend.cpp | ||
egl_hwcomposer_backend.h | ||
hwcomposer.json | ||
hwcomposer_backend.cpp | ||
hwcomposer_backend.h | ||
logging.cpp | ||
logging.h | ||
screens_hwcomposer.cpp | ||
screens_hwcomposer.h |