diff --git a/drivers/video/msm/mdss/mdss_compat_utils.c b/drivers/video/msm/mdss/mdss_compat_utils.c index 8fdf1b75f1c8110645fc59add72f81ded2843104..c67ed82dc93f0f71fe537c4b584b696ac7202024 100644 --- a/drivers/video/msm/mdss/mdss_compat_utils.c +++ b/drivers/video/msm/mdss/mdss_compat_utils.c @@ -2224,6 +2224,7 @@ static int __to_user_mdp_overlay(struct mdp_overlay32 __user *ov32, ret |= put_user(ov->transp_mask, &ov32->transp_mask); ret |= put_user(ov->flags, &ov32->flags); ret |= put_user(ov->id, &ov32->id); + ret |= put_user(ov->priority, &ov32->priority); if (ret) return -EFAULT; @@ -2277,7 +2278,9 @@ static int __from_user_mdp_overlay(struct mdp_overlay *ov, get_user(data, &ov32->flags) || put_user(data, &ov->flags) || get_user(data, &ov32->id) || - put_user(data, &ov->id)) + put_user(data, &ov->id) || + get_user(data, &ov32->priority) || + put_user(data, &ov->priority)) return -EFAULT; if (copy_in_user(&ov->user_data, &ov32->user_data, diff --git a/drivers/video/msm/mdss/mdss_compat_utils.h b/drivers/video/msm/mdss/mdss_compat_utils.h index 79e077d1866de920fdee30d4b0e69f1458ea495a..86ca77f52313ebb0825fdfe575d5bc0d82a13ec5 100644 --- a/drivers/video/msm/mdss/mdss_compat_utils.h +++ b/drivers/video/msm/mdss/mdss_compat_utils.h @@ -356,6 +356,7 @@ struct mdp_overlay32 { uint32_t transp_mask; uint32_t flags; uint32_t id; + uint8_t priority; uint32_t user_data[6]; uint32_t bg_color; uint8_t horz_deci; diff --git a/drivers/video/msm/mdss/mdss_mdp_overlay.c b/drivers/video/msm/mdss/mdss_mdp_overlay.c index 918b6c18bffc77da564ba1f676e4926b18062e8a..25fee8bb9d3bc1c85d2819b73d2e3e646c2c51f8 100644 --- a/drivers/video/msm/mdss/mdss_mdp_overlay.c +++ b/drivers/video/msm/mdss/mdss_mdp_overlay.c @@ -699,6 +699,7 @@ static int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd, pipe->bg_color = req->bg_color; req->id = pipe->ndx; + req->priority = pipe->priority; pipe->req_data = *req; if (pipe->flags & MDP_OVERLAY_PP_CFG_EN) { @@ -2542,8 +2543,9 @@ static int __mdss_overlay_map(struct mdp_overlay *ovs, if ((ovs[j].dst_rect.x == op_ovs[k].dst_rect.x) && (ovs[j].z_order == op_ovs[k].z_order)) { op_ovs[k].id = ovs[j].id; + op_ovs[k].priority = ovs[j].priority; break; - } + } } if ((i != num_ovs) && (i != j) && (ovs[j].dst_rect.x == op_ovs[k].dst_rect.x) && diff --git a/include/uapi/linux/msm_mdp.h b/include/uapi/linux/msm_mdp.h index 0b817d108c33ee8a7c74de77550ad41ca30ac460..d4ec981b3f413c05164af75a5cb063a1ce988c91 100644 --- a/include/uapi/linux/msm_mdp.h +++ b/include/uapi/linux/msm_mdp.h @@ -586,6 +586,11 @@ struct mdp_scale_data { * 4: decimation by 16 (drop 15 lines for each line fetched) * @overlay_pp_cfg: Overlay post processing configuration, for more information * see struct mdp_overlay_pp_params. + * @priority: Priority is returned by the driver when overlay is set for the + * first time. It indicates the priority of the underlying pipe + * serving the overlay. This priority can be used by user-space + * in source split when pipes are re-used and shuffled around to + * reduce fallbacks. */ struct mdp_overlay { struct msmfb_img src; @@ -598,6 +603,7 @@ struct mdp_overlay { uint32_t transp_mask; uint32_t flags; uint32_t id; + uint8_t priority; uint32_t user_data[6]; uint32_t bg_color; uint8_t horz_deci;