summaryrefslogtreecommitdiffstats
path: root/include/hardware/hwcomposer.h
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@google.com>2014-06-12 17:19:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-06-10 21:44:22 +0000
commit0f0b6d5ccb65f69c775accd2c2eada79c369c456 (patch)
treead6a8fa1f6a00747579db9c2affef44e6992e784 /include/hardware/hwcomposer.h
parent460343a1b57ff372887b76a718e8e8ca89f29c88 (diff)
parent02b31986cba2cd1612155a1bb72d0fb17b55b219 (diff)
downloadhardware_libhardware-0f0b6d5ccb65f69c775accd2c2eada79c369c456.zip
hardware_libhardware-0f0b6d5ccb65f69c775accd2c2eada79c369c456.tar.gz
hardware_libhardware-0f0b6d5ccb65f69c775accd2c2eada79c369c456.tar.bz2
Merge "hwcomposer: Add function pointer for setPowerMode() callback"
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 fa772d6..f647ab3 100644
--- a/include/hardware/hwcomposer.h
+++ b/include/hardware/hwcomposer.h
@@ -595,18 +595,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