summaryrefslogtreecommitdiff
path: root/sdm/libs/hwc2/hwc_buffer_allocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sdm/libs/hwc2/hwc_buffer_allocator.cpp')
-rw-r--r--sdm/libs/hwc2/hwc_buffer_allocator.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/sdm/libs/hwc2/hwc_buffer_allocator.cpp b/sdm/libs/hwc2/hwc_buffer_allocator.cpp
index 3ea5a61c..70859018 100644
--- a/sdm/libs/hwc2/hwc_buffer_allocator.cpp
+++ b/sdm/libs/hwc2/hwc_buffer_allocator.cpp
@@ -125,6 +125,9 @@ DisplayError HWCBufferAllocator::AllocateBuffer(BufferInfo *buffer_info) {
auto descriptor = BufferDescriptor();
mapper_V3_->createDescriptor(descriptor_info, [&](const auto &_error, const auto &_descriptor) {
hidl_err = _error;
+ if (hidl_err != MapperV3Error::NONE) {
+ return;
+ }
descriptor = _descriptor;
});
@@ -138,6 +141,9 @@ DisplayError HWCBufferAllocator::AllocateBuffer(BufferInfo *buffer_info) {
allocator_V3_->allocate(descriptor, 1,
[&](const auto &_error, const auto &_stride, const auto &_buffers) {
hidl_err = _error;
+ if (hidl_err != MapperV3Error::NONE) {
+ return;
+ }
raw_handle = _buffers[0];
});
@@ -148,6 +154,9 @@ DisplayError HWCBufferAllocator::AllocateBuffer(BufferInfo *buffer_info) {
mapper_V3_->importBuffer(raw_handle, [&](const auto &_error, const auto &_buffer) {
hidl_err = _error;
+ if (hidl_err != MapperV3Error::NONE) {
+ return;
+ }
buf = static_cast<const native_handle_t *>(_buffer);
});
@@ -169,6 +178,9 @@ DisplayError HWCBufferAllocator::AllocateBuffer(BufferInfo *buffer_info) {
auto descriptor = BufferDescriptor();
mapper_V2_->createDescriptor(descriptor_info, [&](const auto &_error, const auto &_descriptor) {
hidl_err = _error;
+ if (hidl_err != Error::NONE) {
+ return;
+ }
descriptor = _descriptor;
});
@@ -182,6 +194,9 @@ DisplayError HWCBufferAllocator::AllocateBuffer(BufferInfo *buffer_info) {
allocator_V2_->allocate(descriptor, 1,
[&](const auto &_error, const auto &_stride, const auto &_buffers) {
hidl_err = _error;
+ if (hidl_err != Error::NONE) {
+ return;
+ }
raw_handle = _buffers[0];
});
@@ -192,6 +207,9 @@ DisplayError HWCBufferAllocator::AllocateBuffer(BufferInfo *buffer_info) {
mapper_V2_->importBuffer(raw_handle, [&](const auto &_error, const auto &_buffer) {
hidl_err = _error;
+ if (hidl_err != Error::NONE) {
+ return;
+ }
buf = static_cast<const native_handle_t *>(_buffer);
});