summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksandr Lugovyk <x0158320@ti.com>2012-01-10 11:01:41 +0200
committerDaniel Levin <dendy@ti.com>2012-11-28 21:16:22 +0200
commitea684586b96fe4d7a346a0be55737cab0f89945f (patch)
treef24053f2698bf4b3d6f3334d2c92d47d73040631
parent27411d252bcf22eab2dd361da773e53d9dc738e2 (diff)
downloadhardware_ti_omap4-ea684586b96fe4d7a346a0be55737cab0f89945f.zip
hardware_ti_omap4-ea684586b96fe4d7a346a0be55737cab0f89945f.tar.gz
hardware_ti_omap4-ea684586b96fe4d7a346a0be55737cab0f89945f.tar.bz2
hwc: corrected calculation of lcd_xpy
On hwc open xpy for lcd is calculated. In case values in mm are not provided (=0) the result of xpy is NaN. That influences further selection of external display resolution and calculation of video dimensions for external tv. Rebased from p-ics-mr1: 8d481bf HWC: corrected calculation of lcd_xpy Change-Id: I3494bd9c7bd797a27e985b474d6390606bb4106d Signed-off-by: Oleksandr Lugovyk <x0158320@ti.com> Signed-off-by: Tony Lofthouse <a0741364@ti.com>
-rw-r--r--hwc/hwc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/hwc/hwc.c b/hwc/hwc.c
index 354c85c..db5f520 100644
--- a/hwc/hwc.c
+++ b/hwc/hwc.c
@@ -2242,8 +2242,14 @@ static int omap4_hwc_device_open(const hw_module_t* module, const char* name,
err = -errno;
goto done;
}
- hwc_dev->ext.lcd_xpy = (float) hwc_dev->fb_dis.width_in_mm / hwc_dev->fb_dis.timings.x_res /
- hwc_dev->fb_dis.height_in_mm * hwc_dev->fb_dis.timings.y_res;
+
+ /* use default value in case some of requested display parameters missing */
+ hwc_dev->ext.lcd_xpy = 1.0;
+ if (hwc_dev->fb_dis.timings.x_res && hwc_dev->fb_dis.height_in_mm) {
+ hwc_dev->ext.lcd_xpy = (float)
+ hwc_dev->fb_dis.width_in_mm / hwc_dev->fb_dis.timings.x_res /
+ hwc_dev->fb_dis.height_in_mm * hwc_dev->fb_dis.timings.y_res;
+ }
if (pipe(hwc_dev->pipe_fds) == -1) {
ALOGE("failed to event pipe (%d): %m", errno);