QCommUI/HWComposer: Allow application to set 3D format

This change allows the application to set the S3D format for the surface.
With this change application would be specifying 3D format and that would
be handled by hwcomposer would handle it appropriately.

Change-Id: I6b7b33712ab85b8a94231bd65a19709b3c2cd606

Conflicts:

	libqcomui/qcom_ui.cpp
This commit is contained in:
Paras Morabia 2012-01-31 12:26:42 +05:30 committed by Andrew Sutherland
parent bd35204368
commit 6fd8923a96
2 changed files with 45 additions and 0 deletions

View File

@ -741,6 +741,28 @@ static int getS3DVideoFormat (const hwc_layer_list_t* list) {
return s3dFormat;
}
static int getS3DFormat (const hwc_layer_list_t* list) {
int s3dFormat = 0;
if (list) {
for (size_t i=0; i<list->numHwLayers; i++) {
private_handle_t *hnd = (private_handle_t *)list->hwLayers[i].handle;
if (hnd)
s3dFormat = FORMAT_3D_INPUT(hnd->format);
if (s3dFormat)
break;
}
}
return s3dFormat;
}
static int getLayerS3DFormat (hwc_layer_t &layer) {
int s3dFormat = 0;
private_handle_t *hnd = (private_handle_t *)layer.handle;
if (hnd)
s3dFormat = FORMAT_3D_INPUT(hnd->format);
return s3dFormat;
}
static bool isS3DCompositionRequired() {
#ifdef HDMI_AS_PRIMARY
return overlay::is3DTV();
@ -820,6 +842,9 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) {
s3dVideoFormat = getS3DVideoFormat(list);
if (s3dVideoFormat)
isS3DCompositionNeeded = isS3DCompositionRequired();
} else if((s3dVideoFormat = getS3DFormat(list))){
if (s3dVideoFormat)
isS3DCompositionNeeded = isS3DCompositionRequired();
} else {
unlockPreviousOverlayBuffer(ctx);
}
@ -885,6 +910,17 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) {
unlockPreviousOverlayBuffer(ctx);
skipComposition = false;
}
} else if (getLayerS3DFormat(list->hwLayers[i])) {
int flags = WAIT_FOR_VSYNC;
flags |= (1 == list->numHwLayers) ? DISABLE_FRAMEBUFFER_FETCH : 0;
#ifdef USE_OVERLAY
if(prepareOverlay(ctx, &(list->hwLayers[i]), flags) == 0) {
list->hwLayers[i].compositionType = HWC_USE_OVERLAY;
list->hwLayers[i].hints |= HWC_HINT_CLEAR_FB;
// We've opened the channel. Set the state to open.
ctx->hwcOverlayStatus = HWC_OVERLAY_OPEN;
}
#endif
} else if (isS3DCompositionNeeded) {
markUILayerForS3DComposition(list->hwLayers[i], s3dVideoFormat);
} else if (list->hwLayers[i].flags & HWC_USE_ORIGINAL_RESOLUTION) {

View File

@ -47,6 +47,7 @@ using android::GraphicBuffer;
enum {
NATIVE_WINDOW_SET_BUFFERS_SIZE = 0x10000000,
NATIVE_WINDOW_UPDATE_BUFFERS_GEOMETRY = 0x20000000,
NATIVE_WINDOW_SET_S3D_FORMAT = 0x40000000,
};
// Enum containing the supported composition types
@ -249,6 +250,14 @@ bool needNewBuffer(const qBufGeometry currentGeometry,
*/
int updateBufferGeometry(sp<GraphicBuffer> buffer, const qBufGeometry bufGeometry);
/*
* Update the S3D format of this buffer.
*
* @param: buffer whosei S3D format needs to be updated.
* @param: Updated buffer S3D format
*/
int updateBufferS3DFormat(sp<GraphicBuffer> buffer, const int s3dFormat);
/*
* Updates the flags for the layer
*