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>
This commit is contained in:
Ujwal Patel 2014-11-06 18:37:52 -08:00 committed by David Keitel
parent 7541576401
commit 4dc5ccfa3b

View file

@ -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)