Merge "libhwcomposer: add dynamic thresold support for copybit."

This commit is contained in:
Linux Build Service Account
2013-03-27 01:06:57 -07:00
committed by Gerrit - the friendly Code Review server
3 changed files with 10 additions and 3 deletions

View File

@@ -93,7 +93,7 @@ bool CopyBit::canUseCopybitForRGB(hwc_context_t *ctx,
if (compositionType & qdutils::COMPOSITION_TYPE_DYN) { if (compositionType & qdutils::COMPOSITION_TYPE_DYN) {
// DYN Composition: // DYN Composition:
// use copybit, if (TotalRGBRenderArea < 2 * FB Area) // use copybit, if (TotalRGBRenderArea < threashold * FB Area)
// this is done based on perf inputs in ICS // this is done based on perf inputs in ICS
// TODO: Above condition needs to be re-evaluated in JB // TODO: Above condition needs to be re-evaluated in JB
int fbWidth = ctx->dpyAttr[dpy].xres; int fbWidth = ctx->dpyAttr[dpy].xres;
@@ -102,7 +102,7 @@ bool CopyBit::canUseCopybitForRGB(hwc_context_t *ctx,
unsigned int renderArea = getRGBRenderingArea(list); unsigned int renderArea = getRGBRenderingArea(list);
ALOGD_IF (DEBUG_COPYBIT, "%s:renderArea %u, fbArea %u", ALOGD_IF (DEBUG_COPYBIT, "%s:renderArea %u, fbArea %u",
__FUNCTION__, renderArea, fbArea); __FUNCTION__, renderArea, fbArea);
if (renderArea <= (2 * fbArea)) { if (renderArea < (mDynThreshold * fbArea)) {
return true; return true;
} }
} else if ((compositionType & qdutils::COMPOSITION_TYPE_MDP)) { } else if ((compositionType & qdutils::COMPOSITION_TYPE_MDP)) {
@@ -554,6 +554,11 @@ CopyBit::CopyBit():mIsModeOn(false), mCopyBitDraw(false),
mRenderBuffer[i] = NULL; mRenderBuffer[i] = NULL;
mRelFd[0] = -1; mRelFd[0] = -1;
mRelFd[1] = -1; mRelFd[1] = -1;
char value[PROPERTY_VALUE_MAX];
property_get("debug.hwc.dynThreshold", value, "2");
mDynThreshold = atof(value);
if (hw_get_module(COPYBIT_HARDWARE_MODULE_ID, &module) == 0) { if (hw_get_module(COPYBIT_HARDWARE_MODULE_ID, &module) == 0) {
if(copybit_open(module, &mEngine) < 0) { if(copybit_open(module, &mEngine) < 0) {
ALOGE("FATAL ERROR: copybit open failed."); ALOGE("FATAL ERROR: copybit open failed.");

View File

@@ -80,6 +80,9 @@ private:
//These are the the release FDs of the T-2 and T-1 round //These are the the release FDs of the T-2 and T-1 round
//We wait on the T-2 fence //We wait on the T-2 fence
int mRelFd[2]; int mRelFd[2];
//Dynamic composition threshold for deciding copybit usage.
double mDynThreshold;
}; };
}; //namespace qhwc }; //namespace qhwc

View File

@@ -122,7 +122,6 @@ void initContext(hwc_context_t *ctx)
IVideoOverlay::getObject(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres, IVideoOverlay::getObject(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres,
HWC_DISPLAY_PRIMARY); HWC_DISPLAY_PRIMARY);
char value[PROPERTY_VALUE_MAX];
// Check if the target supports copybit compostion (dyn/mdp/c2d) to // Check if the target supports copybit compostion (dyn/mdp/c2d) to
// decide if we need to open the copybit module. // decide if we need to open the copybit module.
int compositionType = int compositionType =