From fb115a56816359dbf8d8200710adfb8c2c1b6b47 Mon Sep 17 00:00:00 2001 From: Jeevan Shriram Date: Thu, 8 Jan 2015 13:50:04 -0800 Subject: [PATCH] msm: mdss: add handoff support for multiple pipes on same mixer stage In the existing implementation, display driver assumes only one pipe can be staged on a layer mixer during overlay handoff. Starting from MDSS v1.03, layer mixer can support two pipes staged at the same stage. This change handles the case for two pipes on layer mixer at same staging level. If more than two pipes are staged on a layer mixer, it is invalid. Change-Id: Ie6fa42e7a5b555de53fc4a3801e89447c3b1f90f Signed-off-by: Jeevan Shriram --- drivers/video/msm/mdss/mdss_mdp_ctl.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/video/msm/mdss/mdss_mdp_ctl.c b/drivers/video/msm/mdss/mdss_mdp_ctl.c index c8b52f442528..66e11984c816 100644 --- a/drivers/video/msm/mdss/mdss_mdp_ctl.c +++ b/drivers/video/msm/mdss/mdss_mdp_ctl.c @@ -3693,22 +3693,38 @@ static int __mdss_mdp_mixer_handoff_helper(struct mdss_mdp_mixer *mixer, struct mdss_mdp_pipe *pipe) { int rc = 0; + struct mdss_data_type *mdata = mdss_mdp_get_mdata(); + u32 right_blend = 0; if (!mixer) { rc = -EINVAL; goto error; } + /* + * It is possible to have more the one pipe staged on a single + * layer mixer at same staging level. + */ if (mixer->stage_pipe[MDSS_MDP_STAGE_UNUSED] != NULL) { - pr_err("More than one pipe staged on mixer num %d\n", - mixer->num); - rc = -EINVAL; - goto error; + if (mdata->mdp_rev < MDSS_MDP_HW_REV_103) { + pr_err("More than one pipe staged on mixer num %d\n", + mixer->num); + rc = -EINVAL; + goto error; + } else if (mixer->stage_pipe[MDSS_MDP_STAGE_UNUSED + 1] != + NULL) { + pr_err("More than two pipe staged on mixer num %d\n", + mixer->num); + rc = -EINVAL; + goto error; + } else { + right_blend = 1; + } } pr_debug("Staging pipe num %d on mixer num %d\n", pipe->num, mixer->num); - mixer->stage_pipe[MDSS_MDP_STAGE_UNUSED] = pipe; + mixer->stage_pipe[MDSS_MDP_STAGE_UNUSED + right_blend] = pipe; pipe->mixer_left = mixer; pipe->mixer_stage = MDSS_MDP_STAGE_UNUSED;