msm_fb: Fixing Aspect Ratio
Non-standard resolution, like 531*398, is treated as 720*480 instead of
640*480 , as it has non 4:3 aspect ratio.Chanding aspect ration calculation
to be in a range , rather than absolute.
CRs-Fixed: 320022
Change-Id: Ie3b1ebefe48ef648720f06336239af907c3468d2
Signed-off-by: Abhishek Kharbanda <akharban@codeaurora.org>
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
diff --git a/drivers/video/msm/external_common.c b/drivers/video/msm/external_common.c
index 3d89e16..cd7d5c4 100644
--- a/drivers/video/msm/external_common.c
+++ b/drivers/video/msm/external_common.c
@@ -1019,7 +1019,11 @@
img_size_v = (((uint32)data_buf[0xE] & 0xF) << 8)
| data_buf[0xD];
- aspect_ratio_4_3 = (img_size_h * 3 == img_size_v * 4);
+ /*
+ * aspect ratio as 4:3 if within specificed range , rathaer than being
+ * absolute value
+ */
+ aspect_ratio_4_3 = (abs(img_size_h * 3 - img_size_v * 4) < 5) ? 1 : 0;
max_num_of_elements = sizeof(hdmi_edid_disp_mode_lut)
/ sizeof(*hdmi_edid_disp_mode_lut);