diff options
author | Prashant Malani <pmalani@google.com> | 2014-05-25 01:36:31 -0700 |
---|---|---|
committer | Prashant Malani <pmalani@google.com> | 2014-06-05 16:35:52 -0700 |
commit | 2c9b11f0291210c9b9513a1a0cce6afebd361b3b (patch) | |
tree | 47ba276853c591e558553ee5e0eefabbc7db4625 /include/gui | |
parent | edcf7f4d3ac452500d68e254d367f559d538695d (diff) | |
download | frameworks_native-2c9b11f0291210c9b9513a1a0cce6afebd361b3b.zip frameworks_native-2c9b11f0291210c9b9513a1a0cce6afebd361b3b.tar.gz frameworks_native-2c9b11f0291210c9b9513a1a0cce6afebd361b3b.tar.bz2 |
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 <pmalani@google.com>
Diffstat (limited to 'include/gui')
-rw-r--r-- | include/gui/ISurfaceComposer.h | 15 | ||||
-rw-r--r-- | include/gui/SurfaceComposerClient.h | 7 |
2 files changed, 7 insertions, 15 deletions
diff --git a/include/gui/ISurfaceComposer.h b/include/gui/ISurfaceComposer.h index 1581084..9f1937b 100644 --- a/include/gui/ISurfaceComposer.h +++ b/include/gui/ISurfaceComposer.h @@ -104,15 +104,11 @@ public: virtual bool authenticateSurfaceTexture( const sp<IGraphicBufferProducer>& surface) const = 0; - /* triggers screen off and waits for it to complete + /* set display power mode. depending on the mode, it can either trigger + * screen on, off or low power mode and wait for it to complete. * requires ACCESS_SURFACE_FLINGER permission. */ - virtual void blank(const sp<IBinder>& display) = 0; - - /* triggers screen on and waits for it to complete - * requires ACCESS_SURFACE_FLINGER permission. - */ - virtual void unblank(const sp<IBinder>& display) = 0; + virtual void setPowerMode(const sp<IBinder>& display, int mode) = 0; /* returns information for each configuration of the given display * intended to be used to get information about built-in displays */ @@ -165,15 +161,14 @@ public: GET_BUILT_IN_DISPLAY, SET_TRANSACTION_STATE, AUTHENTICATE_SURFACE, - BLANK, - UNBLANK, GET_DISPLAY_CONFIGS, GET_ACTIVE_CONFIG, SET_ACTIVE_CONFIG, CONNECT_DISPLAY, CAPTURE_SCREEN, CLEAR_ANIMATION_FRAME_STATS, - GET_ANIMATION_FRAME_STATS + GET_ANIMATION_FRAME_STATS, + SET_POWER_MODE, }; virtual status_t onTransact(uint32_t code, const Parcel& data, diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h index e666329..65313df 100644 --- a/include/gui/SurfaceComposerClient.h +++ b/include/gui/SurfaceComposerClient.h @@ -82,11 +82,8 @@ public: // returned by getDisplayInfo static status_t setActiveConfig(const sp<IBinder>& display, int id); - /* triggers screen off and waits for it to complete */ - static void blankDisplay(const sp<IBinder>& display); - - /* triggers screen on and waits for it to complete */ - static void unblankDisplay(const sp<IBinder>& display); + /* Triggers screen on/off or low power mode and waits for it to complete */ + static void setDisplayPowerMode(const sp<IBinder>& display, int mode); // ------------------------------------------------------------------------ // surface creation / destruction |