hwc: [8x26]Never allow primary get DMA pipe when external connect
For 8x26, if external display is connected, DMA pipe should never
be occupied by primary display. Otherwise, external display would
lack DMA pipe if switch to GPU composition.
This patch refines former commit: 9c1eb2be21a4952ee097d33
CRs-Fixed: 640934
Change-Id: Idc64b724cfacf9e8e22ca73e4e443e8d989e1212
diff --git a/liboverlay/overlay.cpp b/liboverlay/overlay.cpp
index c1757ad..6cb30d3 100644
--- a/liboverlay/overlay.cpp
+++ b/liboverlay/overlay.cpp
@@ -203,7 +203,9 @@
if(pipeSpecs.formatClass == FORMAT_YUV) { //video
return nextPipe(OV_MDP_PIPE_VG, pipeSpecs.dpy, pipeSpecs.mixer);
} else if(pipeSpecs.fb == false) { //RGB app layers
- if(not pipeSpecs.needsScaling) {
+ if((not pipeSpecs.needsScaling) and
+ (not (pipeSpecs.numActiveDisplays > 1 &&
+ pipeSpecs.dpy == DPY_PRIMARY))) {
dest = nextPipe(OV_MDP_PIPE_DMA, pipeSpecs.dpy, pipeSpecs.mixer);
}
if(dest == OV_INVALID) {
@@ -220,7 +222,9 @@
dest = nextPipe(OV_MDP_PIPE_VG, pipeSpecs.dpy, pipeSpecs.mixer);
}
}
- if(dest == OV_INVALID and (not pipeSpecs.needsScaling)) {
+ if(dest == OV_INVALID and (not pipeSpecs.needsScaling) and
+ (not (pipeSpecs.numActiveDisplays > 1 &&
+ pipeSpecs.dpy == DPY_PRIMARY))) {
dest = nextPipe(OV_MDP_PIPE_DMA, pipeSpecs.dpy, pipeSpecs.mixer);
}
}