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

Commit f53a74b2 authored by Xiaoming Zhou's avatar Xiaoming Zhou
Browse files

msm: mdss: fix a dead-lock issue on 8x10



The shutdown function involves two seperate steps: shut down
the dma and unset the overlay.   Due to the use of the mutex,
a UI update thread can comes in between the two steps.   Futher,
the UI update thread does not hold the mutex while trying to
check the display status.   This results a dead-lock: UI update
thread tries to wait for vsync event, while the display has already
been shut-down.

Change-Id: Ib1242c60605a85441af78dcdc75a69a209dec7d1
Signed-off-by: default avatarXiaoming Zhou <zhoux@codeaurora.org>
parent 91df8430
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -673,11 +673,6 @@ static int mdp3_ctrl_display_commit_kickoff(struct msm_fb_data_type *mfd)
	if (!mdp3_session || !mdp3_session->dma)
		return -EINVAL;

	if (!mdp3_session->status) {
		pr_err("%s, display off!\n", __func__);
		return -EPERM;
	}

	if (!mdp3_iommu_is_attached(MDP3_CLIENT_DMA_P)) {
		pr_debug("continuous splash screen, IOMMU not attached\n");
		mdp3_ctrl_off(mfd);
@@ -687,6 +682,12 @@ static int mdp3_ctrl_display_commit_kickoff(struct msm_fb_data_type *mfd)

	mutex_lock(&mdp3_session->lock);

	if (!mdp3_session->status) {
		pr_err("%s, display off!\n", __func__);
		mutex_unlock(&mdp3_session->lock);
		return -EPERM;
	}

	data = mdp3_bufq_pop(&mdp3_session->bufq_in);
	if (data) {
		mdp3_session->dma->update(mdp3_session->dma,
@@ -721,11 +722,6 @@ static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd)
	if (!mdp3_session || !mdp3_session->dma)
		return;

	if (!mdp3_session->status) {
		pr_err("mdp3_ctrl_pan_display, display off!\n");
		return;
	}

	if (!mdp3_iommu_is_attached(MDP3_CLIENT_DMA_P)) {
		pr_debug("continuous splash screen, IOMMU not attached\n");
		mdp3_ctrl_off(mfd);
@@ -733,6 +729,12 @@ static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd)
	}

	mutex_lock(&mdp3_session->lock);

	if (!mdp3_session->status) {
		pr_err("mdp3_ctrl_pan_display, display off!\n");
		goto pan_error;
	}

	fbi = mfd->fbi;

	bpp = fbi->var.bits_per_pixel / 8;