SF: Clean up forced refresh and repaint
Remove the misleading repaintEverything flag from CE, as it only affects
debug flashes (and the fullscreen strobe during refresh rate transitions
is of dubious utility). It also causes GPU virtual displays to recompose
despite not being dirty, but forcing repaint can be done by invalidating
geometry instead.
Clean up the Scheduler/SF interface to schedule invalidate, refresh, and
repaint. Fix atomicity of a few debug variables.
Bug: 182939859
Test: Toggle "Show surface updates" in dev settings.
Test: libcompositionengine_test
Change-Id: I176d01cab43e5ab4697b762fe3172b09f4f3d202
diff --git a/services/surfaceflinger/Scheduler/Scheduler.h b/services/surfaceflinger/Scheduler/Scheduler.h
index 4b6905b..420ba61 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.h
+++ b/services/surfaceflinger/Scheduler/Scheduler.h
@@ -56,10 +56,13 @@
} // namespace frametimeline
struct ISchedulerCallback {
+ // Indicates frame activity, i.e. whether commit and/or composite is taking place.
+ enum class FrameHint { kNone, kActive };
+
+ virtual void scheduleRefresh(FrameHint) = 0;
virtual void setVsyncEnabled(bool) = 0;
virtual void changeRefreshRate(const scheduler::RefreshRateConfigs::RefreshRate&,
scheduler::RefreshRateConfigEvent) = 0;
- virtual void repaintEverythingForHWC() = 0;
virtual void kernelTimerChanged(bool expired) = 0;
virtual void triggerOnFrameRateOverridesChanged() = 0;
@@ -136,8 +139,8 @@
bool isIdleTimerEnabled() const { return mIdleTimer.has_value(); }
void resetIdleTimer();
- // Function that resets the touch timer.
- void notifyTouchEvent();
+ // Indicates that touch interaction is taking place.
+ void onTouchHint();
void setDisplayPowerState(bool normal);
@@ -194,6 +197,8 @@
private:
friend class TestableScheduler;
+ using FrameHint = ISchedulerCallback::FrameHint;
+
// In order to make sure that the features don't override themselves, we need a state machine
// to keep track which feature requested the config change.
enum class ContentDetectionState { Off, On };