hwc : Add support for single layer Bypass in MDP3
If the display list contains single layer and that layer
has same properties as Frame Buffer, avoid BLIT on Frame buffer
and pass it directly to display.
Change-Id: I24decaca4788432a55b550caa2a1354a670cd6fa
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 972f12f..ea3aecb 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -274,6 +274,10 @@
ctx->mMDPDownscaleEnabled = true;
}
+ ctx->enableABC = false;
+ property_get("debug.sf.hwc.canUseABC", value, "0");
+ ctx->enableABC = atoi(value) ? true : false;
+
// Initialize gpu perfomance hint related parameters
property_get("sys.hwc.gpu_perf_mode", value, "0");
#ifdef QCOM_BSP
@@ -838,6 +842,7 @@
ctx->listStats[dpy].yuv4k2kCount = 0;
ctx->mViewFrame[dpy] = (hwc_rect_t){0, 0, 0, 0};
ctx->dpyAttr[dpy].mActionSafePresent = isActionSafePresent(ctx, dpy);
+ ctx->listStats[dpy].renderBufIndexforABC = -1;
resetROI(ctx, dpy);
@@ -1323,7 +1328,8 @@
}
for(uint32_t i = 0; i < list->numHwLayers; i++) {
- if(list->hwLayers[i].compositionType == HWC_OVERLAY &&
+ if(((isAbcInUse(ctx)== true ) ||
+ (list->hwLayers[i].compositionType == HWC_OVERLAY)) &&
list->hwLayers[i].acquireFenceFd >= 0) {
if(UNLIKELY(swapzero))
acquireFd[count++] = -1;
@@ -1379,7 +1385,9 @@
} else if(list->hwLayers[i].releaseFenceFd < 0 ) {
#ifdef QCOM_BSP
//If rotator has not already populated this field
- if(list->hwLayers[i].compositionType == HWC_BLIT) {
+ // & if it's a not VPU layer
+ if((list->hwLayers[i].compositionType == HWC_BLIT)&&
+ (isAbcInUse(ctx) == false)){
//For Blit, the app layers should be released when the Blit is
//complete. This fd was passed from copybit->draw
list->hwLayers[i].releaseFenceFd = dup(fd);
@@ -2017,6 +2025,10 @@
ctx->layerProp[dpy] = new LayerProp[numAppLayers];
}
+bool isAbcInUse(hwc_context_t *ctx){
+ return (ctx->enableABC && ctx->listStats[0].renderBufIndexforABC == 0);
+}
+
/* Since we fake non-Hybrid WFD solution as external display, this
* function helps us in determining the priority between external
* (hdmi/non-Hybrid WFD display) and virtual display devices(SSD/