From 2c9b11f0291210c9b9513a1a0cce6afebd361b3b Mon Sep 17 00:00:00 2001 From: Prashant Malani Date: Sun, 25 May 2014 01:36:31 -0700 Subject: surfaceflinger: Replace blank/unblank with setPowerMode We replace the blank/unblank calls in surfaceFlinger with a more generic setPowerMode() routine. Some displays support different power modes (for example, with reduced color palettes). Depending on the use case we should be able to toggle these modes, so as to achieve incremental power savings. Initially, three power modes will be supported: - HWC_POWER_MODE_OFF - HWC_POWER_MODE_DOZE - HWC_POWER_MODE_NORMAL HWC_POWER_MODE_OFF will correspond to blanking the display, while HWC_POWER_MODE_NORMAL will correspond to unblanking. HWC_POWER_MODE_DOZE will put the display into a low power setting, if it is supported in hardware. If such a low power mode is not supported, it should be treated as a call to set the mode to HWC_POWER_MODE_NORMAL. As a consequence of adding the mPowerMode field, the mScreenAcquired is no longer required, and thus references to it are removed and replaced equivalent references to mPowerMode. We also add the glue code to connect the services invocation of setting a power mode and the HAL implementation in HWComposer. Bug: 13472578 Change-Id: I431595ecf16d2f2c94259272db3dd42f29636204 Signed-off-by: Prashant Malani --- libs/gui/SurfaceComposerClient.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'libs/gui/SurfaceComposerClient.cpp') diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index eedeca18d1..3bee3fc6e9 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -655,12 +655,9 @@ status_t SurfaceComposerClient::setActiveConfig(const sp& display, int return ComposerService::getComposerService()->setActiveConfig(display, id); } -void SurfaceComposerClient::blankDisplay(const sp& token) { - ComposerService::getComposerService()->blank(token); -} - -void SurfaceComposerClient::unblankDisplay(const sp& token) { - ComposerService::getComposerService()->unblank(token); +void SurfaceComposerClient::setDisplayPowerMode(const sp& token, + int mode) { + ComposerService::getComposerService()->setPowerMode(token, mode); } status_t SurfaceComposerClient::clearAnimationFrameStats() { -- cgit v1.2.3-59-g8ed1b