hwc/copybit: Handle "R/B swap" for RGBA and RGBX color formats.

1.Framework notifies HAL with "HWC_FORMAT_RB_SWAP" layer flag to handle
a limitation where R and B components were swapped in Rendering phase.
2.Add "R/B swap" in hwc query to enable framework to query for support
in display HAL, at run-time.

Change-Id: I3b44d15b51b4f24939048fee9d1bac2b9009c97c
This commit is contained in:
Sushil Chauhan
2013-10-11 11:49:35 -07:00
parent 11888cb1bd
commit 1f6d68fce6
7 changed files with 38 additions and 0 deletions

View File

@@ -1385,6 +1385,14 @@ int configureNonSplit(hwc_context_t *ctx, hwc_layer_1_t *layer,
Whf whf(hnd->width, hnd->height,
getMdpFormat(hnd->format), hnd->size);
// Handle R/B swap
if (layer->flags & HWC_FORMAT_RB_SWAP) {
if (hnd->format == HAL_PIXEL_FORMAT_RGBA_8888)
whf.format = getMdpFormat(HAL_PIXEL_FORMAT_BGRA_8888);
else if (hnd->format == HAL_PIXEL_FORMAT_RGBX_8888)
whf.format = getMdpFormat(HAL_PIXEL_FORMAT_BGRX_8888);
}
if(dpy && isYuvBuffer(hnd)) {
if(!ctx->listStats[dpy].isDisplayAnimating) {
ctx->mPrevCropVideo = crop;
@@ -1508,6 +1516,14 @@ int configureSplit(hwc_context_t *ctx, hwc_layer_1_t *layer,
Whf whf(hnd->width, hnd->height,
getMdpFormat(hnd->format), hnd->size);
// Handle R/B swap
if (layer->flags & HWC_FORMAT_RB_SWAP) {
if (hnd->format == HAL_PIXEL_FORMAT_RGBA_8888)
whf.format = getMdpFormat(HAL_PIXEL_FORMAT_BGRA_8888);
else if (hnd->format == HAL_PIXEL_FORMAT_RGBX_8888)
whf.format = getMdpFormat(HAL_PIXEL_FORMAT_BGRX_8888);
}
if(dpy && isYuvBuffer(hnd)) {
if(!ctx->listStats[dpy].isDisplayAnimating) {
ctx->mPrevCropVideo = crop;