diff options
author | Naseer Ahmed <naseer@codeaurora.org> | 2018-03-02 15:42:45 -0500 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-03-02 20:23:40 -0800 |
commit | 62dd96c7a76e9a67f871818a5223476520aeff0f (patch) | |
tree | b2bbc6b9dca8729660a21c5eca9dd161c2761ef3 | |
parent | 7dab1c1e762be704f0faf4355a79102b82ced256 (diff) | |
download | display-62dd96c7a76e9a67f871818a5223476520aeff0f.tar.gz |
gralloc: Use default interfaces of allocator/mapper
Use default interfaces until BOARD_VNDK_VERSION is enabled
Change-Id: I3192c912ca790174f6fc6acb37988d6720167b07
-rw-r--r-- | gralloc/Android.mk | 7 | ||||
-rw-r--r-- | gralloc/QtiAllocator.cpp | 2 | ||||
-rw-r--r-- | gralloc/QtiAllocator.h | 7 | ||||
-rw-r--r-- | gralloc/QtiMapper.cpp | 6 | ||||
-rw-r--r-- | gralloc/QtiMapper.h | 9 | ||||
-rw-r--r-- | gralloc/service.cpp | 4 |
6 files changed, 12 insertions, 23 deletions
diff --git a/gralloc/Android.mk b/gralloc/Android.mk index 6cfc3662..3d19ce16 100644 --- a/gralloc/Android.mk +++ b/gralloc/Android.mk @@ -59,7 +59,6 @@ qti_allocator_version := $(shell \ then echo QTI_ALLOCATOR_1_0; fi) -ifeq ($(qti_mapper_version), QTI_MAPPER_1_0) #mapper include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.graphics.mapper@2.0-impl-qti-display @@ -75,16 +74,12 @@ LOCAL_SHARED_LIBRARIES := $(common_libs) \ libgrallocutils \ libgralloccore \ libsync \ - vendor.qti.hardware.display.mapper@1.0 \ android.hardware.graphics.mapper@2.0 LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdgralloc\" -Wno-sign-conversion LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps) LOCAL_SRC_FILES := QtiMapper.cpp include $(BUILD_SHARED_LIBRARY) -endif # QTI_MAPPER_1_0 -ifeq ($(qti_allocator_version), QTI_ALLOCATOR_1_0) -#allocator service include $(CLEAR_VARS) LOCAL_MODULE := vendor.qti.hardware.display.allocator@1.0-service LOCAL_VENDOR_MODULE := true @@ -97,7 +92,6 @@ LOCAL_SHARED_LIBRARIES := $(common_libs) \ libqdMetaData \ libgrallocutils \ libgralloccore \ - vendor.qti.hardware.display.allocator@1.0 \ android.hardware.graphics.allocator@2.0 LOCAL_CFLAGS := -DLOG_TAG=\"qdgralloc\" $(common_flags) LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps) @@ -105,4 +99,3 @@ LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes) LOCAL_SRC_FILES := QtiAllocator.cpp service.cpp LOCAL_INIT_RC := vendor.qti.hardware.display.allocator@1.0-service.rc include $(BUILD_EXECUTABLE) -endif # QTI_ALLOCATOR_1_0 diff --git a/gralloc/QtiAllocator.cpp b/gralloc/QtiAllocator.cpp index e58b791e..c4d7aef4 100644 --- a/gralloc/QtiAllocator.cpp +++ b/gralloc/QtiAllocator.cpp @@ -100,7 +100,7 @@ Return<void> QtiAllocator::allocate(const hidl_vec<uint32_t> &descriptor, uint32 // Methods from ::android::hidl::base::V1_0::IBase follow. -IQtiAllocator *HIDL_FETCH_IQtiAllocator(const char * /* name */) { +IAllocator *HIDL_FETCH_IAllocator(const char * /* name */) { return new QtiAllocator(); } diff --git a/gralloc/QtiAllocator.h b/gralloc/QtiAllocator.h index be6aa253..1e683e87 100644 --- a/gralloc/QtiAllocator.h +++ b/gralloc/QtiAllocator.h @@ -32,7 +32,7 @@ #include <hidl/MQDescriptor.h> #include <hidl/Status.h> -#include <vendor/qti/hardware/display/allocator/1.0/IQtiAllocator.h> +#include <android/hardware/graphics/allocator/2.0/IAllocator.h> #include "gr_buf_mgr.h" @@ -55,10 +55,9 @@ using ::android::hardware::hidl_vec; 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; -class QtiAllocator : public IQtiAllocator { +class QtiAllocator : public IAllocator { public: QtiAllocator(); // Methods from ::android::hardware::graphics::allocator::V2_0::IAllocator follow. @@ -71,7 +70,7 @@ class QtiAllocator : public IQtiAllocator { BufferManager *buf_mgr_ = nullptr; }; -extern "C" IQtiAllocator *HIDL_FETCH_IQtiAllocator(const char *name); +extern "C" IAllocator *HIDL_FETCH_IAllocator(const char *name); } // namespace implementation } // namespace V1_0 diff --git a/gralloc/QtiMapper.cpp b/gralloc/QtiMapper.cpp index ec07ce0e..8de28f56 100644 --- a/gralloc/QtiMapper.cpp +++ b/gralloc/QtiMapper.cpp @@ -207,6 +207,7 @@ Return<void> QtiMapper::unlock(void *buffer, unlock_cb hidl_cb) { return Void(); } +#ifdef ENABLE_QTI_MAPPER_EXTENSION Return<void> QtiMapper::getMapSecureBufferFlag(void *buffer, getMapSecureBufferFlag_cb hidl_cb) { auto err = Error::BAD_BUFFER; auto hnd = static_cast<private_handle_t *>(buffer); @@ -323,6 +324,7 @@ Return<Error> QtiMapper::setSingleBufferMode(void *buffer, bool enable) { } return err; } +#endif // Methods from ::android::hidl::base::V1_0::IBase follow. @@ -334,10 +336,6 @@ IMapper *HIDL_FETCH_IMapper(const char * /* name */) { return static_cast<IMapper *>(mapper); } -IQtiMapper *HIDL_FETCH_IQtiMapper(const char * /* name */) { - ALOGD_IF(DEBUG, "Fetching QtiMapper"); - return new QtiMapper(); -} } // namespace implementation } // namespace V1_0 } // namespace mapper diff --git a/gralloc/QtiMapper.h b/gralloc/QtiMapper.h index 276f86ef..218f0749 100644 --- a/gralloc/QtiMapper.h +++ b/gralloc/QtiMapper.h @@ -32,7 +32,6 @@ #include <hidl/MQDescriptor.h> #include <hidl/Status.h> -#include <vendor/qti/hardware/display/mapper/1.0/IQtiMapper.h> #include "gr_buf_mgr.h" namespace vendor { @@ -56,10 +55,9 @@ using ::android::hardware::hidl_vec; using ::android::hidl::base::V1_0::DebugInfo; using ::android::hidl::base::V1_0::IBase; using ::android::sp; -using ::vendor::qti::hardware::display::mapper::V1_0::IQtiMapper; using gralloc::BufferManager; -class QtiMapper : public IQtiMapper { +class QtiMapper : public IMapper { public: QtiMapper(); // Methods from ::android::hardware::graphics::mapper::V2_0::IMapper follow. @@ -72,6 +70,8 @@ class QtiMapper : public IQtiMapper { Return<void> lockYCbCr(void *buffer, uint64_t cpu_usage, const IMapper::Rect &access_region, const hidl_handle &acquire_fence, lockYCbCr_cb hidl_cb) override; Return<void> unlock(void *buffer, unlock_cb hidl_cb) override; + +#ifdef ENABLE_QTI_MAPPER_EXTENSION Return<void> getMapSecureBufferFlag(void *buffer, getMapSecureBufferFlag_cb _hidl_cb) override; Return<void> getInterlacedFlag(void *buffer, getInterlacedFlag_cb _hidl_cb) override; Return<void> getCustomDimensions(void *buffer, getCustomDimensions_cb _hidl_cb) override; @@ -82,6 +82,7 @@ class QtiMapper : public IQtiMapper { Return<void> getColorSpace(void *buffer, getColorSpace_cb _hidl_cb) override; Return<void> getYuvPlaneInfo(void *buffer, getYuvPlaneInfo_cb _hidl_cb) override; Return<Error> setSingleBufferMode(void *buffer, bool enable) override; +#endif private: BufferManager *buf_mgr_ = nullptr; @@ -92,8 +93,6 @@ class QtiMapper : public IQtiMapper { }; extern "C" IMapper *HIDL_FETCH_IMapper(const char *name); -extern "C" IQtiMapper *HIDL_FETCH_IQtiMapper(const char *name); - } // namespace implementation } // namespace V1_0 } // namespace mapper diff --git a/gralloc/service.cpp b/gralloc/service.cpp index 8efe3136..1136e2f7 100644 --- a/gralloc/service.cpp +++ b/gralloc/service.cpp @@ -32,11 +32,11 @@ using android::hardware::configureRpcThreadpool; using android::hardware::joinRpcThreadpool; -using vendor::qti::hardware::display::allocator::V1_0::IQtiAllocator; using vendor::qti::hardware::display::allocator::V1_0::implementation::QtiAllocator; +using android::hardware::graphics::allocator::V2_0::IAllocator; int main(int, char **) { - android::sp<IQtiAllocator> service = new QtiAllocator(); + android::sp<IAllocator> service = new QtiAllocator(); configureRpcThreadpool(1, true /*callerWillJoin*/); if (service->registerAsService() != android::OK) { ALOGE("Cannot register QTI Allocator service"); |