From 646975c9e41ec806ac6547b123dbaaf89859f1d4 Mon Sep 17 00:00:00 2001 From: Dan Murphy Date: Tue, 27 Nov 2012 13:37:33 -0600 Subject: Panda: Set lcd_xpy to 1 if the x/y res and dimensions are not set Since the panda uses HDMI and DVI only there is no setting to indicate the x/y res or dimensions. There fore if these values are not set in the kernel set the lcd_xpy to 1 Change-Id: I538eb0fc059daebfa3fe125cbdf0b70eb51f1616 Signed-off-by: Dan Murphy --- hwc/hwc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hwc/hwc.c b/hwc/hwc.c index 74012dde..baae1c14 100644 --- a/hwc/hwc.c +++ b/hwc/hwc.c @@ -2054,8 +2054,15 @@ 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; + + 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; + } else { + ALOGE("x resolution or the height is not populated setting lcd_xpy to 1.0\n"); + hwc_dev->ext.lcd_xpy = 1.0; + } if (pipe(hwc_dev->pipe_fds) == -1) { ALOGE("failed to event pipe (%d): %m", errno); -- cgit v1.2.3