summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorPawin Vongmasa <pawin@google.com>2019-03-07 04:38:57 -0800
committerPawin Vongmasa <pawin@google.com>2019-03-19 06:39:49 -0700
commitd80b5bb7dd1377f54b886a435b0e7f6aad74599e (patch)
treebb1a00c0810650e307e1fb9fd6a40aabe50105f4 /graphics
parent469b3ac3d4709e84365d83f57b7d200acef7987f (diff)
downloadandroid_hardware_interfaces-d80b5bb7dd1377f54b886a435b0e7f6aad74599e.tar.gz
android_hardware_interfaces-d80b5bb7dd1377f54b886a435b0e7f6aad74599e.tar.bz2
android_hardware_interfaces-d80b5bb7dd1377f54b886a435b0e7f6aad74599e.zip
Accompany HardwareBuffer with generation number
attachBuffer() should take a generation number and requestBuffer() should return a generation number because AHardwareBuffer does not carry the generation number. Test: make cts -j123 && cts-tradefed run cts-dev -m \ CtsMediaTestCases --compatibility:module-arg \ CtsMediaTestCases:include-annotation:\ android.platform.test.annotations.RequiresDevice Bug: 127778192 Change-Id: I201f84cf66f0e19b794a05c5ba88066360a37d96
Diffstat (limited to 'graphics')
-rw-r--r--graphics/bufferqueue/2.0/IGraphicBufferProducer.hal21
1 files changed, 16 insertions, 5 deletions
diff --git a/graphics/bufferqueue/2.0/IGraphicBufferProducer.hal b/graphics/bufferqueue/2.0/IGraphicBufferProducer.hal
index 734c0b431..23b360a53 100644
--- a/graphics/bufferqueue/2.0/IGraphicBufferProducer.hal
+++ b/graphics/bufferqueue/2.0/IGraphicBufferProducer.hal
@@ -75,12 +75,19 @@ interface IGraphicBufferProducer {
* @param slot Slot index.
* @return status Status of the call.
* @return buffer New buffer associated to the given slot index.
+ * @return generationNumber Generation number of the buffer. If
+ * requestBuffer() is called immediately after dequeueBuffer() returns
+ * with `bufferNeedsReallocation` set to `true`, @p generationNumber must
+ * match the current generation number of the buffer queue previously
+ * set by setGenerationNumber(). Otherwise, @p generationNumber may not
+ * match the current generation number of the buffer queue.
*/
requestBuffer(
int32_t slot
) generates (
Status status,
- HardwareBuffer buffer
+ HardwareBuffer buffer,
+ uint32_t generationNumber
);
/**
@@ -212,9 +219,9 @@ interface IGraphicBufferProducer {
* parameter.
*
* @param input See #DequeueBufferInput for more information.
- * @param status Status of the call.
- * @param slot Slot index.
- * @param output See #DequeueBufferOutput for more information.
+ * @return status Status of the call.
+ * @return slot Slot index.
+ * @return output See #DequeueBufferOutput for more information.
*
* @sa queueBuffer(), requestBuffer().
*/
@@ -286,6 +293,9 @@ interface IGraphicBufferProducer {
* See dequeueBuffer() for conditions that may cause the call to fail.
*
* @param buffer Buffer to attach to the buffer queue.
+ * @param generationNumber Generation number of the buffer. If this does not
+ * match the current generation number of the buffer queue, the call
+ * must fail with @p status set to `BAD_VALUE`.
* @return status Status of the call.
* @return slot Slot index assigned to @p buffer.
* @return releaseAllBuffers Whether the caller is expected to release all
@@ -294,7 +304,8 @@ interface IGraphicBufferProducer {
* @sa dequeueBuffer().
*/
attachBuffer(
- HardwareBuffer buffer
+ HardwareBuffer buffer,
+ uint32_t generationNumber
) generates (
Status status,
int32_t slot,