summaryrefslogtreecommitdiffstats
path: root/include/hardware/hwcomposer.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-08-01 16:34:42 -0700
committerMathias Agopian <mathias@google.com>2011-08-01 20:45:24 -0700
commitd6afef62ff8ea1fde3a060ac5c5d887c7523b359 (patch)
treec1e0a801634d809f4ef70ce458061fdabab2ed14 /include/hardware/hwcomposer.h
parent482c49bf2783ce67987ab89e5452cab9801cbb46 (diff)
downloadhardware_libhardware-d6afef62ff8ea1fde3a060ac5c5d887c7523b359.zip
hardware_libhardware-d6afef62ff8ea1fde3a060ac5c5d887c7523b359.tar.gz
hardware_libhardware-d6afef62ff8ea1fde3a060ac5c5d887c7523b359.tar.bz2
Add a h/w composer HAL API to allow the HAL to trigger a redraw
This is useful in various situations, for instance if the HAL wants to change its compositing strategy. Bug: 4488017 Change-Id: Idc410c689af30a2c9613dc3141e323d6e02a5648
Diffstat (limited to 'include/hardware/hwcomposer.h')
-rw-r--r--include/hardware/hwcomposer.h40
1 files changed, 37 insertions, 3 deletions
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h
index 321dfc1..0fa3512 100644
--- a/include/hardware/hwcomposer.h
+++ b/include/hardware/hwcomposer.h
@@ -205,8 +205,26 @@ typedef void* hwc_display_t;
/* This represents a surface, typically an EGLSurface object */
typedef void* hwc_surface_t;
-/*****************************************************************************/
+/* see hwc_composer_device::registerProcs()
+ * Any of the callbacks can be NULL, in which case the corresponding
+ * functionality is not supported.
+ */
+typedef struct hwc_procs {
+ /*
+ * (*invalidate)() triggers a screen refresh, in particular prepare and set
+ * will be called shortly after this call is made. Note that there is
+ * NO GUARANTEE that the screen refresh will happen after invalidate()
+ * returns (in particular, it could happen before).
+ * invalidate() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL and
+ * it is safe to call invalidate() from any of hwc_composer_device
+ * hooks, unless noted otherwise.
+ */
+ void (*invalidate)(struct hwc_procs* procs);
+} hwc_procs_t;
+
+
+/*****************************************************************************/
typedef struct hwc_module {
struct hw_module_t common;
@@ -281,11 +299,27 @@ typedef struct hwc_composer_device {
/*
* This hook is OPTIONAL.
*
- * If non NULL it will be caused by SurfaceFlinger on dumpsys
+ * If non NULL it will be called by SurfaceFlinger on dumpsys
*/
void (*dump)(struct hwc_composer_device* dev, char *buff, int buff_len);
- void* reserved_proc[7];
+ /*
+ * This hook is OPTIONAL.
+ *
+ * (*registerProcs)() registers a set of callbacks the h/w composer HAL
+ * can later use. It is FORBIDDEN to call any of the callbacks from
+ * within registerProcs(). registerProcs() must save the hwc_procs_t pointer
+ * which is needed when calling a registered callback.
+ * Each call to registerProcs replaces the previous set of callbacks.
+ * registerProcs is called with NULL to unregister all callbacks.
+ *
+ * Any of the callbacks can be NULL, in which case the corresponding
+ * functionality is not supported.
+ */
+ void (*registerProcs)(struct hwc_composer_device* dev,
+ hwc_procs_t const* procs);
+
+ void* reserved_proc[6];
} hwc_composer_device_t;