Chinese translated version of Documentation/media/v4l-drivers/omap3isp.rst
If you have any comment or update to the content, please contact the
original document maintainer directly. However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help. Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.
Maintainer: Laurent Pinchart laurent.pinchart@ideasonboard.com
Sakari Ailus sakari.ailus@iki.fi
David Cohen dacohen@gmail.com
Chinese maintainer: Fu Wei tekkamanninja@gmail.com
Documentation/media/v4l-drivers/omap3isp.rst çä¸æç¿»è¯
å¦ææ³è¯è®ºææ´æ°æ¬æçå
容ï¼è¯·ç´æ¥èç³»åææ¡£çç»´æ¤è
ãå¦æä½ ä½¿ç¨è±æ
交æµæå°é¾çè¯ï¼ä¹å¯ä»¥åä¸æçç»´æ¤è
æ±å©ãå¦ææ¬ç¿»è¯æ´æ°ä¸åæ¶æè
ç¿»
è¯åå¨é®é¢ï¼è¯·èç³»ä¸æçç»´æ¤è
ã
è±æçç»´æ¤è
ï¼ Laurent Pinchart laurent.pinchart@ideasonboard.com
Sakari Ailus sakari.ailus@iki.fi
David Cohen dacohen@gmail.com
ä¸æçç»´æ¤è
ï¼ å
ç Fu Wei tekkamanninja@gmail.com
ä¸æçç¿»è¯è
ï¼ å
ç Fu Wei tekkamanninja@gmail.com
ä¸æçæ ¡è¯è
ï¼ å
ç Fu Wei tekkamanninja@gmail.com
以ä¸ä¸ºæ£æ
OMAP 3 å¾åä¿¡å·å¤çå¨ (ISP) 驱å¨
Copyright (C) 2010 Nokia Corporation
Copyright (C) 2009 Texas Instruments, Inc.
è系人: Laurent Pinchart laurent.pinchart@ideasonboard.com
Sakari Ailus sakari.ailus@iki.fi
David Cohen dacohen@gmail.com
ä»ç»
æ¬ææ¡£ä»ç»äºç± drivers/media/video/omap3isp å è½½çå¾·å·ä»ªå¨
ï¼TIï¼OMAP 3 å¾åä¿¡å·å¤çå¨ (ISP) 驱å¨ãåå§é©±å¨ç±å¾·å·ä»ªå¨ï¼TIï¼
ç¼åï¼ä½æ¤åç±è¯ºåºäºéåäºä¸¤æ¬¡ã
驱å¨å·²å¨ä»¥ä¸ OMAP 3 ç³»åçè¯çä¸æå使ç¨ï¼
3430
3530
3630
驱å¨å®ç°äº V4L2ãåªä½æ§å¶å¨å v4l2_subdev æ¥å£ãæ¯æå
æ ¸ä¸ä½¿ç¨
v4l2_subdev æ¥å£çä¼ æå¨ãé头åéªå
ç¯é©±å¨ã
æå为å设å¤
OMAP 3 ISP 被æå为 V4L2 å设å¤ï¼ISPä¸çæ¯ä¸ªæ¨¡åé½ç±ä¸ä¸ªå设å¤
æ¥è¡¨ç¤ºãæ¯ä¸ªå设å¤åç¨æ·ç©ºé´æä¾ä¸ä¸ª V4L2 å设å¤æ¥å£ã
OMAP3 ISP CCP2
OMAP3 ISP CSI2a
OMAP3 ISP CCDC
OMAP3 ISP preview
OMAP3 ISP resizer
OMAP3 ISP AEWB
OMAP3 ISP AF
OMAP3 ISP histogram
ISP ä¸æ¯ä¸ªå¯è½çè¿æ¥é½éè¿ä¸ä¸ªé¾æ¥åµå ¥å°åªä½æ§å¶å¨æ¥å£ä¸ã详è§ä¾ç¨ [2]ã
æ§å¶ OMAP 3 ISP
é常ï¼å¯¹ OMAP 3 ISP çé
ç½®ä¼å¨ä¸ä¸å¸§èµ·å§æ¶çæãå¨ä¼ æå¨åç´æ¶éæé´ï¼
模åå为空é²æ¶å®æé
ç½®ãå¨å
åå°å
åçæä½ä¸ï¼è§é¢ç®¡éä¸æ¬¡å¤çä¸å¸§ã
åºç¨é
ç½®åºå¨å¸§é´å®æã
ISP ä¸çææ模åï¼é¤ CSI-2 å ï¼å¯è½åå¨çï¼CCP2 æ¥æ¶å¨å¤ï¼é½å¿
é¡»
æ¥æ¶å®æ´ç帧æ°æ®ãå æ¤ï¼ä¼ æå¨å¿
é¡»ä¿è¯ä»ä¸åéé¨å帧æ°æ®ç»ISPã
Autoidleï¼èªå¨ç©ºé²ï¼åè½è³å°å¨ 3430 ç ISP 模åä¸ç¡®å®åå¨ä¸äºé®é¢ã
å½ omap3isp 模ååæ° autoidle éé¶æ¶ï¼autoidleï¼èªå¨ç©ºé²ï¼åè½
ä»
å¨ 3630 ä¸å¯ç¨äºã
äºä»¶æºå¶
OMAP 3 ISP 驱å¨å¨ CCDC åç»è®¡ï¼AEWBãAF å ç´æ¹å¾ï¼å设å¤ä¸æ¯æ
V4L2 äºä»¶æºå¶æ¥å£ã
CCDC å设å¤éè¿ HS_VS ä¸æï¼å¤ç V4L2_EVENT_FRAME_SYNC ç±»å
äºä»¶ï¼ç¨äºåç¥å¸§èµ·å§ãæ©æçæ¬ç驱å¨åä½¿ç¨ V4L2_EVENT_OMAP3ISP_HS_VSã
å½å¨ CCDC 模åä¸æ¥æ¶å°èµ·å§å¸§ç第ä¸è¡æ¶ï¼ä¼åç¡®å°è§¦åäºä»¶ãè¿ä¸ªäºä»¶
å¯ä»¥å¨ CCDC å设å¤ä¸â订é
âã
ï¼å½ä½¿ç¨å¹¶è¡æ¥å£æ¶ï¼å¿
须注ææ£ç¡®å°é
ç½® VS ä¿¡å·ææ§ãèå½ä½¿ç¨ä¸²è¡æ¥æ¶æ¶
è¿ä¸ªä¼èªå¨æ ¡æ£ãï¼
æ¯ä¸ªç»è®¡å设å¤é½å¯ä»¥äº§çäºä»¶ãæ¯å½ä¸ä¸ªç»è®¡ç¼å²åºå¯ç±ç¨æ·ç©ºé´åºç¨ç¨åº
éè¿ VIDIOC_OMAP3ISP_STAT_REQ IOCTL æä½è·åæ¶ï¼å°±ä¼äº§çä¸ä¸ª
äºä»¶ãå½ååå¨ä»¥ä¸äºä»¶ï¼
V4L2_EVENT_OMAP3ISP_AEWB
V4L2_EVENT_OMAP3ISP_AF
V4L2_EVENT_OMAP3ISP_HIST
è¿äº ioctl çäºä»¶æ°æ®ç±»å为 struct omap3isp_stat_event_status
ç»æä½ãå¦æåºç°è®¡ç®é误çç»è®¡ï¼ä¹åæ ·ä¼äº§çä¸ä¸ªäºä»¶ï¼ä½æ²¡æç¸å
³çç»è®¡
æ°æ®ç¼å²åºãè¿ç§æ
åµä¸ omap3isp_stat_event_status.buf_err ä¼è¢«
设置为éé¶å¼ã
ç§æ IOCTL
OMAP 3 ISP 驱å¨æ¯ææ åç V4L2 IOCTL 以åå¯è½åå¨ä¸å®ç¨çæ§å¶ãä½
ISP æä¾ç许å¤åè½é½ä¸å¨æ å IOCTL ä¹åï¼ä¾å¦ gammaï¼ä¼½é©¬ï¼è¡¨åç»è®¡
æ°æ®ééé
ç½®çã
é常ï¼ä¼æä¸ä¸ªç§æ ioctl ç¨äºé ç½®æ¯ä¸ªå å«ç¡¬ä»¶ä¾èµåè½ç模åã
æ¯æ以ä¸ç§æ IOCTLï¼
VIDIOC_OMAP3ISP_CCDC_CFG
VIDIOC_OMAP3ISP_PRV_CFG
VIDIOC_OMAP3ISP_AEWB_CFG
VIDIOC_OMAP3ISP_HIST_CFG
VIDIOC_OMAP3ISP_AF_CFG
VIDIOC_OMAP3ISP_STAT_REQ
VIDIOC_OMAP3ISP_STAT_EN
å¨ include/linux/omap3isp.h ä¸æè¿°äºè¿äº ioctl 使ç¨çåæ°ç»æä½ã
ä¸ç¹å® ISP 模åç¸å
³ç ISP èªèº«ç详ç»åè½å¨ææ¯åèæå (TRMs)ä¸æ
æè¿°ï¼è¯¦è§ææ¡£ç»å°¾ã
è½ç¶å¨ä¸ä½¿ç¨ä»»ä½ç§æ IOCTL çæ
åµä¸ä½¿ç¨ ISP 驱å¨æ¯å¯è½çï¼ä½è¿æ ·æ æ³
è·å¾æä½³çå¾åè´¨éãAEWBãAF å ç´æ¹å¾ï¼è¯è
注ï¼ä¸è¬ç¨äºèªå¨æå
åå¢ç
æ§å¶ï¼ä»¥åå¾ååè¡¡çï¼æ¨¡åæ æ³å¨æªä½¿ç¨éå½çç§æ IOCTL é
ç½®çæ
åµä¸ä½¿ç¨ã
CCDC å previewï¼é¢è§ï¼æ¨¡å IOCTL
VIDIOC_OMAP3ISP_CCDC_CFG å VIDIOC_OMAP3ISP_PRV_CFG IOCTL
被åå«ç¨äºé
ç½®ãå¯ç¨åç¦ç¨ CCDC å previewï¼é¢è§ï¼æ¨¡åçåè½ãå¨å®ä»¬
ææ§å¶ç模åä¸ï¼ä¸¤ä¸ª IOCTL æ§å¶å¤ç§åè½ãVIDIOC_OMAP3ISP_CCDC_CFG IOCTL
æ¥åä¸ä¸ªæå omap3isp_ccdc_update_config ç»æä½çæéä½ä¸ºå®çåæ°ã
åæ ·çï¼VIDIOC_OMAP3ISP_PRV_CFG æ¥åä¸ä¸ªæå omap3isp_prev_update_config
ç»æä½çæéã以ä¸ä¸¤ä¸ªç»æä½å®ä¹ä½äº [1]ã
è¿äºç»æä½ä¸ç update åæ è¯æ¯å¦é对æå®çåè½æ´æ°é
ç½®ï¼è flag å
åæ è¯æ¯å¯ç¨è¿æ¯ç¦ç¨æ¤åè½ã
update å flag ä½æ¥å以ä¸æ©ç å¼ãCCDC å previewï¼é¢è§ï¼æ¨¡åç
æ¯ä¸ªåç¬åè½é½ä¸ä¸ä¸ª flag å
³èï¼ç¦ç¨æå¯ç¨ï¼å¨ç»æä½ä¸ flag åç
ä¸é¨åï¼åä¸ä¸ªæååè½é
ç½®æ°æ®çæéã
å¯¹äº VIDIOC_OMAP3ISP_CCDC_CFGï¼ä¸é¢ååºäº update å flag å
ä¸çææå¼ã è¿äºå¼å¯è½ä¼å¨åä¸ä¸ª IOCTL è°ç¨ä¸é
ç½®å¤ä¸ªåè½ã
OMAP3ISP_CCDC_ALAW
OMAP3ISP_CCDC_LPF
OMAP3ISP_CCDC_BLCLAMP
OMAP3ISP_CCDC_BCOMP
OMAP3ISP_CCDC_FPC
OMAP3ISP_CCDC_CULL
OMAP3ISP_CCDC_CONFIG_LSC
OMAP3ISP_CCDC_TBL_LSC
é对 VIDIOC_OMAP3ISP_PRV_CFG çç¸åºå¼å¦ä¸ï¼
OMAP3ISP_PREV_LUMAENH
OMAP3ISP_PREV_INVALAW
OMAP3ISP_PREV_HRZ_MED
OMAP3ISP_PREV_CFA
OMAP3ISP_PREV_CHROMA_SUPP
OMAP3ISP_PREV_WB
OMAP3ISP_PREV_BLKADJ
OMAP3ISP_PREV_RGB2RGB
OMAP3ISP_PREV_COLOR_CONV
OMAP3ISP_PREV_YC_LIMIT
OMAP3ISP_PREV_DEFECT_COR
OMAP3ISP_PREV_GAMMABYPASS
OMAP3ISP_PREV_DRK_FRM_CAPTURE
OMAP3ISP_PREV_DRK_FRM_SUBTRACT
OMAP3ISP_PREV_LENS_SHADING
OMAP3ISP_PREV_NF
OMAP3ISP_PREV_GAMMA
å¨å¯ç¨æ个åè½çæ¶åï¼ç¸å
³çé
ç½®æ°æ®æéä¸å¯ä¸º NULLãå¨ç¦ç¨æ个åè½æ¶ï¼
é
ç½®æ°æ®æéä¼è¢«å¿½ç¥ã
ç»è®¡æ¨¡å IOCTL
ç»è®¡å设å¤ç¸è¾äºå
¶ä»å设å¤æä¾äºæ´å¤å¨æé
ç½®é项ãå¨å¾åå¤çæµæ°´çº¿å¤äº
å·¥ä½ç¶ææ¶ï¼å®ä»¬å¯ä»¥è¢«å¯ç¨ãç¦ç¨åéé
ã
ç»è®¡æ¨¡åæ»æ¯ä» CCDC ä¸è·åè¾å
¥çå¾åæ°æ®ï¼ç±äºç´æ¹å¾å
å读åæªå®ç°ï¼ã
ç»è®¡æ°æ®å¯ç±ç¨æ·éè¿ç»è®¡å设å¤èç¹ä½¿ç¨ç§æ IOCTL è·åã
AEWBãAF å ç´æ¹å¾å设å¤æä¾çç§æ IOCTL æ大ç¨åº¦ä¸ååºäº ISP 硬件
æä¾çå¯åå¨çº§æ¥å£ãæäºæ¹é¢çº¯ç²¹å驱å¨ç¨åºçå®ç°ç¸å
³ï¼è¿äºå°å¨ä¸é¢è®¨è®ºã
VIDIOC_OMAP3ISP_STAT_EN
è¿ä¸ªç§æ IOCTL å¯ç¨/ç¦ç¨ ä¸ä¸ªç»è®¡æ¨¡åãå¦æè¿ä¸ªç³è¯·å¨è§é¢æµå¯å¨åå®æï¼
å®å°å¨è§é¢æµæ°´çº¿å¼å§å·¥ä½æ¶çæãå¦æè§é¢æµæ°´çº¿å·²ç»å¤äºå·¥ä½ç¶æäºï¼å®å°å¨
CCDC å为空é²æ¶çæã
VIDIOC_OMAP3ISP_AEWB_CFG, VIDIOC_OMAP3ISP_HIST_CFG and VIDIOC_OMAP3ISP_AF_CFG
è¿äº IOCTL ç¨äºé
置模åãå®ä»¬è¦æ±ç¨æ·åºç¨ç¨åºå¯¹ç¡¬ä»¶ææ·±å
¥ç认è¯ã对
大å¤æ°åç解éå¯ä»¥å¨ OMAP ç TRM ä¸æ¾å°ã以ä¸ä¸¤ä¸ªå对äºä»¥ä¸ææç
ç§æ IOCTL é
ç½®é½å¾å¸¸è§ï¼ç±äºä»ä»¬æ²¡æå¨ TRM ä¸æåï¼æ
éè¦å¯¹å
¶æ
æ´å¥½ç认è¯ã
omap3isp_[h3a_af/h3a_aewb/hist]_config.buf_size:
模åå¨å
é¨å¤çèªèº«ç¼å²ã对模åæ°æ®è¾åºæå¿
éçç¼å大å°ä¾èµäºå·²ç³è¯·çé
ç½®ã
è½ç¶é©±å¨æ¯æå¨è§é¢æµå·¥ä½æ¶éæ°é
ç½®ï¼ä½å¯¹äºæéç¼åé大äºæ¨¡åå¯ç¨æ¶å
é¨
æåé
æ°éçæ
åµï¼åä¸æ¯æéæ°é
ç½®ãå¨è¿ç§æ
åµä¸å°è¿å -EBUSYã为äºé¿å
æ¤ç±»ç¶åµï¼æ 论æ¯ç¦ç¨/éé
/å¯ç¨æ¨¡åï¼è¿æ¯ç¬¬ä¸æ¬¡é
ç½®æ¶ç³è¯·å¿
é¡»çç¼å大å°ï¼
é½åºå¨æ¨¡åç¦ç¨çæ
åµä¸è¿è¡ã
å
é¨ç¼å²åé
ç大å°é综åèèæç³è¯·é
ç½®çæå°ç¼åé以å buf_size åä¸
æ设çå¼ãå¦æ buf_size åå¨[minimumï¼æå°å¼ï¼, maximumï¼æ大å¼ï¼]
ç¼å²å¤§å°èå´ä¹å¤ï¼ååºè¯¥å°å
¶è°æ´å°å
¶èå´ä¸ã驱å¨åä¼éæ©æ大å¼ãæ£ç¡®ç
buf_size å¼å°ååå°ç¨æ·åºç¨ç¨åºä¸ã
omap3isp_[h3a_af/h3a_aewb/hist]_config.config_counter:
ç±äºé
置并æªå¨ç³è¯·ä¹ååæ¥çæï¼é©±å¨å¿
é¡»æä¾ä¸ä¸ªè·è¸ªè¿ç±»ä¿¡æ¯çæ¹æ³ï¼
以æä¾æ´åç¡®çæ°æ®ãå¨ä¸ä¸ªé
置被ç³è¯·ä¹åï¼è¿åå°ç¨æ·ç©ºé´åºç¨ç¨åºç
config_counter æ¯ä¸ä¸ªä¸å
¶é
ç½®ç¸å
³çå¯ä¸å¼ãå½ç¨æ·åºç¨ç¨åºæ¥æ¶å°
ä¸ä¸ªç¼å²å¯ç¨æä¸ä¸ªæ°çç¼å²ç³è¯·äºä»¶æ¶ï¼è¿ä¸ª config_counter ç¨äº
ä¸ä¸ªç¼å²æ°æ®åä¸ä¸ªé
ç½®çå¹é
ã
VIDIOC_OMAP3ISP_STAT_REQ
å°å
é¨ç¼å²éåä¸ææ©çæ°æ®åéå°ç¨æ·ç©ºé´ï¼ç¶å丢å¼æ¤ç¼å²åºã
omap3isp_stat_data.frame_number åä¸è§é¢ç¼å²ç field_count
åç¸å¹é
ã
ææ¯åèæå (TRMs) åå ¶ä»ææ¡£
OMAP 3430 TRM:
URL:http://focus.ti.com/pdfs/wtbu/OMAP34xx_ES3.1.x_PUBLIC_TRM_vZM.zip
åèäº 2011-03-05.
OMAP 35xx TRM:
URL:http://www.ti.com/litv/pdf/spruf98o åèäº 2011-03-05.
OMAP 3630 TRM:
URL:http://focus.ti.com/pdfs/wtbu/OMAP36xx_ES1.x_PUBLIC_TRM_vQ.zip
åèäº 2011-03-05.
DM 3730 TRM:
URL:http://www.ti.com/litv/pdf/sprugn4h åèäº 2011-03-06.
åèèµæ
[1] include/linux/omap3isp.h