From 25297cbe9b79ad3ab093ed62f87ae8a8bda1ecff Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Wed, 11 Jan 2012 12:30:27 +0530 Subject: [PATCH] display: Fix blending on MDP 3.0 Assign the correct blending value for MDP 3.0, earlier it was incorrectly assigned to zero for cases where blending was not needed. Change-Id: Icec6541616c8a9dc6ffc0e99c5b2936389799656 --- libcopybit/copybit.cpp | 2 +- libhwcomposer/hwcomposer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libcopybit/copybit.cpp b/libcopybit/copybit.cpp index 42378ea..1b3436b 100644 --- a/libcopybit/copybit.cpp +++ b/libcopybit/copybit.cpp @@ -285,7 +285,7 @@ static int set_parameter_copybit( } break; case COPYBIT_PLANE_ALPHA: - if (value < 0) value = 0; + if (value < 0) value = MDP_ALPHA_NOP; if (value >= 256) value = 255; ctx->mAlpha = value; break; diff --git a/libhwcomposer/hwcomposer.cpp b/libhwcomposer/hwcomposer.cpp index e261911..822d64e 100755 --- a/libhwcomposer/hwcomposer.cpp +++ b/libhwcomposer/hwcomposer.cpp @@ -1069,7 +1069,7 @@ static int drawLayerUsingCopybit(hwc_composer_device_t *dev, hwc_layer_t *layer, copybit->set_parameter(copybit, COPYBIT_FRAMEBUFFER_HEIGHT, renderBuffer->height); copybit->set_parameter(copybit, COPYBIT_TRANSFORM, layer->transform); copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, - (layer->blending == HWC_BLENDING_NONE) ? 0x0 : layer->alpha); + (layer->blending == HWC_BLENDING_NONE) ? -1 : layer->alpha); copybit->set_parameter(copybit, COPYBIT_PREMULTIPLIED_ALPHA, (layer->blending == HWC_BLENDING_PREMULT)? COPYBIT_ENABLE : COPYBIT_DISABLE); err = copybit->stretch(copybit, &dst, &src, &dstRect, &srcRect, ©bitRegion);