summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaadi Maalem <saadi.maalem@intel.com>2015-07-13 15:54:07 +0800
committerZhengyin Qian <qianzy@google.com>2015-08-13 19:42:47 -0700
commit219b6962f08cc66bd6227f4647388c26f486a4dd (patch)
tree044101965185aa003bbf24b260742559fb8b8203
parent040739aeaee679e4a570d51d8c081c61b7da3271 (diff)
downloadandroid_hardware_intel_img_hwcomposer-219b6962f08cc66bd6227f4647388c26f486a4dd.tar.gz
android_hardware_intel_img_hwcomposer-219b6962f08cc66bd6227f4647388c26f486a4dd.tar.bz2
android_hardware_intel_img_hwcomposer-219b6962f08cc66bd6227f4647388c26f486a4dd.zip
Display: power consumption saving
JIRA: MARVIN-142 implement hwc setPowerMode for display power saving. Change-Id: Ia7c5d3da733f674cbb977fc443cd17c0cf81a2f8 Signed-off-by: Sophia Gong <sophia.gong@intel.com> Reviewed-on: https://android.intel.com/386435 Tested-by: Ledentec, AlexandreX <alexandrex.ledentec@intel.com> Reviewed-by: Maalem, Saadi <saadi.maalem@intel.com>
-rw-r--r--merrifield/common/devices/PhysicalDevice.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/merrifield/common/devices/PhysicalDevice.cpp b/merrifield/common/devices/PhysicalDevice.cpp
index dc72a00..601b63e 100644
--- a/merrifield/common/devices/PhysicalDevice.cpp
+++ b/merrifield/common/devices/PhysicalDevice.cpp
@@ -511,18 +511,20 @@ void PhysicalDevice::dump(Dump& d)
bool PhysicalDevice::setPowerMode(int mode)
{
- // TODO: set proper blanking modes for HWC 1.4 modes
- switch (mode) {
- case HWC_POWER_MODE_OFF:
- return blank(true);
- case HWC_POWER_MODE_DOZE:
- case HWC_POWER_MODE_NORMAL:
- case HWC_POWER_MODE_DOZE_SUSPEND:
- return blank(false);
- default:
- return false;
+ // TODO: set proper power modes for HWC 1.4
+ ATRACE("mode = %d", mode);
+
+ bool ret;
+ int arg = mode;
+
+ Drm *drm = Hwcomposer::getInstance().getDrm();
+ ret = drm->writeIoctl(DRM_PSB_PM_SET, &arg, sizeof(arg));
+ if (ret == false) {
+ ETRACE("psb power mode set fail");
+ return false;
}
- return false;
+
+ return true;
}
int PhysicalDevice::getActiveConfig()