From a9181ba3035df77a1ddebe170d2aa7bd2d453b77 Mon Sep 17 00:00:00 2001 From: Chetan Kalyan Date: Mon, 6 Jun 2011 15:35:35 -0700 Subject: [PATCH] OverlayLib: Set format to non-tiled if rotated Rotator outputs non-tiled formats. Hence, if there is rotation, tiled format needs to be set to non-tiled and aligned properly. Change-Id: I88335ad49c2f7446aa5fa71db80f6051c02bb5ff CRs-fixed: 290428 --- liboverlay/overlayLib.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/liboverlay/overlayLib.cpp b/liboverlay/overlayLib.cpp index cd2d43c..7cd6c62 100644 --- a/liboverlay/overlayLib.cpp +++ b/liboverlay/overlayLib.cpp @@ -838,18 +838,28 @@ bool OverlayControlChannel::setSource(uint32_t w, uint32_t h, int format = cFormat & INTERLACE_MASK ? (cFormat ^ HAL_PIXEL_FORMAT_INTERLACE) : cFormat; format = get_mdp_format(format); - if ((orientation == mOrientation) - && ((orientation == OVERLAY_TRANSFORM_ROT_90) - || (orientation == OVERLAY_TRANSFORM_ROT_270))) { + if (orientation == mOrientation && orientation != 0){ + //set format to non-tiled and align w, h to 64-bit and 32-bit respectively. if (format == MDP_Y_CRCB_H2V2_TILE) { format = MDP_Y_CRCB_H2V2; w = (((w-1)/64 +1)*64); h = (((h-1)/32 +1)*32); } - int tmp = w; - w = h; - h = tmp; + switch(orientation){ + case (HAL_TRANSFORM_ROT_90 | HAL_TRANSFORM_FLIP_H): + case (HAL_TRANSFORM_ROT_90 | HAL_TRANSFORM_FLIP_V): + case HAL_TRANSFORM_ROT_90: + case HAL_TRANSFORM_ROT_270: + { + int tmp = w; + w = h; + h = tmp; + } + default: + break; + } } + if (w == mOVInfo.src.width && h == mOVInfo.src.height && format == mOVInfo.src.format && orientation == mOrientation) { mdp_overlay ov;