Loading include/ui/Gralloc1.h +8 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,10 @@ public: gralloc1_consumer_usage_t consumerUsage, const gralloc1_rect_t* accessRegion, struct android_ycbcr* outData, const sp<Fence>& acquireFence); #ifdef EXYNOS4_ENHANCEMENTS gralloc1_error_t getphys(buffer_handle_t buffer, void **paddr); #endif gralloc1_error_t unlock(buffer_handle_t buffer, sp<Fence>* outFence); Loading Loading @@ -208,6 +212,10 @@ private: GRALLOC1_FUNCTION_LOCK_YCBCR> lockYCbCr; FunctionLoader<GRALLOC1_PFN_UNLOCK, GRALLOC1_FUNCTION_UNLOCK> unlock; #ifdef EXYNOS4_ENHANCEMENTS FunctionLoader<GRALLOC1_PFN_GETPHYS, GRALLOC1_FUNCTION_GETPHYS> getphys; #endif // Adapter-only functions FunctionLoader<GRALLOC1_PFN_RETAIN_GRAPHIC_BUFFER, Loading include/ui/Gralloc1On0Adapter.h +13 −1 Original line number Diff line number Diff line Loading @@ -102,6 +102,14 @@ private: } std::string mCachedDump; #ifdef EXYNOS4_ENHANCEMENTS static int32_t getphysHook(gralloc1_device_t* device, buffer_handle_t handle, void **paddr) { return getAdapter(device)->getphys(device, handle, paddr); } #endif // Buffer descriptor lifecycle functions class Descriptor; Loading Loading @@ -335,7 +343,11 @@ private: static gralloc1_error_t allocateWithIdHook(gralloc1_device_t* device, gralloc1_buffer_descriptor_t descriptors, gralloc1_backing_store_t id, buffer_handle_t* outBuffer); #ifdef EXYNOS4_ENHANCEMENTS gralloc1_error_t getphys(gralloc1_device_t* device, buffer_handle_t buffer, void **paddr); #endif gralloc1_error_t retain(const std::shared_ptr<Buffer>& buffer); gralloc1_error_t release(const std::shared_ptr<Buffer>& buffer); Loading libs/ui/Gralloc1.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,14 @@ gralloc1_error_t Device::lockYCbCr(buffer_handle_t buffer, consumerUsage, accessRegion, outData, acquireFence); } #ifdef EXYNOS4_ENHANCEMENTS gralloc1_error_t Device::getphys(buffer_handle_t buffer, void** paddr) { int32_t intError = mFunctions.getphys(mDevice, buffer, paddr); return static_cast<gralloc1_error_t>(intError); } #endif gralloc1_error_t Device::unlock(buffer_handle_t buffer, sp<Fence>* outFence) { int32_t fenceFd = -1; Loading Loading @@ -348,6 +356,11 @@ bool Device::loadFunctions() if (!mFunctions.unlock.load(mDevice, true)) { return false; } #ifdef EXYNOS4_ENHANCEMENTS if (!mFunctions.getphys.load(mDevice, true)) { return false; } #endif if (hasCapability(GRALLOC1_CAPABILITY_ON_ADAPTER)) { // These should always be present on the adapter Loading libs/ui/Gralloc1On0Adapter.cpp +25 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,10 @@ gralloc1_function_pointer_t Gralloc1On0Adapter::doGetFunction( &Gralloc1On0Adapter::lockYCbCr>); case GRALLOC1_FUNCTION_UNLOCK: return asFP<GRALLOC1_PFN_UNLOCK>(unlockHook); #ifdef EXYNOS4_ENHANCEMENTS case GRALLOC1_FUNCTION_GETPHYS: return asFP<GRALLOC1_PFN_GETPHYS>(getphysHook); #endif case GRALLOC1_FUNCTION_INVALID: ALOGE("Invalid function descriptor"); return nullptr; Loading Loading @@ -285,6 +289,27 @@ gralloc1_error_t Gralloc1On0Adapter::allocateWithIdHook( return error; } #ifdef EXYNOS4_ENHANCEMENTS gralloc1_error_t Gralloc1On0Adapter::getphys( gralloc1_device_t* device, buffer_handle_t handle, void **paddr) { gralloc1_error_t err; auto adapter = getAdapter(device); int res = mModule->getphys(mModule, handle, paddr); if (res) { ALOGE("getphys(%p) fail %d(%s)", handle, res, strerror(-res)); err = GRALLOC1_ERROR_UNDEFINED; } else { err = GRALLOC1_ERROR_NONE; } return err; } #endif gralloc1_error_t Gralloc1On0Adapter::retain( const std::shared_ptr<Buffer>& buffer) { Loading libs/ui/GraphicBufferMapper.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -292,7 +292,7 @@ status_t GraphicBufferMapper::getphys(buffer_handle_t handle, void** paddr) { status_t err; err = mAllocMod->getphys(mAllocMod, handle, paddr); err = mDevice->getphys(handle, paddr); ALOGW_IF(err, "getphys(%p) fail %d(%s)", handle, err, strerror(-err)); return err; Loading Loading
include/ui/Gralloc1.h +8 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,10 @@ public: gralloc1_consumer_usage_t consumerUsage, const gralloc1_rect_t* accessRegion, struct android_ycbcr* outData, const sp<Fence>& acquireFence); #ifdef EXYNOS4_ENHANCEMENTS gralloc1_error_t getphys(buffer_handle_t buffer, void **paddr); #endif gralloc1_error_t unlock(buffer_handle_t buffer, sp<Fence>* outFence); Loading Loading @@ -208,6 +212,10 @@ private: GRALLOC1_FUNCTION_LOCK_YCBCR> lockYCbCr; FunctionLoader<GRALLOC1_PFN_UNLOCK, GRALLOC1_FUNCTION_UNLOCK> unlock; #ifdef EXYNOS4_ENHANCEMENTS FunctionLoader<GRALLOC1_PFN_GETPHYS, GRALLOC1_FUNCTION_GETPHYS> getphys; #endif // Adapter-only functions FunctionLoader<GRALLOC1_PFN_RETAIN_GRAPHIC_BUFFER, Loading
include/ui/Gralloc1On0Adapter.h +13 −1 Original line number Diff line number Diff line Loading @@ -102,6 +102,14 @@ private: } std::string mCachedDump; #ifdef EXYNOS4_ENHANCEMENTS static int32_t getphysHook(gralloc1_device_t* device, buffer_handle_t handle, void **paddr) { return getAdapter(device)->getphys(device, handle, paddr); } #endif // Buffer descriptor lifecycle functions class Descriptor; Loading Loading @@ -335,7 +343,11 @@ private: static gralloc1_error_t allocateWithIdHook(gralloc1_device_t* device, gralloc1_buffer_descriptor_t descriptors, gralloc1_backing_store_t id, buffer_handle_t* outBuffer); #ifdef EXYNOS4_ENHANCEMENTS gralloc1_error_t getphys(gralloc1_device_t* device, buffer_handle_t buffer, void **paddr); #endif gralloc1_error_t retain(const std::shared_ptr<Buffer>& buffer); gralloc1_error_t release(const std::shared_ptr<Buffer>& buffer); Loading
libs/ui/Gralloc1.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,14 @@ gralloc1_error_t Device::lockYCbCr(buffer_handle_t buffer, consumerUsage, accessRegion, outData, acquireFence); } #ifdef EXYNOS4_ENHANCEMENTS gralloc1_error_t Device::getphys(buffer_handle_t buffer, void** paddr) { int32_t intError = mFunctions.getphys(mDevice, buffer, paddr); return static_cast<gralloc1_error_t>(intError); } #endif gralloc1_error_t Device::unlock(buffer_handle_t buffer, sp<Fence>* outFence) { int32_t fenceFd = -1; Loading Loading @@ -348,6 +356,11 @@ bool Device::loadFunctions() if (!mFunctions.unlock.load(mDevice, true)) { return false; } #ifdef EXYNOS4_ENHANCEMENTS if (!mFunctions.getphys.load(mDevice, true)) { return false; } #endif if (hasCapability(GRALLOC1_CAPABILITY_ON_ADAPTER)) { // These should always be present on the adapter Loading
libs/ui/Gralloc1On0Adapter.cpp +25 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,10 @@ gralloc1_function_pointer_t Gralloc1On0Adapter::doGetFunction( &Gralloc1On0Adapter::lockYCbCr>); case GRALLOC1_FUNCTION_UNLOCK: return asFP<GRALLOC1_PFN_UNLOCK>(unlockHook); #ifdef EXYNOS4_ENHANCEMENTS case GRALLOC1_FUNCTION_GETPHYS: return asFP<GRALLOC1_PFN_GETPHYS>(getphysHook); #endif case GRALLOC1_FUNCTION_INVALID: ALOGE("Invalid function descriptor"); return nullptr; Loading Loading @@ -285,6 +289,27 @@ gralloc1_error_t Gralloc1On0Adapter::allocateWithIdHook( return error; } #ifdef EXYNOS4_ENHANCEMENTS gralloc1_error_t Gralloc1On0Adapter::getphys( gralloc1_device_t* device, buffer_handle_t handle, void **paddr) { gralloc1_error_t err; auto adapter = getAdapter(device); int res = mModule->getphys(mModule, handle, paddr); if (res) { ALOGE("getphys(%p) fail %d(%s)", handle, res, strerror(-res)); err = GRALLOC1_ERROR_UNDEFINED; } else { err = GRALLOC1_ERROR_NONE; } return err; } #endif gralloc1_error_t Gralloc1On0Adapter::retain( const std::shared_ptr<Buffer>& buffer) { Loading
libs/ui/GraphicBufferMapper.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -292,7 +292,7 @@ status_t GraphicBufferMapper::getphys(buffer_handle_t handle, void** paddr) { status_t err; err = mAllocMod->getphys(mAllocMod, handle, paddr); err = mDevice->getphys(handle, paddr); ALOGW_IF(err, "getphys(%p) fail %d(%s)", handle, err, strerror(-err)); return err; Loading