summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenet Clark <benetc@codeaurora.org>2015-03-25 13:39:46 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:40:06 -0700
commitce7b8b7d16e2c45cd04caec0af19ed8ff0165810 (patch)
treeeef0b3d1671b8b8485a47d38d022744b022b0f69
parentb5165614145f39248b62dd3ac8fc11d7284cf713 (diff)
msm: mdss: Fix VIG pipe reset of postprocessing parameters
When a VIG pipe is destroyed or reinitialized, the PP related parameters stored inside the pipe structure are cleared. There was an issue with clearing the parameters. The histogram structure was set to 0, causing a problem with histogram-related mutex and spinlock. Rather than resetting the whole PP structure to 0, this change adds support to only clear PP config enable flags and dirty flags. The histogram structure is disabled but not cleared, avoiding a need to reinitialize the histogram synchronization resources. Change-Id: I286b528436a457b9580c3a4c2c24cc8a31dacabf Signed-off-by: Benet Clark <benetc@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp.h2
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_overlay.c2
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_pipe.c4
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_pp.c38
4 files changed, 29 insertions, 17 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp.h b/drivers/video/fbdev/msm/mdss_mdp.h
index 363d009c9768..dccf7d720a2b 100644
--- a/drivers/video/fbdev/msm/mdss_mdp.h
+++ b/drivers/video/fbdev/msm/mdss_mdp.h
@@ -1059,8 +1059,8 @@ int mdss_mdp_pp_resume(struct mdss_mdp_ctl *ctl, u32 mixer_num);
int mdss_mdp_pp_setup(struct mdss_mdp_ctl *ctl);
int mdss_mdp_pp_setup_locked(struct mdss_mdp_ctl *ctl);
int mdss_mdp_pipe_pp_setup(struct mdss_mdp_pipe *pipe, u32 *op);
+void mdss_mdp_pipe_pp_clear(struct mdss_mdp_pipe *pipe);
int mdss_mdp_pipe_sspp_setup(struct mdss_mdp_pipe *pipe, u32 *op);
-void mdss_mdp_pipe_sspp_term(struct mdss_mdp_pipe *pipe);
int mdss_mdp_pp_sspp_config(struct mdss_mdp_pipe *pipe);
int mdss_mdp_smp_setup(struct mdss_data_type *mdata, u32 cnt, u32 size);
diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
index 2f80ce0191cd..7f63e8e42709 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
@@ -904,7 +904,7 @@ int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,
if (pipe->type == MDSS_MDP_PIPE_TYPE_CURSOR)
goto cursor_done;
- mdss_mdp_pipe_sspp_term(pipe);
+ mdss_mdp_pipe_pp_clear(pipe);
if (pipe->flags & MDP_OVERLAY_PP_CFG_EN) {
memcpy(&pipe->pp_cfg, &req->overlay_pp_cfg,
sizeof(struct mdp_overlay_pp_params));
diff --git a/drivers/video/fbdev/msm/mdss_mdp_pipe.c b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
index 63ce7fbec7bf..13372c242010 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_pipe.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
@@ -928,8 +928,6 @@ static int mdss_mdp_pipe_init_config(struct mdss_mdp_pipe *pipe,
if (pipe) {
pr_debug("type=%x pnum=%d\n", pipe->type, pipe->num);
- mutex_init(&pipe->pp_res.hist.hist_mutex);
- spin_lock_init(&pipe->pp_res.hist.hist_lock);
kref_init(&pipe->kref);
INIT_LIST_HEAD(&pipe->buf_queue);
@@ -1188,7 +1186,7 @@ static void mdss_mdp_pipe_free(struct kref *kref)
mdss_mdp_pipe_panic_signal_ctrl(pipe, false);
if (pipe->play_cnt) {
mdss_mdp_pipe_fetch_halt(pipe);
- mdss_mdp_pipe_sspp_term(pipe);
+ mdss_mdp_pipe_pp_clear(pipe);
mdss_mdp_smp_free(pipe);
} else {
mdss_mdp_smp_unreserve(pipe);
diff --git a/drivers/video/fbdev/msm/mdss_mdp_pp.c b/drivers/video/fbdev/msm/mdss_mdp_pp.c
index bac89628ea77..2af9e9029502 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_pp.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_pp.c
@@ -1260,22 +1260,36 @@ int mdss_mdp_pipe_pp_setup(struct mdss_mdp_pipe *pipe, u32 *op)
return ret;
}
-void mdss_mdp_pipe_sspp_term(struct mdss_mdp_pipe *pipe)
+void mdss_mdp_pipe_pp_clear(struct mdss_mdp_pipe *pipe)
{
struct pp_hist_col_info *hist_info;
- if (pipe) {
- if (pipe->pp_res.hist.col_en) {
- hist_info = &pipe->pp_res.hist;
- pp_hist_disable(hist_info);
- }
- kfree(pipe->pp_res.pa_cfg_payload);
- kfree(pipe->pp_res.igc_cfg_payload);
- kfree(pipe->pp_res.pcc_cfg_payload);
- kfree(pipe->pp_res.hist_lut_cfg_payload);
- memset(&pipe->pp_cfg, 0, sizeof(struct mdp_overlay_pp_params));
- memset(&pipe->pp_res, 0, sizeof(struct mdss_pipe_pp_res));
+ if (!pipe) {
+ pr_err("Invalid pipe context passed, %p\n",
+ pipe);
+ return;
}
+
+ if (mdss_mdp_pipe_is_yuv(pipe)) {
+ hist_info = &pipe->pp_res.hist;
+ pp_hist_disable(hist_info);
+ }
+
+ kfree(pipe->pp_res.pa_cfg_payload);
+ pipe->pp_res.pa_cfg_payload = NULL;
+ pipe->pp_cfg.pa_v2_cfg_data.cfg_payload = NULL;
+ kfree(pipe->pp_res.igc_cfg_payload);
+ pipe->pp_res.igc_cfg_payload = NULL;
+ pipe->pp_cfg.igc_cfg.cfg_payload = NULL;
+ kfree(pipe->pp_res.pcc_cfg_payload);
+ pipe->pp_res.pcc_cfg_payload = NULL;
+ pipe->pp_cfg.pcc_cfg_data.cfg_payload = NULL;
+ kfree(pipe->pp_res.hist_lut_cfg_payload);
+ pipe->pp_res.hist_lut_cfg_payload = NULL;
+ pipe->pp_cfg.hist_lut_cfg.cfg_payload = NULL;
+
+ memset(&pipe->pp_res.pp_sts, 0, sizeof(struct pp_sts_type));
+ pipe->pp_cfg.config_ops = 0;
}
int mdss_mdp_pipe_sspp_setup(struct mdss_mdp_pipe *pipe, u32 *op)