summaryrefslogtreecommitdiff
path: root/libs/ui/Gralloc4.cpp
diff options
context:
space:
mode:
author Xin Li <delphij@google.com> 2024-05-24 08:27:45 -0700
committer Xin Li <delphij@google.com> 2024-05-24 08:27:45 -0700
commit5968781840bb5bead4758c9adb1e41bbea1c24c7 (patch)
treed0c6e21063ef3a2265bd3071e363ddfe9ccf618b /libs/ui/Gralloc4.cpp
parenta99e1cd67b5d2237200bf23b44a03e0eb31e9326 (diff)
parent8bf4487ae52ce8d1797ea58dd0b1109255518ceb (diff)
Merge Android 24Q2 Release (ab/11526283) to aosp-main-future
Bug: 337098550 Merged-In: I8d975b81afd2cde1d543e8bc7e730a6e42393bec Change-Id: I714982d2b0df34afc9f9729deb2636de5d0c7b64
Diffstat (limited to 'libs/ui/Gralloc4.cpp')
-rw-r--r--libs/ui/Gralloc4.cpp37
1 files changed, 5 insertions, 32 deletions
diff --git a/libs/ui/Gralloc4.cpp b/libs/ui/Gralloc4.cpp
index 03ff58a76c..2a607308d1 100644
--- a/libs/ui/Gralloc4.cpp
+++ b/libs/ui/Gralloc4.cpp
@@ -262,37 +262,8 @@ void Gralloc4Mapper::getTransportSize(buffer_handle_t bufferHandle, uint32_t* ou
status_t Gralloc4Mapper::lock(buffer_handle_t bufferHandle, uint64_t usage, const Rect& bounds,
int acquireFence, void** outData, int32_t* outBytesPerPixel,
int32_t* outBytesPerStride) const {
- std::vector<ui::PlaneLayout> planeLayouts;
- status_t err = getPlaneLayouts(bufferHandle, &planeLayouts);
-
- if (err == NO_ERROR && !planeLayouts.empty()) {
- if (outBytesPerPixel) {
- int32_t bitsPerPixel = planeLayouts.front().sampleIncrementInBits;
- for (const auto& planeLayout : planeLayouts) {
- if (bitsPerPixel != planeLayout.sampleIncrementInBits) {
- bitsPerPixel = -1;
- }
- }
- if (bitsPerPixel >= 0 && bitsPerPixel % 8 == 0) {
- *outBytesPerPixel = bitsPerPixel / 8;
- } else {
- *outBytesPerPixel = -1;
- }
- }
- if (outBytesPerStride) {
- int32_t bytesPerStride = planeLayouts.front().strideInBytes;
- for (const auto& planeLayout : planeLayouts) {
- if (bytesPerStride != planeLayout.strideInBytes) {
- bytesPerStride = -1;
- }
- }
- if (bytesPerStride >= 0) {
- *outBytesPerStride = bytesPerStride;
- } else {
- *outBytesPerStride = -1;
- }
- }
- }
+ if (outBytesPerPixel) *outBytesPerPixel = -1;
+ if (outBytesPerStride) *outBytesPerStride = -1;
auto buffer = const_cast<native_handle_t*>(bufferHandle);
@@ -1069,7 +1040,7 @@ std::string Gralloc4Allocator::dumpDebugInfo(bool less) const {
status_t Gralloc4Allocator::allocate(std::string requestorName, uint32_t width, uint32_t height,
android::PixelFormat format, uint32_t layerCount,
- uint64_t usage, uint32_t bufferCount, uint32_t* outStride,
+ uint64_t usage, uint32_t* outStride,
buffer_handle_t* outBufferHandles, bool importBuffers) const {
IMapper::BufferDescriptorInfo descriptorInfo;
if (auto error = sBufferDescriptorInfo(requestorName, width, height, format, layerCount, usage,
@@ -1084,6 +1055,8 @@ status_t Gralloc4Allocator::allocate(std::string requestorName, uint32_t width,
return error;
}
+ constexpr auto bufferCount = 1;
+
if (mAidlAllocator) {
AllocationResult result;
#pragma clang diagnostic push