sf: Add basic implementation of onVsyncIdle
To adopt the new AIDL composer callback API, the patch changes the
architecture to pass HWC2::ComposerCallback directly in the
registerCallback function. The underlying implementations can use their
own bridge to adapt with different versions of callback APIs.
Bug: 194068871
Test: atest libsurfaceflinger_unittest
Change-Id: I08bcf481747f38805fb2527e18293585ede51554
diff --git a/services/surfaceflinger/DisplayHardware/HidlComposerHal.h b/services/surfaceflinger/DisplayHardware/HidlComposerHal.h
index c8c7800..1ffca6e 100644
--- a/services/surfaceflinger/DisplayHardware/HidlComposerHal.h
+++ b/services/surfaceflinger/DisplayHardware/HidlComposerHal.h
@@ -172,7 +172,7 @@
std::vector<IComposer::Capability> getCapabilities() override;
std::string dumpDebugInfo() override;
- void registerCallback(const sp<IComposerCallback>& callback) override;
+ void registerCallback(HWC2::ComposerCallback& callback) override;
// Reset all pending commands in the command buffer. Useful if you want to
// skip a frame but have already queued some commands.
@@ -334,6 +334,8 @@
~CommandWriter() override {}
};
+ void registerCallback(const sp<IComposerCallback>& callback);
+
// Many public functions above simply write a command into the command
// queue to batch the calls. validateDisplay and presentDisplay will call
// this function to execute the command queue.