Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ec6a58c authored by zhaoyuan's avatar zhaoyuan Committed by Abhijith Desai
Browse files

msm: mdss: reset cdm block after used



After cdm has been used, need to reset cdm block,
or the next HDMI device will be affected by the
cdm config.

Change-Id: I4eb879202cc3547d9149b3352377c3395ebfe6b3
Signed-off-by: default avatarzhaoyuan <yzhao@codeaurora.org>
parent 5baed0b2
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
/* Copyright (c) 2014-2016, 2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018, 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
@@ -378,6 +378,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;
+7 −4
Original line number Diff line number Diff line
@@ -929,6 +929,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((unsigned long)ret)) {
@@ -941,10 +948,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;
}

+3 −1
Original line number Diff line number Diff line
@@ -518,7 +518,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;