commit | 8b5b9fb52c7af7972fecb6ca9213ddd38237fda1 | [log] [tgz] |
---|---|---|
author | Jason Macnak <natsu@google.com> | Fri Sep 27 09:58:45 2019 -0700 |
committer | Jason Macnak <natsu@google.com> | Fri Sep 27 09:58:45 2019 -0700 |
tree | 75309633785a2aa4e39e6db5c805825b8726c4b8 | |
parent | 4321dfea636fb64f79f0bbc096f757e093758552 [diff] |
Make gralloc0 pass-through mapper handle layers Gralloc0 does not support layers. This change is needed for Cuttlefish to pass the GraphicsMapperHidlTest.ValidateBufferSizeBadValue VTS test Bug: b/132087346 Test: vts-tradefed run commandAndExit vts -m VtsHalGraphicsMapperV2_1Target Change-Id: I2ed7dae209629d401ccaf2fc0fd992d766b0fa9b
diff --git a/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h b/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h index 18fbb6d..8540068 100644 --- a/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h +++ b/graphics/mapper/2.1/utils/passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h
@@ -37,6 +37,10 @@ Error validateBufferSize(const native_handle_t* bufferHandle, const IMapper::BufferDescriptorInfo& descriptorInfo, uint32_t stride) override { + if (descriptorInfo.layerCount != 1) { + return Error::BAD_VALUE; + } + if (!mModule->validateBufferSize) { return Error::NONE; }