Merge "hwc: Add check for YUV formats in configRotator."
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index 893da72..ba46bf5 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -162,7 +162,7 @@
ret = true;
if(configMdp(ctx->mOverlay, parg, orient, sourceCrop, displayFrame,
NULL, mDest) < 0) {
- ALOGE("%s: ConfigMdp failed for low res", __FUNCTION__);
+ ALOGE("%s: configMdp failed for dpy %d", __FUNCTION__, mDpy);
ret = false;
}
}
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 22d9042..4dbc3fc 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -515,9 +515,10 @@
/* Checks for conditions where YUV layers cannot be bypassed */
bool MDPComp::isYUVDoable(hwc_context_t* ctx, hwc_layer_1_t* layer) {
+ bool extAnimBlockFeature = mDpy && ctx->listStats[mDpy].isDisplayAnimating;
- if(isSkipLayer(layer) && mDpy == HWC_DISPLAY_PRIMARY) {
- ALOGE("%s: Unable to bypass skipped YUV", __FUNCTION__);
+ if(isSkipLayer(layer) && !extAnimBlockFeature) {
+ ALOGD_IF(isDebug(), "%s: Video marked SKIP dpy %d", __FUNCTION__, mDpy);
return false;
}
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index cc0be09..16c2c8f 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -378,7 +378,8 @@
ctx->listStats[dpy].yuvIndices[yuvCount] = i;
yuvCount++;
- if(layer->transform & HWC_TRANSFORM_ROT_90) {
+ if((layer->transform & HWC_TRANSFORM_ROT_90) &&
+ canUseRotator(ctx)) {
if(ctx->mOverlay->isPipeTypeAttached(OV_MDP_PIPE_DMA)) {
ctx->isPaddingRound = true;
}
@@ -432,7 +433,7 @@
}
-static inline void calc_cut(float& leftCutRatio, float& topCutRatio,
+static void calc_cut(float& leftCutRatio, float& topCutRatio,
float& rightCutRatio, float& bottomCutRatio, int orient) {
if(orient & HAL_TRANSFORM_FLIP_H) {
swap(leftCutRatio, rightCutRatio);
@@ -749,7 +750,7 @@
}
}
-inline int configRotator(Rotator *rot, const Whf& whf,
+int configRotator(Rotator *rot, const Whf& whf,
hwc_rect_t& crop, const eMdpFlags& mdpFlags,
const eTransform& orient, const int& downscale) {
@@ -776,7 +777,7 @@
return 0;
}
-inline int configMdp(Overlay *ov, const PipeArgs& parg,
+int configMdp(Overlay *ov, const PipeArgs& parg,
const eTransform& orient, const hwc_rect_t& crop,
const hwc_rect_t& pos, const MetaData_t *metadata,
const eDest& dest) {
@@ -802,7 +803,7 @@
return 0;
}
-inline void updateSource(eTransform& orient, Whf& whf,
+void updateSource(eTransform& orient, Whf& whf,
hwc_rect_t& crop) {
Dim srcCrop(crop.left, crop.top,
crop.right - crop.left,
@@ -1059,4 +1060,14 @@
return 0;
}
+bool canUseRotator(hwc_context_t *ctx) {
+ if(qdutils::MDPVersion::getInstance().is8x26() &&
+ ctx->mExtDisplay->isExternalConnected()) {
+ return false;
+ }
+ if(ctx->mMDP.version == qdutils::MDP_V3_0_4)
+ return false;
+ return true;
+}
+
};//namespace qhwc
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index ccef284..40bf352 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -173,8 +173,6 @@
void updateSource(ovutils::eTransform& orient, ovutils::Whf& whf,
hwc_rect_t& crop);
-
-
//Routine to configure low resolution panels (<= 2048 width)
int configureLowRes(hwc_context_t *ctx, hwc_layer_1_t *layer, const int& dpy,
ovutils::eMdpFlags& mdpFlags, ovutils::eZorder& z,
@@ -187,6 +185,14 @@
ovutils::eIsFg& isFg, const ovutils::eDest& lDest,
const ovutils::eDest& rDest, overlay::Rotator **rot);
+//On certain targets DMA pipes are used for rotation and they won't be available
+//for line operations. On a per-target basis we can restrict certain use cases
+//from using rotator, since we know before-hand that such scenarios can lead to
+//extreme unavailability of pipes. This can also be done via hybrid calculations
+//also involving many more variables like number of write-back interfaces etc,
+//but the variety of scenarios is too high to warrant that.
+bool canUseRotator(hwc_context_t *ctx);
+
// Inline utility functions
static inline bool isSkipLayer(const hwc_layer_1_t* l) {
return (UNLIKELY(l && (l->flags & HWC_SKIP_LAYER)));
diff --git a/libqdutils/mdp_version.cpp b/libqdutils/mdp_version.cpp
index e328d23..cac6b1d 100644
--- a/libqdutils/mdp_version.cpp
+++ b/libqdutils/mdp_version.cpp
@@ -130,5 +130,10 @@
// BWC - Bandwidth Compression
return (mFeatures & MDP_BWC_EN);
}
+
+bool MDPVersion::is8x26() {
+ return mMdpRev == MDSS_MDP_HW_REV_101;
+}
+
}; //namespace qdutils
diff --git a/libqdutils/mdp_version.h b/libqdutils/mdp_version.h
index c34c0a4..f7b16fa 100644
--- a/libqdutils/mdp_version.h
+++ b/libqdutils/mdp_version.h
@@ -53,6 +53,12 @@
MDSS_V5 = 500,
};
+enum mdp_rev {
+ MDSS_MDP_HW_REV_100 = 0x10000000,
+ MDSS_MDP_HW_REV_101 = 0x10010000, //8x26
+ MDSS_MDP_HW_REV_102 = 0x10020000,
+};
+
enum {
MAX_DISPLAY_DIM = 2048,
};
@@ -84,6 +90,7 @@
bool supportsDecimation();
uint32_t getMaxMDPDownscale();
bool supportsBWC();
+ bool is8x26();
private:
int mMDPVersion;
char mPanelType;