From 758f4c6fa1f1be7bf1ebc7c1714c95564afde9e9 Mon Sep 17 00:00:00 2001 From: "Singh, Sapna1" Date: Thu, 25 May 2023 16:41:22 +0530 Subject: [PATCH] Camera orientation fails in Portrait mode When bypass_rotation is enabled and auto-rotate is on, changing camera orientation from landscape to portrait mode fails. Whenever auto-rotate is turned on, windows manager triggers informs camera app to update display and display gets updated. Hwc gets the updated frames and since bypass_rotation is enabled, it performs the rotation again on this. Both bypass_rotation and Auto_rotation can't be applied at the sametime and need to prioritize one of these. Whenever bypass_rotation is enable and auto_rotate is on, prioritize auto_rotate. Tracked-On: OAM-108836 Signed-off-by: Singh, Sapna1 --- hwc2/Hwc2Display.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hwc2/Hwc2Display.cpp b/hwc2/Hwc2Display.cpp index e1b70b9..2a5e18a 100644 --- a/hwc2/Hwc2Display.cpp +++ b/hwc2/Hwc2Display.cpp @@ -952,6 +952,12 @@ bool Hwc2Display::checkFullScreenMode() { if (layer.info().dstFrame.right != mWidth || layer.info().dstFrame.bottom != mHeight) return false; + // Prioritize Auto-Rotate when both Auto-Rotate and Rotation Bypass is enabled + if (mEnableRotationBypass && (layer.info().transform == HAL_TRANSFORM_ROT_90 || + layer.info().transform == HAL_TRANSFORM_ROT_180 || + layer.info().transform == HAL_TRANSFORM_ROT_270)) + return false; + // Supported formats BufferMapper::getMapper().getBufferFormat(layer.buffer(), format); if (format == HAL_PIXEL_FORMAT_RGBA_8888 ||