Merge "msm: mdss: reset cdm block after used"

This commit is contained in:
Linux Build Service Account 2017-04-18 22:19:18 -07:00 committed by Gerrit - the friendly Code Review server
commit c5371f74c8
3 changed files with 22 additions and 6 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2017, 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
@ -377,6 +377,17 @@ int mdss_mdp_cdm_destroy(struct mdss_mdp_cdm *cdm)
return -EINVAL;
}
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);
mutex_lock(&cdm->lock);
/* Disable HDMI packer */
writel_relaxed(0x0, cdm->base + MDSS_MDP_REG_CDM_HDMI_PACK_OP_MODE);
/* Put CDM in bypass */
writel_relaxed(0x0, cdm->mdata->mdp_base + MDSS_MDP_MDP_OUT_CTL_0);
mutex_unlock(&cdm->lock);
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
kref_put(&cdm->kref, mdss_mdp_cdm_free);
return rc;

View file

@ -1071,6 +1071,13 @@ static int mdss_mdp_video_stop(struct mdss_mdp_ctl *ctl, int panel_power_state)
{
int intfs_num, ret = 0;
if (ctl->cdm) {
if (!mdss_mdp_cdm_destroy(ctl->cdm))
mdss_mdp_ctl_write(ctl,
MDSS_MDP_REG_CTL_FLUSH, BIT(26));
ctl->cdm = NULL;
}
intfs_num = ctl->intf_num - MDSS_MDP_INTF0;
ret = mdss_mdp_video_intfs_stop(ctl, ctl->panel_data, intfs_num);
if (IS_ERR_VALUE(ret)) {
@ -1083,10 +1090,6 @@ static int mdss_mdp_video_stop(struct mdss_mdp_ctl *ctl, int panel_power_state)
mdss_mdp_ctl_reset(ctl, false);
ctl->intf_ctx[MASTER_CTX] = NULL;
if (ctl->cdm) {
mdss_mdp_cdm_destroy(ctl->cdm);
ctl->cdm = NULL;
}
return 0;
}

View file

@ -792,7 +792,9 @@ static int mdss_mdp_writeback_stop(struct mdss_mdp_ctl *ctl,
}
if (ctl->cdm) {
mdss_mdp_cdm_destroy(ctl->cdm);
if (!mdss_mdp_cdm_destroy(ctl->cdm))
mdss_mdp_ctl_write(ctl,
MDSS_MDP_REG_CTL_FLUSH, BIT(26));
ctl->cdm = NULL;
}
return 0;