summaryrefslogtreecommitdiff
path: root/libs/ui/Gralloc5.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ui/Gralloc5.cpp')
-rw-r--r--libs/ui/Gralloc5.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/libs/ui/Gralloc5.cpp b/libs/ui/Gralloc5.cpp
index 21068394d2..c3b2d3d808 100644
--- a/libs/ui/Gralloc5.cpp
+++ b/libs/ui/Gralloc5.cpp
@@ -343,14 +343,17 @@ status_t Gralloc5Mapper::validateBufferSize(buffer_handle_t bufferHandle, uint32
return BAD_VALUE;
}
}
- {
- auto value = getStandardMetadata<StandardMetadataType::USAGE>(mMapper, bufferHandle);
- if (static_cast<BufferUsage>(usage) != value) {
- ALOGW("Usage didn't match, expected %" PRIu64 " got %" PRId64, usage,
- static_cast<int64_t>(value.value_or(BufferUsage::CPU_READ_NEVER)));
- return BAD_VALUE;
- }
- }
+ // TODO: This can false-positive fail if the allocator adjusted the USAGE bits internally
+ // Investigate further & re-enable or remove, but for now ignoring usage should be OK
+ (void)usage;
+ // {
+ // auto value = getStandardMetadata<StandardMetadataType::USAGE>(mMapper, bufferHandle);
+ // if (static_cast<BufferUsage>(usage) != value) {
+ // ALOGW("Usage didn't match, expected %" PRIu64 " got %" PRId64, usage,
+ // static_cast<int64_t>(value.value_or(BufferUsage::CPU_READ_NEVER)));
+ // return BAD_VALUE;
+ // }
+ // }
{
auto value = getStandardMetadata<StandardMetadataType::STRIDE>(mMapper, bufferHandle);
if (stride != value) {