summaryrefslogtreecommitdiff
path: root/libs/ui/Gralloc2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ui/Gralloc2.cpp')
-rw-r--r--libs/ui/Gralloc2.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/ui/Gralloc2.cpp b/libs/ui/Gralloc2.cpp
index 040a62b542..f23f10a1a9 100644
--- a/libs/ui/Gralloc2.cpp
+++ b/libs/ui/Gralloc2.cpp
@@ -110,6 +110,15 @@ status_t Gralloc2Mapper::validateBufferDescriptorInfo(
descriptorInfo->usage & ~validUsageBits);
return BAD_VALUE;
}
+
+ // Gralloc2 implementations never understand non-BLOB with GPU_DATA_BUFFER
+ // and do not reliably reject it.
+ if (descriptorInfo->usage & BufferUsage::GPU_DATA_BUFFER &&
+ descriptorInfo->format != hardware::graphics::common::V1_1::PixelFormat::BLOB) {
+ ALOGE("gralloc2 does not support non-BLOB pixel formats with GPU_DATA_BUFFER usage");
+ return BAD_VALUE;
+ }
+
return NO_ERROR;
}