summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-11-09 11:18:08 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-11-09 11:18:08 +0000
commit53432050c2df61ebe56e2101c43b702f844b9c88 (patch)
tree4426de04af8fcd2e94b81ca078e3524f7812bbe7
parenta329f0076f0d757dde617713d1582f5aa08e7f65 (diff)
parentaf160a4cec08f6da0d09c0a4700ecc7d07e169d3 (diff)
Snap for 11075041 from af160a4cec08f6da0d09c0a4700ecc7d07e169d3 to u-keystone-qcom-release
Change-Id: I829ea10625e9b18627f2fe1ad5ba348604acda89
-rw-r--r--services/surfaceflinger/Layer.cpp23
-rw-r--r--services/surfaceflinger/QtiExtension/QtiSurfaceFlingerExtension.cpp29
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,