Permalink
Browse files

preview fix for msm7k

  *credit to stritfajt for figuring it out
  *gralloc usage stuff from rapmv78's panorama fix
  *uses original gralloc_priv.h include location

Change-Id: Ie409c5b4df1369483a34b8eca1859988d91ae43d
  • Loading branch information...
MongooseHelix committed May 6, 2012
1 parent 7da8894 commit 2446d35b2e8193464fde6409bb881842582b0f49
Showing with 17 additions and 2 deletions.
  1. +7 −2 Android.mk
  2. +10 −0 QcomCamera.cpp
View
@@ -15,8 +15,13 @@ LOCAL_SHARED_LIBRARIES := liblog libutils libcamera_client libbinder \
LOCAL_C_INCLUDES := frameworks/base/services \
frameworks/base/include \
- hardware/libhardware/include \
- hardware/qcom/display/libgralloc
+ hardware/libhardware/include
+ifeq ($(TARGET_BOARD_PLATFORM),msm7k)
+LOCAL_C_INCLUDES += hardware/libhardware/modules/gralloc
+LOCAL_CFLAGS := -DPREVIEW_MSM7K
+else
+LOCAL_C_INCLUDES += hardware/qcom/display/libgralloc
+endif
LOCAL_PRELINK_MODULE := false
View
@@ -36,6 +36,10 @@ extern "C" {
#include <sys/time.h>
}
+#ifdef PREVIEW_MSM7K
+#define GRALLOC_USAGE_PMEM_PRIVATE_ADSP GRALLOC_USAGE_PRIVATE_0
+#endif
+
/* HAL function implementation goes here*/
/**
@@ -220,6 +224,12 @@ CameraHAL_HandlePreviewData(const sp<IMemory>& dataPtr,
"offset:%#x size:%#x base:%p", previewWidth, previewHeight,
(unsigned)offset, size, mHeap != NULL ? mHeap->base() : 0);
+#ifdef PREVIEW_MSM7K
+ mWindow->set_usage(mWindow,
+ GRALLOC_USAGE_PMEM_PRIVATE_ADSP |
+ GRALLOC_USAGE_SW_READ_OFTEN);
+#endif
+
retVal = mWindow->set_buffers_geometry(mWindow,
previewWidth, previewHeight,
HAL_PIXEL_FORMAT_RGBX_8888);

0 comments on commit 2446d35

Please sign in to comment.