msm_fb: hdmi: update data on resolution change

On changing resolution, all information related to display
needs to be updated which helps in calculating the right mdp
clock for each resolution.

CRs-Fixed: 436151
Change-Id: I1ab6e5859491936a7fa8c62247da9ef5a0ff45ef
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
This commit is contained in:
Ajay Singh Parmar 2013-01-16 17:59:04 +05:30 committed by Iliyan Malchev
parent eb93a60c33
commit e9f3e0c072
4 changed files with 20 additions and 8 deletions

View file

@ -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;

View file

@ -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)

View file

@ -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);
}

View file

@ -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;