hwc: Full MDP Composition mode with overlap region removal
MDP bandwidth limitations can be avoided, if the overlapping region
covered by the smallest layer at a higher z-order, can be composed
on a render buffer using Copybit, and then it can be queued to MDP
along with other layers. It helps to improve performace by avoiding
GPU Composition in use cases like Home Screen pan. To enable this
feature, set system prop "persist.hwc.ptor.enable" to "true" or '1'
and enable Copybit HAL compilation.
Change-Id: Ib719d3dd42477837519518cc427f1b95356c28f7
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 902f882..f04bd76 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -580,8 +580,14 @@
hwc_layer_1_t *fbLayer = &list->hwLayers[last];
int fd = -1; //FenceFD from the Copybit(valid in async mode)
bool copybitDone = false;
- if(ctx->mCopyBit[dpy])
- copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd);
+
+ if (ctx->mCopyBit[dpy]) {
+ if (ctx->mMDP.version < qdutils::MDP_V4_0)
+ copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd);
+ else
+ fd = ctx->mMDPComp[dpy]->drawOverlap(ctx, list);
+ }
+
if(list->numHwLayers > 1)
hwc_sync(ctx, list, dpy, fd);