liboverlay: Fix pipe priority mismatch on new allocations
With source split enabled:
1) When both LEFT and RIGHT pipes gets reused pipes, we use their
pipe id's to compare their priority and swap them as needed.
2) When both LEFT and RIGHT pipes needs to be newly allocated, we
let driver take care of the priority as long as both pipes are
of same type. If different, we swap them according to the pipe
type priority.
3) When LEFT is reused and RIGHT needs new allocation, we swap
them only when they need same pipe type and LEFT has the
pipe with lowest priority.
4) When RIGHT is reused and LEFT needs new allocation, we swap
them only when they need same pipe type and RIGHT has the
pipe with highest priority.
Change-Id: I320285aaca7ffc032e3b3b0832380a9c705bc4fc
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index d2962a3..7f31ad0 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -2669,12 +2669,8 @@
return false;
}
- // Return values
- // 1 Left pipe is higher priority, do nothing.
- // 0 Pipes of same priority.
- //-1 Right pipe is of higher priority, needs swap.
- if(ctx->mOverlay->comparePipePriority(pipe_info.lIndex,
- pipe_info.rIndex) == -1) {
+ if(ctx->mOverlay->needsPrioritySwap(pipe_info.lIndex,
+ pipe_info.rIndex)) {
qhwc::swap(pipe_info.lIndex, pipe_info.rIndex);
}
}