hwc: Add support for plane alpha

HWC 1.2 API passes down the plane alpha and the blending
operation to apply. Pass this information to the MDP.

Change-Id: I7fbd17345d9157aa654e4b1031ac3e26adf87f37
This commit is contained in:
Naseer Ahmed
2013-03-18 20:14:05 -04:00
committed by Gerrit - the friendly Code Review server
parent e36a9c2f1a
commit 522ce66a3e
7 changed files with 87 additions and 14 deletions

View File

@@ -545,6 +545,18 @@ bool isSecureModePolicy(int mdpVersion) {
return false;
}
int getBlending(int blending) {
switch(blending) {
case HWC_BLENDING_NONE:
return overlay::utils::OVERLAY_BLENDING_OPAQUE;
case HWC_BLENDING_PREMULT:
return overlay::utils::OVERLAY_BLENDING_PREMULT;
case HWC_BLENDING_COVERAGE :
default:
return overlay::utils::OVERLAY_BLENDING_COVERAGE;
}
}
//Crops source buffer against destination and FB boundaries
void calculate_crop_rects(hwc_rect_t& crop, hwc_rect_t& dst,
const hwc_rect_t& scissor, int orient) {
@@ -1035,7 +1047,10 @@ int configureLowRes(hwc_context_t *ctx, hwc_layer_1_t *layer,
//For the mdp, since either we are pre-rotating or MDP does flips
orient = OVERLAY_TRANSFORM_0;
transform = 0;
PipeArgs parg(mdpFlags, whf, z, isFg, static_cast<eRotFlags>(rotFlags));
PipeArgs parg(mdpFlags, whf, z, isFg,
static_cast<eRotFlags>(rotFlags), layer->planeAlpha,
(ovutils::eBlending) getBlending(layer->blending));
if(configMdp(ctx->mOverlay, parg, orient, crop, dst, metadata, dest) < 0) {
ALOGE("%s: commit failed for low res panel", __FUNCTION__);
return -1;
@@ -1164,7 +1179,9 @@ int configureHighRes(hwc_context_t *ctx, hwc_layer_1_t *layer,
//configure left mixer
if(lDest != OV_INVALID) {
PipeArgs pargL(mdpFlagsL, whf, z, isFg,
static_cast<eRotFlags>(rotFlags));
static_cast<eRotFlags>(rotFlags), layer->planeAlpha,
(ovutils::eBlending) getBlending(layer->blending));
if(configMdp(ctx->mOverlay, pargL, orient,
tmp_cropL, tmp_dstL, metadata, lDest) < 0) {
ALOGE("%s: commit failed for left mixer config", __FUNCTION__);
@@ -1175,7 +1192,9 @@ int configureHighRes(hwc_context_t *ctx, hwc_layer_1_t *layer,
//configure right mixer
if(rDest != OV_INVALID) {
PipeArgs pargR(mdpFlagsR, whf, z, isFg,
static_cast<eRotFlags>(rotFlags));
static_cast<eRotFlags>(rotFlags),
layer->planeAlpha,
(ovutils::eBlending) getBlending(layer->blending));
tmp_dstR.right = tmp_dstR.right - lSplit;
tmp_dstR.left = tmp_dstR.left - lSplit;
if(configMdp(ctx->mOverlay, pargR, orient,