Merge "Add standardized VERSION symbol"
diff --git a/cros_gralloc/aidl/Allocator.cpp b/cros_gralloc/aidl/Allocator.cpp
index 48025b7..2ea5a0d 100644
--- a/cros_gralloc/aidl/Allocator.cpp
+++ b/cros_gralloc/aidl/Allocator.cpp
@@ -173,6 +173,10 @@
return ToBinderStatus(AllocationError::NO_RESOURCES);
}
+ if (!descriptor.additionalOptions.empty()) {
+ return ToBinderStatus(AllocationError::UNSUPPORTED);
+ }
+
BufferDescriptorInfoV4 descriptionV4 = convertAidlToIMapperV4Descriptor(descriptor);
std::vector<native_handle_t*> handles;
@@ -205,6 +209,11 @@
return ToBinderStatus(AllocationError::NO_RESOURCES);
}
+ if (!descriptor.additionalOptions.empty()) {
+ *outResult = false;
+ return ndk::ScopedAStatus::ok();
+ }
+
struct cros_gralloc_buffer_descriptor crosDescriptor;
if (convertToCrosDescriptor(convertAidlToIMapperV4Descriptor(descriptor), &crosDescriptor)) {
// Failing to convert the descriptor means the layer count, pixel format, or usage is
diff --git a/cros_gralloc/mapper_stablec/Mapper.cpp b/cros_gralloc/mapper_stablec/Mapper.cpp
index 4014b37..6c4ac86 100644
--- a/cros_gralloc/mapper_stablec/Mapper.cpp
+++ b/cros_gralloc/mapper_stablec/Mapper.cpp
@@ -22,6 +22,7 @@
using namespace ::aidl::android::hardware::graphics::common;
using namespace ::android::hardware::graphics::mapper;
+using ::aidl::android::hardware::graphics::allocator::BufferDescriptorInfo;
using ::android::base::unique_fd;
#define REQUIRE_DRIVER() \
@@ -40,10 +41,9 @@
REQUIRE_DRIVER() \
VALIDATE_BUFFER_HANDLE(bufferHandle)
-static_assert(
- CROS_GRALLOC4_METADATA_MAX_NAME_SIZE >=
- ::aidl::android::hardware::graphics::allocator::BufferDescriptorInfo{}.name.size(),
- "Metadata name storage too small to fit a BufferDescriptorInfo::name");
+static_assert(CROS_GRALLOC4_METADATA_MAX_NAME_SIZE >=
+ decltype(std::declval<BufferDescriptorInfo>().name){}.size(),
+ "Metadata name storage too small to fit a BufferDescriptorInfo::name");
constexpr const char* STANDARD_METADATA_NAME =
"android.hardware.graphics.common.StandardMetadataType";
@@ -216,8 +216,8 @@
} else {
if (region.left < 0 || region.top < 0 || region.right <= region.left ||
region.bottom <= region.top) {
- ALOGE("Failed to lock. Invalid accessRegion: [%d, %d, %d, %d]", region.left,
- region.top, region.right, region.bottom);
+ ALOGE("Failed to lock. Invalid accessRegion: [%d, %d, %d, %d]", region.left, region.top,
+ region.right, region.bottom);
return AIMAPPER_ERROR_BAD_VALUE;
}
@@ -235,8 +235,8 @@
}
rect = {static_cast<uint32_t>(region.left), static_cast<uint32_t>(region.top),
- static_cast<uint32_t>(region.right - region.left),
- static_cast<uint32_t>(region.bottom - region.top)};
+ static_cast<uint32_t>(region.right - region.left),
+ static_cast<uint32_t>(region.bottom - region.top)};
}
uint8_t* addr[DRV_MAX_PLANES];