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

Commit a42150bd authored by Adrian Salido-Moreno's avatar Adrian Salido-Moreno
Browse files

msm: mdss: release all overlay resources on last fb release



There are cases where the last frame buffer reference is released from a
different pid than the one who originally allocated the resource.
In these cases we can still deallocate all resources currently allocated
as we know that all references on fb dev have been released.

Change-Id: Ice2ca8df765cb8c4537a89fec887cb125d820d7a
Signed-off-by: default avatarAdrian Salido-Moreno <adrianm@codeaurora.org>
parent c99f9b85
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1197,6 +1197,12 @@ static int mdss_fb_release(struct fb_info *info, int user)
	if (!pinfo || (pinfo->pid != pid)) {
		pr_warn("unable to find process info for fb%d pid=%d\n",
				mfd->index, pid);
		if (mfd->mdp.release_fnc) {
			ret = mfd->mdp.release_fnc(mfd);
			if (ret)
				pr_err("error releasing fb%d resources\n",
						mfd->index);
		}
	} else {
		pr_debug("found process entry pid=%d ref=%d\n",
				pinfo->pid, pinfo->ref_cnt);
+1 −1
Original line number Diff line number Diff line
@@ -1051,7 +1051,7 @@ static int __mdss_mdp_overlay_release_all(struct msm_fb_data_type *mfd)
	mutex_lock(&mdp5_data->ov_lock);
	mutex_lock(&mfd->lock);
	list_for_each_entry(pipe, &mdp5_data->pipes_used, used_list) {
		if (pipe->pid == pid) {
		if (!mfd->ref_cnt || (pipe->pid == pid)) {
			unset_ndx |= pipe->ndx;
			cnt++;
		}