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
This commit is contained in:
Saurabh Shah 2010-11-22 19:56:31 -08:00 committed by Govind Surti
parent ed76fc69a8
commit a2d029bef1

View File

@ -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;
}
}