From e308ceb1e9940d1d90a11177782a7cfe8630bb95 Mon Sep 17 00:00:00 2001 From: mtk07406 Date: Thu, 13 Feb 2020 10:46:55 +0800 Subject: [PATCH] Fix VTS fail for GraphicsMapperHidlTest VTS_10 testing item VtsHalGraphicsMapperV2_1Target fail due to Gralloc0 HAL do not have return value : BAD_VALUE and BAD_BUFFER so add Error::BAD_VALUE and Error::BAD_BUFFER as return value to fix this VTS fail. Bug: 146034198 Test: ran VtsHalGraphicsMapperV2_1Target 10 times and it all pass. Change-Id: I792830ddf98cbf59de7d3a7b4dd4cf5f72269244 --- .../include/mapper-passthrough/2.1/Gralloc0Hal.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 8540068a48..13df3bcbc6 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 @@ -49,7 +49,12 @@ class Gralloc0HalImpl : public V2_0::passthrough::detail::Gralloc0HalImpl { mModule, bufferHandle, descriptorInfo.width, descriptorInfo.height, static_cast(descriptorInfo.format), static_cast(descriptorInfo.usage), stride); - return static_cast(ret); + if (ret == -EINVAL) { + return Error::BAD_BUFFER; + } else if (ret < 0) { + return Error::BAD_VALUE; + } + return Error::NONE; } Error getTransportSize(const native_handle_t* bufferHandle, uint32_t* outNumFds, uint32_t* outNumInts) override {