summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWiwit Rifa'i <wiwitrifai@google.com>2023-06-06 16:55:51 +0800
committerWiwit Rifa'i <wiwitrifai@google.com>2023-06-07 14:56:39 +0800
commit8c34de5710be7e0cc2b4a2d919ae546d176f9776 (patch)
tree3a972b57c11a30c31c38f4095ff95e4cfc0ad86d
parentba60527e79815ed03f2760728a0778a2ab6eabba (diff)
libhwc2.1: use mRequestedCompositionType to check indicator layer
Instead of checking (mCompositionType == REFRESH_RATE_INDICATOR), we should check mRequestedCompositionType to check whether a layer is for refresh rate indicator or not. This is because mCompositionType can be changed to CLIENT when acceptDisplayChanges() is called. Thus, we should use mRequestedCompositionType that will only be changed by setLayerCompositionType(). Bug: 283352279 Test: refresh rate indicator can enter idle after play HDR video on YT Change-Id: I5381157107550ed380c9671fe712285b1b53f814
-rw-r--r--libhwc2.1/libdevice/ExynosDisplay.cpp6
-rw-r--r--libhwc2.1/libdevice/ExynosLayer.cpp4
2 files changed, 6 insertions, 4 deletions
diff --git a/libhwc2.1/libdevice/ExynosDisplay.cpp b/libhwc2.1/libdevice/ExynosDisplay.cpp
index c6b7433..ffd9cd5 100644
--- a/libhwc2.1/libdevice/ExynosDisplay.cpp
+++ b/libhwc2.1/libdevice/ExynosDisplay.cpp
@@ -1712,7 +1712,8 @@ int ExynosDisplay::skipStaticLayers(ExynosCompositionInfo& compositionInfo)
bool ExynosDisplay::skipSignalIdle(void) {
for (size_t i = 0; i < mLayers.size(); i++) {
// Frame update for refresh rate overlay indicator layer can be ignored
- if (mLayers[i]->mCompositionType == HWC2_COMPOSITION_REFRESH_RATE_INDICATOR) continue;
+ if (mLayers[i]->mRequestedCompositionType == HWC2_COMPOSITION_REFRESH_RATE_INDICATOR)
+ continue;
// Frame update for video layer can be ignored
if (mLayers[i]->isLayerFormatYuv()) continue;
if (mLayers[i]->mLastLayerBuffer != mLayers[i]->mLayerBuffer) {
@@ -6282,7 +6283,8 @@ nsecs_t ExynosDisplay::getLastLayerUpdateTime() {
nsecs_t time = 0;
for (size_t i = 0; i < mLayers.size(); ++i) {
// The update from refresh rate indicator layer should be ignored
- if (mLayers[i]->mCompositionType == HWC2_COMPOSITION_REFRESH_RATE_INDICATOR) continue;
+ if (mLayers[i]->mRequestedCompositionType == HWC2_COMPOSITION_REFRESH_RATE_INDICATOR)
+ continue;
time = max(time, mLayers[i]->mLastUpdateTime);
}
return time;
diff --git a/libhwc2.1/libdevice/ExynosLayer.cpp b/libhwc2.1/libdevice/ExynosLayer.cpp
index dbf8cbd..8f1662d 100644
--- a/libhwc2.1/libdevice/ExynosLayer.cpp
+++ b/libhwc2.1/libdevice/ExynosLayer.cpp
@@ -423,7 +423,7 @@ int32_t ExynosLayer::setLayerBuffer(buffer_handle_t buffer, int32_t acquireFence
checkFps(mLastLayerBuffer != mLayerBuffer);
if (mLayerBuffer != mLastLayerBuffer) {
mLastUpdateTime = systemTime(CLOCK_MONOTONIC);
- if (mCompositionType != HWC2_COMPOSITION_REFRESH_RATE_INDICATOR)
+ if (mRequestedCompositionType != HWC2_COMPOSITION_REFRESH_RATE_INDICATOR)
mDisplay->mBufferUpdates++;
}
}
@@ -1168,7 +1168,7 @@ void ExynosLayer::setGeometryChanged(uint64_t changedBit)
{
mLastUpdateTime = systemTime(CLOCK_MONOTONIC);
mGeometryChanged |= changedBit;
- if (mCompositionType != HWC2_COMPOSITION_REFRESH_RATE_INDICATOR)
+ if (mRequestedCompositionType != HWC2_COMPOSITION_REFRESH_RATE_INDICATOR)
mDisplay->setGeometryChanged(changedBit);
}