msm: mdss: update PHY timing calculation logic for resolution change
In current implementation we are always overriding the PHY read from dt entry with the ones we are calculating in driver. Update the PHY timing only when there is a change in resolution. Change-Id: I2ba936af6e55b27c7b28d38990b32e896c877e08 Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
This commit is contained in:
parent
83af99dce7
commit
4b33528c74
4 changed files with 29 additions and 16 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012-2016, 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
|
||||
|
@ -2376,13 +2376,20 @@ static int mdss_dsi_event_handler(struct mdss_panel_data *pdata,
|
|||
case MDSS_EVENT_CHECK_PARAMS:
|
||||
pr_debug("%s:Entered Case MDSS_EVENT_CHECK_PARAMS\n", __func__);
|
||||
if (mdss_dsi_check_params(ctrl_pdata, arg)) {
|
||||
ctrl_pdata->refresh_clk_rate = true;
|
||||
ctrl_pdata->update_phy_timing = true;
|
||||
/*
|
||||
* Call to MDSS_EVENT_CHECK_PARAMS expects
|
||||
* the return value of 1, if there is a change
|
||||
* in panel timing parameters.
|
||||
*/
|
||||
rc = 1;
|
||||
}
|
||||
ctrl_pdata->refresh_clk_rate = true;
|
||||
break;
|
||||
case MDSS_EVENT_LINK_READY:
|
||||
if (ctrl_pdata->refresh_clk_rate)
|
||||
rc = mdss_dsi_clk_refresh(pdata);
|
||||
rc = mdss_dsi_clk_refresh(pdata,
|
||||
ctrl_pdata->update_phy_timing);
|
||||
|
||||
mdss_dsi_get_hw_revision(ctrl_pdata);
|
||||
mdss_dsi_get_phy_revision(ctrl_pdata);
|
||||
|
|
|
@ -525,6 +525,7 @@ struct mdss_dsi_ctrl_pdata {
|
|||
struct workqueue_struct *workq;
|
||||
struct delayed_work dba_work;
|
||||
bool timing_db_mode;
|
||||
bool update_phy_timing; /* flag to recalculate PHY timings */
|
||||
};
|
||||
|
||||
struct dsi_status_data {
|
||||
|
@ -567,7 +568,7 @@ void mdss_dsi_irq_handler_config(struct mdss_dsi_ctrl_pdata *ctrl_pdata);
|
|||
void mdss_dsi_set_tx_power_mode(int mode, struct mdss_panel_data *pdata);
|
||||
int mdss_dsi_clk_div_config(struct mdss_panel_info *panel_info,
|
||||
int frame_rate);
|
||||
int mdss_dsi_clk_refresh(struct mdss_panel_data *pdata);
|
||||
int mdss_dsi_clk_refresh(struct mdss_panel_data *pdata, bool update_phy);
|
||||
int mdss_dsi_link_clk_init(struct platform_device *pdev,
|
||||
struct mdss_dsi_ctrl_pdata *ctrl_pdata);
|
||||
void mdss_dsi_link_clk_deinit(struct device *dev,
|
||||
|
|
|
@ -1942,7 +1942,7 @@ int mdss_dsi_panel_timing_switch(struct mdss_dsi_ctrl_pdata *ctrl,
|
|||
ctrl->panel_data.current_timing = timing;
|
||||
if (!timing->clk_rate)
|
||||
ctrl->refresh_clk_rate = true;
|
||||
mdss_dsi_clk_refresh(&ctrl->panel_data);
|
||||
mdss_dsi_clk_refresh(&ctrl->panel_data, ctrl->update_phy_timing);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012-2016, 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
|
||||
|
@ -1105,7 +1105,7 @@ void mdss_dsi_core_clk_deinit(struct device *dev, struct dsi_shared_data *sdata)
|
|||
devm_clk_put(dev, sdata->mdp_core_clk);
|
||||
}
|
||||
|
||||
int mdss_dsi_clk_refresh(struct mdss_panel_data *pdata)
|
||||
int mdss_dsi_clk_refresh(struct mdss_panel_data *pdata, bool update_phy)
|
||||
{
|
||||
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
|
||||
struct mdss_panel_info *pinfo = NULL;
|
||||
|
@ -1125,9 +1125,11 @@ int mdss_dsi_clk_refresh(struct mdss_panel_data *pdata)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Re-calculate frame rate before clk config */
|
||||
pinfo->mipi.frame_rate = mdss_panel_calc_frame_rate(pinfo);
|
||||
pr_debug("%s: new frame rate %d\n", __func__, pinfo->mipi.frame_rate);
|
||||
if (update_phy) {
|
||||
pinfo->mipi.frame_rate = mdss_panel_calc_frame_rate(pinfo);
|
||||
pr_debug("%s: new frame rate %d\n",
|
||||
__func__, pinfo->mipi.frame_rate);
|
||||
}
|
||||
|
||||
rc = mdss_dsi_clk_div_config(&pdata->panel_info,
|
||||
pdata->panel_info.mipi.frame_rate);
|
||||
|
@ -1160,12 +1162,15 @@ int mdss_dsi_clk_refresh(struct mdss_panel_data *pdata)
|
|||
return rc;
|
||||
}
|
||||
|
||||
/* phy panel timing calaculation */
|
||||
rc = mdss_dsi_phy_calc_timing_param(pinfo,
|
||||
ctrl_pdata->shared_data->phy_rev, pinfo->mipi.frame_rate);
|
||||
if (rc) {
|
||||
pr_err("%s: unable to calculate phy timings\n", __func__);
|
||||
return rc;
|
||||
if (update_phy) {
|
||||
/* phy panel timing calaculation */
|
||||
rc = mdss_dsi_phy_calc_timing_param(pinfo,
|
||||
ctrl_pdata->shared_data->phy_rev,
|
||||
pinfo->mipi.frame_rate);
|
||||
if (rc) {
|
||||
pr_err("Error in calculating phy timings\n");
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
|
Loading…
Add table
Reference in a new issue