summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUjwal Patel <ujwalp@codeaurora.org>2014-11-06 18:37:52 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:36:05 -0700
commit4dc5ccfa3b89083b3b5dbdd7f95bffcee04b710d (patch)
treee80ec532bd01b0ac70ef722518f0779dbd14c0ea
parent7541576401fca25f97b015e8458997a6e51c49c6 (diff)
msm: mdss: fix processed overlay number mapping
When source split is enabled, overlay list is sorted and then processed but user-space is not aware of this sorting and assumes that driver processes overlays in the original order. So when there is an error during prepare ioctl, processed_overlay return value is used by user-space to find out which overlay had an error. But user-space uses this process_overlay in the original list order while driver operates on sorted list. This requires mapping of bad overlay from sorted list to original list. Simplify and correct this mapping implementation. Change-Id: If78f65812b989deed9f423a0c8630effc905d111 Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_overlay.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
index e234a3bc2820..eee66267cb2c 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
@@ -2973,7 +2973,8 @@ static int mdss_fb_get_metadata(struct msm_fb_data_type *mfd,
static int __mdss_overlay_map(struct mdp_overlay *ovs,
struct mdp_overlay *op_ovs, int num_ovs, int num_ovs_processed)
{
- int i = num_ovs_processed, j, k;
+ int mapped = num_ovs_processed;
+ int j, k;
for (j = 0; j < num_ovs; j++) {
for (k = 0; k < num_ovs; k++) {
@@ -2984,15 +2985,14 @@ static int __mdss_overlay_map(struct mdp_overlay *ovs,
break;
}
}
- if ((i != num_ovs) && (i != j) &&
- (ovs[j].dst_rect.x == op_ovs[k].dst_rect.x) &&
- (ovs[i].z_order == op_ovs[k].z_order)) {
- pr_debug("mapped %d->%d\n", i, j);
- i = j;
+
+ if ((mapped != num_ovs) && (mapped == j)) {
+ pr_debug("mapped %d->%d\n", mapped, k);
+ mapped = k;
}
}
- return i;
+ return mapped;
}
static inline void __overlay_swap_func(void *a, void *b, int size)