From aa181aec49a78a40b56fa644ccd22c8f19d64b00 Mon Sep 17 00:00:00 2001 From: Marissa Wall Date: Mon, 14 Oct 2019 13:17:17 -0700 Subject: [PATCH] gralloc: require locked buffers follow format Clarify that buffers that are locked (mapped) to the CPU must be in the format requested in their BufferDescriptorInfo. The buffers should not be compressed/swizzled/tiled/etc. Bug: 141631415 Test: This is already assumed by the tests. Change-Id: Ie674117418aaefc3f99ac2bc89c3da4072e236ec --- graphics/mapper/4.0/IMapper.hal | 3 +++ 1 file changed, 3 insertions(+) diff --git a/graphics/mapper/4.0/IMapper.hal b/graphics/mapper/4.0/IMapper.hal index f5df04b853..85c7c81e85 100644 --- a/graphics/mapper/4.0/IMapper.hal +++ b/graphics/mapper/4.0/IMapper.hal @@ -202,6 +202,9 @@ interface IMapper { * the buffer. If the bytesPerStride is unknown or variable, a value of -1 * should be returned. * + * The locked buffer must adhere to the format requested at allocation time + * in the BufferDescriptorInfo. + * * @param buffer Buffer to lock. * @param cpuUsage CPU usage flags to request. See +ndk * libnativewindow#AHardwareBuffer_UsageFlags for possible values.