From d767263ad9fb5c93da0864c4311b0ec8a8ab5a08 Mon Sep 17 00:00:00 2001 From: Yichi Chen Date: Tue, 15 Mar 2022 07:21:58 +0800 Subject: hwc3: implement VsyncIdle callback for HWC3 The patch creates the new method to register the HWC3 callback function. The corresponding VsyncIdle callback function will be called when idle TE vrefresh is changed in the idle. Bug: 194068871 Test: switch refresh rates, enable panel idle at 60hz Change-Id: I4876fdfd341366ca2012a3ce6704a2c8de5866d2 --- hwc3/impl/HalImpl.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'hwc3/impl/HalImpl.cpp') diff --git a/hwc3/impl/HalImpl.cpp b/hwc3/impl/HalImpl.cpp index 1029fe8..38c8b02 100644 --- a/hwc3/impl/HalImpl.cpp +++ b/hwc3/impl/HalImpl.cpp @@ -14,15 +14,17 @@ * limitations under the License. */ +#include "HalImpl.h" + +#include #include #include -#include "ExynosDeviceModule.h" #include "ExynosDevice.h" +#include "ExynosDeviceModule.h" #include "ExynosDisplay.h" #include "ExynosHWCService.h" #include "ExynosLayer.h" -#include "HalImpl.h" #include "TranslateHwcAidl.h" #include "Util.h" @@ -185,6 +187,10 @@ void HalImpl::registerEventCallback(EventCallback* callback) { reinterpret_cast(hook::vsyncPeriodTimingChanged)); mDevice->registerCallback(HWC2_CALLBACK_SEAMLESS_POSSIBLE, this, reinterpret_cast(hook::seamlessPossible)); + + // register HWC3 Callback + mDevice->registerHwc3Callback(IComposerCallback::TRANSACTION_onVsyncIdle, this, + reinterpret_cast(hook::vsyncIdle)); } void HalImpl::unregisterEventCallback() { @@ -194,6 +200,9 @@ void HalImpl::unregisterEventCallback() { mDevice->registerCallback(HWC2_CALLBACK_VSYNC_PERIOD_TIMING_CHANGED, this, nullptr); mDevice->registerCallback(HWC2_CALLBACK_SEAMLESS_POSSIBLE, this, nullptr); + // unregister HWC3 Callback + mDevice->registerHwc3Callback(IComposerCallback::TRANSACTION_onVsyncIdle, this, nullptr); + mEventCallback = nullptr; } -- cgit v1.2.3