From fc907d939b1f5b829995e33d90234d0ae195ecdd Mon Sep 17 00:00:00 2001 From: Abhijit Kulkarni Date: Mon, 20 Jun 2016 09:43:03 -0700 Subject: msm: mdss: fix multi-rect validation properties Fix issues with multi-rect to allow the multi-rects on the same z-order. In multi-rect use cases the rect 0 of the pipes have higher priority than rect 1. The change checks the priority of rect on the right mixer with the priority of rect on the pipe staged on left mixer. CRs-Fixed: 1023723 Change-Id: Ifd1df8ee04238db0338a7dd70eb5097af2d0eb62 Signed-off-by: Abhijit Kulkarni --- drivers/video/fbdev/msm/mdss_mdp_layer.c | 33 ++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/msm/mdss_mdp_layer.c b/drivers/video/fbdev/msm/mdss_mdp_layer.c index 59283c815897..65b3b9739be6 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_layer.c +++ b/drivers/video/fbdev/msm/mdss_mdp_layer.c @@ -662,6 +662,23 @@ exit_fail: return ret; } +static int __validate_pipe_priorities(struct mdss_mdp_pipe *left, + struct mdss_mdp_pipe *right) +{ + if (left->multirect.num > right->multirect.num) + return -EINVAL; + + if ((left->multirect.num == right->multirect.num) && + (left->priority >= right->priority)) + return -EINVAL; + + if ((left->multirect.num < right->multirect.num) && + (left->priority > right->priority)) + return -EINVAL; + + return 0; +} + static int __configure_pipe_params(struct msm_fb_data_type *mfd, struct mdss_mdp_validate_info_t *vinfo, struct mdss_mdp_pipe *pipe, struct mdss_mdp_pipe *left_blend_pipe, bool is_single_layer, @@ -773,10 +790,12 @@ static int __configure_pipe_params(struct msm_fb_data_type *mfd, */ if (mdata->has_src_split) { if (left_blend_pipe) { - if (pipe->priority <= left_blend_pipe->priority) { - pr_err("priority limitation. left:%d right%d\n", - left_blend_pipe->priority, - pipe->priority); + if (__validate_pipe_priorities(left_blend_pipe, pipe)) { + pr_err("priority limitation. left:%d rect:%d, right:%d rect:%d\n", + left_blend_pipe->priority, + left_blend_pipe->multirect.num, + pipe->priority, + pipe->multirect.num); ret = -EPERM; goto end; } else { @@ -1521,12 +1540,6 @@ static bool __multirect_validate_properties(struct mdp_input_layer **layers, return false; } - if (layers[0]->z_order == layers[1]->z_order) { - pr_err("multirect layers cannot have same z_order=%d\n", - layers[0]->z_order); - return false; - } - return true; } -- cgit v1.2.3