Skip to content

Commit

Permalink
gralloc: Use actual layer count from buffer descriptor
Browse files Browse the repository at this point in the history
Use actual layer count passed in buffer descriptor for size
calculation in ValidateBufferSize and AllocateBUffer API.

Change-Id: I8a5bd8196cd3e34da5c24a111ced4161d6be6b1e
Signed-off-by: Karthi kandasamy <[email protected]>
  • Loading branch information
Karthi kandasamy authored and Gerrit - the friendly Code Review server committed Sep 23, 2019
1 parent 2e3fcea commit 3eb18ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions gralloc/gr_buf_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ int BufferManager::AllocateBuffer(const BufferDescriptor &descriptor, buffer_han
unsigned int alignedw, alignedh;
int buffer_type = GetBufferType(gralloc_format);
BufferInfo info = GetBufferInfo(descriptor);
info.layer_count = static_cast<int>(layer_count);
GetBufferSizeAndDimensions(info, &size, &alignedw, &alignedh);
size = (bufferSize >= size) ? bufferSize : size;

Expand Down
2 changes: 1 addition & 1 deletion gralloc/gr_device_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,9 @@ gralloc1_error_t GrallocImpl::ValidateBufferSize(gralloc1_device_t *device,
static_cast<int>(descriptor_info.format),
static_cast<gralloc1_producer_usage_t>(descriptor_info.producerUsage),
static_cast<gralloc1_consumer_usage_t>(descriptor_info.consumerUsage));
info.layer_count = static_cast<int>(descriptor_info.layerCount);
err = dev->buf_mgr_->ValidateBufferSize(hnd, info);
}

return err;
}

Expand Down

0 comments on commit 3eb18ce

Please sign in to comment.