Skip to content

Commit

Permalink
hwc: Allow for yuv content to go through ppp on 8x10
Browse files Browse the repository at this point in the history
8x10 has overlay but it also allows for composition to go through
copybit.

Change-Id: I086aab118b03c1cbc7fa0dbc080ceb906310deab
  • Loading branch information
Terence Hampson committed Jun 3, 2013
1 parent 0124cc7 commit d0fd579
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions libcopybit/copybit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 5 additions & 9 deletions libhwcomposer/hwc_copybit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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--) {
Expand All @@ -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;
Expand Down

0 comments on commit d0fd579

Please sign in to comment.