SF: add HWVsync state to dumpsys
Log debugging information about whether HWVsync callbacks
where enabled with HWC.
Bug: 201605862
Test: adb logcat -s SurfaceFlinger
Change-Id: Iaa13a92d37fcfea1328a6e91b17372c3737ffff6
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index dba2bd6..9e2e216 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -1064,6 +1064,11 @@
*/
nsecs_t getVsyncPeriodFromHWC() const REQUIRES(mStateLock);
+ void setHWCVsyncEnabled(PhysicalDisplayId id, hal::Vsync enabled) {
+ mLastHWCVsyncState = enabled;
+ getHwComposer().setVsyncEnabled(id, enabled);
+ }
+
// Sets the refresh rate by switching active configs, if they are available for
// the desired refresh rate.
void changeRefreshRateLocked(const RefreshRate&, Scheduler::ModeEvent) REQUIRES(mStateLock);
@@ -1422,6 +1427,7 @@
std::atomic<nsecs_t> mExpectedPresentTime = 0;
nsecs_t mScheduledPresentTime = 0;
hal::Vsync mHWCVsyncPendingState = hal::Vsync::DISABLE;
+ hal::Vsync mLastHWCVsyncState = hal::Vsync::DISABLE;
// below flags are set by main thread only
bool mSetActiveModePending = false;