OSDN Git Service

drm_hwcomposer: Fix returned fence in PresentDisplay
authorMatteo Franchin <matteo.franchin@arm.com>
Tue, 3 Dec 2019 17:10:38 +0000 (17:10 +0000)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 3 Dec 2019 17:10:38 +0000 (17:10 +0000)
commitc56eede3396a4a8aa26126e20bf6d174a6a75f7c
tree0feac6a020c41028fb6b16cecfc283fa5a28e10a
parentd6a6e6eadd783365013fdc493c00994054f3e6aa
drm_hwcomposer: Fix returned fence in PresentDisplay

DrmHwcTwo::HwcDisplay::PresentDisplay was always returning -1 as the
present fence. This commits ensures the fence fd is correctly retrieved
after doing the commit-frame operation. It also updates outdated logic
that caused PresentDisplay to return the retire fence rather than the
present fence.

DrmHwcTwo::HwcDisplay::AddFenceToPresentFence is also changed so that
it assumes it is given ownership of the file descriptor it receives as
argument. This function was indeed called consistently with this
behaviour, which meant the dup led to leakage of file descriptors.

With the changes above this patch fixes a failure in the CTS test
dEQP-VK.wsi.android.display_timing.fifo.display_timing (for example
running Android 10 on HiKey960). The test failed with the error
"Unexpectedly received invalid timestamp." reported multiple times in
the logcat output.

Change-Id: If662e5239895b8b0e2ea31fd99747855f901a427
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
drmhwctwo.cpp
include/drmdisplaycompositor.h
include/drmhwcomposer.h
include/drmhwctwo.h