Unverified Commit abf385ef authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15465 CVE-2022-49490

Merge Pull Request from: @ci-robot 
 
PR sync from: Zeng Heng <zengheng4@huawei.com>
https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/MYPEOHBXM2AV4HIGONV7FTJGUCUSKGTA/ 
Jessica Zhang (1):
  drm/msm/mdp5: Return error code in mdp5_pipe_release when deadlock is
    detected

Rob Clark (1):
  drm/msm/mdp5: Fix global state lock backoff


--
2.25.1
 
https://gitee.com/src-openeuler/kernel/issues/IBP1O4 
 
Link:https://gitee.com/openeuler/kernel/pulls/15465

 

Reviewed-by: default avatarYuan Can <yuancan@huawei.com>
Reviewed-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
parents 8a7a3996 70776071
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -130,18 +130,24 @@ int mdp5_pipe_assign(struct drm_atomic_state *s, struct drm_plane *plane,
	return 0;
}

void mdp5_pipe_release(struct drm_atomic_state *s, struct mdp5_hw_pipe *hwpipe)
int mdp5_pipe_release(struct drm_atomic_state *s, struct mdp5_hw_pipe *hwpipe)
{
	struct msm_drm_private *priv = s->dev->dev_private;
	struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(priv->kms));
	struct mdp5_global_state *state = mdp5_get_global_state(s);
	struct mdp5_hw_pipe_state *new_state = &state->hwpipe;
	struct mdp5_global_state *state;
	struct mdp5_hw_pipe_state *new_state;

	if (!hwpipe)
		return;
		return 0;

	state = mdp5_get_global_state(s);
	if (IS_ERR(state))
		return PTR_ERR(state);

	new_state = &state->hwpipe;

	if (WARN_ON(!new_state->hwpipe_to_plane[hwpipe->idx]))
		return;
		return -EINVAL;

	DBG("%s: release from plane %s", hwpipe->name,
		new_state->hwpipe_to_plane[hwpipe->idx]->name);
@@ -152,6 +158,8 @@ void mdp5_pipe_release(struct drm_atomic_state *s, struct mdp5_hw_pipe *hwpipe)
	}

	new_state->hwpipe_to_plane[hwpipe->idx] = NULL;

	return 0;
}

void mdp5_pipe_destroy(struct mdp5_hw_pipe *hwpipe)
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ int mdp5_pipe_assign(struct drm_atomic_state *s, struct drm_plane *plane,
		     uint32_t caps, uint32_t blkcfg,
		     struct mdp5_hw_pipe **hwpipe,
		     struct mdp5_hw_pipe **r_hwpipe);
void mdp5_pipe_release(struct drm_atomic_state *s, struct mdp5_hw_pipe *hwpipe);
int mdp5_pipe_release(struct drm_atomic_state *s, struct mdp5_hw_pipe *hwpipe);

struct mdp5_hw_pipe *mdp5_pipe_init(enum mdp5_pipe pipe,
		uint32_t reg_offset, uint32_t caps);
+16 −4
Original line number Diff line number Diff line
@@ -399,12 +399,24 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state,
				mdp5_state->r_hwpipe = NULL;


			mdp5_pipe_release(state->state, old_hwpipe);
			mdp5_pipe_release(state->state, old_right_hwpipe);
			ret = mdp5_pipe_release(state->state, old_hwpipe);
			if (ret)
				return ret;

			ret = mdp5_pipe_release(state->state, old_right_hwpipe);
			if (ret)
				return ret;

		}
	} else {
		mdp5_pipe_release(state->state, mdp5_state->hwpipe);
		mdp5_pipe_release(state->state, mdp5_state->r_hwpipe);
		ret = mdp5_pipe_release(state->state, mdp5_state->hwpipe);
		if (ret)
			return ret;

		ret = mdp5_pipe_release(state->state, mdp5_state->r_hwpipe);
		if (ret)
			return ret;

		mdp5_state->hwpipe = mdp5_state->r_hwpipe = NULL;
	}