diff options
| author | Ujwal Patel <ujwalp@codeaurora.org> | 2013-11-17 20:09:16 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:23:38 -0700 |
| commit | 1ce4f4c6cff4c036cdb99e5c0bdce7534cabfbfa (patch) | |
| tree | b94a8502dc918329214abe98a730e769cbdf7aaa /drivers | |
| parent | b7a4a49ae3b09be0db92d7444afaabb85f6de743 (diff) | |
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.
This issue was previously fixed by a42150bd. But later it again resurfaced
with 831a828.
Change-Id: Ie35194b1e11ae90ff886b1be22cf02c842a76d1a
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_fb.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdss_fb.c b/drivers/video/fbdev/msm/mdss_fb.c index ba31fd39e917..85c347251aa1 100644 --- a/drivers/video/fbdev/msm/mdss_fb.c +++ b/drivers/video/fbdev/msm/mdss_fb.c @@ -1206,6 +1206,8 @@ static int mdss_fb_release_all(struct fb_info *info, bool release_all) struct mdss_fb_proc_info *pinfo = NULL, *temp_pinfo = NULL; int ret = 0; int pid = current->tgid; + bool unknown_pid = true; + struct task_struct *task; if (!mfd->ref_cnt) { pr_info("try to close unopened fb %d!\n", mfd->index); @@ -1220,6 +1222,7 @@ static int mdss_fb_release_all(struct fb_info *info, bool release_all) if (!release_all && (pinfo->pid != pid)) continue; + unknown_pid = false; pr_debug("found process entry pid=%d ref=%d\n", pinfo->pid, pinfo->ref_cnt); @@ -1245,6 +1248,20 @@ static int mdss_fb_release_all(struct fb_info *info, bool release_all) } } + if (unknown_pid) { + task = current->group_leader; + pr_debug("unknown process %s pid=%d mfd->ref_cnt=%d\n", + task->comm, pid, mfd->ref_cnt); + + mfd->ref_cnt--; + if (mfd->mdp.release_fnc) { + ret = mfd->mdp.release_fnc(mfd); + if (ret) + pr_err("error releasing fb%d pid=%d\n", + mfd->index, pinfo->pid); + } + } + if (!mfd->ref_cnt) { ret = mdss_fb_blank_sub(FB_BLANK_POWERDOWN, info, mfd->op_enable); |
