summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHashcode <hashcode0f@gmail.com>2015-02-03 13:59:34 -0800
committerHashcode <hashcode0f@gmail.com>2015-02-03 13:59:34 -0800
commitd90446340834c8c10cdd7bf94852747c96c4afa3 (patch)
tree2bcd7a14cc692ea6164d431bd2f613e6c90a920a
parent90007397e53d5b94763946ce2c90004d98aa7ed6 (diff)
downloadhardware_ti_omap4-d90446340834c8c10cdd7bf94852747c96c4afa3.zip
hardware_ti_omap4-d90446340834c8c10cdd7bf94852747c96c4afa3.tar.gz
hardware_ti_omap4-d90446340834c8c10cdd7bf94852747c96c4afa3.tar.bz2
camera: add flag USE_LIBION_TI and adjust checks in camera HAL
Make sure we use modified TI ion calls when this is set
-rwxr-xr-xcamera/Android.mk2
-rw-r--r--camera/MemoryManager.cpp5
-rw-r--r--camera/inc/CameraHal.h2
3 files changed, 7 insertions, 2 deletions
diff --git a/camera/Android.mk b/camera/Android.mk
index 95f19f8..97a6abf 100755
--- a/camera/Android.mk
+++ b/camera/Android.mk
@@ -238,7 +238,7 @@ ifeq ($(OMAP4_CAMERA_HAL_USES),ALL)
include $(CLEAR_VARS)
-CAMERAHAL_CFLAGS += -DOMX_CAMERA_ADAPTER -DV4L_CAMERA_ADAPTER
+CAMERAHAL_CFLAGS += -DOMX_CAMERA_ADAPTER -DV4L_CAMERA_ADAPTER -DUSE_LIBION_TI
LOCAL_SRC_FILES:= \
$(TI_CAMERAHAL_COMMON_SRC) \
diff --git a/camera/MemoryManager.cpp b/camera/MemoryManager.cpp
index 8d40b76..b684203 100644
--- a/camera/MemoryManager.cpp
+++ b/camera/MemoryManager.cpp
@@ -91,8 +91,13 @@ CameraBuffer* MemoryManager::allocateBufferList(int width, int height, const cha
///1D buffers
for (int i = 0; i < numBufs; i++) {
unsigned char *data;
+#ifdef USE_LIBION_TI
int ret = ion_alloc(mIonFd, size, 0, 1 << ION_HEAP_TYPE_CARVEOUT,
&handle);
+#else
+ int ret = ion_alloc(mIonFd, size, 0, 1 << ION_HEAP_TYPE_CARVEOUT, 0,
+ &handle);
+#endif
if((ret < 0) || ((int)handle == -ENOMEM)) {
ret = ion_alloc_tiler(mIonFd, (size_t)size, 1, TILER_PIXEL_FMT_PAGE,
OMAP_ION_HEAP_TILER_MASK, &handle, &stride);
diff --git a/camera/inc/CameraHal.h b/camera/inc/CameraHal.h
index 9b92da3..4a21a67 100644
--- a/camera/inc/CameraHal.h
+++ b/camera/inc/CameraHal.h
@@ -48,7 +48,7 @@
#include <ui/GraphicBufferMapper.h>
#include <hal_public.h>
-#ifdef ANDROID_API_JB_MR1_OR_LATER
+#ifdef USE_LIBION_TI
#include <ion_ti/ion.h>
#else
#include <ion/ion.h>