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/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index d2104ed..68461c7 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -238,6 +238,14 @@
ctx->mBufferMirrorMode = false;
ctx->mVPUClient = NULL;
+ // Read the system property to determine if downscale feature is enabled.
+ ctx->mMDPDownscaleEnabled = false;
+ char value[PROPERTY_VALUE_MAX];
+ if(property_get("sys.hwc.mdp_downscale_enabled", value, "false")
+ && !strcmp(value, "true")) {
+ ctx->mMDPDownscaleEnabled = true;
+ }
+
#ifdef VPU_TARGET
if(qdutils::MDPVersion::getInstance().is8092())
ctx->mVPUClient = new VPUClient(ctx);