diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2023-12-07 05:58:54 -0800 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2023-12-07 05:58:54 -0800 |
commit | fe3c8f399f9abe836050b1f5d2dc128d625cb53c (patch) | |
tree | 1d66090be0aeeccd464541e13406fbf37754c42e | |
parent | 87f1200913a98b19b1dd302798cfc546de87a050 (diff) | |
parent | df70b6101649e73df840a6ecd36dce071f72a50d (diff) |
Merge df70b6101649e73df840a6ecd36dce071f72a50d on remote branch
Change-Id: Ia7790aaa2443521213f2a30a5fbe28cd7fc8a083
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 23 | ||||
-rw-r--r-- | services/surfaceflinger/QtiExtension/QtiSurfaceFlingerExtension.cpp | 29 |
2 files changed, 17 insertions, 35 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 4f02e4b8d3..0dcac494e3 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -3518,24 +3518,11 @@ void Layer::gatherBufferInfo() { err = mapper.setDataspace(mBufferInfo.mBuffer->getBuffer()->handle, static_cast<ui::Dataspace>(mBufferInfo.mDataspace)); } - - // Some GPU drivers may cache gralloc metadata which means before we composite we need - // to upsert RenderEngine's caches. Put in a special workaround to be backwards - // compatible with old vendors, with a ticking clock. - static const int32_t kVendorVersion = - base::GetIntProperty("ro.vndk.version", __ANDROID_API_FUTURE__); - if (const auto format = - static_cast<aidl::android::hardware::graphics::common::PixelFormat>( - mBufferInfo.mBuffer->getPixelFormat()); - err == OK && kVendorVersion < __ANDROID_API_U__ && - (format == - aidl::android::hardware::graphics::common::PixelFormat:: - IMPLEMENTATION_DEFINED || - format == aidl::android::hardware::graphics::common::PixelFormat::YCBCR_420_888 || - format == aidl::android::hardware::graphics::common::PixelFormat::YV12 || - format == aidl::android::hardware::graphics::common::PixelFormat::YCBCR_P010)) { - mBufferInfo.mBuffer->remapBuffer(); - } + /* QTI_BEGIN */ + // GPU drivers cache gralloc metadata which means before we composite we need + // to upsert RenderEngine's cache. + mBufferInfo.mBuffer->remapBuffer(); + /* QTI_END */ } } if (lastDataspace != mBufferInfo.mDataspace) { diff --git a/services/surfaceflinger/QtiExtension/QtiSurfaceFlingerExtension.cpp b/services/surfaceflinger/QtiExtension/QtiSurfaceFlingerExtension.cpp index 542b7c4b01..cb669e6085 100644 --- a/services/surfaceflinger/QtiExtension/QtiSurfaceFlingerExtension.cpp +++ b/services/surfaceflinger/QtiExtension/QtiSurfaceFlingerExtension.cpp @@ -2009,36 +2009,23 @@ void QtiSurfaceFlingerExtension::qtiSetFrameBufferSizeForScaling( auto display = displayDevice->getCompositionDisplay(); int newWidth = currentState.layerStackSpaceRect.width(); int newHeight = currentState.layerStackSpaceRect.height(); - int currentWidth = drawingState.layerStackSpaceRect.width(); - int currentHeight = drawingState.layerStackSpaceRect.height(); int displayWidth = displayDevice->getWidth(); int displayHeight = displayDevice->getHeight(); - bool update_needed = false; - ALOGV("%s: newWidth %d newHeight %d currentWidth %d currentHeight %d displayWidth %d " - "displayHeight %d", - __func__, newWidth, newHeight, currentWidth, currentHeight, displayWidth, displayHeight); + ALOGV("%s: newWidth %d newHeight %d displayWidth %d displayHeight %d", + __func__, newWidth, newHeight, displayWidth, displayHeight); - if (newWidth != currentWidth || newHeight != currentHeight) { - update_needed = true; + if (newWidth != displayWidth || newHeight != displayHeight) { if (!((newWidth > newHeight && displayWidth > displayHeight) || (newWidth < newHeight && displayWidth < displayHeight))) { std::swap(newWidth, newHeight); ALOGV("%s: Width %d or height %d was updated. Swap the values of newWidth %d and " "newHeight %d", - __func__, (newWidth != currentWidth), (newHeight != currentHeight), newWidth, + __func__, (newWidth != displayWidth), (newHeight != displayHeight), newWidth, newHeight); } } - if (displayDevice->getWidth() == newWidth && displayDevice->getHeight() == newHeight && - !update_needed) { - ALOGV("%s: No changes on the configuration", __func__); - displayDevice->setProjection(currentState.orientation, currentState.layerStackSpaceRect, - currentState.orientedDisplaySpaceRect); - return; - } - if (newWidth > 0 && newHeight > 0) { currentState.width = static_cast<uint32_t>(newWidth); currentState.height = static_cast<uint32_t>(newHeight); @@ -2047,6 +2034,14 @@ void QtiSurfaceFlingerExtension::qtiSetFrameBufferSizeForScaling( } currentState.orientedDisplaySpaceRect = currentState.layerStackSpaceRect; + + if (displayWidth == newWidth && displayHeight == newHeight) { + ALOGV("%s: No changes on the configuration", __func__); + displayDevice->setProjection(currentState.orientation, currentState.layerStackSpaceRect, + currentState.orientedDisplaySpaceRect); + return; + } + ALOGV("%s: Update currentState's orientedDisplaySpaceRect left %f top %f right %f bottom %f", __func__, currentState.orientedDisplaySpaceRect.left, currentState.orientedDisplaySpaceRect.top, currentState.orientedDisplaySpaceRect.right, |