summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-02-27 03:48:11 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-02-27 03:48:11 +0000
commit6ae9934f054c2ada5fc92e0ea669a634aedd064a (patch)
tree967bd1c362cfcb9cef177fd8db3945d3c97ed87e
parent42f3d53a37964ea43ef268e4c479bb125b74fcb6 (diff)
parent8b089c8dcbaaee83da8d348e1d9dab2320906212 (diff)
downloaddisplay-6ae9934f054c2ada5fc92e0ea669a634aedd064a.tar.gz
Snap for 6241478 from 8b089c8dcbaaee83da8d348e1d9dab2320906212 to qt-d4-release
Change-Id: Ib094079abfbeef81e0c328152b7a7c1ed2a1c4af
-rw-r--r--config/display-board.mk2
-rw-r--r--config/display-product.mk2
-rw-r--r--config/talos.mk4
-rw-r--r--gralloc/Android.mk21
-rw-r--r--gralloc/QtiAllocator.cpp6
-rw-r--r--gralloc/QtiAllocator.h20
-rw-r--r--gralloc/QtiMapper.cpp52
-rw-r--r--gralloc/QtiMapper.h42
-rw-r--r--gralloc/QtiMapperExtensions.h6
-rw-r--r--gralloc/gr_buf_descriptor.h8
-rw-r--r--gralloc/gr_buf_mgr.cpp8
-rw-r--r--gralloc/gr_buf_mgr.h6
-rw-r--r--gralloc/gr_utils.cpp28
-rw-r--r--gralloc/gr_utils.h5
-rw-r--r--gralloc/service.cpp6
-rw-r--r--sdm/libs/hwc2/Android.mk2
-rw-r--r--sdm/libs/hwc2/hwc_buffer_allocator.cpp270
-rw-r--r--sdm/libs/hwc2/hwc_buffer_allocator.h17
18 files changed, 179 insertions, 326 deletions
diff --git a/config/display-board.mk b/config/display-board.mk
index 3c28fdc2..29f540b9 100644
--- a/config/display-board.mk
+++ b/config/display-board.mk
@@ -15,5 +15,5 @@ TARGET_HAS_HDR_DISPLAY := true
TARGET_USES_DISPLAY_RENDER_INTENTS := true
TARGET_USE_COLOR_MANAGEMENT := true
SF_WCG_COMPOSITION_DATA_SPACE := 143261696
-TARGET_USES_QTI_MAPPER_3_0 := true
+TARGET_USES_QTI_MAPPER_2_0 := true
TARGET_USES_QTI_MAPPER_EXTENSIONS_1_1 := true
diff --git a/config/display-product.mk b/config/display-product.mk
index f27e6b10..7ffa9617 100644
--- a/config/display-product.mk
+++ b/config/display-product.mk
@@ -2,7 +2,7 @@
PRODUCT_PACKAGES += \
android.hardware.graphics.composer@2.3-impl \
android.hardware.graphics.composer@2.3-service-sm7150 \
- android.hardware.graphics.mapper@3.0-impl-qti-display \
+ android.hardware.graphics.mapper@2.0-impl-qti-display \
vendor.qti.hardware.display.allocator-service \
android.hardware.memtrack@1.0-impl \
android.hardware.memtrack@1.0-service \
diff --git a/config/talos.mk b/config/talos.mk
index 2ea56aab..c80ece7b 100644
--- a/config/talos.mk
+++ b/config/talos.mk
@@ -3,7 +3,7 @@
PRODUCT_PACKAGES += \
android.hardware.graphics.composer@2.3-impl \
android.hardware.graphics.composer@2.3-service \
- android.hardware.graphics.mapper@3.0-impl-qti-display \
+ android.hardware.graphics.mapper@2.0-impl-qti-display \
vendor.qti.hardware.display.allocator-service \
android.hardware.memtrack@1.0-impl \
android.hardware.memtrack@1.0-service \
@@ -49,7 +49,7 @@ TARGET_USES_HWC2 := true
TARGET_USES_QCOM_DISPLAY_BSP := true
TARGET_USES_COLOR_METADATA := true
TARGET_USES_DISPLAY_RENDER_INTENTS := true
-TARGET_USES_QTI_MAPPER_3_0 := true
+TARGET_USES_QTI_MAPPER_2_0 := true
TARGET_USES_QTI_MAPPER_EXTENSIONS_1_1 := true
PRODUCT_PROPERTY_OVERRIDES += \
diff --git a/gralloc/Android.mk b/gralloc/Android.mk
index 6f23493c..9ad44e52 100644
--- a/gralloc/Android.mk
+++ b/gralloc/Android.mk
@@ -13,8 +13,7 @@ LOCAL_HEADER_LIBRARIES := display_headers
LOCAL_SHARED_LIBRARIES := $(common_libs) libqdMetaData libsync libgrallocutils \
libgralloccore \
android.hardware.graphics.mapper@2.0 \
- android.hardware.graphics.mapper@2.1 \
- android.hardware.graphics.mapper@3.0
+ android.hardware.graphics.mapper@2.1
LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdgralloc\" -Wall -Werror
LOCAL_CLANG := true
LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
@@ -30,8 +29,7 @@ LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes)
LOCAL_HEADER_LIBRARIES := display_headers
LOCAL_SHARED_LIBRARIES := $(common_libs) libqdMetaData libdl \
android.hardware.graphics.mapper@2.0 \
- android.hardware.graphics.mapper@2.1 \
- android.hardware.graphics.mapper@3.0
+ android.hardware.graphics.mapper@2.1
LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdgralloc\" -Wno-sign-conversion
LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
LOCAL_SRC_FILES := gr_utils.cpp gr_adreno_info.cpp
@@ -49,8 +47,7 @@ LOCAL_C_INCLUDES := $(common_includes) \
LOCAL_HEADER_LIBRARIES := display_headers
LOCAL_SHARED_LIBRARIES := $(common_libs) libqdMetaData libdl libgrallocutils libion \
- android.hardware.graphics.mapper@2.1 \
- android.hardware.graphics.mapper@3.0
+ android.hardware.graphics.mapper@2.1
LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdgralloc\" -Wno-sign-conversion
LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
LOCAL_SRC_FILES := gr_allocator.cpp gr_buf_mgr.cpp gr_ion_alloc.cpp
@@ -58,7 +55,7 @@ include $(BUILD_SHARED_LIBRARY)
#mapper
include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.graphics.mapper@3.0-impl-qti-display
+LOCAL_MODULE := android.hardware.graphics.mapper@2.0-impl-qti-display
LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_MODULE_TAGS := optional
@@ -71,12 +68,11 @@ LOCAL_SHARED_LIBRARIES := $(common_libs) \
libgrallocutils \
libgralloccore \
libsync \
- vendor.qti.hardware.display.mapper@3.0 \
+ vendor.qti.hardware.display.mapper@2.0 \
vendor.qti.hardware.display.mapperextensions@1.0 \
android.hardware.graphics.mapper@2.0 \
android.hardware.graphics.mapper@2.1 \
- vendor.qti.hardware.display.mapperextensions@1.1 \
- android.hardware.graphics.mapper@3.0
+ vendor.qti.hardware.display.mapperextensions@1.1
LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdgralloc\" -Wno-sign-conversion
LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
LOCAL_SRC_FILES := QtiMapper.cpp QtiMapperExtensions.cpp
@@ -95,10 +91,9 @@ LOCAL_SHARED_LIBRARIES := $(common_libs) \
libqdMetaData \
libgrallocutils \
libgralloccore \
- vendor.qti.hardware.display.allocator@3.0 \
- android.hardware.graphics.mapper@3.0 \
+ vendor.qti.hardware.display.allocator@1.0 \
android.hardware.graphics.mapper@2.1 \
- android.hardware.graphics.allocator@3.0
+ android.hardware.graphics.allocator@2.0
LOCAL_CFLAGS := -DLOG_TAG=\"qdgralloc\" $(common_flags)
LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes)
diff --git a/gralloc/QtiAllocator.cpp b/gralloc/QtiAllocator.cpp
index e623e814..bdb8ebe4 100644
--- a/gralloc/QtiAllocator.cpp
+++ b/gralloc/QtiAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -40,7 +40,7 @@ namespace qti {
namespace hardware {
namespace display {
namespace allocator {
-namespace V3_0 {
+namespace V1_0 {
namespace implementation {
using android::hardware::hidl_handle;
@@ -105,7 +105,7 @@ IQtiAllocator *HIDL_FETCH_IQtiAllocator(const char * /* name */) {
}
} // namespace implementation
-} // namespace V3_0
+} // namespace V1_0
} // namespace allocator
} // namespace display
} // namespace hardware
diff --git a/gralloc/QtiAllocator.h b/gralloc/QtiAllocator.h
index 76ee392f..2f3add8a 100644
--- a/gralloc/QtiAllocator.h
+++ b/gralloc/QtiAllocator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -32,7 +32,7 @@
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <vendor/qti/hardware/display/allocator/3.0/IQtiAllocator.h>
+#include <vendor/qti/hardware/display/allocator/1.0/IQtiAllocator.h>
#include "gr_buf_mgr.h"
@@ -41,22 +41,22 @@ namespace qti {
namespace hardware {
namespace display {
namespace allocator {
-namespace V3_0 {
+namespace V1_0 {
namespace implementation {
-using ::android::sp;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::graphics::allocator::V2_0::IAllocator;
+using ::android::hardware::graphics::mapper::V2_0::Error;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-using ::android::hardware::graphics::allocator::V3_0::IAllocator;
-using ::android::hardware::graphics::mapper::V3_0::Error;
using ::android::hidl::base::V1_0::DebugInfo;
using ::android::hidl::base::V1_0::IBase;
+using ::android::sp;
+using ::vendor::qti::hardware::display::allocator::V1_0::IQtiAllocator;
using gralloc::BufferManager;
-using ::vendor::qti::hardware::display::allocator::V3_0::IQtiAllocator;
class QtiAllocator : public IQtiAllocator {
public:
@@ -74,7 +74,7 @@ class QtiAllocator : public IQtiAllocator {
extern "C" IQtiAllocator *HIDL_FETCH_IQtiAllocator(const char *name);
} // namespace implementation
-} // namespace V3_0
+} // namespace V1_0
} // namespace allocator
} // namespace display
} // namespace hardware
diff --git a/gralloc/QtiMapper.cpp b/gralloc/QtiMapper.cpp
index 27f91c14..c9790c26 100644
--- a/gralloc/QtiMapper.cpp
+++ b/gralloc/QtiMapper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -50,7 +50,7 @@ QtiMapper::QtiMapper() {
ALOGD_IF(DEBUG, "Created QtiMapper instance");
}
-bool QtiMapper::ValidDescriptor(const BufferDescriptorInfo_3_0 &bd) {
+bool QtiMapper::ValidDescriptor(const BufferDescriptorInfo_2_1 &bd) {
if (bd.width == 0 || bd.height == 0 || (static_cast<int32_t>(bd.format) <= 0) ||
bd.layerCount <= 0) {
return false;
@@ -59,7 +59,7 @@ bool QtiMapper::ValidDescriptor(const BufferDescriptorInfo_3_0 &bd) {
return true;
}
-Error QtiMapper::CreateDescriptor(const BufferDescriptorInfo_3_0 &descriptor_info,
+Error QtiMapper::CreateDescriptor(const BufferDescriptorInfo_2_1& descriptor_info,
IMapperBufferDescriptor *descriptor) {
ALOGD_IF(DEBUG,
"BufferDescriptorInfo: wxh: %dx%d usage: 0x%" PRIu64 " format: %d layer_count: %d",
@@ -76,17 +76,17 @@ Error QtiMapper::CreateDescriptor(const BufferDescriptorInfo_3_0 &descriptor_inf
}
// Methods from ::android::hardware::graphics::mapper::V2_0::IMapper follow.
-Return<void> QtiMapper::createDescriptor(const BufferDescriptorInfo_3_0 &descriptor_info,
+Return<void> QtiMapper::createDescriptor(const BufferDescriptorInfo_2_0 &descriptor_info,
createDescriptor_cb hidl_cb) {
IMapperBufferDescriptor descriptor;
- auto info_3_0 = BufferDescriptorInfo_3_0{
+ auto info_2_1 = BufferDescriptorInfo_2_1 {
descriptor_info.width,
descriptor_info.height,
descriptor_info.layerCount,
static_cast<PixelFormat>(descriptor_info.format),
descriptor_info.usage,
};
- auto err = CreateDescriptor(info_3_0, &descriptor);
+ auto err = CreateDescriptor(info_2_1, &descriptor);
hidl_cb(err, descriptor);
return Void();
}
@@ -177,13 +177,13 @@ Return<void> QtiMapper::lock(void *buffer, uint64_t cpu_usage,
const hidl_handle &acquire_fence, lock_cb hidl_cb) {
auto err = LockBuffer(buffer, cpu_usage, acquire_fence);
if (err != Error::NONE) {
- hidl_cb(err, nullptr, -1, -1);
+ hidl_cb(err, nullptr);
return Void();
}
auto hnd = PRIV_HANDLE_CONST(buffer);
auto *out_data = reinterpret_cast<void *>(hnd->base);
- hidl_cb(err, out_data, gralloc::GetBpp(hnd->format), hnd->width);
+ hidl_cb(Error::NONE, out_data);
return Void();
}
@@ -222,8 +222,8 @@ Return<void> QtiMapper::unlock(void *buffer, unlock_cb hidl_cb) {
return Void();
}
-Return<Error> QtiMapper::validateBufferSize(void *buffer,
- const BufferDescriptorInfo_3_0 &descriptor_info,
+Return<Error> QtiMapper::validateBufferSize(void* buffer,
+ const BufferDescriptorInfo_2_1& descriptor_info,
uint32_t /*stride*/) {
auto err = Error::BAD_BUFFER;
auto hnd = static_cast<private_handle_t *>(buffer);
@@ -240,7 +240,8 @@ Return<Error> QtiMapper::validateBufferSize(void *buffer,
return err;
}
-Return<void> QtiMapper::getTransportSize(void *buffer, IMapper_3_0::getTransportSize_cb hidl_cb) {
+Return<void> QtiMapper::getTransportSize(void *buffer,
+ IMapper_2_1::getTransportSize_cb hidl_cb) {
auto err = Error::BAD_BUFFER;
auto hnd = static_cast<private_handle_t *>(buffer);
uint32_t num_fds = 0, num_ints = 0;
@@ -259,30 +260,11 @@ Return<void> QtiMapper::getTransportSize(void *buffer, IMapper_3_0::getTransport
return Void();
}
-Return<void> QtiMapper::isSupported(const BufferDescriptorInfo_3_0 &descriptor_info,
- IMapper_3_0::isSupported_cb hidl_cb) {
+Return<void> QtiMapper::createDescriptor_2_1(const BufferDescriptorInfo_2_1& descriptor_info,
+ IMapper_2_1::createDescriptor_2_1_cb hidl_cb) {
IMapperBufferDescriptor descriptor;
auto err = CreateDescriptor(descriptor_info, &descriptor);
- if (err != Error::NONE) {
- hidl_cb(err, false);
- return Void();
- }
-
- gralloc::BufferDescriptor desc;
- err = desc.Decode(descriptor);
- if (err != Error::NONE) {
- hidl_cb(err, false);
- return Void();
- }
-
- buffer_handle_t buffer;
- err = buf_mgr_->AllocateBuffer(desc, &buffer, 0, true);
- if (err != Error::NONE) {
- hidl_cb(err, false);
- } else {
- hidl_cb(err, true);
- }
-
+ hidl_cb(err, descriptor);
return Void();
}
@@ -299,10 +281,10 @@ Return<void> QtiMapper::getMapperExtensions(QtiMapper::getMapperExtensions_cb hi
// When we are in passthrough mode, this method is used
// by hidl to obtain the SP HAL object
-IMapper_3_0 *HIDL_FETCH_IMapper(const char * /* name */) {
+IMapper_2_1 *HIDL_FETCH_IMapper(const char * /* name */) {
ALOGD_IF(DEBUG, "Fetching IMapper from QtiMapper");
auto mapper = new QtiMapper();
- return static_cast<IMapper_3_0 *>(mapper);
+ return static_cast<IMapper_2_1 *>(mapper);
}
IQtiMapper *HIDL_FETCH_IQtiMapper(const char * /* name */) {
diff --git a/gralloc/QtiMapper.h b/gralloc/QtiMapper.h
index 09e29c0b..7302e5e3 100644
--- a/gralloc/QtiMapper.h
+++ b/gralloc/QtiMapper.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -32,7 +32,7 @@
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <vendor/qti/hardware/display/mapper/3.0/IQtiMapper.h>
+#include <vendor/qti/hardware/display/mapper/2.0/IQtiMapper.h>
#include "QtiMapperExtensions.h"
#include "gr_buf_mgr.h"
@@ -51,27 +51,29 @@ using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::graphics::common::V1_2::PixelFormat;
-using ::android::hardware::graphics::mapper::V3_0::Error;
-using ::android::hardware::graphics::mapper::V3_0::IMapper;
-using ::android::hardware::graphics::mapper::V3_0::YCbCrLayout;
+using ::android::hardware::graphics::common::V1_1::PixelFormat;
+using ::android::hardware::graphics::mapper::V2_0::Error;
+using ::android::hardware::graphics::mapper::V2_0::IMapper;
+using ::android::hardware::graphics::mapper::V2_0::YCbCrLayout;
using ::android::hidl::base::V1_0::DebugInfo;
using ::android::hidl::base::V1_0::IBase;
using gralloc::BufferManager;
-using ::vendor::qti::hardware::display::mapper::V3_0::IQtiMapper;
+using ::vendor::qti::hardware::display::mapper::V2_0::IQtiMapper;
using ::vendor::qti::hardware::display::mapperextensions::V1_1::IQtiMapperExtensions;
using ::vendor::qti::hardware::display::mapperextensions::V1_1::implementation::QtiMapperExtensions;
-using IMapper_3_0 = android::hardware::graphics::mapper::V3_0::IMapper;
-using BufferDescriptorInfo_3_0 =
- android::hardware::graphics::mapper::V3_0::IMapper::BufferDescriptorInfo;
-using IMapperBufferDescriptor = android::hardware::graphics::mapper::V3_0::BufferDescriptor;
+using IMapper_2_1 = android::hardware::graphics::mapper::V2_1::IMapper;
+using BufferDescriptorInfo_2_0 =
+android::hardware::graphics::mapper::V2_0::IMapper::BufferDescriptorInfo;
+using BufferDescriptorInfo_2_1 =
+android::hardware::graphics::mapper::V2_1::IMapper::BufferDescriptorInfo;
+using IMapperBufferDescriptor = android::hardware::graphics::mapper::V2_0::BufferDescriptor;
class QtiMapper : public IQtiMapper {
public:
QtiMapper();
// Methods from ::android::hardware::graphics::mapper::V2_0::IMapper follow.
- Return<void> createDescriptor(const BufferDescriptorInfo_3_0 &descriptor_info,
+ Return<void> createDescriptor(const BufferDescriptorInfo_2_0 &descriptor_info,
createDescriptor_cb hidl_cb) override;
Return<void> importBuffer(const hidl_handle &raw_handle, importBuffer_cb hidl_cb) override;
Return<Error> freeBuffer(void *buffer) override;
@@ -82,27 +84,27 @@ class QtiMapper : public IQtiMapper {
Return<void> unlock(void *buffer, unlock_cb hidl_cb) override;
// Methods from ::android::hardware::graphics::mapper::V2_1::IMapper follow.
- Return<Error> validateBufferSize(void *buffer, const BufferDescriptorInfo_3_0 &descriptorInfo,
+ Return<Error> validateBufferSize(void* buffer,
+ const BufferDescriptorInfo_2_1& descriptorInfo,
uint32_t stride) override;
- Return<void> getTransportSize(void *buffer, IMapper_3_0::getTransportSize_cb hidl_cb) override;
-
- Return<void> isSupported(const BufferDescriptorInfo_3_0 &descriptor_info,
- IMapper_3_0::isSupported_cb hidl_cb) override;
+ Return<void> getTransportSize(void* buffer, IMapper_2_1::getTransportSize_cb hidl_cb) override;
+ Return<void> createDescriptor_2_1(const BufferDescriptorInfo_2_1& descriptorInfo,
+ createDescriptor_2_1_cb _hidl_cb) override;
Return<void> getMapperExtensions(getMapperExtensions_cb hidl_cb);
sp<mapperextensions::V1_1::IQtiMapperExtensions> extensions_ = nullptr;
private:
BufferManager *buf_mgr_ = nullptr;
- Error CreateDescriptor(const BufferDescriptorInfo_3_0 &descriptor_info,
- IMapperBufferDescriptor *descriptor);
+ Error CreateDescriptor(const BufferDescriptorInfo_2_1& descriptor_info,
+ IMapperBufferDescriptor * descriptor);
bool ValidDescriptor(const IMapper::BufferDescriptorInfo &bd);
bool GetFenceFd(const hidl_handle &fence_handle, int *outFenceFd);
void WaitFenceFd(int fence_fd);
Error LockBuffer(void *buffer, uint64_t usage, const hidl_handle &acquire_fence);
};
-extern "C" IMapper_3_0 *HIDL_FETCH_IMapper(const char *name);
+extern "C" IMapper_2_1 *HIDL_FETCH_IMapper(const char *name);
extern "C" IQtiMapper *HIDL_FETCH_IQtiMapper(const char *name);
} // namespace implementation
diff --git a/gralloc/QtiMapperExtensions.h b/gralloc/QtiMapperExtensions.h
index b3c05009..b3333123 100644
--- a/gralloc/QtiMapperExtensions.h
+++ b/gralloc/QtiMapperExtensions.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -51,8 +51,8 @@ using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::graphics::common::V1_2::PixelFormat;
-using ::android::hardware::graphics::mapper::V3_0::IMapper;
+using ::android::hardware::graphics::common::V1_1::PixelFormat;
+using ::android::hardware::graphics::mapper::V2_0::IMapper;
using ::android::hidl::base::V1_0::DebugInfo;
using ::android::hidl::base::V1_0::IBase;
using gralloc::BufferManager;
diff --git a/gralloc/gr_buf_descriptor.h b/gralloc/gr_buf_descriptor.h
index f608d8ad..2d426da2 100644
--- a/gralloc/gr_buf_descriptor.h
+++ b/gralloc/gr_buf_descriptor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018, 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -30,13 +30,13 @@
#ifndef __GR_BUF_DESCRIPTOR_H__
#define __GR_BUF_DESCRIPTOR_H__
-#include <android/hardware/graphics/mapper/3.0/IMapper.h>
+#include <android/hardware/graphics/mapper/2.1/IMapper.h>
#include <atomic>
namespace gralloc {
+using android::hardware::graphics::mapper::V2_0::Error;
+using android::hardware::graphics::mapper::V2_1::IMapper;
using android::hardware::hidl_vec;
-using android::hardware::graphics::mapper::V3_0::Error;
-using android::hardware::graphics::mapper::V3_0::IMapper;
const uint32_t kBufferDescriptorSize = 7;
const uint32_t kMagicVersion = 0x76312E30; // v1.0
diff --git a/gralloc/gr_buf_mgr.cpp b/gralloc/gr_buf_mgr.cpp
index e0538628..cd36c137 100644
--- a/gralloc/gr_buf_mgr.cpp
+++ b/gralloc/gr_buf_mgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2018, 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
* Not a Contribution
*
* Copyright (C) 2010 The Android Open Source Project
@@ -262,7 +262,7 @@ Error BufferManager::UnlockBuffer(const private_handle_t *handle) {
}
Error BufferManager::AllocateBuffer(const BufferDescriptor &descriptor, buffer_handle_t *handle,
- unsigned int bufferSize, bool testAlloc) {
+ unsigned int bufferSize) {
if (!handle)
return Error::BAD_BUFFER;
std::lock_guard<std::mutex> buffer_lock(buffer_lock_);
@@ -286,10 +286,6 @@ Error BufferManager::AllocateBuffer(const BufferDescriptor &descriptor, buffer_h
return Error::BAD_DESCRIPTOR;
}
- if (testAlloc) {
- return Error::NONE;
- }
-
size = (bufferSize >= size) ? bufferSize : size;
uint64_t flags = 0;
auto page_size = UINT(getpagesize());
diff --git a/gralloc/gr_buf_mgr.h b/gralloc/gr_buf_mgr.h
index 5f0f8962..6c5f365d 100644
--- a/gralloc/gr_buf_mgr.h
+++ b/gralloc/gr_buf_mgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2018, 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*
* Copyright (C) 2008 The Android Open Source Project
@@ -33,14 +33,14 @@
namespace gralloc {
-using android::hardware::graphics::mapper::V3_0::Error;
+using android::hardware::graphics::mapper::V2_0::Error;
class BufferManager {
public:
~BufferManager();
Error AllocateBuffer(const BufferDescriptor &descriptor, buffer_handle_t *handle,
- unsigned int bufferSize = 0, bool testAlloc = false);
+ unsigned int bufferSize = 0);
Error RetainBuffer(private_handle_t const *hnd);
Error ReleaseBuffer(private_handle_t const *hnd);
Error LockBuffer(const private_handle_t *hnd, uint64_t usage);
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 997c8b94..2f8f5505 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -235,32 +235,6 @@ bool IsGPUFlagSupported(uint64_t usage) {
return ret;
}
-int GetBpp(int format) {
- if (IsUncompressedRGBFormat(format)) {
- return GetBppForUncompressedRGB(format);
- }
- switch (format) {
- case HAL_PIXEL_FORMAT_COMPRESSED_RGBA_ASTC_4x4_KHR:
- case HAL_PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
- case HAL_PIXEL_FORMAT_RAW8:
- case HAL_PIXEL_FORMAT_Y8:
- return 1;
- case HAL_PIXEL_FORMAT_RAW16:
- case HAL_PIXEL_FORMAT_Y16:
- case HAL_PIXEL_FORMAT_YCbCr_422_SP:
- case HAL_PIXEL_FORMAT_YCrCb_422_SP:
- case HAL_PIXEL_FORMAT_YCbCr_422_I:
- case HAL_PIXEL_FORMAT_YCrCb_422_I:
- case HAL_PIXEL_FORMAT_CbYCrY_422_I:
- return 2;
- case HAL_PIXEL_FORMAT_YCbCr_420_P010_VENUS:
- case HAL_PIXEL_FORMAT_YCbCr_420_P010:
- return 3;
- default:
- return -1;
- }
-}
-
// Returns the final buffer size meant to be allocated with ion
unsigned int GetSize(const BufferInfo &info, unsigned int alignedw, unsigned int alignedh) {
unsigned int size = 0;
diff --git a/gralloc/gr_utils.h b/gralloc/gr_utils.h
index 6b86ee63..39d7e9bd 100644
--- a/gralloc/gr_utils.h
+++ b/gralloc/gr_utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2016,2018-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2016,2018-2019, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -30,7 +30,7 @@
#ifndef __GR_UTILS_H__
#define __GR_UTILS_H__
-#include <android/hardware/graphics/common/1.2/types.h>
+#include <android/hardware/graphics/common/1.1/types.h>
#include "gralloc_priv.h"
#include "qdMetaData.h"
@@ -132,7 +132,6 @@ uint32_t GetBppForUncompressedRGB(int format);
bool CpuCanAccess(uint64_t usage);
bool CpuCanRead(uint64_t usage);
bool CpuCanWrite(uint64_t usage);
-int GetBpp(int format);
unsigned int GetSize(const BufferInfo &d, unsigned int alignedw, unsigned int alignedh);
int GetBufferSizeAndDimensions(const BufferInfo &d, unsigned int *size, unsigned int *alignedw,
unsigned int *alignedh);
diff --git a/gralloc/service.cpp b/gralloc/service.cpp
index 3431a1d6..ecc86805 100644
--- a/gralloc/service.cpp
+++ b/gralloc/service.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -31,8 +31,8 @@
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
-using vendor::qti::hardware::display::allocator::V3_0::IQtiAllocator;
-using vendor::qti::hardware::display::allocator::V3_0::implementation::QtiAllocator;
+using vendor::qti::hardware::display::allocator::V1_0::IQtiAllocator;
+using vendor::qti::hardware::display::allocator::V1_0::implementation::QtiAllocator;
int main(int, char **) {
android::sp<IQtiAllocator> service = new QtiAllocator();
diff --git a/sdm/libs/hwc2/Android.mk b/sdm/libs/hwc2/Android.mk
index 7dd763f8..4d423279 100644
--- a/sdm/libs/hwc2/Android.mk
+++ b/sdm/libs/hwc2/Android.mk
@@ -25,9 +25,7 @@ LOCAL_SHARED_LIBRARIES := libsdmcore libqservice libbinder libhardware li
vendor.display.config@1.0 \
android.hardware.graphics.mapper@2.0 \
android.hardware.graphics.mapper@2.1 \
- android.hardware.graphics.mapper@3.0 \
android.hardware.graphics.allocator@2.0 \
- android.hardware.graphics.allocator@3.0 \
android.hardware.graphics.composer@2.2 \
android.hardware.graphics.composer@2.3 \
hardware.google.light@1.0 \
diff --git a/sdm/libs/hwc2/hwc_buffer_allocator.cpp b/sdm/libs/hwc2/hwc_buffer_allocator.cpp
index 3ea5a61c..896c5276 100644
--- a/sdm/libs/hwc2/hwc_buffer_allocator.cpp
+++ b/sdm/libs/hwc2/hwc_buffer_allocator.cpp
@@ -1,31 +1,31 @@
/*
- * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of The Linux Foundation nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
#include <gralloc_priv.h>
@@ -39,10 +39,9 @@
#define __CLASS__ "HWCBufferAllocator"
-using android::hardware::graphics::mapper::V2_0::Error;
-using MapperV3Error = android::hardware::graphics::mapper::V3_0::Error;
+using android::hardware::graphics::common::V1_0::PixelFormat;
using android::hardware::graphics::mapper::V2_0::BufferDescriptor;
-using MapperV3BufferDescriptor = android::hardware::graphics::mapper::V3_0::BufferDescriptor;
+using android::hardware::graphics::mapper::V2_0::Error;
using android::hardware::hidl_handle;
using android::hardware::hidl_vec;
@@ -50,29 +49,17 @@ namespace sdm {
DisplayError HWCBufferAllocator::GetGrallocInstance() {
// Lazy initialization of gralloc HALs
- if (mapper_V3_ != nullptr || mapper_V2_ != nullptr || allocator_V3_ != nullptr ||
- allocator_V2_ != nullptr) {
+ if (mapper_ != nullptr || allocator_ != nullptr) {
return kErrorNone;
}
- allocator_V3_ = IAllocatorV3::getService();
- if (allocator_V3_ == nullptr) {
- allocator_V2_ = IAllocatorV2::getService();
- if (allocator_V2_ == nullptr) {
- DLOGE("Unable to get allocator");
- return kErrorCriticalResource;
- }
- }
+ allocator_ = IAllocator::getService();
+ mapper_ = IMapper::getService();
- mapper_V3_ = IMapperV3::getService();
- if (mapper_V3_ == nullptr) {
- mapper_V2_ = IMapperV2::getService();
- if (mapper_V2_ == nullptr) {
- DLOGE("Unable to get mapper");
- return kErrorCriticalResource;
- }
+ if (mapper_ == nullptr || allocator_ == nullptr) {
+ DLOGE("Unable to get mapper or allocator");
+ return kErrorCriticalResource;
}
-
return kErrorNone;
}
@@ -109,99 +96,48 @@ DisplayError HWCBufferAllocator::AllocateBuffer(BufferInfo *buffer_info) {
alloc_flags |= BufferUsage::COMPOSER_OVERLAY;
- const native_handle_t *buf = nullptr;
-
- if (mapper_V3_ != nullptr) {
- IMapperV3::BufferDescriptorInfo descriptor_info;
- descriptor_info.width = buffer_config.width;
- descriptor_info.height = buffer_config.height;
- descriptor_info.layerCount = 1;
- descriptor_info.format =
- static_cast<android::hardware::graphics::common::V1_2::PixelFormat>(format);
- descriptor_info.usage = alloc_flags;
-
- auto hidl_err = MapperV3Error::NONE;
-
- auto descriptor = BufferDescriptor();
- mapper_V3_->createDescriptor(descriptor_info, [&](const auto &_error, const auto &_descriptor) {
- hidl_err = _error;
- descriptor = _descriptor;
- });
-
- if (hidl_err != MapperV3Error::NONE) {
- DLOGE("Failed to create descriptor");
- return kErrorMemory;
- }
-
- hidl_handle raw_handle = nullptr;
-
- allocator_V3_->allocate(descriptor, 1,
- [&](const auto &_error, const auto &_stride, const auto &_buffers) {
- hidl_err = _error;
- raw_handle = _buffers[0];
- });
-
- if (hidl_err != MapperV3Error::NONE) {
- DLOGE("Failed to allocate buffer");
- return kErrorMemory;
- }
-
- mapper_V3_->importBuffer(raw_handle, [&](const auto &_error, const auto &_buffer) {
- hidl_err = _error;
- buf = static_cast<const native_handle_t *>(_buffer);
- });
-
- if (hidl_err != MapperV3Error::NONE) {
- DLOGE("Failed to import buffer into HWC");
- return kErrorMemory;
- }
- } else {
- IMapperV2::BufferDescriptorInfo descriptor_info;
- descriptor_info.width = buffer_config.width;
- descriptor_info.height = buffer_config.height;
- descriptor_info.layerCount = 1;
- descriptor_info.format =
- static_cast<android::hardware::graphics::common::V1_0::PixelFormat>(format);
- descriptor_info.usage = alloc_flags;
-
- auto hidl_err = Error::NONE;
-
- auto descriptor = BufferDescriptor();
- mapper_V2_->createDescriptor(descriptor_info, [&](const auto &_error, const auto &_descriptor) {
- hidl_err = _error;
- descriptor = _descriptor;
- });
-
- if (hidl_err != Error::NONE) {
- DLOGE("Failed to create descriptor");
- return kErrorMemory;
- }
-
- hidl_handle raw_handle = nullptr;
-
- allocator_V2_->allocate(descriptor, 1,
- [&](const auto &_error, const auto &_stride, const auto &_buffers) {
- hidl_err = _error;
- raw_handle = _buffers[0];
- });
-
- if (hidl_err != Error::NONE) {
- DLOGE("Failed to allocate buffer");
- return kErrorMemory;
- }
-
- mapper_V2_->importBuffer(raw_handle, [&](const auto &_error, const auto &_buffer) {
- hidl_err = _error;
- buf = static_cast<const native_handle_t *>(_buffer);
- });
-
- if (hidl_err != Error::NONE) {
- DLOGE("Failed to import buffer into HWC");
- return kErrorMemory;
- }
+ IMapper::BufferDescriptorInfo descriptor_info;
+ descriptor_info.width = buffer_config.width;
+ descriptor_info.height = buffer_config.height;
+ descriptor_info.layerCount = 1;
+ descriptor_info.format = static_cast<PixelFormat>(format);
+ descriptor_info.usage = alloc_flags;
+ auto descriptor = BufferDescriptor();
+ auto hidl_err = Error::NONE;
+
+ mapper_->createDescriptor(descriptor_info, [&](const auto &_error, const auto &_descriptor) {
+ hidl_err = _error;
+ descriptor = _descriptor;
+ });
+ if (hidl_err != Error::NONE) {
+ DLOGE("Failed to create descriptor");
+ return kErrorMemory;
}
+ hidl_handle raw_handle = nullptr;
private_handle_t *hnd = nullptr;
+
+ allocator_->allocate(descriptor, 1,
+ [&](const auto &_error, const auto &_stride, const auto &_buffers) {
+ hidl_err = _error;
+ raw_handle = _buffers[0];
+ });
+ if (hidl_err != Error::NONE) {
+ DLOGE("Failed to allocate buffer");
+ return kErrorMemory;
+ }
+
+ const native_handle_t *buf = nullptr;
+ mapper_->importBuffer(raw_handle, [&](const auto &_error, const auto &_buffer) {
+ hidl_err = _error;
+ buf = static_cast<const native_handle_t *>(_buffer);
+ });
+
+ if (hidl_err != Error::NONE) {
+ DLOGE("Failed to import buffer into HWC");
+ return kErrorMemory;
+ }
+
hnd = (private_handle_t *)buf; // NOLINT
alloc_buffer_info->fd = hnd->fd;
alloc_buffer_info->stride = UINT32(hnd->width);
@@ -217,11 +153,7 @@ DisplayError HWCBufferAllocator::AllocateBuffer(BufferInfo *buffer_info) {
DisplayError HWCBufferAllocator::FreeBuffer(BufferInfo *buffer_info) {
DisplayError err = kErrorNone;
auto hnd = reinterpret_cast<void *>(buffer_info->private_data);
- if (mapper_V3_ != nullptr) {
- mapper_V3_->freeBuffer(hnd);
- } else {
- mapper_V2_->freeBuffer(hnd);
- }
+ mapper_->freeBuffer(hnd);
AllocatedBufferInfo &alloc_buffer_info = buffer_info->alloc_buffer_info;
alloc_buffer_info.fd = -1;
@@ -479,6 +411,9 @@ DisplayError HWCBufferAllocator::MapBuffer(const private_handle_t *handle, int a
if (err != kErrorNone) {
return err;
}
+ void *buffer_ptr = NULL;
+ const IMapper::Rect access_region = {.left = 0, .top = 0, .width = 0, .height = 0};
+
NATIVE_HANDLE_DECLARE_STORAGE(acquire_fence_storage, 1, 0);
hidl_handle acquire_fence_handle;
if (acquire_fence >= 0) {
@@ -488,27 +423,13 @@ DisplayError HWCBufferAllocator::MapBuffer(const private_handle_t *handle, int a
}
auto hnd = const_cast<private_handle_t *>(handle);
- void *buffer_ptr = NULL;
- if (mapper_V3_ != nullptr) {
- const IMapperV3::Rect access_region = {.left = 0, .top = 0, .width = 0, .height = 0};
- mapper_V3_->lock(
- reinterpret_cast<void *>(hnd), (uint64_t)BufferUsage::CPU_READ_OFTEN, access_region,
- acquire_fence_handle,
- [&](const auto &_error, const auto &_buffer, const auto &_bpp, const auto &_stride) {
- if (_error == MapperV3Error::NONE) {
- buffer_ptr = _buffer;
- }
- });
- } else {
- const IMapperV2::Rect access_region = {.left = 0, .top = 0, .width = 0, .height = 0};
- mapper_V2_->lock(reinterpret_cast<void *>(hnd), (uint64_t)BufferUsage::CPU_READ_OFTEN,
- access_region, acquire_fence_handle,
- [&](const auto &_error, const auto &_buffer) {
- if (_error == Error::NONE) {
- buffer_ptr = _buffer;
- }
- });
- }
+ mapper_->lock(reinterpret_cast<void *>(hnd), (uint64_t)BufferUsage::CPU_READ_OFTEN,
+ access_region, acquire_fence_handle, [&](const auto &_error, const auto &_buffer) {
+ if (_error == Error::NONE) {
+ buffer_ptr = _buffer;
+ }
+ });
+
if (!buffer_ptr) {
return kErrorUndefined;
}
@@ -519,21 +440,12 @@ DisplayError HWCBufferAllocator::UnmapBuffer(const private_handle_t *handle, int
DisplayError err = kErrorNone;
*release_fence = -1;
auto hnd = const_cast<private_handle_t *>(handle);
- if (mapper_V3_ != nullptr) {
- mapper_V3_->unlock(reinterpret_cast<void *>(hnd),
- [&](const auto &_error, const auto &_release_fence) {
- if (_error != MapperV3Error::NONE) {
- err = kErrorUndefined;
- }
- });
- } else {
- mapper_V2_->unlock(reinterpret_cast<void *>(hnd),
- [&](const auto &_error, const auto &_release_fence) {
- if (_error != Error::NONE) {
- err = kErrorUndefined;
- }
- });
- }
+ mapper_->unlock(reinterpret_cast<void *>(hnd),
+ [&](const auto &_error, const auto &_release_fence) {
+ if (_error != Error::NONE) {
+ err = kErrorUndefined;
+ }
+ });
return err;
}
diff --git a/sdm/libs/hwc2/hwc_buffer_allocator.h b/sdm/libs/hwc2/hwc_buffer_allocator.h
index b412542a..cec5614c 100644
--- a/sdm/libs/hwc2/hwc_buffer_allocator.h
+++ b/sdm/libs/hwc2/hwc_buffer_allocator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -33,15 +33,12 @@
#include <sys/mman.h>
#include <android/hardware/graphics/allocator/2.0/IAllocator.h>
-#include <android/hardware/graphics/allocator/3.0/IAllocator.h>
#include <android/hardware/graphics/mapper/2.1/IMapper.h>
-#include <android/hardware/graphics/mapper/3.0/IMapper.h>
#include "gralloc_priv.h"
-using IAllocatorV3 = android::hardware::graphics::allocator::V3_0::IAllocator;
-using IAllocatorV2 = android::hardware::graphics::allocator::V2_0::IAllocator;
-using IMapperV3 = android::hardware::graphics::mapper::V3_0::IMapper;
-using IMapperV2 = android::hardware::graphics::mapper::V2_0::IMapper;
+using android::hardware::graphics::allocator::V2_0::IAllocator;
+using android::hardware::graphics::mapper::V2_0::IMapper;
+
namespace sdm {
template <class Type>
@@ -68,10 +65,8 @@ class HWCBufferAllocator : public BufferAllocator {
private:
DisplayError GetGrallocInstance();
- android::sp<IMapperV2> mapper_V2_;
- android::sp<IMapperV3> mapper_V3_;
- android::sp<IAllocatorV2> allocator_V2_;
- android::sp<IAllocatorV3> allocator_V3_;
+ android::sp<IMapper> mapper_;
+ android::sp<IAllocator> allocator_;
};
} // namespace sdm