hwc: Modify MDPOnly composition to allow only secure RGB layers
MDPOnly composition needs to cater for the use case when we have
secure RGB layers that require MDP composition. For non-secure RGB
layers we can afford to send them for GPU composition. This is
especially needed for the following use case: full MDP composition
on primary (including YUV layers), followed by external connection.
For the mentioned use case, we need to fall back to Video and then
GPU composition in in order to reclaim pipe resources for external
usage.
Change-Id: I6da3ca48cf6e38e767fecfbfee6b06e82ba00a51
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index a5bf0b5..6336655 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2014, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2012-2015, The Linux Foundation. All rights reserved.
* Not a Contribution, Apache license notifications and license are retained
* for attribution purposes only.
*
@@ -1372,6 +1372,12 @@
}
}
+ /* Bail out if we dont have any secure RGB layers */
+ if (!ctx->listStats[mDpy].secureRGBCount) {
+ reset(ctx);
+ return false;
+ }
+
mCurrentFrame.reset(numAppLayers);
mCurrentFrame.fbCount -= mCurrentFrame.dropCount;