summaryrefslogtreecommitdiffstats
path: root/include/hardware/hwcomposer.h
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@google.com>2014-05-25 20:41:20 -0700
committerPrashant Malani <pmalani@google.com>2014-06-12 17:11:03 +0000
commit02b31986cba2cd1612155a1bb72d0fb17b55b219 (patch)
treeb2d681aaa7fa24c0c5ff2955865d0fae38ddac47 /include/hardware/hwcomposer.h
parent5fa7fb99b087a4959479728a86d355f9fa8bb1e3 (diff)
downloadhardware_libhardware-02b31986cba2cd1612155a1bb72d0fb17b55b219.zip
hardware_libhardware-02b31986cba2cd1612155a1bb72d0fb17b55b219.tar.gz
hardware_libhardware-02b31986cba2cd1612155a1bb72d0fb17b55b219.tar.bz2
hwcomposer: Add function pointer for setPowerMode() callback
The blank HWC call is being replaced by a setPowerMode() call. This incorporates all of the blank functionality, but provides added support for display low power modes, if they are available in hardware. Currently there are three supported modes: - HWC_POWER_MODE_OFF : Turn screen off. - HWC_POWER_MODE_DOZE : Put screen in low power mode. - HWC_POWER_MODE_NORMAL : Turn screen on, and exit low power mode (if display was previously in low power mode). Where applicable, the device driver is expected to retain and restore the low power mode state of the display during entry and exit from suspend, respectively. Bug: 13472578 Change-Id: I743ea3a2cb58247d14d7c47158b09a5309cca710 Signed-off-by: Prashant Malani <pmalani@google.com>
Diffstat (limited to 'include/hardware/hwcomposer.h')
-rw-r--r--include/hardware/hwcomposer.h59
1 files changed, 47 insertions, 12 deletions
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h
index 049edea..67dc3c7 100644
--- a/include/hardware/hwcomposer.h
+++ b/include/hardware/hwcomposer.h
@@ -586,18 +586,53 @@ typedef struct hwc_composer_device_1 {
int (*eventControl)(struct hwc_composer_device_1* dev, int disp,
int event, int enabled);
- /*
- * blank(..., blank)
- * Blanks or unblanks a display's screen.
- *
- * Turns the screen off when blank is nonzero, on when blank is zero.
- * Multiple sequential calls with the same blank value must be supported.
- * The screen state transition must be be complete when the function
- * returns.
- *
- * returns 0 on success, negative on error.
- */
- int (*blank)(struct hwc_composer_device_1* dev, int disp, int blank);
+ union {
+ /*
+ * For HWC 1.3 and earlier, the blank() interface is used.
+ *
+ * blank(..., blank)
+ * Blanks or unblanks a display's screen.
+ *
+ * Turns the screen off when blank is nonzero, on when blank is zero.
+ * Multiple sequential calls with the same blank value must be
+ * supported.
+ * The screen state transition must be be complete when the function
+ * returns.
+ *
+ * returns 0 on success, negative on error.
+ */
+ int (*blank)(struct hwc_composer_device_1* dev, int disp, int blank);
+
+ /*
+ * For HWC 1.4 and above, setPowerMode() will be used in place of
+ * blank().
+ *
+ * setPowerMode(..., mode)
+ * Sets the display screen's power state.
+ *
+ * The expected functionality for the various modes is as follows:
+ * HWC_POWER_MODE_OFF : Turn the display off.
+ * HWC_POWER_MODE_DOZE : Turn on the display (if it was previously
+ * off) and put the display in a low power mode.
+ * HWC_POWER_MODE_NORMAL : Turn on the display (if it was previously
+ * off), and take it out of low power mode.
+ *
+ * The functionality is similar to the blank() command in previous
+ * versions of HWC, but with support for more power states.
+ *
+ * The display driver is expected to retain and restore the low power
+ * state of the display while entering and exiting from suspend.
+ *
+ * Multiple sequential calls with the same mode value must be supported.
+ *
+ * The screen state transition must be be complete when the function
+ * returns.
+ *
+ * returns 0 on success, negative on error.
+ */
+ int (*setPowerMode)(struct hwc_composer_device_1* dev, int disp,
+ int mode);
+ };
/*
* Used to retrieve information about the h/w composer