diff options
author | Yichi Chen <yichichen@google.com> | 2021-12-16 21:59:24 +0800 |
---|---|---|
committer | Midas Chien <midaschieh@google.com> | 2022-01-04 14:57:00 +0800 |
commit | 6bf7e1132ab41883159a0906ea4f93fa39b1b8c3 (patch) | |
tree | 18268fefa787f89397c9aa858569948996aad722 /hwc3/impl/HalImpl.cpp | |
parent | 076837ca55baf1c9eca7b4115daa8190b12cbc35 (diff) |
hwc3: create the interface for expectedPresentTime
The expectedPresentTime is an optional value specified in
validateDisplay and presentOrValidateDisplay. The patch creates the
proper command dispatchers to read the information only in the two
functions. A warning message will show if the expectedPresentTime is
provided multiple times within one frame update.
Bug: 198186194
Test: VtsHalGraphicsComposer3_TargetTest
Change-Id: Ifff31202bef3297c1ddc28189ed301a7f6175695
Diffstat (limited to 'hwc3/impl/HalImpl.cpp')
-rw-r--r-- | hwc3/impl/HalImpl.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/hwc3/impl/HalImpl.cpp b/hwc3/impl/HalImpl.cpp index e3afeb5..74f850d 100644 --- a/hwc3/impl/HalImpl.cpp +++ b/hwc3/impl/HalImpl.cpp @@ -931,4 +931,20 @@ int32_t HalImpl::validateDisplay(int64_t display, std::vector<int64_t>* outChang return HWC2_ERROR_NONE; } +int HalImpl::setExpectedPresentTime( + int64_t display, const std::optional<ClockMonotonicTimestamp> expectedPresentTime) { + ExynosDisplay* halDisplay; + RET_IF_ERR(getHalDisplay(display, halDisplay)); + + if (!expectedPresentTime.has_value()) return HWC2_ERROR_NONE; + + if (halDisplay->getPendingExpectedPresentTime() != 0) { + ALOGW("HalImpl: set expected present time multiple times in one frame"); + } + + halDisplay->setExpectedPresentTime(expectedPresentTime->timestampNanos); + + return HWC2_ERROR_NONE; +} + } // namespace aidl::android::hardware::graphics::composer3::impl |