diff options
author | Midas Chien <midaschieh@google.com> | 2022-05-18 08:35:10 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-05-18 08:35:10 +0000 |
commit | 964173ff0ecd48c7654328fb048ccbf32e3cf2ac (patch) | |
tree | 7aadb1a6a91d131409891b9f52ae44de799e506e | |
parent | 281967e8286c0e438e781ed44e99c19c4f35bfc4 (diff) | |
parent | 407cbb7329909ffd343aa197c2e9ecd97c2a2dd8 (diff) |
Merge "libhwc2.1: don't pass expected present time during transition" into tm-dev am: 407cbb7329
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/graphics/common/+/18321590
Change-Id: I76e650213b20a4665ad02e9b3f42f24a036c7ae0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp index 70648a4..4500e6a 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp @@ -36,7 +36,6 @@ using namespace std::chrono_literals; constexpr uint32_t MAX_PLANE_NUM = 3; constexpr uint32_t CBCR_INDEX = 1; constexpr float DISPLAY_LUMINANCE_UNIT = 10000; -constexpr auto nsecsPerMs = std::chrono::nanoseconds(1ms).count(); constexpr auto nsecsPerSec = std::chrono::nanoseconds(1s).count(); constexpr auto vsyncPeriodTag = "VsyncPeriod"; @@ -753,9 +752,10 @@ bool ExynosDisplayDrmInterface::ExynosVsyncCallback::Callback( /* * mDesiredVsyncPeriod is nanoseconds - * Compare with milliseconds + * Compare with 20% margin */ - if (mDesiredVsyncPeriod / nsecsPerMs == mVsyncPeriod / nsecsPerMs) return true; + if (abs(static_cast<int32_t>(mDesiredVsyncPeriod - mVsyncPeriod)) < (mDesiredVsyncPeriod / 5)) + return true; return false; } @@ -1810,11 +1810,16 @@ int32_t ExynosDisplayDrmInterface::deliverWinConfigData() auto expectedPresentTime = mExynosDisplay->getPendingExpectedPresentTime(); if (expectedPresentTime != 0) { - if ((ret = drmReq.atomicAddProperty(mDrmCrtc->id(), - mDrmCrtc->expected_present_time_property(), - expectedPresentTime)) < 0) { - HWC_LOGE(mExynosDisplay, "%s: Fail to set expected_present_time property (%d)", - __func__, ret); + /* TODO: don't pass expected present time before we can provide accurate time that desire + * refresh rate take effect (b/202346402) + */ + if (!mVsyncCallback.getDesiredVsyncPeriod()) { + if ((ret = drmReq.atomicAddProperty(mDrmCrtc->id(), + mDrmCrtc->expected_present_time_property(), + expectedPresentTime)) < 0) { + HWC_LOGE(mExynosDisplay, "%s: Fail to set expected_present_time property (%d)", + __func__, ret); + } } mExynosDisplay->applyExpectedPresentTime(); } |