libQcomUI: Add support for qcom specific layer flags.
Add support for updating the qcom specific layer flags. Add support for getting the per frame HWC flags based on the layer flags. Change-Id: I5f7759a6a7fae6d4f70dd26f380a9b08e48e9475
This commit is contained in:
parent
be32078a40
commit
8d7ff87f5c
@ -249,4 +249,45 @@ int updateBufferGeometry(sp<GraphicBuffer> buffer, const qBufGeometry updatedGeo
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates the flags for the layer
|
||||
*
|
||||
* @param: Attribute
|
||||
* @param: Identifies if the attribute was enabled or disabled.
|
||||
*
|
||||
* @return: -EINVAL if the attribute is invalid
|
||||
*/
|
||||
int updateLayerQcomFlags(eLayerAttrib attribute, bool enable, int& currentFlags)
|
||||
{
|
||||
int ret = 0;
|
||||
switch (attribute) {
|
||||
case LAYER_UPDATE_STATUS: {
|
||||
if (enable)
|
||||
currentFlags |= LAYER_UPDATING;
|
||||
else
|
||||
currentFlags &= ~LAYER_UPDATING;
|
||||
} break;
|
||||
default: LOGE("%s: invalid attribute(0x%x)", __FUNCTION__, attribute);
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets the per frame HWC flags for this layer.
|
||||
*
|
||||
* @param: current hwcl flags
|
||||
* @param: current layerFlags
|
||||
*
|
||||
* @return: the per frame flags.
|
||||
*/
|
||||
int getPerFrameFlags(int hwclFlags, int layerFlags) {
|
||||
int flags = hwclFlags;
|
||||
if (layerFlags & LAYER_UPDATING)
|
||||
flags &= ~HWC_LAYER_NOT_UPDATING;
|
||||
else
|
||||
flags |= HWC_LAYER_NOT_UPDATING;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,30 @@ enum {
|
||||
NATIVE_WINDOW_UPDATE_BUFFERS_GEOMETRY = 0x20000000,
|
||||
};
|
||||
|
||||
/*
|
||||
* Layer Attributes
|
||||
*/
|
||||
enum eLayerAttrib {
|
||||
LAYER_UPDATE_STATUS,
|
||||
};
|
||||
|
||||
/*
|
||||
* Layer Flags
|
||||
*/
|
||||
enum {
|
||||
LAYER_UPDATING = 1<<0,
|
||||
};
|
||||
|
||||
/*
|
||||
* Flags set by the layer and sent to HWC
|
||||
*/
|
||||
enum {
|
||||
HWC_LAYER_NOT_UPDATING = 0x00000002,
|
||||
HWC_USE_ORIGINAL_RESOLUTION = 0x10000000,
|
||||
HWC_DO_NOT_USE_OVERLAY = 0x20000000,
|
||||
HWC_COMP_BYPASS = 0x40000000,
|
||||
};
|
||||
|
||||
/*
|
||||
* Structure to hold the buffer geometry
|
||||
*/
|
||||
@ -109,4 +133,26 @@ bool needNewBuffer(const qBufGeometry currentGeometry,
|
||||
* @param: Updated buffer geometry
|
||||
*/
|
||||
int updateBufferGeometry(sp<GraphicBuffer> buffer, const qBufGeometry bufGeometry);
|
||||
|
||||
/*
|
||||
* Updates the flags for the layer
|
||||
*
|
||||
* @param: Attribute
|
||||
* @param: Identifies if the attribute was enabled or disabled.
|
||||
* @param: current Layer flags.
|
||||
*
|
||||
* @return: Flags for the layer
|
||||
*/
|
||||
int updateLayerQcomFlags(eLayerAttrib attribute, bool enable, int& currentFlags);
|
||||
|
||||
/*
|
||||
* Gets the per frame HWC flags for this layer.
|
||||
*
|
||||
* @param: current hwcl flags
|
||||
* @param: current layerFlags
|
||||
*
|
||||
* @return: the per frame flags.
|
||||
*/
|
||||
int getPerFrameFlags(int hwclFlags, int layerFlags);
|
||||
|
||||
#endif // INCLUDE_LIBQCOM_UI
|
||||
|
Loading…
Reference in New Issue
Block a user