hwc: Enable downscale feature through system property
Add support to turn the MDP downscale feature ON through the
use of a system property. 'sys.hwc.mdp_downscale_enabled' shall be
set to 'true' in build.prop file to enable this functionality.
This is required for OEMs that might have privacy concerns over panel
size information being exposed.
Change-Id: I354b25b1fdabe5786aed7552f2afccda35412467
diff --git a/libvirtual/virtual.cpp b/libvirtual/virtual.cpp
index 795d8a1..7d8b942 100644
--- a/libvirtual/virtual.cpp
+++ b/libvirtual/virtual.cpp
@@ -167,7 +167,13 @@
initResolution(extW, extH);
- if(!qdutils::MDPVersion::getInstance().is8x26()) {
+ // Dynamic Resolution Change depends on MDP downscaling.
+ // MDP downscale property will be ignored to exercise DRC use case.
+ // If DRC is in progress, ext WxH will have non-zero values.
+ bool isDRC = (extW > 0) && (extH > 0);
+
+ if(!qdutils::MDPVersion::getInstance().is8x26()
+ && (mHwcContext->mMDPDownscaleEnabled || isDRC)) {
// maxArea represents the maximum resolution between
// primary and virtual display.