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

Commit fa0a8e6b authored by Ramakant Singh's avatar Ramakant Singh Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: avoid removing wrong multirect on validate failures



During atomic commit - validate failures, the newly allocated
pipes and pipes taken from the destroy list are cleaned up.
Currently pipe ndx is checked which can lead to cleaning up
the already in use multirect instead of the rect allocated
in the current validate. Add checks to include checking based
on multirect to avoid such cases.

Change-Id: Icbc7e390110ccfbbe65645711b47d1eff8f60fa2
Signed-off-by: default avatarRamakant Singh <ramaka@codeaurora.org>
parent d044c402
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -1936,16 +1936,20 @@ validate_exit:
	mutex_lock(&mdp5_data->list_lock);
	list_for_each_entry_safe(pipe, tmp, &mdp5_data->pipes_used, list) {
		if (IS_ERR_VALUE(ret)) {
			if ((pipe->ndx & rec_release_ndx[0]) ||
			    (pipe->ndx & rec_release_ndx[1])) {
			if (((pipe->ndx & rec_release_ndx[0]) &&
						(pipe->multirect.num == 0)) ||
					((pipe->ndx & rec_release_ndx[1]) &&
					 (pipe->multirect.num == 1))) {
				mdss_mdp_smp_unreserve(pipe);
				pipe->params_changed = 0;
				pipe->dirty = true;
				if (!list_empty(&pipe->list))
					list_del_init(&pipe->list);
				mdss_mdp_pipe_destroy(pipe);
			} else if ((pipe->ndx & rec_destroy_ndx[0]) ||
				   (pipe->ndx & rec_destroy_ndx[1])) {
			} else if (((pipe->ndx & rec_destroy_ndx[0]) &&
						(pipe->multirect.num == 0)) ||
					((pipe->ndx & rec_destroy_ndx[1]) &&
					 (pipe->multirect.num == 1))) {
				/*
				 * cleanup/destroy list pipes should move back
				 * to destroy list. Next/current kickoff cycle