summaryrefslogtreecommitdiffstats
path: root/include/hardware/hwcomposer.h
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2014-05-06 15:56:59 -0700
committerMichael Lentine <mlentine@google.com>2014-07-14 14:09:13 -0700
commite83d10c1fc61ac7921d58d8818a9ad4926a207ad (patch)
treeaaebebd6119dca731b253ed456bb2c6b0293a1a0 /include/hardware/hwcomposer.h
parent549e6be33d9e87408260b53d8bdc1019ac92101f (diff)
downloadhardware_libhardware-e83d10c1fc61ac7921d58d8818a9ad4926a207ad.zip
hardware_libhardware-e83d10c1fc61ac7921d58d8818a9ad4926a207ad.tar.gz
hardware_libhardware-e83d10c1fc61ac7921d58d8818a9ad4926a207ad.tar.bz2
hwcomposer: Allow display configuration selection
Adds two functions to the HWC interface: one for querying the current display configuration, and one for setting a new configuration. This will enable DisplayManager to change the mode on demand. Bug: 14320401 Change-Id: I556c509192b877b38b2103a78f937b3687f35546
Diffstat (limited to 'include/hardware/hwcomposer.h')
-rw-r--r--include/hardware/hwcomposer.h65
1 files changed, 54 insertions, 11 deletions
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h
index f647ab3..882bade 100644
--- a/include/hardware/hwcomposer.h
+++ b/include/hardware/hwcomposer.h
@@ -678,16 +678,24 @@ typedef struct hwc_composer_device_1 {
* total number of configurations available for the display is returned in
* *numConfigs. If *numConfigs is zero on entry, then configs may be NULL.
*
- * HWC_DEVICE_API_VERSION_1_1 does not provide a way to choose a config.
- * For displays that support multiple configurations, the h/w composer
- * implementation should choose one and report it as the first config in
- * the list. Reporting the not-chosen configs is not required.
- *
- * Returns 0 on success or -errno on error. If disp is a hotpluggable
- * display type and no display is connected, an error should be returned.
+ * Hardware composers implementing HWC_DEVICE_API_VERSION_1_3 or prior
+ * shall choose one configuration to activate and report it as the first
+ * entry in the returned list. Reporting the inactive configurations is not
+ * required.
+ *
+ * HWC_DEVICE_API_VERSION_1_4 and later provide configuration management
+ * through SurfaceFlinger, and hardware composers implementing these APIs
+ * must also provide getActiveConfig and setActiveConfig. Hardware composers
+ * implementing these API versions may choose not to activate any
+ * configuration, leaving configuration selection to higher levels of the
+ * framework.
+ *
+ * Returns 0 on success or a negative error code on error. If disp is a
+ * hotpluggable display type and no display is connected, an error shall be
+ * returned.
*
* This field is REQUIRED for HWC_DEVICE_API_VERSION_1_1 and later.
- * It should be NULL for previous versions.
+ * It shall be NULL for previous versions.
*/
int (*getDisplayConfigs)(struct hwc_composer_device_1* dev, int disp,
uint32_t* configs, size_t* numConfigs);
@@ -704,19 +712,54 @@ typedef struct hwc_composer_device_1 {
* array will have one less value than the attributes array.
*
* This field is REQUIRED for HWC_DEVICE_API_VERSION_1_1 and later.
- * It should be NULL for previous versions.
+ * It shall be NULL for previous versions.
*
* If disp is a hotpluggable display type and no display is connected,
* or if config is not a valid configuration for the display, a negative
- * value should be returned.
+ * error code shall be returned.
*/
int (*getDisplayAttributes)(struct hwc_composer_device_1* dev, int disp,
uint32_t config, const uint32_t* attributes, int32_t* values);
/*
+ * (*getActiveConfig)() returns the index of the configuration that is
+ * currently active on the connected display. The index is relative to
+ * the list of configuration handles returned by getDisplayConfigs. If there
+ * is no active configuration, -1 shall be returned.
+ *
+ * Returns the configuration index on success or -1 on error.
+ *
+ * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_4 and later.
+ * It shall be NULL for previous versions.
+ */
+ int (*getActiveConfig)(struct hwc_composer_device_1* dev, int disp);
+
+ /*
+ * (*setActiveConfig)() instructs the hardware composer to switch to the
+ * display configuration at the given index in the list of configuration
+ * handles returned by getDisplayConfigs.
+ *
+ * If this function returns without error, any subsequent calls to
+ * getActiveConfig shall return the index set by this function until one
+ * of the following occurs:
+ * 1) Another successful call of this function
+ * 2) The display is disconnected
+ *
+ * Returns 0 on success or a negative error code on error. If disp is a
+ * hotpluggable display type and no display is connected, or if index is
+ * outside of the range of hardware configurations returned by
+ * getDisplayConfigs, an error shall be returned.
+ *
+ * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_4 and later.
+ * It shall be NULL for previous versions.
+ */
+ int (*setActiveConfig)(struct hwc_composer_device_1* dev, int disp,
+ int index);
+
+ /*
* Reserved for future use. Must be NULL.
*/
- void* reserved_proc[4];
+ void* reserved_proc[2];
} hwc_composer_device_1_t;