hwc: Don't permit rotator use under certain conditions
These include constrained targets, with external connected which could
lead to a scarcity of pipes. Furthermore owing to a scarcity of writeback
interfaces, even if pipes are available, we may not be able to still
use rotator.
Change-Id: Ie2fb4c1726f32addcace89c268a126abe0cddbe0
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 05bdfb9..5663ee0 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -382,7 +382,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;
}
@@ -436,7 +437,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);
@@ -753,7 +754,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) {
@@ -778,7 +779,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) {
@@ -804,7 +805,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,12 @@
return 0;
}
+bool canUseRotator(hwc_context_t *ctx) {
+ if(qdutils::MDPVersion::getInstance().is8x26() &&
+ ctx->mExtDisplay->isExternalConnected()) {
+ return false;
+ }
+ return true;
+}
+
};//namespace qhwc