From 8b5b9fb52c7af7972fecb6ca9213ddd38237fda1 Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Fri, 27 Sep 2019 09:58:45 -0700 Subject: [PATCH] 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 --- .../passthrough/include/mapper-passthrough/2.1/Gralloc0Hal.h | 4 ++++ 1 file changed, 4 insertions(+) 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 18fbb6d035..8540068a48 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 @@ class Gralloc0HalImpl : public V2_0::passthrough::detail::Gralloc0HalImpl { 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; }