hwc: Fix src split bugs
--In "always_split" mode, split FB only if the updated portion of
FB's width is less than mixer width
--While deciding whether or not to allocate the 2nd pipe, account
for 90 transform in crop width
--Crop minimum width limitation of at least 5 pixels does not apply
to targets after 8974 v2.
Change-Id: I83b4690216a75c0d57e7e4e7b18b4531bb22df05
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index 7839139..e567e18 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -514,12 +514,13 @@
based on an empirically derived value of panel height.
*/
- bool primarySplitAlways = (mDpy == HWC_DISPLAY_PRIMARY) and
+ const bool primarySplitAlways = (mDpy == HWC_DISPLAY_PRIMARY) and
qdutils::MDPVersion::getInstance().isSrcSplitAlways();
+ const uint32_t lSplit = getLeftSplit(ctx, mDpy);
+ const uint32_t cropWidth = sourceCrop.right - sourceCrop.left;
- if(((sourceCrop.right - sourceCrop.left) >
- (int)qdutils::MDPVersion::getInstance().getMaxMixerWidth()) or
- primarySplitAlways) {
+ if((cropWidth > qdutils::MDPVersion::getInstance().getMaxMixerWidth()) or
+ (primarySplitAlways and cropWidth > lSplit)) {
destR = ov.getPipe(pipeSpecs);
if(destR == ovutils::OV_INVALID) {
ALOGE("%s: No pipes available to configure fb for dpy %d's right"