hwcomposer: Fix regression in hwc_sync

Hwc_sync is in the hotpath of display
rendering and gets called every ~17ms
during active rerendering.

Reading the property "debug.egl.swapinterval"
on every execution of hwc_sync causes a major
regression where the execution of hwc_sync
is much slower than it can be.

Doing I/O in hotpaths is inacceptable
and can cause an unnecessary constant
I/O load, additionally to the slowdown
in display rendering which was caused
in this case.

As solution, we condition this debugging
feature with "DISPLAY_DEBUG_SWAPINTERVAL",
so it can be enabled when explicitly needed.

Gralloc is not directly affected by the regression,
it was adjusted to match the conditioning
of the swapinterval debugging feature.

The HALs of msm8084,msm8226,msm8909,msm8960 and
msm8994 are affected by the regression and
get patched by this patch. Newer HALs
are not affected.

The stats contained in this patch were
collected using a Nextbit Robin (MSM8992),
which uses the msm8994 HAL.

Test: Manual testing for proper conditioning.
Test: Running full CTS suite without DISPLAY_DEBUG_SWAPINTERVAL set.

Change-Id: If08595d37ac0c1a19edd8d296289a21c9f95512a
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
3 files changed