libhwcomposer: Only 4 pipes can be used per display for MDP Comp.
Although 6 pipes are available in total but only up to 4 pipes are
available per display (single mixer) for MDP Composition.
CRs-Fixed: 450985
Change-Id: I99df91ab955a1a7110dfbea2aaf790ba26058a78
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index c51a6aa..c22c2fe 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -401,7 +401,7 @@
/*
* MDPComp not possible when
- * 1. We have more than sMaxLayers
+ * 1. App layers > available pipes
* 2. External display connected
* 3. Composition is triggered by
* Idle timer expiry
@@ -417,6 +417,8 @@
overlay::Overlay& ov = *ctx->mOverlay;
int availablePipes = ov.availablePipes(dpy);
+ if (availablePipes > MAX_PIPES_PER_MIXER)
+ availablePipes = MAX_PIPES_PER_MIXER;
if(numAppLayers < 1 || numAppLayers > (uint32_t)availablePipes) {
ALOGD_IF(isDebug(), "%s: Unsupported number of layers",__FUNCTION__);
diff --git a/libhwcomposer/hwc_mdpcomp.h b/libhwcomposer/hwc_mdpcomp.h
index 9ae9b2e..45cd77b 100644
--- a/libhwcomposer/hwc_mdpcomp.h
+++ b/libhwcomposer/hwc_mdpcomp.h
@@ -25,6 +25,7 @@
#include <overlay.h>
#define DEFAULT_IDLE_TIME 2000
+#define MAX_PIPES_PER_MIXER 4
namespace qhwc {
namespace ovutils = overlay::utils;