summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-06-15 23:17:42 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-06-15 23:17:42 +0000
commit6d98f62745fa3b4296ee749df7aadf18e278966f (patch)
tree3a972b57c11a30c31c38f4095ff95e4cfc0ad86d
parent00ac054ef7620ff8a3a2ff16c2a8b8f9dda2dd9e (diff)
parent8c34de5710be7e0cc2b4a2d919ae546d176f9776 (diff)
Snap for 10331563 from 8c34de5710be7e0cc2b4a2d919ae546d176f9776 to udc-release
Change-Id: Id567326bd5e42fbd624d2a19ed1a9f24f599ccc2
-rw-r--r--libhwc2.1/libdevice/ExynosDisplay.cpp6
-rw-r--r--libhwc2.1/libdevice/ExynosLayer.cpp8
-rw-r--r--libhwc2.1/libdevice/ExynosLayer.h10
3 files changed, 19 insertions, 5 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 79a9ca1..8f1662d 100644
--- a/libhwc2.1/libdevice/ExynosLayer.cpp
+++ b/libhwc2.1/libdevice/ExynosLayer.cpp
@@ -39,6 +39,7 @@ ExynosLayer::ExynosLayer(ExynosDisplay* display)
: ExynosMPPSource(MPP_SOURCE_LAYER, this),
mDisplay(display),
mCompositionType(HWC2_COMPOSITION_INVALID),
+ mRequestedCompositionType(HWC2_COMPOSITION_INVALID),
mExynosCompositionType(HWC2_COMPOSITION_INVALID),
mValidateCompositionType(HWC2_COMPOSITION_INVALID),
mValidateExynosCompositionType(HWC2_COMPOSITION_INVALID),
@@ -422,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++;
}
}
@@ -512,11 +513,12 @@ int32_t ExynosLayer::setLayerCompositionType(int32_t /*hwc2_composition_t*/ type
type = HWC2_COMPOSITION_DEVICE;
#endif
- if (type != mCompositionType) {
+ if (type != mCompositionType && type != mRequestedCompositionType) {
setGeometryChanged(GEOMETRY_LAYER_TYPE_CHANGED);
}
mCompositionType = type;
+ mRequestedCompositionType = type;
return HWC2_ERROR_NONE;
}
@@ -1166,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);
}
diff --git a/libhwc2.1/libdevice/ExynosLayer.h b/libhwc2.1/libdevice/ExynosLayer.h
index 4dc2423..e1df54d 100644
--- a/libhwc2.1/libdevice/ExynosLayer.h
+++ b/libhwc2.1/libdevice/ExynosLayer.h
@@ -92,10 +92,20 @@ class ExynosLayer : public ExynosMPPSource {
/**
* Layer's compositionType
+ *
+ * If acceptDisplayChanges() is called, it will be set to the validated type
+ * since SF may update their state and doesn't call back into HWC
*/
int32_t mCompositionType;
/**
+ * Composition type that is originally requested by SF only using setLayerComposisionType()
+ *
+ * It will not be changed if applyDisplayChanges() is called.
+ */
+ int32_t mRequestedCompositionType;
+
+ /**
* Composition type that is used by HAL
* (ex: COMPOSITION_G2D)
*/