summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-12-03 18:25:48 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-12-03 18:25:48 -0800
commit9f5f49764ba7b37b020e89881e27bfb7ee545356 (patch)
tree1ec2b709bcdd3835d77f0316f9847c40dbfbe0bd
parent64c6d6dddfe9b1a0fdd5b501ed343c82c345b7eb (diff)
parent32f08e77913e7938f5982276a3c44d93d8091498 (diff)
downloadomap4xxx-9f5f49764ba7b37b020e89881e27bfb7ee545356.tar.gz
am 32f08e77: Merge "Panda: Set lcd_xpy to 1 if the x/y res and dimensions are not set"
* commit '32f08e77913e7938f5982276a3c44d93d8091498': Panda: Set lcd_xpy to 1 if the x/y res and dimensions are not set
-rw-r--r--hwc/hwc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hwc/hwc.c b/hwc/hwc.c
index 74012dd..baae1c1 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);