From d0fd579ab4e13d1957e8ba8669c75c2977ab56b0 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Wed, 29 May 2013 11:56:52 -0400 Subject: [PATCH] hwc: Allow for yuv content to go through ppp on 8x10 8x10 has overlay but it also allows for composition to go through copybit. Change-Id: I086aab118b03c1cbc7fa0dbc080ceb906310deab --- libcopybit/copybit.cpp | 1 + libhwcomposer/hwc_copybit.cpp | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/libcopybit/copybit.cpp b/libcopybit/copybit.cpp index 43b90d1ea1..e641f2e600 100644 --- a/libcopybit/copybit.cpp +++ b/libcopybit/copybit.cpp @@ -125,6 +125,7 @@ static int get_format(int format) { case HAL_PIXEL_FORMAT_YCbCr_422_SP: return MDP_Y_CRCB_H2V1; case HAL_PIXEL_FORMAT_YCbCr_420_SP: return MDP_Y_CRCB_H2V2; case HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO: return MDP_Y_CBCR_H2V2_ADRENO; + case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS: return MDP_Y_CBCR_H2V2_ADRENO; case HAL_PIXEL_FORMAT_NV12_ENCODEABLE: return MDP_Y_CBCR_H2V2; } return -1; diff --git a/libhwcomposer/hwc_copybit.cpp b/libhwcomposer/hwc_copybit.cpp index 8cdf467e0c..160e6daa51 100644 --- a/libhwcomposer/hwc_copybit.cpp +++ b/libhwcomposer/hwc_copybit.cpp @@ -72,7 +72,7 @@ void CopyBit::reset() { bool CopyBit::canUseCopybitForYUV(hwc_context_t *ctx) { // return true for non-overlay targets - if(ctx->mMDP.hasOverlay) { + if(ctx->mMDP.hasOverlay && ctx->mMDP.version >= qdutils::MDP_V4_0) { return false; } return true; @@ -84,14 +84,6 @@ bool CopyBit::canUseCopybitForRGB(hwc_context_t *ctx, int compositionType = qdutils::QCCompositionType:: getInstance().getCompositionType(); - if ((compositionType & qdutils::COMPOSITION_TYPE_C2D) || - (compositionType & qdutils::COMPOSITION_TYPE_DYN)) { - if(ctx->listStats[dpy].yuvCount) { - //Overlay up & running. Dont use COPYBIT for RGB layers. - return false; - } - } - if (compositionType & qdutils::COMPOSITION_TYPE_DYN) { // DYN Composition: // use copybit, if (TotalRGBRenderArea < threashold * FB Area) @@ -181,6 +173,9 @@ bool CopyBit::prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list, } } + // We cannot mix copybit layer with layers marked to be drawn on FB + if (!useCopybitForYUV && ctx->listStats[dpy].yuvCount) + return true; // numAppLayers-1, as we iterate till 0th layer index for (int i = ctx->listStats[dpy].numAppLayers-1; i >= 0 ; i--) { @@ -197,6 +192,7 @@ bool CopyBit::prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list, mCopyBitDraw = false; //There is no need to reset layer properties here as we return in //draw if mCopyBitDraw is false + break; } } return true;