Merge "hwc: disable MDP composition on Secondary display"
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 8500bac..e84b345 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -541,6 +541,7 @@
hwc_display_contents_1_t* list){
const int numAppLayers = ctx->listStats[mDpy].numAppLayers;
+ int priDispW = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
if(sIdleFallBack && !ctx->listStats[mDpy].secureUI) {
ALOGD_IF(isDebug(), "%s: Idle fallback dpy %d",__FUNCTION__, mDpy);
@@ -554,6 +555,17 @@
return false;
}
+ if(mDpy > HWC_DISPLAY_PRIMARY && (priDispW > MAX_DISPLAY_DIM) &&
+ (ctx->dpyAttr[mDpy].xres < MAX_DISPLAY_DIM)) {
+ // Disable MDP comp on Secondary when the primary is highres panel and
+ // the secondary is a normal 1080p, because, MDP comp on secondary under
+ // in such usecase, decimation gets used for downscale and there will be
+ // a quality mismatch when there will be a fallback to GPU comp
+ ALOGD_IF(isDebug(), "%s: Disable MDP Compositon for Secondary Disp",
+ __FUNCTION__);
+ return false;
+ }
+
// check for action safe flag and downscale mode which requires scaling.
if(ctx->dpyAttr[mDpy].mActionSafePresent
|| ctx->dpyAttr[mDpy].mDownScaleMode) {