diff --git a/drivers/video/msm/external_common.c b/drivers/video/msm/external_common.c index 63731ddd27bb..a720143a01d0 100644 --- a/drivers/video/msm/external_common.c +++ b/drivers/video/msm/external_common.c @@ -2074,7 +2074,7 @@ EXPORT_SYMBOL(hdmi_common_read_edid); bool hdmi_common_get_video_format_from_drv_data(struct msm_fb_data_type *mfd) { - uint32 format = HDMI_VFRMT_1920x1080p60_16_9; + uint32 format = external_common_state->video_resolution; struct fb_var_screeninfo *var = &mfd->fbi->var; bool changed = TRUE; uint32_t userformat = 0; diff --git a/drivers/video/msm/hdmi_msm.c b/drivers/video/msm/hdmi_msm.c index b73ca0d25075..1ec2561e7d27 100644 --- a/drivers/video/msm/hdmi_msm.c +++ b/drivers/video/msm/hdmi_msm.c @@ -4540,10 +4540,20 @@ void hdmi_msm_config_hdcp_feature(void) hdmi_msm_state->hdcp_enable ? "Enabled" : "Disabled"); } +static void hdmi_msm_update_panel_info(struct msm_fb_data_type *mfd) +{ + if (!mfd) + return; + + if (hdmi_common_get_video_format_from_drv_data(mfd)) + hdmi_common_init_panel_info(&mfd->panel_info); +} + static int __devinit hdmi_msm_probe(struct platform_device *pdev) { int rc; struct platform_device *fb_dev; + struct msm_fb_data_type *mfd = NULL; if (!hdmi_msm_state) { pr_err("%s: hdmi_msm_state is NULL\n", __func__); @@ -4665,6 +4675,9 @@ static int __devinit hdmi_msm_probe(struct platform_device *pdev) } else DEV_ERR("Init FAILED: failed to add fb device\n"); + mfd = platform_get_drvdata(fb_dev); + mfd->update_panel_info = hdmi_msm_update_panel_info; + if (hdmi_prim_display) { rc = hdmi_msm_hpd_on(); if (rc) diff --git a/drivers/video/msm/msm_fb.c b/drivers/video/msm/msm_fb.c index 57df0ba2f60d..41dfc73f4287 100644 --- a/drivers/video/msm/msm_fb.c +++ b/drivers/video/msm/msm_fb.c @@ -2131,12 +2131,6 @@ static int msm_fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) if ((var->xres == 0) || (var->yres == 0)) return -EINVAL; - if ((var->xres > MAX(mfd->panel_info.xres, - mfd->panel_info.mode2_xres)) || - (var->yres > MAX(mfd->panel_info.yres, - mfd->panel_info.mode2_yres))) - return -EINVAL; - if (var->xoffset > (var->xres_virtual - var->xres)) return -EINVAL; @@ -2220,6 +2214,10 @@ static int msm_fb_set_par(struct fb_info *info) if (blank) { msm_fb_blank_sub(FB_BLANK_POWERDOWN, info, mfd->op_enable); + + if (mfd->update_panel_info) + mfd->update_panel_info(mfd); + msm_fb_blank_sub(FB_BLANK_UNBLANK, info, mfd->op_enable); } diff --git a/drivers/video/msm/msm_fb.h b/drivers/video/msm/msm_fb.h index 1a185fb5d35b..d9167271be11 100644 --- a/drivers/video/msm/msm_fb.h +++ b/drivers/video/msm/msm_fb.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2013, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2008-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -140,6 +140,7 @@ struct msm_fb_data_type { int (*stop_histogram) (struct fb_info *info, uint32_t block); void (*vsync_ctrl) (int enable); void (*vsync_init) (int cndx); + void (*update_panel_info)(struct msm_fb_data_type *mfd); void *vsync_show; void *cursor_buf; void *cursor_buf_phys;