diff options
author | Oleksandr Lugovyk <x0158320@ti.com> | 2012-01-10 11:01:41 +0200 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-11-28 21:16:22 +0200 |
commit | ea684586b96fe4d7a346a0be55737cab0f89945f (patch) | |
tree | f24053f2698bf4b3d6f3334d2c92d47d73040631 | |
parent | 27411d252bcf22eab2dd361da773e53d9dc738e2 (diff) | |
download | hardware_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.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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); |