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

Commit 303c324c authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran
Browse files

disp: msm: sde: fix crtc_state iteration during vm release



Iterate over the crtc old/new state and decide which ones
to process by checking the active state of both during
the vm release in error cases.

Change-Id: Iab20e89792c53fb72e0c00f1fa5091616c7afbf3
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent 26b6ae2d
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -2689,18 +2689,21 @@ static void sde_kms_vm_res_release(struct msm_kms *kms,
		struct drm_atomic_state *state)
{
	struct drm_crtc *crtc;
	struct drm_crtc_state *crtc_state;
	struct drm_crtc_state *new_cstate, *old_cstate;
	struct sde_vm_ops *vm_ops;
	enum sde_crtc_vm_req vm_req;
	struct sde_kms *sde_kms = to_sde_kms(kms);
	int i;

	for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
		struct sde_crtc_state *cstate;
	for_each_oldnew_crtc_in_state(state, crtc, old_cstate, new_cstate, i) {
		struct sde_crtc_state *new_state;

		cstate = to_sde_crtc_state(state->crtcs[0].new_state);
		if (!new_cstate->active && !old_cstate->active)
			continue;

		vm_req = sde_crtc_get_property(cstate, CRTC_PROP_VM_REQ_STATE);
		new_state = to_sde_crtc_state(new_cstate);
		vm_req = sde_crtc_get_property(new_state,
					CRTC_PROP_VM_REQ_STATE);
		if (vm_req != VM_REQ_ACQUIRE)
			return;
	}