Merge "hwc: Use 1 pipe if rotator downscale reduces dimensions"

This commit is contained in:
Linux Build Service Account
2015-02-09 16:47:07 -08:00
committed by Gerrit - the friendly Code Review server

View File

@@ -2772,19 +2772,21 @@ bool MDPCompSrcSplit::acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
const uint32_t lSplit = getLeftSplit(ctx, mDpy);
const uint32_t dstWidth = dst.right - dst.left;
const uint32_t dstHeight = dst.bottom - dst.top;
const uint32_t cropWidth = has90Transform(layer) ? crop.bottom - crop.top :
uint32_t cropWidth = has90Transform(layer) ? crop.bottom - crop.top :
crop.right - crop.left;
const uint32_t cropHeight = has90Transform(layer) ? crop.right - crop.left :
uint32_t cropHeight = has90Transform(layer) ? crop.right - crop.left :
crop.bottom - crop.top;
//Approximation to actual clock, ignoring the common factors in pipe and
//mixer cases like line_time
const uint32_t layerClock = getLayerClock(dstWidth, dstHeight, cropHeight);
const uint32_t mixerClock = lSplit;
//TODO Even if a 4k video is going to be rot-downscaled to dimensions under
//pipe line length, we are still using 2 pipes. This is fine just because
//this is source split where destination doesn't matter. Evaluate later to
//see if going through all the calcs to save a pipe is worth it
const uint32_t downscale = getRotDownscale(ctx, layer);
if(downscale) {
cropWidth /= downscale;
cropHeight /= downscale;
}
if(dstWidth > mdpHw.getMaxPipeWidth() or
cropWidth > mdpHw.getMaxPipeWidth() or
(primarySplitAlways and