From de03d0ec9f83116c92032306290fded73ceeea89 Mon Sep 17 00:00:00 2001 From: Saurabh Shah Date: Mon, 22 Nov 2010 19:56:31 -0800 Subject: [PATCH] hardware/msm7k: Fix position, aspect ratio on HDMI UI Fix position, aspect ratio of HDMI UI when the primary panel type is MIPI, 8660 Panel or 7x30 Panel Change-Id: I8e9824520317e3facb4ef25bc25dd9b1de60b4ce CRs-fixed: 263690, 269433 --- framebuffer.cpp | 50 ++++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/framebuffer.cpp b/framebuffer.cpp index 949f23f..56a24dc 100644 --- a/framebuffer.cpp +++ b/framebuffer.cpp @@ -247,18 +247,15 @@ static void *hdmi_ui_loop(void *ptr) // ROT_0 case 0: // ROT_180 - case HAL_TRANSFORM_ROT_180: - x = (width - fbwidth) / 2; - if (x < 0) - x = 0; - if (fbwidth < width) - width = fbwidth; - if (fbheight < height) - height = fbheight; - if(rot == HAL_TRANSFORM_ROT_180) - rot = OVERLAY_TRANSFORM_ROT_180; - else - rot = 0; + case HAL_TRANSFORM_ROT_180: { + int tmpWidth = (height * fbwidth) / fbheight; + x = (width - tmpWidth) / 2; + width = tmpWidth; + if(rot == HAL_TRANSFORM_ROT_180) + rot = OVERLAY_TRANSFORM_ROT_180; + else + rot = 0; + } break; // ROT_90 case HAL_TRANSFORM_ROT_90: @@ -283,22 +280,19 @@ static void *hdmi_ui_loop(void *ptr) // ROT_90 case HAL_TRANSFORM_ROT_90: // ROT_270 - case HAL_TRANSFORM_ROT_270: - //Swap width and height - int t = fbwidth; - fbwidth = fbheight; - fbheight = t; - x = (width - fbwidth) / 2; - if (x < 0) - x = 0; - if (fbwidth < width) - width = fbwidth; - if (fbheight < height) - height = fbheight; - if(rot == HAL_TRANSFORM_ROT_90) - rot = OVERLAY_TRANSFORM_ROT_270; - else - rot = OVERLAY_TRANSFORM_ROT_90; + case HAL_TRANSFORM_ROT_270: { + //Swap width and height + int t = fbwidth; + fbwidth = fbheight; + fbheight = t; + int tmpWidth = (height * fbwidth) / fbheight; + x = (width - tmpWidth) / 2; + width = tmpWidth; + if(rot == HAL_TRANSFORM_ROT_90) + rot = OVERLAY_TRANSFORM_ROT_270; + else + rot = OVERLAY_TRANSFORM_ROT_90; + } break; } }