libhwcomposer/libqcomui: disable composition bypass for asynchronous mode

The current composition bypass implementation prevents the app frame rate from
being decoupled with vsync. As a result when a graphics application requests
EGL swap interval zero it is still limited by vsync. This change disables
composition bypass if any layers being composited for the frame are in
asynchronous mode.

CRs-Fixed: 335498
(cherry picked from commit 8e1a74ffff6a07ac9ef649347b7ac23be143f2ea)

Change-Id: Ia0b6b14fbc953b04616667a494d98fcca99932f9
This commit is contained in:
Jeff Boody 2012-03-06 11:28:23 -07:00 committed by Andrew Sutherland
parent 4636422dd7
commit 6ee9758eb8
3 changed files with 19 additions and 2 deletions

View File

@ -406,11 +406,14 @@ inline static bool isBypassDoable(hwc_composer_device_t *dev, const int yuvCount
return false;
}
//Bypass is not efficient if rotation is needed.
//Bypass is not efficient if rotation or asynchronous mode is needed.
for(int i = 0; i < list->numHwLayers; ++i) {
if(list->hwLayers[i].transform) {
return false;
}
if(list->hwLayers[i].flags & HWC_LAYER_ASYNCHRONOUS) {
return false;
}
}
return (yuvCount == 0) && (ctx->hwcOverlayStatus == HWC_OVERLAY_CLOSED)

View File

@ -354,6 +354,12 @@ int updateLayerQcomFlags(eLayerAttrib attribute, bool enable, int& currentFlags)
else
currentFlags &= ~LAYER_UPDATING;
} break;
case LAYER_ASYNCHRONOUS_STATUS: {
if (enable)
currentFlags |= LAYER_ASYNCHRONOUS;
else
currentFlags &= ~LAYER_ASYNCHRONOUS;
} break;
default: LOGE("%s: invalid attribute(0x%x)", __FUNCTION__, attribute);
break;
}
@ -375,6 +381,11 @@ int getPerFrameFlags(int hwclFlags, int layerFlags) {
else
flags |= HWC_LAYER_NOT_UPDATING;
if (layerFlags & LAYER_ASYNCHRONOUS)
flags |= HWC_LAYER_ASYNCHRONOUS;
else
flags &= ~HWC_LAYER_ASYNCHRONOUS;
return flags;
}

View File

@ -67,13 +67,15 @@ enum {
*/
enum eLayerAttrib {
LAYER_UPDATE_STATUS,
LAYER_ASYNCHRONOUS_STATUS,
};
/*
* Layer Flags
*/
enum {
LAYER_UPDATING = 1<<0,
LAYER_UPDATING = 1<<0,
LAYER_ASYNCHRONOUS = 1<<1,
};
/*
@ -81,6 +83,7 @@ enum {
*/
enum {
HWC_LAYER_NOT_UPDATING = 0x00000002,
HWC_LAYER_ASYNCHRONOUS = 0x00000004,
HWC_USE_ORIGINAL_RESOLUTION = 0x10000000,
HWC_DO_NOT_USE_OVERLAY = 0x20000000,
HWC_COMP_BYPASS = 0x40000000,