Reduce number of binders from SurfaceFlinger for ADPF
Currently, SF is using the wrong vsync value when calculating the
target for ADPF, causing it to send a binder every frame instead of
every vsync change. This patch fixes that to reduce the binder
frequency from SF, and also adds a debug option to disable reportActual
to reduce the amount of binders even more in certain cases.
Bug: 284357218
Test: manual
Change-Id: I8435b170016c5af8219d8ed8cc9ed65a0a2cb0e7
diff --git a/services/surfaceflinger/DisplayHardware/PowerAdvisor.h b/services/surfaceflinger/DisplayHardware/PowerAdvisor.h
index 7a0d426..f0d3fd8 100644
--- a/services/surfaceflinger/DisplayHardware/PowerAdvisor.h
+++ b/services/surfaceflinger/DisplayHardware/PowerAdvisor.h
@@ -269,6 +269,9 @@
static const Duration sTargetSafetyMargin;
static constexpr const Duration kDefaultTargetSafetyMargin{1ms};
+ // Whether we should send reportActualWorkDuration calls
+ static const bool sUseReportActualDuration;
+
// How long we expect hwc to run after the present call until it waits for the fence
static constexpr const Duration kFenceWaitStartDelayValidated{150us};
static constexpr const Duration kFenceWaitStartDelaySkippedValidate{250us};