From 2229623f1fb38706f7d52d28bd43f8553ad4203a Mon Sep 17 00:00:00 2001 From: Valerie Hau Date: Mon, 30 Mar 2020 15:40:12 -0700 Subject: [PATCH] Relax constraints on getting PlaneLayouts PlaneLayouts may only be known at allocation time. Bug: 152806713 Test: build, boot Change-Id: Ic878943b405469a70a685a895c04a1d4e2678686 --- .../VtsHalGraphicsMapperV4_0TargetTest.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index 6cc5e34326..8b68e1b733 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -1855,13 +1855,15 @@ TEST_P(GraphicsMapperHidlTest, GetFromBufferDescriptorInfoChromaSiting) { */ TEST_P(GraphicsMapperHidlTest, GetFromBufferDescriptorInfoPlaneLayouts) { hidl_vec vec; - ASSERT_EQ(Error::NONE, - mGralloc->getFromBufferDescriptorInfo(mDummyDescriptorInfo, - gralloc4::MetadataType_PlaneLayouts, &vec)); - - std::vector planeLayouts; - ASSERT_EQ(NO_ERROR, gralloc4::decodePlaneLayouts(vec, &planeLayouts)); - ASSERT_NO_FATAL_FAILURE(verifyDummyDescriptorInfoPlaneLayouts(planeLayouts)); + const auto ret = mGralloc->getFromBufferDescriptorInfo( + mDummyDescriptorInfo, gralloc4::MetadataType_PlaneLayouts, &vec); + if (ret == Error::NONE) { + std::vector planeLayouts; + ASSERT_EQ(NO_ERROR, gralloc4::decodePlaneLayouts(vec, &planeLayouts)); + ASSERT_NO_FATAL_FAILURE(verifyDummyDescriptorInfoPlaneLayouts(planeLayouts)); + } else { + ASSERT_EQ(Error::UNSUPPORTED, ret); + } } /**