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 QtiAllocator::allocate(const hidl_vec &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 #include -#include +#include #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 QtiMapper::unlock(void *buffer, unlock_cb hidl_cb) { return Void(); } +#ifdef ENABLE_QTI_MAPPER_EXTENSION Return QtiMapper::getMapSecureBufferFlag(void *buffer, getMapSecureBufferFlag_cb hidl_cb) { auto err = Error::BAD_BUFFER; auto hnd = static_cast(buffer); @@ -323,6 +324,7 @@ Return 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(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 #include -#include #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 lockYCbCr(void *buffer, uint64_t cpu_usage, const IMapper::Rect &access_region, const hidl_handle &acquire_fence, lockYCbCr_cb hidl_cb) override; Return unlock(void *buffer, unlock_cb hidl_cb) override; + +#ifdef ENABLE_QTI_MAPPER_EXTENSION Return getMapSecureBufferFlag(void *buffer, getMapSecureBufferFlag_cb _hidl_cb) override; Return getInterlacedFlag(void *buffer, getInterlacedFlag_cb _hidl_cb) override; Return getCustomDimensions(void *buffer, getCustomDimensions_cb _hidl_cb) override; @@ -82,6 +82,7 @@ class QtiMapper : public IQtiMapper { Return getColorSpace(void *buffer, getColorSpace_cb _hidl_cb) override; Return getYuvPlaneInfo(void *buffer, getYuvPlaneInfo_cb _hidl_cb) override; Return 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 service = new QtiAllocator(); + android::sp service = new QtiAllocator(); configureRpcThreadpool(1, true /*callerWillJoin*/); if (service->registerAsService() != android::OK) { ALOGE("Cannot register QTI Allocator service");