summaryrefslogtreecommitdiffstats
path: root/include/hardware/hwcomposer.h
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-09-06 16:57:12 -0700
committerJesse Hall <jessehall@google.com>2012-09-12 09:41:57 -0700
commit7cb03d79b3040d9b43ffc81414e9853e8a57adb1 (patch)
tree3c72f919c1081bf11009fa46b36bf446100225b4 /include/hardware/hwcomposer.h
parent5d85c537fcae931428ba8b7a47fdd393cc3cbd88 (diff)
downloadhardware_libhardware-7cb03d79b3040d9b43ffc81414e9853e8a57adb1.zip
hardware_libhardware-7cb03d79b3040d9b43ffc81414e9853e8a57adb1.tar.gz
hardware_libhardware-7cb03d79b3040d9b43ffc81414e9853e8a57adb1.tar.bz2
Add outbuf fields for HWC 1.2 virtual displays
Also rename HWC_DISPLAY_RESOLUTION_* to HWC_DISPLAY_WIDTH and HWC_DISPLAY_HEIGHT for consistency. Change-Id: Iabe6db0816f6f6eaaac24c3c9ae554177bcabf1d
Diffstat (limited to 'include/hardware/hwcomposer.h')
-rw-r--r--include/hardware/hwcomposer.h56
1 files changed, 41 insertions, 15 deletions
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h
index 0a4d40d..5488e75 100644
--- a/include/hardware/hwcomposer.h
+++ b/include/hardware/hwcomposer.h
@@ -222,23 +222,49 @@ enum {
*/
typedef struct hwc_display_contents_1 {
/* File descriptor referring to a Sync HAL fence object which will signal
- * when this display image is no longer visible, i.e. when the following
- * set() takes effect. The fence object is created and returned by the set
- * call; this field will be -1 on entry to prepare and set. SurfaceFlinger
- * will close the returned file descriptor.
+ * when this composition is retired. For a physical display, a composition
+ * is retired when it has been replaced on-screen by a subsequent set. For
+ * a virtual display, the composition is retired when the writes to
+ * outputBuffer are complete and can be read. The fence object is created
+ * and returned by the set call; this field will be -1 on entry to prepare
+ * and set. SurfaceFlinger will close the returned file descriptor.
*/
- int flipFenceFd;
+ int retireFenceFd;
- /* (dpy, sur) is the target of SurfaceFlinger's OpenGL ES composition for
- * HWC versions before HWC_DEVICE_VERSION_1_1. They aren't relevant to
- * prepare. The set call should commit this surface atomically to the
- * display along with any overlay layers.
- *
- * For HWC_DEVICE_VERSION_1_1 and later, these will always be set to
- * EGL_NO_DISPLAY and EGL_NO_SURFACE.
- */
- hwc_display_t dpy;
- hwc_surface_t sur;
+ union {
+ /* Fields only relevant for HWC_DEVICE_VERSION_1_0. */
+ struct {
+ /* (dpy, sur) is the target of SurfaceFlinger's OpenGL ES
+ * composition for HWC_DEVICE_VERSION_1_0. They aren't relevant to
+ * prepare. The set call should commit this surface atomically to
+ * the display along with any overlay layers.
+ */
+ hwc_display_t dpy;
+ hwc_surface_t sur;
+ };
+
+ /* Fields only relevant for HWC_DEVICE_VERSION_1_2 and later. */
+ struct {
+ /* outbuf is the buffer that receives the composed image for
+ * virtual displays. Writes to the outbuf must wait until
+ * outbufAcquireFenceFd signals. A fence that will signal when
+ * writes to outbuf are complete should be returned in
+ * retireFenceFd.
+ *
+ * For physical displays, outbuf will be NULL.
+ */
+ buffer_handle_t outbuf;
+
+ /* File descriptor for a fence that will signal when outbuf is
+ * ready to be written. The h/w composer is responsible for closing
+ * this when no longer needed.
+ *
+ * Will be -1 whenever outbuf is NULL, or when the outbuf can be
+ * written immediately.
+ */
+ int outbufAcquireFenceFd;
+ };
+ };
/* List of layers that will be composed on the display. The buffer handles
* in the list will be unique. If numHwLayers is 0, all composition will be