summaryrefslogtreecommitdiff
path: root/cros_gralloc/gralloc4/CrosGralloc4Allocator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cros_gralloc/gralloc4/CrosGralloc4Allocator.cc')
-rw-r--r--cros_gralloc/gralloc4/CrosGralloc4Allocator.cc42
1 files changed, 0 insertions, 42 deletions
diff --git a/cros_gralloc/gralloc4/CrosGralloc4Allocator.cc b/cros_gralloc/gralloc4/CrosGralloc4Allocator.cc
index 3166793..852df88 100644
--- a/cros_gralloc/gralloc4/CrosGralloc4Allocator.cc
+++ b/cros_gralloc/gralloc4/CrosGralloc4Allocator.cc
@@ -10,7 +10,6 @@
#include <gralloctypes/Gralloc4.h>
#include "cros_gralloc/cros_gralloc_helpers.h"
-#include "cros_gralloc/gralloc4/CrosGralloc4Metadata.h"
#include "cros_gralloc/gralloc4/CrosGralloc4Utils.h"
using aidl::android::hardware::graphics::common::BlendMode;
@@ -31,37 +30,6 @@ Error CrosGralloc4Allocator::init() {
return mDriver ? Error::NONE : Error::NO_RESOURCES;
}
-Error CrosGralloc4Allocator::initializeMetadata(
- cros_gralloc_handle_t crosHandle,
- const struct cros_gralloc_buffer_descriptor& crosDescriptor) {
- if (!mDriver) {
- ALOGE("Failed to initializeMetadata. Driver is uninitialized.");
- return Error::NO_RESOURCES;
- }
-
- if (!crosHandle) {
- ALOGE("Failed to initializeMetadata. Invalid handle.");
- return Error::BAD_BUFFER;
- }
-
- void* addr;
- uint64_t size;
- int ret = mDriver->get_reserved_region(crosHandle, &addr, &size);
- if (ret) {
- ALOGE("Failed to getReservedRegion.");
- return Error::NO_RESOURCES;
- }
-
- CrosGralloc4Metadata* crosMetadata = reinterpret_cast<CrosGralloc4Metadata*>(addr);
-
- snprintf(crosMetadata->name, CROS_GRALLOC4_METADATA_MAX_NAME_SIZE, "%s",
- crosDescriptor.name.c_str());
- crosMetadata->dataspace = Dataspace::UNKNOWN;
- crosMetadata->blendMode = BlendMode::INVALID;
-
- return Error::NONE;
-}
-
Error CrosGralloc4Allocator::allocate(const BufferDescriptorInfo& descriptor, uint32_t* outStride,
hidl_handle* outHandle) {
if (!mDriver) {
@@ -78,8 +46,6 @@ Error CrosGralloc4Allocator::allocate(const BufferDescriptorInfo& descriptor, ui
return Error::UNSUPPORTED;
}
- crosDescriptor.reserved_region_size += sizeof(CrosGralloc4Metadata);
-
if (!mDriver->is_supported(&crosDescriptor)) {
std::string drmFormatString = get_drm_format_string(crosDescriptor.drm_format);
std::string pixelFormatString = getPixelFormatString(descriptor.format);
@@ -97,14 +63,6 @@ Error CrosGralloc4Allocator::allocate(const BufferDescriptorInfo& descriptor, ui
cros_gralloc_handle_t crosHandle = cros_gralloc_convert_handle(handle);
- Error error = initializeMetadata(crosHandle, crosDescriptor);
- if (error != Error::NONE) {
- mDriver->release(handle);
- native_handle_close(handle);
- native_handle_delete(handle);
- return error;
- }
-
outHandle->setTo(handle, /*shouldOwn=*/true);
*outStride = crosHandle->pixel_stride;