hwc: Reset FB Z order to -1 instead of 0
In Video-only mode FB Z-order of 0 was being used, incorrectly,
because the value was reset to 0 and wasn't changed subsequently.
Reset to -1 to prevent this. Any MDP comp strategy that needs to use
FB should set it's Z order appropriately.
If cache based mode has no MDP comp layers, fail so that other
strategies can be used, rather than succeeding with FB Z as 0, which
will at most allow GPU comp to be used.
Change-Id: Ifdae2cd5f8d8ff0e10447b1fed6ee1671260f311
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index dbd05ae..0a77d6a 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -233,7 +233,7 @@
fbCount = numLayers;
mdpCount = 0;
needsRedraw = true;
- fbZ = 0;
+ fbZ = -1;
}
void MDPComp::FrameInfo::map() {
@@ -637,7 +637,6 @@
}
mCurrentFrame.fbCount = 0;
- mCurrentFrame.fbZ = -1;
memcpy(&mCurrentFrame.isFBComposed, &mCurrentFrame.drop,
sizeof(mCurrentFrame.isFBComposed));
mCurrentFrame.mdpCount = mCurrentFrame.layerCount - mCurrentFrame.fbCount -
@@ -1128,14 +1127,14 @@
int maxBatchCount = 0;
int fbZ = -1;
- /* All or Nothing is cached. No batching needed */
- if(!mCurrentFrame.fbCount) {
- mCurrentFrame.fbZ = -1;
+ /* Nothing is cached. No batching needed */
+ if(mCurrentFrame.fbCount == 0) {
return true;
}
- if(!mCurrentFrame.mdpCount) {
- mCurrentFrame.fbZ = 0;
- return true;
+
+ /* No MDP comp layers, try to use other comp modes */
+ if(mCurrentFrame.mdpCount == 0) {
+ return false;
}
fbZ = getBatch(list, maxBatchStart, maxBatchEnd, maxBatchCount);