When using drm_hwcomposer with the hikey board, the resulting display shows lots of tearing.
This seems to be due to EGLcomposition not initializing properly, potentially due to I'm guessing limitations of what the utgard mali driver can do. I've noted that with the HiKey960 board, this patch is *not* necessary.
Hacking around a bit, I found that since the glworker code isn't running properly, we never call glFinish(), which is required to fix the tearing.
Ideas for a better way to implement this would be greatly appreciated!
Cc: Marissa Wall marissaw@google.com Cc: Sean Paul seanpaul@google.com Cc: Dmitry Shmidt dimitrysh@google.com Cc: Robert Foss robert.foss@collabora.com Cc: Matt Szczesiak matt.szczesiak@arm.com Cc: Liviu Dudau Liviu.Dudau@arm.com Cc: David Hanna david.hanna11@gmail.com Cc: Rob Herring rob.herring@linaro.org Signed-off-by: John Stultz john.stultz@linaro.org --- v2: * Simplified, focusing on the key glFinsh() call --- drmdisplaycompositor.cpp | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp index 3a20b31..eb0b77a 100644 --- a/drmdisplaycompositor.cpp +++ b/drmdisplaycompositor.cpp @@ -439,6 +439,10 @@ int DrmDisplayCompositor::PrepareFrame(DrmDisplayComposition *display_comp) {
fb.set_release_fence_fd(ret); ret = 0; + } else { + /*If we're not doing anything, block to avoid tearing */ + glFinish(); + return 0; } }