[hardware/rockchip/camera] Camerahal: v1.0x36.e

This commit is contained in:
Firefly
2015-08-21 09:51:26 +08:00
committed by djw
parent 9c729480a5
commit 58e57f49a8
5 changed files with 8 additions and 26 deletions

View File

@ -658,14 +658,10 @@ int CameraAdapter::getFrame(FramInfo_s** tmpFrame){
mPreviewFrameInfos[cfilledbuffer1.index].frame_width = mCamDrvWidth;
mPreviewFrameInfos[cfilledbuffer1.index].frame_index = cfilledbuffer1.index;
if(mCamDriverV4l2MemType == V4L2_MEMORY_OVERLAY){
/*#if ((defined(TARGET_RK312x) && (IOMMU_ENABLED == 1)))
if(cif_driver_iommu){
mPreviewFrameInfos[cfilledbuffer1.index].phy_addr = mPreviewBufProvider->getBufShareFd(cfilledbuffer1.index);
#else*/
if(cif_driver_iommu && (IOMMU_ENABLED == 1)){
mPreviewFrameInfos[cfilledbuffer1.index].phy_addr = mPreviewBufProvider->getBufShareFd(cfilledbuffer1.index);
}else
mPreviewFrameInfos[cfilledbuffer1.index].phy_addr = mPreviewBufProvider->getBufPhyAddr(cfilledbuffer1.index);
//#endif
}else
mPreviewFrameInfos[cfilledbuffer1.index].phy_addr = mPreviewBufProvider->getBufPhyAddr(cfilledbuffer1.index);
}else
mPreviewFrameInfos[cfilledbuffer1.index].phy_addr = 0;
mPreviewFrameInfos[cfilledbuffer1.index].vir_addr = (unsigned long)mCamDriverV4l2Buffer[cfilledbuffer1.index];

View File

@ -88,11 +88,6 @@ CameraHal::CameraHal(int cameraId)
mCamMemManager = new IonMemManager();
LOG1("%s(%d): Camera Hal memory is alloced from ION device",__FUNCTION__,__LINE__);
#elif(CONFIG_CAMERA_MEM == CAMERA_MEM_IONDMA)
if((strcmp(gCamInfos[cameraId].driver,"uvcvideo") == 0) //uvc camera
//|| (gCamInfos[cameraId].pcam_total_info->mHardInfo.mSensorInfo.mPhy.type == CamSys_Phy_end)// soc cif
) {
gCamInfos[cameraId].pcam_total_info->mIsIommuEnabled = (IOMMU_ENABLED == 1)? true:false;
}
mCamMemManager = new IonDmaMemManager(gCamInfos[cameraId].pcam_total_info->mIsIommuEnabled);
LOG1("%s(%d): Camera Hal memory is alloced from ION device",__FUNCTION__,__LINE__);
#elif(CONFIG_CAMERA_MEM == CAMERA_MEM_PMEM)

View File

@ -536,6 +536,10 @@ namespace android {
3) add some setting for usb camera.
*v1.0x36.d:
1) fix risk in v1.0x36.c.
*v1.0x36.e:
1) fix bug in v1.0x36.7:dynamic query iommu status for usb camera.
2) macro IOMMU is invalide, remove it.
3) avoid the access of mDisplayBufInfo when it is NULL.
*/
#define CONFIG_CAMERAHAL_VERSION KERNEL_VERSION(1, 0x36, 0xd)
@ -628,12 +632,6 @@ namespace android {
#endif
#if (defined(TARGET_RK312x)) /*dalon.zhang@rock-chips.com: V1.0x29.7*/
#define IOMMU_ENABLED (1)
#else
#define IOMMU_ENABLED (0)
#endif
#define JPEG_BUFFER_DYNAMIC (1)
#define V4L2_BUFFER_MAX 32

View File

@ -916,13 +916,6 @@ int CameraUSBAdapter::reprocessFrame(FramInfo_s* frame)
int ret = 0;
long phy_addr;
#if 0
#if (IOMMU_ENABLED == 1)
long phy_addr = mPreviewBufProvider->getBufShareFd(frame->frame_index);
#else
long phy_addr = mPreviewBufProvider->getBufPhyAddr(frame->frame_index);
#endif
#endif
if(gCamInfos[mCamId].pcam_total_info->mIsIommuEnabled)
phy_addr = mPreviewBufProvider->getBufShareFd(frame->frame_index);
else

View File

@ -354,7 +354,7 @@ int DisplayAdapter::cameraDisplayBufferCreate(int width, int height, const char
return err;
fail:
for (i = 0; i<total; i++) {
if (mDisplayBufInfo[i].buffer_hnd) {
if (mDisplayBufInfo && mDisplayBufInfo[i].buffer_hnd) {
err = mANativeWindow->cancel_buffer(mANativeWindow, (buffer_handle_t*)mDisplayBufInfo[i].buffer_hnd);
if (err != 0) {
LOGE("%s(%d): cancelBuffer failed w/ error 0x%08x",__FUNCTION__,__LINE__, err);