summaryrefslogtreecommitdiff
path: root/libhwc2.1/libresource
diff options
context:
space:
mode:
authorHyunKyung Kim <hk310.kim@samsung.com>2020-11-13 11:02:26 +0900
committerLong Ling <longling@google.com>2021-01-08 13:30:28 -0800
commitec3d265354fff64d31c426b5e40fcb81d11e68a1 (patch)
treea770bcb13c629ac78af8a5bc403829a03503a001 /libhwc2.1/libresource
parentcc76561d55ef57a1230697393a8d10a9acfdde34 (diff)
downloadgs101-ec3d265354fff64d31c426b5e40fcb81d11e68a1.tar.gz
libhwc2.1: Set layer color data only if conversion is required
There was issue that color space conversion was applied twice by G2D and DPP when both IPs are used for one layer. HWC decides who should convert color space with dataSpace setting in mSrcImg, mMidImg and mDstImg of layer. DPP converts color space when mSrcImg.dataSpace, mMidImg.dataSpace are same, mMidImg.dataSpace, mDstImg.dataSpace are different. G2D converts color space when mSrcImg.dataSpace, mMidImg.dataSpace are different, mMidImg.dataSpace, mDstImg.dataSpace are same. Signed-off-by: HyunKyung Kim <hk310.kim@samsung.com> Change-Id: I485120adf6612f6d20b5be7719fa8e56833ceecb
Diffstat (limited to 'libhwc2.1/libresource')
-rw-r--r--libhwc2.1/libresource/ExynosMPPModule.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/libhwc2.1/libresource/ExynosMPPModule.cpp b/libhwc2.1/libresource/ExynosMPPModule.cpp
index 74680e6..504c02d 100644
--- a/libhwc2.1/libresource/ExynosMPPModule.cpp
+++ b/libhwc2.1/libresource/ExynosMPPModule.cpp
@@ -52,18 +52,25 @@ int32_t ExynosMPPModule::setColorConversionInfo()
(ExynosPrimaryDisplayModule*)mAssignedDisplay;
for (size_t i = 0; i < mAssignedSources.size(); i++) {
- ExynosLayer* layer = (ExynosLayer*)mAssignedSources[i];
+ auto mppSource = mAssignedSources[i];
+ ExynosLayer* layer = (ExynosLayer*)mppSource;
AcrylicLayer* mppLayer = mSrcImgs[i].mppLayer;
- if (mppLayer == nullptr) {
- MPP_LOGE("%s: src[%zu] mppLayer is null", __func__, i);
+ if ((mppSource == nullptr) || (layer == nullptr) ||
+ (mppLayer == nullptr)) {
+ MPP_LOGE("%s: src[%zu] source layer is null", __func__, i);
return -EINVAL;
}
+ if (mppSource->mSrcImg.dataSpace == mppSource->mMidImg.dataSpace) {
+ //set null layer data to acryl
+ mppLayer->setLayerData(nullptr, 0);
+ continue;
+ }
if (primaryDisplay->hasDppForLayer(layer) == false) {
MPP_LOGE("%s: src[%zu] need color conversion but there is no IDpp", __func__, i);
return -EINVAL;
}
MPP_LOGD(eDebugColorManagement,
- "%s, src: 0x%8x", __func__, layer->mSrcImg.dataSpace);
+ "%s, src: 0x%8x", __func__, mppSource->mSrcImg.dataSpace);
const IDisplayColorGS101::IDpp& dpp =
primaryDisplay->getDppForLayer(layer);
mppLayer->setLayerData((void *)&dpp,