diff options
author | Saadi Maalem <saadi.maalem@intel.com> | 2015-08-19 23:10:33 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-19 23:10:33 +0000 |
commit | 126cf478969961ce64d064aa8bddb2a72335c0d5 (patch) | |
tree | 94dc1aa44d49d81def5009f31ae00d00fa616146 | |
parent | a6aa7047e527d469977d7e303736f7f9eb9874b5 (diff) | |
parent | 219b6962f08cc66bd6227f4647388c26f486a4dd (diff) | |
download | android_hardware_intel_img_hwcomposer-126cf478969961ce64d064aa8bddb2a72335c0d5.tar.gz android_hardware_intel_img_hwcomposer-126cf478969961ce64d064aa8bddb2a72335c0d5.tar.bz2 android_hardware_intel_img_hwcomposer-126cf478969961ce64d064aa8bddb2a72335c0d5.zip |
am 219b6962: Display: power consumption saving
* commit '219b6962f08cc66bd6227f4647388c26f486a4dd':
Display: power consumption saving
-rw-r--r-- | merrifield/common/devices/PhysicalDevice.cpp | 24 |
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() |