summaryrefslogtreecommitdiffstats
path: root/include/hardware/gralloc.h
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2015-05-29 12:43:19 -0700
committerDan Stoza <stoza@google.com>2015-05-29 19:52:34 +0000
commit201c7d91b757f632bfd67ca24e6c55d0dc88a8d4 (patch)
tree79243655a2520dfa88aa9aff47d9a8d077785ca5 /include/hardware/gralloc.h
parentfa216fc29d471da3264421024b7a485f05bfe634 (diff)
downloadhardware_libhardware-201c7d91b757f632bfd67ca24e6c55d0dc88a8d4.zip
hardware_libhardware-201c7d91b757f632bfd67ca24e6c55d0dc88a8d4.tar.gz
hardware_libhardware-201c7d91b757f632bfd67ca24e6c55d0dc88a8d4.tar.bz2
gralloc: Add foreign buffer usage flag
Adds GRALLOC_USAGE_FOREIGN_BUFFERS, which a consumer may set as a usage flag if it intends to attach buffers that it has not detached from the BufferQueue. It provides a hint to the producer (who may query the consumer usage bits) that it may receive a buffer from another BufferQueue, so that it can exit during initialization, hopefully with a meaningful error message, if such buffers are not supported. Also adds GRALLOC_USAGE_ALLOC_MASK, which is applied to usage bits before calling alloc on the gralloc module, and prevents the module from seeing GRALLOC_USAGE_FOREIGN_BUFFERS, since that usage flag is of no use while allocating buffers. Bug: 19801661 Change-Id: I17b927de94245f4df7cfd3f4483b544da3e9cd35
Diffstat (limited to 'include/hardware/gralloc.h')
-rw-r--r--include/hardware/gralloc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/hardware/gralloc.h b/include/hardware/gralloc.h
index 7d00114..7aeb84e 100644
--- a/include/hardware/gralloc.h
+++ b/include/hardware/gralloc.h
@@ -127,6 +127,17 @@ enum {
/* buffer may be used as a cursor */
GRALLOC_USAGE_CURSOR = 0x00008000,
+ /* Set by the consumer to indicate to the producer that they may attach a
+ * buffer that they did not detach from the BufferQueue. Will be filtered
+ * out by GRALLOC_USAGE_ALLOC_MASK, so gralloc modules will not need to
+ * handle this flag. */
+ GRALLOC_USAGE_FOREIGN_BUFFERS = 0x00010000,
+
+ /* Mask of all flags which could be passed to a gralloc module for buffer
+ * allocation. Any flags not in this mask do not need to be handled by
+ * gralloc modules. */
+ GRALLOC_USAGE_ALLOC_MASK = ~(GRALLOC_USAGE_FOREIGN_BUFFERS),
+
/* implementation-specific private usage flags */
GRALLOC_USAGE_PRIVATE_0 = 0x10000000,
GRALLOC_USAGE_PRIVATE_1 = 0x20000000,