hwc/overlay: Add support for pipe priorities, 1 pipe config for FB

If using source split to stage 2 pipes on the same mixer stage,
the left pipe needs to be a higher priority than the right.

Add API in overlay to compare pipe priorities and use this in
source split config to stage pipes accordingly.

Add support for 1 pipe config for FB if updating rect is within 2048
pixels.

Change-Id: I8b33d5ebd0f8765ee842bab128d8abd67a110145
diff --git a/liboverlay/overlay.cpp b/liboverlay/overlay.cpp
index 265aa9f..7e7f275 100644
--- a/liboverlay/overlay.cpp
+++ b/liboverlay/overlay.cpp
@@ -175,6 +175,19 @@
     return false;
 }
 
+int Overlay::comparePipePriority(utils::eDest pipe1Index,
+        utils::eDest pipe2Index) {
+    validate((int)pipe1Index);
+    validate((int)pipe2Index);
+    uint8_t pipe1Prio = mPipeBook[(int)pipe1Index].mPipe->getPriority();
+    uint8_t pipe2Prio = mPipeBook[(int)pipe2Index].mPipe->getPriority();
+    if(pipe1Prio > pipe2Prio)
+        return 1;
+    if(pipe1Prio < pipe2Prio)
+        return -1;
+    return 0;
+}
+
 bool Overlay::commit(utils::eDest dest) {
     bool ret = false;
     int index = (int)dest;