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

This commit is contained in:
Firefly
2015-07-29 11:31:24 +08:00
committed by djw
parent d2e5260617
commit e820836e3f
6 changed files with 34 additions and 20 deletions

View File

@ -1046,9 +1046,13 @@ int AppMsgNotifier::captureEncProcessPicture(FramInfo_s* frame){
(char*)rawbuf_vir,frame->frame_width, frame->frame_height,
jpeg_w, jpeg_h,false,frame->zoom_value);
#else
rga_nv12_scale_crop(frame->frame_width, frame->frame_height,
(char*)(frame->vir_addr), (short int *)rawbuf_vir,
jpeg_w,jpeg_h,frame->zoom_value,false,!mIs_Verifier,false);
#if defined(TARGET_RK3188)
rk_camera_zoom_ipp(V4L2_PIX_FMT_NV12, (int)(frame->phy_addr), frame->frame_width, frame->frame_height,(int)rawbuf_phy,frame->zoom_value);
#else
rga_nv12_scale_crop(frame->frame_width, frame->frame_height,
(char*)(frame->vir_addr), (short int *)rawbuf_vir,
jpeg_w,jpeg_h,frame->zoom_value,false,!mIs_Verifier,false);
#endif
#endif
input_phy_addr = output_phy_addr;
input_vir_addr = output_vir_addr;

4
hardware/rockchip/camera/CameraHal/CameraAdapter.cpp Normal file → Executable file
View File

