Send power hints from surfaceflinger using the PowerAdvisor
Have SurfaceFlinger send timing hints to the PowerHAL to help meet the frame deadline and dynamically scale clock frequency for different workloads.
This patch additionally refactors a few closely related parts of the PowerAdvisor, and expands the logging there for this feature.
To enable the power hint session, use:
adb shell device_config put surface_flinger_native_boot AdpfFeature__adpf_cpu_hint true
Bug: b/195990840
Test: manual
Change-Id: Ib3eca9d08e0fb5e446ea7075630f741b48940f84
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index e1b52c5..d6d31cb 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -1357,6 +1357,13 @@
float getLayerFramerate(nsecs_t now, int32_t id) const {
return mScheduler->getLayerFramerate(now, id);
}
+
+ struct {
+ bool sessionEnabled = false;
+ nsecs_t commitStart;
+ nsecs_t compositeStart;
+ nsecs_t presentEnd;
+ } mPowerHintSessionData GUARDED_BY(SF_MAIN_THREAD);
};
} // namespace android