From d727e9c78f799534ea606e3793d50fc73a4566d7 Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 8 Dec 2023 11:30:37 -0500 Subject: Add AHB_allocate2 + get/setDataSpace Also fix that some ADataSpace enum values were not prefixed with ADATASPACE_* Test: atest AHardwareBufferTest Bug: 315475131 Change-Id: Ie92f416a209501fa8fdc9b3593ea6d3bb68eaa48 --- libs/ui/Gralloc2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libs/ui/Gralloc2.cpp') diff --git a/libs/ui/Gralloc2.cpp b/libs/ui/Gralloc2.cpp index e9b5decee8..a5aca9912f 100644 --- a/libs/ui/Gralloc2.cpp +++ b/libs/ui/Gralloc2.cpp @@ -384,8 +384,8 @@ std::string Gralloc2Allocator::dumpDebugInfo(bool /*less*/) const { status_t Gralloc2Allocator::allocate(std::string /*requestorName*/, uint32_t width, uint32_t height, PixelFormat format, uint32_t layerCount, uint64_t usage, - uint32_t bufferCount, uint32_t* outStride, - buffer_handle_t* outBufferHandles, bool importBuffers) const { + uint32_t* outStride, buffer_handle_t* outBufferHandles, + bool importBuffers) const { IMapper::BufferDescriptorInfo descriptorInfo = {}; descriptorInfo.width = width; descriptorInfo.height = height; @@ -400,6 +400,8 @@ status_t Gralloc2Allocator::allocate(std::string /*requestorName*/, uint32_t wid return error; } + constexpr auto bufferCount = 1; + auto ret = mAllocator->allocate(descriptor, bufferCount, [&](const auto& tmpError, const auto& tmpStride, const auto& tmpBuffers) { -- cgit v1.2.3-59-g8ed1b