@ -181,9 +181,7 @@ status_t CameraAdapter::startPreview(int preview_w,int preview_h,int w, int h, i
{
case V4L2_PIX_FMT_NV12:
case V4L2_PIX_FMT_YUV420:
w = (w+15)&(~15);
h = (h+15)&(~15);
frame_size = w*h*3/2;
frame_size = ((w+15)&(~15))*((h+15)&(~15))*3/2;
break;
case V4L2_PIX_FMT_NV16:
case V4L2_PIX_FMT_YUV422P:

View File

@ -52,11 +52,6 @@ int BufferProvider::createBuffer(int count,int perbufsize,buffer_type_enum bufty
switch(buftype){
case PREVIEWBUFFER:
/*
#if (defined(TARGET_RK312x) || defined(TARGET_RK32))
//should use cma buffer
buf.mIsForceIommuBuf = false;
#endif*/
if(is_cif_driver){//should use cma buffer
buf.mIsForceIommuBuf = false;
}
@ -66,6 +61,9 @@ int BufferProvider::createBuffer(int count,int perbufsize,buffer_type_enum bufty
}
break;
case RAWBUFFER:
#if defined(TARGET_RK3188)//should use cma buffer
buf.mIsForceIommuBuf = false;
#endif
if(mCamBuffer->createRawBuffer(&buf) !=0) {
LOGE("%s(%d): raw buffer create failed",__FUNCTION__,__LINE__);
ret = -1;

View File

@ -121,6 +121,7 @@ extern "C" int cameraFormatConvert(int v4l2_fmt_src, int v4l2_fmt_dst, const cha
bool mirror);
extern "C" int rga_nv12_scale_crop(int src_width, int src_height, char *src, short int *dst,int dst_width,int dst_height,int zoom_val,bool mirror,bool isNeedCrop,bool isDstNV21);
extern "C" int rk_camera_zoom_ipp(int v4l2_fmt_src, int srcbuf, int src_w, int src_h,int dstbuf,int zoom_value);
extern rk_cam_info_t gCamInfos[CAMERAS_SUPPORT_MAX];
@ -525,9 +526,11 @@ namespace android {
1) ensure that input size and offset is 2 alignment for rga.
*v1.0x30.5:
1) src x_offset must be 32 alignment, rga's bug.
*v1.0x36.a:
1) support rk3188 scale by ipp
*/
#define CONFIG_CAMERAHAL_VERSION KERNEL_VERSION(1, 0x36, 9)
#define CONFIG_CAMERAHAL_VERSION KERNEL_VERSION(1, 0x36, a)
/* */

13
hardware/rockchip/camera/CameraHal/CameraHalUtil.cpp Normal file → Executable file
View File

@ -415,8 +415,13 @@ extern "C" int rga_nv12_scale_crop(int src_width, int src_height, char *src, sho
return arm_camera_yuv420_scale_arm(V4L2_PIX_FMT_NV12, (isDstNV21 ? V4L2_PIX_FMT_NV21:V4L2_PIX_FMT_NV12),
src, (char *)dst,src_width, src_height,dst_width, dst_height,true,zoom_val);
}
#endif
#endif
/*rk3188 do not support yuv to yuv scale by rga*/
#if defined(TARGET_RK3188)
return arm_camera_yuv420_scale_arm(V4L2_PIX_FMT_NV12, (isDstNV21 ? V4L2_PIX_FMT_NV21:V4L2_PIX_FMT_NV12),
src, (char *)dst,src_width, src_height,dst_width, dst_height,true,zoom_val);
#endif
if((dst_width > RGA_VIRTUAL_W) || (dst_height > RGA_VIRTUAL_H)){
LOGE("%s(%d):(dst_width > RGA_VIRTUAL_W) || (dst_height > RGA_VIRTUAL_H), switch to arm ",__FUNCTION__,__LINE__);
@ -485,7 +490,7 @@ extern "C" int rga_nv12_scale_crop(int src_width, int src_height, char *src, sho
#if defined(TARGET_RK3188)
Rga_Request.src.yrgb_addr = (long)psY;
Rga_Request.src.uv_addr = (long)psY+ src_cropW * src_cropH;;
Rga_Request.src.uv_addr = (long)psY + src_width * src_height;
#else
Rga_Request.src.yrgb_addr = 0;
Rga_Request.src.uv_addr = (long)psY;
@ -845,7 +850,7 @@ extern "C" int rk_camera_yuv_scale_crop_ipp(int v4l2_fmt_src, int v4l2_fmt_dst,
if((ippFd = open("/dev/rk29-ipp",O_RDWR)) < 0) {
LOGE("%s(%d):open rga device failed!!",__FUNCTION__,__LINE__);
LOGE("%s(%d):open /dev/rk29-ipp device failed!!",__FUNCTION__,__LINE__);
ret = -1;
goto do_ipp_err;
}

View File

@ -323,9 +323,11 @@ int DisplayAdapter::cameraDisplayBufferCreate(int width, int height, const char
/* ddl@rock-chips.com: gralloc buffer is not continuous in phy */
mDisplayBufInfo[i].phy_addr = 0x00;
}
#else
mDisplayBufInfo[i].phy_addr = 0x00;
#endif
#elif defined(TARGET_RK3188)
mDisplayBufInfo[i].phy_addr = mDisplayBufInfo[i].priv_hnd->phy_addr;
#else
mDisplayBufInfo[i].phy_addr = 0x00;
#endif
}
// lock the initial queueable buffers
@ -729,9 +731,13 @@ display_receive_cmd:
mDisplayWidth, mDisplayHeight,
false,frame->zoom_value);
#else
rga_nv12_scale_crop(frame->frame_width, frame->frame_height,
#if defined(TARGET_RK3188)
rk_camera_zoom_ipp(V4L2_PIX_FMT_NV12, (int)(frame->phy_addr), frame->frame_width, frame->frame_height,(int)(mDisplayBufInfo[queue_display_index].phy_addr),frame->zoom_value);
#else
rga_nv12_scale_crop(frame->frame_width, frame->frame_height,
(char*)(frame->vir_addr), (short int *)(mDisplayBufInfo[queue_display_index].vir_addr),
mDisplayWidth,mDisplayHeight,frame->zoom_value,false,true,false);
#endif
#endif
}