diff --git a/libhwcomposer/hwc_copybit.cpp b/libhwcomposer/hwc_copybit.cpp index ad9c3b5..6717272 100644 --- a/libhwcomposer/hwc_copybit.cpp +++ b/libhwcomposer/hwc_copybit.cpp @@ -92,9 +92,7 @@ bool CopyBit::canUseCopybitForRGB(hwc_context_t *ctx, hwc_layer_list_t *list) { if (compositionType & qdutils::COMPOSITION_TYPE_DYN) { // DYN Composition: - // use copybit, if (TotalRGBRenderArea < 2 * FB Area) - // this is done based on perf inputs in ICS - // TODO: Above condition needs to be re-evaluated in JB + // use copybit, depending on dyn threshold framebuffer_device_t *fbDev = ctx->mFbDev; if (!fbDev) { @@ -105,7 +103,7 @@ bool CopyBit::canUseCopybitForRGB(hwc_context_t *ctx, hwc_layer_list_t *list) { unsigned int renderArea = getRGBRenderingArea(list); ALOGD_IF (DEBUG_COPYBIT, "%s:renderArea %u, fbArea %u", __FUNCTION__, renderArea, fbArea); - if (renderArea < (2 * fbArea)) { + if (renderArea < (unsigned int) (ctx->dynThreshold * fbArea)) { return true; } } else if ((compositionType & qdutils::COMPOSITION_TYPE_MDP)) { diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp index 932adc7..875404f 100644 --- a/libhwcomposer/hwc_utils.cpp +++ b/libhwcomposer/hwc_utils.cpp @@ -59,8 +59,16 @@ void initContext(hwc_context_t *ctx) property_get("debug.egl.swapinterval", value, "1"); ctx->swapInterval = atoi(value); + //Initialize dyn threshold to 2.0 + //system property can override this value + ctx->dynThreshold = 2.0; + + property_get("debug.hwc.dynThreshold", value, "3"); + ctx->dynThreshold = atof(value); + ALOGI("Initializing Qualcomm Hardware Composer"); ALOGI("MDP version: %d", ctx->mMDP.version); + ALOGI("DYN composition threshold : %f", ctx->dynThreshold); } void closeContext(hwc_context_t *ctx) diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h index 54ac1a5..6ed830d 100644 --- a/libhwcomposer/hwc_utils.h +++ b/libhwcomposer/hwc_utils.h @@ -136,6 +136,7 @@ struct hwc_context_t { int overlayInUse; int deviceOrientation; int swapInterval; + double dynThreshold; //Framebuffer device framebuffer_device_t *mFbDev;