diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cdab6b9..01e1012 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -133,10 +133,10 @@ jobs: export HW_MODEL=`echo ${{ matrix.cfg }}|awk -F '_' '{print $1}'` export HW_VER=`echo ${{ matrix.cfg }}|awk -F '_' '{print $3"."$4}'` test -d bin || mkdir ./bin - test -f ./bin/ai_dut && rm -rf ./bin/ai_dut - wget -qc https://ai.b-bug.org/k510_buildroot/github/ai_dut -O ./bin/ai_dut - chmod +x ./bin/ai_dut - available=$(./bin/ai_dut show --dest available --hw_type k510 --hw_model $HW_MODEL --hw_ver $HW_VER --format args) + test -f ./bin/ailab && rm -rf ./bin/ailab + wget -qc https://ai.b-bug.org/k510_buildroot/github/ailab -O ./bin/ailab + chmod +x ./bin/ailab + available=$(./bin/ailab show --dest available --hw_type k510 --hw_model $HW_MODEL --hw_ver $HW_VER --format args) echo $available echo "available=$available" >> $GITHUB_ENV if [[ $available =~ "k510" ]]; then @@ -152,7 +152,7 @@ jobs: echo "Reserve DUT start" echo "PR ID: $PULL_REQUEST_ID" echo "Job ID: $GITHUB_RUN_ID" - reserved=$(./bin/ai_dut add ${{ env.available }} --site github-actions --source $PULL_REQUEST_ID --job $GITHUB_RUN_ID --format args) + reserved=$(./bin/ailab add ${{ env.available }} --time 15m --site github-actions --source $PULL_REQUEST_ID --job $GITHUB_RUN_ID --format args) echo $reserved echo "reserved=$reserved" >> $GITHUB_ENV if [[ $reserved =~ "github-actions" ]]; then @@ -161,12 +161,12 @@ jobs: echo "ERROR: Reserve DUT failed" exit 1 fi - power=$(./bin/ai_dut power --type=cycle ${{ env.available }}) + power=$(./bin/ailab power --type=on ${{ env.available }}) echo $power if [[ $power =~ "True" ]]; then - echo "Power Cycle DUT pass" + echo "Power on DUT pass" else - echo "ERROR: Power Cycle DUT failed" + echo "ERROR: Power on DUT failed" exit 1 fi @@ -178,12 +178,12 @@ jobs: echo "bbl md5: ${{needs.build_image.outputs.md5_bbl}}" echo "dtb md5: ${{needs.build_image.outputs.md5_dtb}}" test -d bin || mkdir ./bin - test -f ./bin/ai_load && rm -rf ./bin/ai_load - wget -qc https://ai.b-bug.org/k510_buildroot/github/ai_load -O ./bin/ai_load - chmod +x ./bin/ai_load + test -f ./bin/aiload && rm -rf ./bin/aiload + wget -qc https://ai.b-bug.org/k510_buildroot/github/aiload -O ./bin/aiload + chmod +x ./bin/aiload echo $PULL_REQUEST_ID echo $GITHUB_RUN_ID - ./bin/ai_load --pr_id $PULL_REQUEST_ID --job_id $GITHUB_RUN_ID --md5_dtb ${{needs.build_image.outputs.md5_dtb}} --md5_bbl ${{needs.build_image.outputs.md5_bbl}} ${{ env.available }} + ./bin/aiload --pr_id $PULL_REQUEST_ID --job_id $GITHUB_RUN_ID --md5_dtb ${{needs.build_image.outputs.md5_dtb}} --md5_bbl ${{needs.build_image.outputs.md5_bbl}} ${{ env.available }} - name: Run Test id: run_test @@ -191,15 +191,15 @@ jobs: run: | echo "Run Test start" test -d bin || mkdir ./bin - test -f ./bin/ai_robot && rm -rf ./bin/ai_robot - wget -qc https://ai.b-bug.org/k510_buildroot/github/ai_robot -O ./bin/ai_robot - chmod +x ./bin/ai_robot + test -f ./bin/airobot && rm -rf ./bin/airobot + wget -qc https://ai.b-bug.org/k510_buildroot/github/airobot -O ./bin/airobot + chmod +x ./bin/airobot test -f ./k510.robot && rm -rf ./k510.robot wget -qc https://ai.b-bug.org/k510_buildroot/github/k510.robot -O ./k510.robot - ./bin/ai_dut convert --dest=script --format yaml --file_name=var.yml ${{ env.available }} + ./bin/ailab convert --dest=script --format yaml --file_name=var.yml ${{ env.available }} test -f var.yml || exit 1 echo "Run test case start" - ./bin/ai_robot -m github -V var.yml -i github k510.robot + ./bin/airobot -m github -V var.yml -i github k510.robot echo "Run test case pass" - name: Release DUT @@ -208,7 +208,7 @@ jobs: run: | echo "Release DUT start" test -d bin || mkdir ./bin - result=$(./bin/ai_dut delete ${{ env.reserved }}) + result=$(./bin/ailab update ${{ env.reserved }}) echo $result if [[ $result =~ "True" ]]; then echo "Release DUT pass" @@ -216,3 +216,11 @@ jobs: echo "ERROR: Release DUT failed" exit 1 fi + power=$(./bin/ailab power --type=off ${{ env.available }}) + echo $power + if [[ $power =~ "True" ]]; then + echo "Power off DUT pass" + else + echo "ERROR: Power off DUT failed" + exit 1 + fi diff --git a/Config.in b/Config.in index 078bd1e..e9b6551 100644 --- a/Config.in +++ b/Config.in @@ -13,7 +13,6 @@ source "$BR2_EXTERNAL_K510_PATH/package/dsp_app_new/Config.in" source "$BR2_EXTERNAL_K510_PATH/package/k510_evb_test/Config.in" source "$BR2_EXTERNAL_K510_PATH/package/dsp_log/Config.in" source "$BR2_EXTERNAL_K510_PATH/package/venc_lib/Config.in" -source "$BR2_EXTERNAL_K510_PATH/package/alsa_demo/Config.in" source "$BR2_EXTERNAL_K510_PATH/package/ffmpeg_canaan/Config.in" source "$BR2_EXTERNAL_K510_PATH/package/audio3a_lib/Config.in" source "$BR2_EXTERNAL_K510_PATH/package/mediactl_lib/Config.in" diff --git a/Makefile b/Makefile index 07de47b..74c926b 100755 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ BR2_VERSION = 2020.02.11 + RED=\e[1;31m NC=\e[0m @@ -106,11 +107,11 @@ clean: dl: rm -rf pkg-download/dl.tar.gz; - wget -c https://github.com/kendryte/k510_buildroot/releases/download/v1.6/dl.tar.gz -O pkg-download/dl.tar.gz; + wget -c https://kendryte-download.canaan-creative.com/k510/package/dl/v1.0.0/dl.tar.gz -O pkg-download/dl.tar.gz; tar -zxf pkg-download/dl.tar.gz; - mkdir -p dl/ai/; wget -c https://github.com/kendryte/k510_buildroot/releases/download/v1.7/ai_kmodel_data.tar.xz -O dl/ai/ai_kmodel_data.tar.xz; + mkdir -p dl/ai/; wget -c https://kendryte-download.canaan-creative.com/k510/package/ai/v1.0.0/ai_kmodel_data.tar.xz -O dl/ai/ai_kmodel_data.tar.xz; (set -xe; NNCASE_VER=v1.7.1 ;\ - NNCASE_SITE=https://github.com/kendryte/nncase/releases/download;\ + NNCASE_SITE=https://kendryte-download.canaan-creative.com/k510/nncase/release;\ NNCASE_PIP_VD=1.7.1.20220701 ; \ NNCASE_PIP_K510_VD=1.7.1.20220701 ;\ mkdir -p dl/nncase_linux_runtime; cd dl/nncase_linux_runtime; \ diff --git a/board/canaan/k510/k510_rootfs_skeleton/etc/init.d/rc.sysinit b/board/canaan/k510/k510_rootfs_skeleton/etc/init.d/rc.sysinit index dd60f3d..125eb9b 100755 --- a/board/canaan/k510/k510_rootfs_skeleton/etc/init.d/rc.sysinit +++ b/board/canaan/k510/k510_rootfs_skeleton/etc/init.d/rc.sysinit @@ -74,6 +74,17 @@ else #udhcpc -b -i eth0 & fi +ifconfig wlan0 up +if [ $? -eq 0 ];then + if [ -f /first_run_flag_file ];then + echo "ctrl_interface=/var/run/wpa_supplicant" > /etc/wpa_supplicant.conf + echo "update_config=1" >> /etc/wpa_supplicant.conf + echo "ap_scan=1" >> /etc/wpa_supplicant.conf + fi + + wpa_supplicant -D nl80211 -i wlan0 -c /etc/wpa_supplicant.conf -B +fi + /sbin/ifup -a -f #telnetd diff --git a/board/canaan/k510/k510_rootfs_skeleton/etc/init.d/run.sh b/board/canaan/k510/k510_rootfs_skeleton/etc/init.d/run.sh index ffed1de..45c104f 100755 --- a/board/canaan/k510/k510_rootfs_skeleton/etc/init.d/run.sh +++ b/board/canaan/k510/k510_rootfs_skeleton/etc/init.d/run.sh @@ -86,10 +86,6 @@ if [ -d /lib/modules/$linux_ver/ ]; then done #include "k510_drm.h" # define DRM_CARD "/dev/dri/card0" @@ -55,7 +56,9 @@ struct drm_dev drm_dev; int draw_frame(struct vo_draw_frame *frame) { - return drmIoctl(drm_dev.fd, DRM_IOCTL_KENDRYTE_DRAW_FRAME, frame); + unsigned color = frame->draw_en ? 0xff0000 : 0xff000000; + mediactl_rect(ISP_F2K_PIPELINE, 1, frame->frame_num, frame->line_x_start, frame->line_y_start, frame->line_x_end - frame->line_x_start, frame->line_y_end - frame->line_y_start, 4, color, 0); + return 0; } static uint32_t get_plane_property_id(const char *name) @@ -644,7 +647,7 @@ static int drm_allocate_dumb_argb(struct drm_buffer *buf) /* create dumb buffer */ memset(&creq, 0, sizeof(creq)); - creq.width = (drm_dev.width+15)/16*16; + creq.width = (drm_dev.width+7)/8*8; creq.height = drm_dev.height; //* 4; creq.bpp = 32; //8 diff --git a/package/ai/code/common/media_ctl.h b/package/ai/code/common/media_ctl.h index 832fe23..7b25a78 100644 --- a/package/ai/code/common/media_ctl.h +++ b/package/ai/code/common/media_ctl.h @@ -78,6 +78,7 @@ struct video_info int mediactl_init(char *video_cfg_file,struct video_info *dev_info); void mediactl_exit(void); +int mediactl_rect(enum isp_pipeline_e pipeline, unsigned layer, unsigned area, unsigned x, unsigned y, unsigned width, unsigned height, unsigned line_width, unsigned color, unsigned border_mask); int mediactl_set_ae(enum isp_pipeline_e pipeline); int mediactl_set_ae_single(enum isp_pipeline_e pipeline); int mediactl_set_ae_sync(enum isp_pipeline_e pipeline); diff --git a/package/ai/code/face_alignment/main.cc b/package/ai/code/face_alignment/main.cc index aef33ef..e754868 100755 --- a/package/ai/code/face_alignment/main.cc +++ b/package/ai/code/face_alignment/main.cc @@ -784,7 +784,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/ai/code/face_detect/main.cc b/package/ai/code/face_detect/main.cc index f583be4..fa1fabb 100755 --- a/package/ai/code/face_detect/main.cc +++ b/package/ai/code/face_detect/main.cc @@ -207,7 +207,7 @@ void ai_worker(ai_worker_args ai_args) for (auto p : points_to_clear[index]) { - cv::circle(img_argb, p, 8, cv::Scalar(0, 0, 0, 0), -1); + cv::circle(img_argb, p, 4, cv::Scalar(0, 0, 0, 0), -1); } } @@ -242,7 +242,7 @@ void ai_worker(ai_worker_args ai_args) { int32_t x0 = l.points[2 * ll + 0] * screen_width * net_len / valid_width; int32_t y0 = l.points[2 * ll + 1] * net_len / valid_height * screen_height; - cv::circle(img_argb, cv::Point(x0, y0), 8, cv::Scalar(0, 0, 255, 255), -1); + cv::circle(img_argb, cv::Point(x0, y0), 4, cv::Scalar(0, 0, 255, 255), -1); points_to_clear[index].push_back(cv::Point(x0, y0)); } } @@ -629,7 +629,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/ai/code/face_expression/main.cc b/package/ai/code/face_expression/main.cc index fa558e9..959b10f 100755 --- a/package/ai/code/face_expression/main.cc +++ b/package/ai/code/face_expression/main.cc @@ -224,7 +224,7 @@ void ai_worker(ai_worker_args ai_args) for (uint32_t cc = 0; cc < points_to_clear[index].size(); cc++) { - cv::putText(img_argb, strs_to_clear[index][cc], points_to_clear[index][cc], cv::FONT_HERSHEY_COMPLEX, 2, cv::Scalar(0, 0, 0, 0), 2, 8, 0); + cv::putText(img_argb, strs_to_clear[index][cc], points_to_clear[index][cc], cv::FONT_HERSHEY_COMPLEX, 1, cv::Scalar(0, 0, 0, 0), 1, 8, 0); } } @@ -283,7 +283,7 @@ void ai_worker(ai_worker_args ai_args) std::string text = fexpre.labels[score_index] + ":" + std::to_string(round(score_max * 100) / 100.0).substr(0,4); int x0 = std::max(0, std::min(int((b.x - b.w / 2) * fd_net_len / valid_width * screen_width), (int)screen_width)); int y0 = std::max(0, std::min(int((b.y - b.h / 2) * fd_net_len / valid_height * screen_height) + 60, (int)screen_height)); - cv::putText(img_argb, text, cv::Point(x0, y0), cv::FONT_HERSHEY_COMPLEX, 2, cv::Scalar(255, 0, 0, 255), 2, 8, 0); + cv::putText(img_argb, text, cv::Point(x0, y0), cv::FONT_HERSHEY_COMPLEX, 1, cv::Scalar(255, 0, 0, 255), 1, 8, 0); points_to_clear[index].push_back(cv::Point(x0, y0)); strs_to_clear[index].push_back(text); } @@ -687,7 +687,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/ai/code/face_landmarks/main.cc b/package/ai/code/face_landmarks/main.cc index d858c95..db6900d 100755 --- a/package/ai/code/face_landmarks/main.cc +++ b/package/ai/code/face_landmarks/main.cc @@ -736,7 +736,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/ai/code/face_recog/insightface.cc b/package/ai/code/face_recog/insightface.cc index 352d5ca..27548de 100644 --- a/package/ai/code/face_recog/insightface.cc +++ b/package/ai/code/face_recog/insightface.cc @@ -61,6 +61,7 @@ void insightface::prepare_memory() if(virtual_addr_output == MAP_FAILED) { std::cerr << "map allocAlignMemFeOutput error" << std::endl; + // FIXME: memory leak, free share memory std::abort(); } diff --git a/package/ai/code/face_recog/main.cc b/package/ai/code/face_recog/main.cc index 12bc5e2..a1fa2c4 100755 --- a/package/ai/code/face_recog/main.cc +++ b/package/ai/code/face_recog/main.cc @@ -22,6 +22,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include @@ -98,6 +99,9 @@ void fun_sig(int sig) quit.store(false); } } +void fun_sig_abrt(int sig) { + exit(0); +} int kbhit(void) { struct termios oldt, newt; @@ -561,7 +565,7 @@ void display_worker(int enable_profile) mtx.lock(); video_stop(vdev); video_cleanup(vdev); - system("killall -9 face_recog"); + // system("killall -9 face_recog"); mtx.unlock(); } @@ -718,11 +722,15 @@ int main(int argc, char *argv[]) ai_args.dump_img_dir = argv[15]; /****fixed operation for ctrl+c****/ - struct sigaction sa; + struct sigaction sa, sa_abrt; memset( &sa, 0, sizeof(sa) ); + memset(&sa_abrt, 0, sizeof(sa_abrt)); sa.sa_handler = fun_sig; sigfillset(&sa.sa_mask); sigaction(SIGINT, &sa, NULL); + sa_abrt.sa_handler = fun_sig_abrt; + sigfillset(&sa_abrt.sa_mask); + sigaction(SIGABRT, &sa_abrt, NULL); // get screen resolution if (drm_get_resolution(NULL, &screen_width, &screen_height) < 0) { @@ -757,8 +765,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - thread_key.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { @@ -768,6 +777,6 @@ int main(int argc, char *argv[]) { drm_destory_dumb(&drm_dev.drm_bufs_argb[i]); } - mediactl_exit(); + mediactl_exit(); return 0; } diff --git a/package/ai/code/face_recog/retinaface.cc b/package/ai/code/face_recog/retinaface.cc index 9236188..1bcf606 100644 --- a/package/ai/code/face_recog/retinaface.cc +++ b/package/ai/code/face_recog/retinaface.cc @@ -103,6 +103,7 @@ void retinaface::prepare_memory() if(ioctl(share_memory, SHARE_MEMORY_ALIGN_ALLOC, &allocAlignMemFdInput[i]) < 0) { std::cerr << "alloc allocAlignMemFdInput error" << std::endl; + // FIXME: share memory leak std::abort(); } virtual_addr_input[i] = (char *)mmap(NULL, allocAlignMemFdInput[i].size, PROT_READ | PROT_WRITE, MAP_SHARED, mem_map, allocAlignMemFdInput[i].phyAddr); @@ -400,7 +401,7 @@ retinaface::~retinaface() if(ioctl(share_memory, SHARE_MEMORY_FREE, &allocAlignMemFdInput[i].phyAddr) < 0) { std::cerr << "free allocAlignMemFdInput error" << std::endl; - std::abort(); + // std::abort(); } } } @@ -412,7 +413,7 @@ retinaface::~retinaface() if(ioctl(share_memory, SHARE_MEMORY_FREE, &allocAlignMemFdOutput.phyAddr) < 0) { std::cerr << "free allocAlignMemFdOutput error" << std::endl; - std::abort(); + // std::abort(); } } close(share_memory); diff --git a/package/ai/code/gc2053.conf b/package/ai/code/gc2053.conf new file mode 100644 index 0000000..ad24d59 --- /dev/null +++ b/package/ai/code/gc2053.conf @@ -0,0 +1,531 @@ +{ + "isp_general":{ + "isp_out_sel":0, + "dvp_ch_mode":1, + "hist_3a_out_en":0, + "main_out":{ + "out_img_format":1, + "out_yuv_in_format":0, + "out_yuv422_pxl_order":0, + "out_pxl_width":0, + "out_frame_buf_size":2048 + }, + "out0":{ + "ds0_out_img_format":1, + "ds0_out_yuv_in_format":0, + "ds0_out_yuv422_pxl_order":0, + "ds0_out_pxl_width":0, + "ds0_frame_buf_size":2048 + }, + "out1":{ + "ds1_out_img_format":1, + "ds1_out_yuv_in_format":0, + "ds1_out_yuv422_pxl_order":0, + "ds1_out_pxl_width":0, + "ds1_frame_buf_size":2048 + }, + "out2":{ + "ds2_out_img_format":0, + "ds2_out_yuv_in_format":0, + "ds2_out_yuv422_pxl_order":0, + "ds2_out_pxl_width":0, + "ds2_frame_buf_size":2048 + }, + "wdr":{ + "wdr_mode":0, + "wdr_long_ch_mode":0, + "wdr_long_l2_buf_en":0, + "wdr_short_s1_buf_en":0, + "wdr_dynamic_switch_en":0, + "wdr_long_l2_buf_depth":0, + "wdr_long_img_format":0, + "wdr_long_yuv_in_format":0, + "wdr_long_img_out_format":0, + "wdr_long_yuv422_pxl_order":0, + "wdr_long_pixel_width":2, + "wdr_buf_base":0, + "wdr_line_stride":0, + "wdr_frame_buf_size":0 + }, + "nr3d":{ + "nr3d_en":0, + "nr3d_fbcd_en":0, + "nr3d_mv_out_en":0, + "nr3d_y_img_format":0, + "nr3d_y_yuv_in_format":0, + "nr3d_y_img_out_format":0, + "nr3d_y_yuv422_pxl_order":0, + "nr3d_y_pixel_width":2, + "nr3d_uv_img_format":0, + "nr3d_uv_yuv_in_format":0, + "nr3d_uv_mig_out_format":0, + "nr3d_uv_yuv422_pxl_order":0, + "nr3d_uv_pixel_width":2, + "nr3d_frame_buf_size":0 + }, + "ldc":{ + "ldc_line_stride":2048, + "ldc_frame_buf_size":2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol":0, + "vsync_pol":0, + "hsync_input_timing":2, + "vsync_input_timing":1, + "flip_ctl" :0, + "video_fmt_sl":0, + "itc_ttl_h" :2200, + "itc_ttl_v" :1125, + "itc_stt_hr" :0, + "itc_stt_vr" :1 + }, + "tpg": { + "tpg_en":0, + "bayer_mode_sel":3, + "motion_mode_sel":0, + "tpg_sel":9, + "wdr_l_mul_data":0, + "wdr_m_mul_data":0, + "wdr_s_mul_data":0 + }, + "blc":{ + "blc_en" :1, + "blc_offset" :240, + "blc_ratio" :272 + }, + "lsc":{ + "lsc_en" :1, + "lsc_h_center" :900, + "lsc_v_center" :580, + "lsc_r_ratio" :8, + "lsc_g_ratio":6, + "lsc_b_ratio" :6, + "lsc_ir_ratio" :6 + }, + "ae":{ + "ae_as_en" :0, + "ae_ag_en" :0, + "ae_airis_en" :0, + "ae_enter_ls_sel" :0, + "ae_exit_ls_sel" :0, + "ae_win_mode_sel" :0, + "ae_back_light_mode_sel" :2, + "ae_day_change_en" :0, + "ae_day_change_sel" :0, + "ae_win_stth" :0, + "ae_win_sttv" :0, + "ae_win_endh" :1919, + "ae_win_endv" :1079, + "ae_yobj" :80, + "ae_av_rg" :11, + "ae_l_ex_time" :1100, + "ae_m_ex_time" :32, + "ae_s_ex_time" :32, + "ae_agc" :256, + "ae_ad_shuttle_freq" :0, + "ae_ad_gain_freq" :0, + "ae_adjust_step_max":36, + "ae_ex_value_max" :1124, + "ae_ex_value_mid" :256, + "ae_ex_value_min" :1, + "ae_gain_value_max" :4095, + "ae_gain_value_mid" :512, + "ae_gain_value_min" :256, + "ae_dn_switch_ad_step_max" :512, + "ae_dn_switch_wait_time" :255, + "ape_max_diff" :12, + "ape_drv_signal_max" :3840, + "ape_coeff_distance" :0, + "ape_coeff_speed" :0, + "ape_coeff_acceleration" :0, + "ape_drv_manual_value" :4095, + "ape_damp_manual_value" :2048 + }, + "awb":{ + "awb_d65_en" :0, + "awb_ccm_en" :0, + "awb_en" :0, + "awb_mode_sel" :0, + "awb_hist_mode_sel" :0, + "awb_veri_en" :0, + "awb_fb_en" :0, + "awb_value_save_en" :0, + "awb_ccm_adp_adjust_en" :0, + "awb_stab_en" :1, + "awb_d65_red_gain" :256, + "awb_d65_blue_gain" :256, + "ccm_rr" :256, + "ccm_rg" :0, + "ccm_rb" :0, + "ccm_gr" :0, + "ccm_gg" :256, + "ccm_gb" :0, + "ccm_br" :0, + "ccm_bg" :0, + "ccm_bb" :256, + "ccm_correct_coff" :256, + "awb_win_stth" :0, + "awb_win_sttv" :0, + "awb_win_endh" :1919, + "awb_win_endv" :1079, + "awb_correct_diff_th" :8, + "awb_color_changeres_time" :8, + "awb_historgram_th" :4, + "awb_red_gain_adjust" :256, + "awb_green_gain_adjust" :256, + "awb_blue_gain_adjust" :256, + "awb_red_max_value" :240, + "awb_blue_max_value" :379, + "awb_red_min_value" :176, + "awb_blue_min_value" :281, + "awb_red_obj_value" :256, + "awb_blue_obj_value" :256 + }, + "wdr":{ + "wdr_fusion_en" :0, + "wdr_frame_sel" :0, + "wdr_adp_adjust_en" :0, + "wdr_stab_en" :0, + "wdr_en" :0, + "wdr_ghost_remove_en" :0, + "wdr_3frame_out_mode" :0, + "wdr_mode_sel" :0, + "wdr_2frame_ex_ratio" :1, + "wdr_3frame_ex_ratio" :1, + "wdr_stat_img_sel" :0, + "wdr_ltm_data_sel" :1, + "wdr_tz_data_sel" :1, + "wdr_remove_purple_en" :0, + "wdr_over_ex_ratio_th1" :384, + "wdr_over_ex_ratio_th2" :32, + "wdr_fusion_ratio_th" :192, + "wdr_fusion_value1" :64, + "wdr_fusion_value2" :16 + }, + "csc":{ + "rgb2yuv_00":153, + "rgb2yuv_01":256, + "rgb2yuv_02":86, + "rgb2yuv_10":301, + "rgb2yuv_11":214, + "rgb2yuv_12":170, + "rgb2yuv_20":58, + "rgb2yuv_21":42, + "rgb2yuv_22":256 + }, + "ada":{ + "gm_rgb_en" :1, + "gm_yuv_en" :0, + "ada_en" :1, + "ada_sbz_en" :0, + "ada_ccr_en" :0, + "ada_adp_en" :0, + "ada_adp_ccr_en" :0, + "ada_stat_mode_sel" :0, + "ada_enh_mode_sel" :0, + "ada_hist_max" :128, + "ada_ttl_max" :255, + "ada_win_stth" :0, + "ada_win_sttv" :0, + "ada_win_endh" :1919, + "ada_win_endv" :1079 + }, + "rgb-ir":{ + "raw_fmt" :0, + "rgbir_rct_en" :0, + "dfc_en" :0, + "rgbir_fs_en" :0, + "rgbir_ot_sl" :0, + "rgbir_fs_max" :256, + "dfc_krb" :0, + "dfc_ky" :0, + "dfc_th" :256, + "dfc_th_1" :256 + }, + "2dnr":{ + "dpeak_en" :1, + "nr2d_raw_en" :1, + "nr2d_eg_en" :1, + "nr2d_jl_en" :1, + "nr2d_av_en" :1, + "nr2d_c_en" :0, + "dpeak_adp_en" :0, + "nr2d_raw_adp_en":0, + "nr2d_y_adp_en" :0, + "nr2d_c_adp_en" :0, + "nr2d_raw_kl" :12, + "nr2d_jl_th" :128, + "nr2d_eg_k" :24, + "nr2d_y_k" :16, + "nr2d_c_k" :1 + }, + "3dnr":{ + "nr3d_en" :1, + "nr3dp_y_en" :1, + "nr3dp_c_en" :0, + "nr3dm_y_en" :1, + "nr3dm_c_en" :0, + "nr3db_y_en" :1, + "nr3db_c_en" :0, + "nr3dm_nr2d_y_en" :1, + "nr3dm_nr2d_c_en" :0, + "core_3dnr_wb_en" :1, + "core_3dnr_wb_sel" :1, + "core_3dnr_adp_luma_en" :0, + "core_3dnr_adp_chroma_en" :0, + "nr3dp_thy" :64, + "nr3dp_thyp" :64, + "nr3dp_thcp" :64, + "nr3dm_mid_th" :128, + "nr3dm_mtp_th" :8, + "nr3dm_mtc_th" :128, + "nr3dm_ym_k" :60, + "nr3dm_thy" :64, + "nr3dm_min" :0, + "nr3dm_thw0" :128, + "core_3dnr_chroma_intensity" :16, + "nr3db_nr2d_eg_th" :64, + "nr3db_thyp" :64, + "nr3db_thcp" :32 + }, + "enh":{ + "ltm":{ + "enh_ltm_en" :1, + "enh_adp_ltm_en" :0, + "ltm_gain" :128, + "ltm_mm_th" :128 + }, + "sharp":{ + "enh_sharp_en" :1, + "enh_adp_sharp_en" :0, + "shp_core" :8, + "shp_th1" :3840, + "shp_th2" :4095, + "shp_gain" :64 + }, + "cc":{ + "enh_cc_en" :0, + "enh_adp_cc_en" :0 + } + }, + "post_ctl":{ + "otc_ctl":{ + "otc_en" :0, + "otc_yc_sl" :0, + "otc_uv_sl" :1, + "otc_hs_plt_sl" :0, + "otc_vs_plt_sl" :0, + "otc_stt_vr" :0, + "otc_stt_hr" :0 + }, + "ctrst":{ + "ctrst_en" :1, + "ctrst_gain":128 + }, + "luma":{ + "luma_en" :1, + "luma_gain":128 + }, + "strt":{ + "strt_en" :1, + "strt_gain":0 + } + }, + "ldc":{ + "ldc_en" :0, + "ldc_rct_en" :0, + "ldc_rq_frq" :128, + "ldc_stt_ln" :540, + "ldc_ch" :960, + "ldc_cv" :540, + "ldc_cr" :684, + "ldc_cz" :684 + }, + "af":{ + "af_stat_en" :1, + "af_stat_mode_sel" :0, + "af_stat_win_h_start":0, + "af_stat_win_v_start":0, + "af_stat_win_h_end" :1919, + "af_stat_win_v_end" :1079 + } + }, + "isp_post":{ + "rgb2yuv":{ + "osd_rgb2yuv_coeff00":306, + "osd_rgb2yuv_coeff01":601, + "osd_rgb2yuv_coeff02":117, + "osd_rgb2yuv_coeff03":0, + "osd_rgb2yuv_coeff10":3920, + "osd_rgb2yuv_coeff11":3749, + "osd_rgb2yuv_coeff12":523, + "osd_rgb2yuv_coeff13":128, + "osd_rgb2yuv_coeff20":523, + "osd_rgb2yuv_coeff21":3658, + "osd_rgb2yuv_coeff22":4011, + "osd_rgb2yuv_coeff23":128 + }, + "yuv2rgb":{ + "out_yuv2rgb_coeff00":1024, + "out_yuv2rgb_coeff01":0, + "out_yuv2rgb_coeff02":1441, + "out_yuv2rgb_coeff03":3916, + "out_yuv2rgb_coeff10":1024, + "out_yuv2rgb_coeff11":3742, + "out_yuv2rgb_coeff12":3362, + "out_yuv2rgb_coeff13":136, + "out_yuv2rgb_coeff20":1024, + "out_yuv2rgb_coeff21":1822, + "out_yuv2rgb_coeff22":0, + "out_yuv2rgb_coeff23":3868 + }, + "ds0":{ + "ds0_out_rgb_mode":0, + "ds0_out_rgb_en":0, + "ds0_out_yuv_mode":0, + "ds0_out_uv_swap":0, + "ds0_osd0":{ + "ds0_osd0_enable":0, + "ds0_osd0_type":0, + "ds0_osd0_alpha_tpye":0, + "ds0_osd0_vst":0, + "ds0_osd0_hst":0, + "ds0_osd0_vend":0, + "ds0_osd0_hend":0, + "ds0_osd0_dma_request_length":0, + "ds0_osd0_dma_map":0, + "ds0_osd0_rgb_rev":0, + "ds0_osd0_global_alpha":0, + "ds0_osd0_swap_64":0, + "ds0_osd0_outstanding_num":0, + "ds0_osd0_bd_limit_en":0 + }, + "ds0_osd1":{ + "ds0_osd1_enable":0, + "ds0_osd1_type":0, + "ds0_osd1_alpha_tpye":0, + "ds0_osd1_vst":0, + "ds0_osd1_hst":0, + "ds0_osd1_vend":0, + "ds0_osd1_hend":0, + "ds0_osd1_dma_request_length":0, + "ds0_osd1_dma_map":0, + "ds0_osd1_rgb_rev":0, + "ds0_osd1_global_alpha":0, + "ds0_osd1_swap_64":0, + "ds0_osd1_outstanding_num":0, + "ds0_osd1_bd_limit_en":0 + }, + "ds0_osd2":{ + "ds0_osd2_enable":0, + "ds0_osd2_type":0, + "ds0_osd2_alpha_tpye":0, + "ds0_osd2_vst":0, + "ds0_osd2_hst":0, + "ds0_osd2_vend":0, + "ds0_osd2_hend":0, + "ds0_osd2_dma_request_length":0, + "ds0_osd2_dma_map":0, + "ds0_osd2_rgb_rev":0, + "ds0_osd2_global_alpha":0, + "ds0_osd2_swap_64":0, + "ds0_osd2_outstanding_num":0, + "ds0_osd2_bd_limit_en":0 + } + }, + "ds1":{ + "ds1_out_rgb_mode":0, + "ds1_out_rgb_en":0, + "ds1_out_yuv_mode":0, + "ds1_out_uv_swap":0, + "ds1_osd0":{ + "ds1_osd0_enable":0, + "ds1_osd0_type":0, + "ds1_osd0_alpha_tpye":0, + "ds1_osd0_vst":0, + "ds1_osd0_hst":0, + "ds1_osd0_vend":0, + "ds1_osd0_hend":0, + "ds1_osd0_dma_request_length":0, + "ds1_osd0_dma_map":0, + "ds1_osd0_rgb_rev":0, + "ds1_osd0_global_alpha":0, + "ds1_osd0_swap_64":0, + "ds1_osd0_outstanding_num":0, + "ds1_osd0_bd_limit_en":0 + }, + "ds1_osd1":{ + "ds1_osd1_enable":0, + "ds1_osd1_type":0, + "ds1_osd1_alpha_tpye":0, + "ds1_osd1_vst":0, + "ds1_osd1_hst":0, + "ds1_osd1_vend":0, + "ds1_osd1_hend":0, + "ds1_osd1_dma_request_length":0, + "ds1_osd1_dma_map":0, + "ds1_osd1_rgb_rev":0, + "ds1_osd1_global_alpha":0, + "ds1_osd1_swap_64":0, + "ds1_osd1_outstanding_num":0, + "ds1_osd1_bd_limit_en":0 + }, + "ds1_osd2":{ + "ds1_osd2_enable":0, + "ds1_osd2_type":0, + "ds1_osd2_alpha_tpye":0, + "ds1_osd2_vst":0, + "ds1_osd2_hst":0, + "ds1_osd2_vend":0, + "ds1_osd2_hend":0, + "ds1_osd2_dma_request_length":0, + "ds1_osd2_dma_map":0, + "ds1_osd2_rgb_rev":0, + "ds1_osd2_global_alpha":0, + "ds1_osd2_swap_64":0, + "ds1_osd2_outstanding_num":0, + "ds1_osd2_bd_limit_en":0 + } + }, + "ds2":{ + "ds2_out_rgb_mode":0, + "ds2_out_rgb_en":1, + "ds2_out_yuv_mode":0, + "ds2_out_uv_swap":0, + "ds2_osd0":{ + "ds2_osd0_enable":0, + "ds2_osd0_type":0, + "ds2_osd0_alpha_tpye":0, + "ds2_osd0_vst":0, + "ds2_osd0_hst":0, + "ds2_osd0_vend":0, + "ds2_osd0_hend":0, + "ds2_osd0_dma_request_length":0, + "ds2_osd0_dma_map":0, + "ds2_osd0_rgb_rev":0, + "ds2_osd0_global_alpha":0, + "ds2_osd0_swap_64":0, + "ds2_osd0_outstanding_num":0, + "ds2_osd0_bd_limit_en":0 + }, + "ds2_osd1":{ + "ds2_osd1_enable":0, + "ds2_osd1_type":0, + "ds2_osd1_alpha_tpye":0, + "ds2_osd1_vst":0, + "ds2_osd1_hst":0, + "ds2_osd1_vend":0, + "ds2_osd1_hend":0, + "ds2_osd1_dma_request_length":0, + "ds2_osd1_dma_map":0, + "ds2_osd1_rgb_rev":0, + "ds2_osd1_global_alpha":0, + "ds2_osd1_swap_64":0, + "ds2_osd1_outstanding_num":0, + "ds2_osd1_bd_limit_en":0 + } + } + } +} diff --git a/package/ai/code/gc2093.conf b/package/ai/code/gc2093.conf new file mode 100644 index 0000000..a08a526 --- /dev/null +++ b/package/ai/code/gc2093.conf @@ -0,0 +1,531 @@ +{ + "isp_general":{ + "isp_out_sel":0, + "dvp_ch_mode":1, + "hist_3a_out_en":0, + "main_out":{ + "out_img_format":1, + "out_yuv_in_format":0, + "out_yuv422_pxl_order":0, + "out_pxl_width":0, + "out_frame_buf_size":2048 + }, + "out0":{ + "ds0_out_img_format":1, + "ds0_out_yuv_in_format":0, + "ds0_out_yuv422_pxl_order":0, + "ds0_out_pxl_width":0, + "ds0_frame_buf_size":2048 + }, + "out1":{ + "ds1_out_img_format":1, + "ds1_out_yuv_in_format":0, + "ds1_out_yuv422_pxl_order":0, + "ds1_out_pxl_width":0, + "ds1_frame_buf_size":2048 + }, + "out2":{ + "ds2_out_img_format":0, + "ds2_out_yuv_in_format":0, + "ds2_out_yuv422_pxl_order":0, + "ds2_out_pxl_width":0, + "ds2_frame_buf_size":2048 + }, + "wdr":{ + "wdr_mode":0, + "wdr_long_ch_mode":0, + "wdr_long_l2_buf_en":0, + "wdr_short_s1_buf_en":0, + "wdr_dynamic_switch_en":0, + "wdr_long_l2_buf_depth":0, + "wdr_long_img_format":0, + "wdr_long_yuv_in_format":0, + "wdr_long_img_out_format":0, + "wdr_long_yuv422_pxl_order":0, + "wdr_long_pixel_width":2, + "wdr_buf_base":0, + "wdr_line_stride":0, + "wdr_frame_buf_size":0 + }, + "nr3d":{ + "nr3d_en":0, + "nr3d_fbcd_en":0, + "nr3d_mv_out_en":0, + "nr3d_y_img_format":0, + "nr3d_y_yuv_in_format":0, + "nr3d_y_img_out_format":0, + "nr3d_y_yuv422_pxl_order":0, + "nr3d_y_pixel_width":2, + "nr3d_uv_img_format":0, + "nr3d_uv_yuv_in_format":0, + "nr3d_uv_mig_out_format":0, + "nr3d_uv_yuv422_pxl_order":0, + "nr3d_uv_pixel_width":2, + "nr3d_frame_buf_size":0 + }, + "ldc":{ + "ldc_line_stride":2048, + "ldc_frame_buf_size":2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol":0, + "vsync_pol":0, + "hsync_input_timing":2, + "vsync_input_timing":1, + "flip_ctl" :0, + "video_fmt_sl":0, + "itc_ttl_h" :2844, + "itc_ttl_v" :1125, + "itc_stt_hr" :0, + "itc_stt_vr" :1 + }, + "tpg": { + "tpg_en":0, + "bayer_mode_sel":3, + "motion_mode_sel":0, + "tpg_sel":9, + "wdr_l_mul_data":0, + "wdr_m_mul_data":0, + "wdr_s_mul_data":0 + }, + "blc":{ + "blc_en" :1, + "blc_offset" :240, + "blc_ratio" :272 + }, + "lsc":{ + "lsc_en" :1, + "lsc_h_center" :900, + "lsc_v_center" :580, + "lsc_r_ratio" :6, + "lsc_g_ratio":6, + "lsc_b_ratio" :4, + "lsc_ir_ratio" :6 + }, + "ae":{ + "ae_as_en" :1, + "ae_ag_en" :1, + "ae_airis_en" :0, + "ae_enter_ls_sel" :0, + "ae_exit_ls_sel" :0, + "ae_win_mode_sel" :0, + "ae_back_light_mode_sel" :2, + "ae_day_change_en" :0, + "ae_day_change_sel" :0, + "ae_win_stth" :0, + "ae_win_sttv" :0, + "ae_win_endh" :1919, + "ae_win_endv" :1079, + "ae_yobj" :100, + "ae_av_rg" :14, + "ae_l_ex_time" :1100, + "ae_m_ex_time" :32, + "ae_s_ex_time" :32, + "ae_agc" :256, + "ae_ad_shuttle_freq" :0, + "ae_ad_gain_freq" :0, + "ae_adjust_step_max":36, + "ae_ex_value_max" :1124, + "ae_ex_value_mid" :256, + "ae_ex_value_min" :1, + "ae_gain_value_max" :4095, + "ae_gain_value_mid" :512, + "ae_gain_value_min" :256, + "ae_dn_switch_ad_step_max" :512, + "ae_dn_switch_wait_time" :255, + "ape_max_diff" :12, + "ape_drv_signal_max" :3840, + "ape_coeff_distance" :0, + "ape_coeff_speed" :0, + "ape_coeff_acceleration" :0, + "ape_drv_manual_value" :4095, + "ape_damp_manual_value" :2048 + }, + "awb":{ + "awb_d65_en" :1, + "awb_ccm_en" :1, + "awb_en" :1, + "awb_mode_sel" :1, + "awb_hist_mode_sel" :0, + "awb_veri_en" :0, + "awb_fb_en" :0, + "awb_value_save_en" :0, + "awb_ccm_adp_adjust_en" :0, + "awb_stab_en" :1, + "awb_d65_red_gain" :487, + "awb_d65_blue_gain" :418, + "ccm_rr" :261, + "ccm_rg" :5, + "ccm_rb" :0, + "ccm_gr" :47, + "ccm_gg" :308, + "ccm_gb" :5, + "ccm_br" :6, + "ccm_bg" :69, + "ccm_bb" :331, + "ccm_correct_coff" :256, + "awb_win_stth" :0, + "awb_win_sttv" :0, + "awb_win_endh" :1919, + "awb_win_endv" :1079, + "awb_correct_diff_th" :8, + "awb_color_changeres_time" :8, + "awb_historgram_th" :4, + "awb_red_gain_adjust" :256, + "awb_green_gain_adjust" :256, + "awb_blue_gain_adjust" :256, + "awb_red_max_value" :258, + "awb_blue_max_value" :450, + "awb_red_min_value" :164, + "awb_blue_min_value" :256, + "awb_red_obj_value" :256, + "awb_blue_obj_value" :256 + }, + "wdr":{ + "wdr_fusion_en" :0, + "wdr_frame_sel" :0, + "wdr_adp_adjust_en" :0, + "wdr_stab_en" :0, + "wdr_en" :0, + "wdr_ghost_remove_en" :0, + "wdr_3frame_out_mode" :0, + "wdr_mode_sel" :0, + "wdr_2frame_ex_ratio" :1, + "wdr_3frame_ex_ratio" :1, + "wdr_stat_img_sel" :0, + "wdr_ltm_data_sel" :1, + "wdr_tz_data_sel" :1, + "wdr_remove_purple_en" :0, + "wdr_over_ex_ratio_th1" :384, + "wdr_over_ex_ratio_th2" :32, + "wdr_fusion_ratio_th" :192, + "wdr_fusion_value1" :64, + "wdr_fusion_value2" :16 + }, + "csc":{ + "rgb2yuv_00":153, + "rgb2yuv_01":256, + "rgb2yuv_02":86, + "rgb2yuv_10":301, + "rgb2yuv_11":214, + "rgb2yuv_12":170, + "rgb2yuv_20":58, + "rgb2yuv_21":42, + "rgb2yuv_22":256 + }, + "ada":{ + "gm_rgb_en" :1, + "gm_yuv_en" :0, + "ada_en" :1, + "ada_sbz_en" :0, + "ada_ccr_en" :0, + "ada_adp_en" :0, + "ada_adp_ccr_en" :0, + "ada_stat_mode_sel" :0, + "ada_enh_mode_sel" :0, + "ada_hist_max" :128, + "ada_ttl_max" :255, + "ada_win_stth" :0, + "ada_win_sttv" :0, + "ada_win_endh" :1919, + "ada_win_endv" :1079 + }, + "rgb-ir":{ + "raw_fmt" :0, + "rgbir_rct_en" :0, + "dfc_en" :0, + "rgbir_fs_en" :0, + "rgbir_ot_sl" :0, + "rgbir_fs_max" :256, + "dfc_krb" :0, + "dfc_ky" :0, + "dfc_th" :256, + "dfc_th_1" :256 + }, + "2dnr":{ + "dpeak_en" :1, + "nr2d_raw_en" :1, + "nr2d_eg_en" :1, + "nr2d_jl_en" :1, + "nr2d_av_en" :1, + "nr2d_c_en" :1, + "dpeak_adp_en" :0, + "nr2d_raw_adp_en":0, + "nr2d_y_adp_en" :0, + "nr2d_c_adp_en" :0, + "nr2d_raw_kl" :16, + "nr2d_jl_th" :128, + "nr2d_eg_k" :24, + "nr2d_y_k" :32, + "nr2d_c_k" :1 + }, + "3dnr":{ + "nr3d_en" :1, + "nr3dp_y_en" :1, + "nr3dp_c_en" :1, + "nr3dm_y_en" :1, + "nr3dm_c_en" :1, + "nr3db_y_en" :1, + "nr3db_c_en" :1, + "nr3dm_nr2d_y_en" :1, + "nr3dm_nr2d_c_en" :1, + "core_3dnr_wb_en" :1, + "core_3dnr_wb_sel" :1, + "core_3dnr_adp_luma_en" :0, + "core_3dnr_adp_chroma_en" :0, + "nr3dp_thy" :255, + "nr3dp_thyp" :255, + "nr3dp_thcp" :32, + "nr3dm_mid_th" :128, + "nr3dm_mtp_th" :8, + "nr3dm_mtc_th" :128, + "nr3dm_ym_k" :30, + "nr3dm_thy" :64, + "nr3dm_min" :0, + "nr3dm_thw0" :128, + "core_3dnr_chroma_intensity" :16, + "nr3db_nr2d_eg_th" :64, + "nr3db_thyp" :64, + "nr3db_thcp" :32 + }, + "enh":{ + "ltm":{ + "enh_ltm_en" :1, + "enh_adp_ltm_en" :0, + "ltm_gain" :128, + "ltm_mm_th" :128 + }, + "sharp":{ + "enh_sharp_en" :1, + "enh_adp_sharp_en" :0, + "shp_core" :8, + "shp_th1" :3840, + "shp_th2" :4095, + "shp_gain" :64 + }, + "cc":{ + "enh_cc_en" :0, + "enh_adp_cc_en" :0 + } + }, + "post_ctl":{ + "otc_ctl":{ + "otc_en" :0, + "otc_yc_sl" :0, + "otc_uv_sl" :1, + "otc_hs_plt_sl" :0, + "otc_vs_plt_sl" :0, + "otc_stt_vr" :0, + "otc_stt_hr" :0 + }, + "ctrst":{ + "ctrst_en" :1, + "ctrst_gain":128 + }, + "luma":{ + "luma_en" :1, + "luma_gain":128 + }, + "strt":{ + "strt_en" :1, + "strt_gain":222 + } + }, + "ldc":{ + "ldc_en" :0, + "ldc_rct_en" :0, + "ldc_rq_frq" :128, + "ldc_stt_ln" :540, + "ldc_ch" :960, + "ldc_cv" :540, + "ldc_cr" :684, + "ldc_cz" :684 + }, + "af":{ + "af_stat_en" :1, + "af_stat_mode_sel" :0, + "af_stat_win_h_start":0, + "af_stat_win_v_start":0, + "af_stat_win_h_end" :1919, + "af_stat_win_v_end" :1079 + } + }, + "isp_post":{ + "rgb2yuv":{ + "osd_rgb2yuv_coeff00":306, + "osd_rgb2yuv_coeff01":601, + "osd_rgb2yuv_coeff02":117, + "osd_rgb2yuv_coeff03":0, + "osd_rgb2yuv_coeff10":3920, + "osd_rgb2yuv_coeff11":3749, + "osd_rgb2yuv_coeff12":523, + "osd_rgb2yuv_coeff13":128, + "osd_rgb2yuv_coeff20":523, + "osd_rgb2yuv_coeff21":3658, + "osd_rgb2yuv_coeff22":4011, + "osd_rgb2yuv_coeff23":128 + }, + "yuv2rgb":{ + "out_yuv2rgb_coeff00":1024, + "out_yuv2rgb_coeff01":0, + "out_yuv2rgb_coeff02":1441, + "out_yuv2rgb_coeff03":3916, + "out_yuv2rgb_coeff10":1024, + "out_yuv2rgb_coeff11":3742, + "out_yuv2rgb_coeff12":3362, + "out_yuv2rgb_coeff13":136, + "out_yuv2rgb_coeff20":1024, + "out_yuv2rgb_coeff21":1822, + "out_yuv2rgb_coeff22":0, + "out_yuv2rgb_coeff23":3868 + }, + "ds0":{ + "ds0_out_rgb_mode":0, + "ds0_out_rgb_en":0, + "ds0_out_yuv_mode":0, + "ds0_out_uv_swap":0, + "ds0_osd0":{ + "ds0_osd0_enable":0, + "ds0_osd0_type":0, + "ds0_osd0_alpha_tpye":0, + "ds0_osd0_vst":0, + "ds0_osd0_hst":0, + "ds0_osd0_vend":0, + "ds0_osd0_hend":0, + "ds0_osd0_dma_request_length":0, + "ds0_osd0_dma_map":0, + "ds0_osd0_rgb_rev":0, + "ds0_osd0_global_alpha":0, + "ds0_osd0_swap_64":0, + "ds0_osd0_outstanding_num":0, + "ds0_osd0_bd_limit_en":0 + }, + "ds0_osd1":{ + "ds0_osd1_enable":0, + "ds0_osd1_type":0, + "ds0_osd1_alpha_tpye":0, + "ds0_osd1_vst":0, + "ds0_osd1_hst":0, + "ds0_osd1_vend":0, + "ds0_osd1_hend":0, + "ds0_osd1_dma_request_length":0, + "ds0_osd1_dma_map":0, + "ds0_osd1_rgb_rev":0, + "ds0_osd1_global_alpha":0, + "ds0_osd1_swap_64":0, + "ds0_osd1_outstanding_num":0, + "ds0_osd1_bd_limit_en":0 + }, + "ds0_osd2":{ + "ds0_osd2_enable":0, + "ds0_osd2_type":0, + "ds0_osd2_alpha_tpye":0, + "ds0_osd2_vst":0, + "ds0_osd2_hst":0, + "ds0_osd2_vend":0, + "ds0_osd2_hend":0, + "ds0_osd2_dma_request_length":0, + "ds0_osd2_dma_map":0, + "ds0_osd2_rgb_rev":0, + "ds0_osd2_global_alpha":0, + "ds0_osd2_swap_64":0, + "ds0_osd2_outstanding_num":0, + "ds0_osd2_bd_limit_en":0 + } + }, + "ds1":{ + "ds1_out_rgb_mode":0, + "ds1_out_rgb_en":0, + "ds1_out_yuv_mode":0, + "ds1_out_uv_swap":0, + "ds1_osd0":{ + "ds1_osd0_enable":0, + "ds1_osd0_type":0, + "ds1_osd0_alpha_tpye":0, + "ds1_osd0_vst":0, + "ds1_osd0_hst":0, + "ds1_osd0_vend":0, + "ds1_osd0_hend":0, + "ds1_osd0_dma_request_length":0, + "ds1_osd0_dma_map":0, + "ds1_osd0_rgb_rev":0, + "ds1_osd0_global_alpha":0, + "ds1_osd0_swap_64":0, + "ds1_osd0_outstanding_num":0, + "ds1_osd0_bd_limit_en":0 + }, + "ds1_osd1":{ + "ds1_osd1_enable":0, + "ds1_osd1_type":0, + "ds1_osd1_alpha_tpye":0, + "ds1_osd1_vst":0, + "ds1_osd1_hst":0, + "ds1_osd1_vend":0, + "ds1_osd1_hend":0, + "ds1_osd1_dma_request_length":0, + "ds1_osd1_dma_map":0, + "ds1_osd1_rgb_rev":0, + "ds1_osd1_global_alpha":0, + "ds1_osd1_swap_64":0, + "ds1_osd1_outstanding_num":0, + "ds1_osd1_bd_limit_en":0 + }, + "ds1_osd2":{ + "ds1_osd2_enable":0, + "ds1_osd2_type":0, + "ds1_osd2_alpha_tpye":0, + "ds1_osd2_vst":0, + "ds1_osd2_hst":0, + "ds1_osd2_vend":0, + "ds1_osd2_hend":0, + "ds1_osd2_dma_request_length":0, + "ds1_osd2_dma_map":0, + "ds1_osd2_rgb_rev":0, + "ds1_osd2_global_alpha":0, + "ds1_osd2_swap_64":0, + "ds1_osd2_outstanding_num":0, + "ds1_osd2_bd_limit_en":0 + } + }, + "ds2":{ + "ds2_out_rgb_mode":0, + "ds2_out_rgb_en":1, + "ds2_out_yuv_mode":0, + "ds2_out_uv_swap":0, + "ds2_osd0":{ + "ds2_osd0_enable":0, + "ds2_osd0_type":0, + "ds2_osd0_alpha_tpye":0, + "ds2_osd0_vst":0, + "ds2_osd0_hst":0, + "ds2_osd0_vend":0, + "ds2_osd0_hend":0, + "ds2_osd0_dma_request_length":0, + "ds2_osd0_dma_map":0, + "ds2_osd0_rgb_rev":0, + "ds2_osd0_global_alpha":0, + "ds2_osd0_swap_64":0, + "ds2_osd0_outstanding_num":0, + "ds2_osd0_bd_limit_en":0 + }, + "ds2_osd1":{ + "ds2_osd1_enable":0, + "ds2_osd1_type":0, + "ds2_osd1_alpha_tpye":0, + "ds2_osd1_vst":0, + "ds2_osd1_hst":0, + "ds2_osd1_vend":0, + "ds2_osd1_hend":0, + "ds2_osd1_dma_request_length":0, + "ds2_osd1_dma_map":0, + "ds2_osd1_rgb_rev":0, + "ds2_osd1_global_alpha":0, + "ds2_osd1_swap_64":0, + "ds2_osd1_outstanding_num":0, + "ds2_osd1_bd_limit_en":0 + } + } + } +} \ No newline at end of file diff --git a/package/ai/code/hand_image_classify/main.cc b/package/ai/code/hand_image_classify/main.cc index c50e273..f3f61ea 100755 --- a/package/ai/code/hand_image_classify/main.cc +++ b/package/ai/code/hand_image_classify/main.cc @@ -62,6 +62,8 @@ #include #include #include +#define SELECT_TIMEOUT 2000 + using namespace rapidjson; extern int hls_hand[12][2]; @@ -140,11 +142,11 @@ void ai_worker(ai_worker_args ai_args) // define cv::Mat for ai input // padding offset is (hd_net_len - valid_width) / 2 - cv::Mat rgb24_img_for_ai(hd_net_len, hd_net_len, CV_8UC3, hd.virtual_addr_input[0] + (hd_net_len - valid_width) / 2); + cv::Mat rgb24_img_for_ai(hd_net_len, hd_net_len, CV_8UC3, hd.virtual_addr_input[0] + (hd_net_len - valid_width) / 2 + (hd_net_len - valid_height) / 2 * hd_net_len); // define cv::Mat for post process - cv::Mat ori_img_R = cv::Mat(hd_net_len, hd_net_len, CV_8UC1, hd.virtual_addr_input[0] + (hd_net_len - valid_width) / 2); - cv::Mat ori_img_G = cv::Mat(hd_net_len, hd_net_len, CV_8UC1, hd.virtual_addr_input[0] + offset_channel + (hd_net_len - valid_width) / 2); - cv::Mat ori_img_B = cv::Mat(hd_net_len, hd_net_len, CV_8UC1, hd.virtual_addr_input[0] + offset_channel * 2 + (hd_net_len - valid_width) / 2); + cv::Mat ori_img_R = cv::Mat(hd_net_len, hd_net_len, CV_8UC1, rgb24_img_for_ai.data); + cv::Mat ori_img_G = cv::Mat(hd_net_len, hd_net_len, CV_8UC1, rgb24_img_for_ai.data + offset_channel); + cv::Mat ori_img_B = cv::Mat(hd_net_len, hd_net_len, CV_8UC1, rgb24_img_for_ai.data + offset_channel * 2); cv::Mat hld_img_R = cv::Mat(hld_net_len, hld_net_len, CV_8UC1, hkd.virtual_addr_input[0]); @@ -183,8 +185,9 @@ void ai_worker(ai_worker_args ai_args) if (gnne_valid_width < gnne_input_width) { uint32_t padding_r = (gnne_input_width - gnne_valid_width); uint32_t padding_l = padding_r / 2; + uint32_t row_offset = (gnne_input_height - gnne_valid_height) / 2; padding_r -= padding_l; - for (int row = 0; row < gnne_valid_height; row++) { + for (int row = row_offset; row < row_offset + gnne_valid_height; row++) { uint32_t offset_l = row * gnne_input_width; uint32_t offset_r = offset_l + gnne_valid_width + padding_l; memset(r_addr + offset_l, PADDING_R, padding_l); @@ -196,11 +199,18 @@ void ai_worker(ai_worker_args ai_args) } } if (gnne_valid_height < gnne_input_height) { - uint32_t padding = (gnne_input_height - gnne_valid_height) * gnne_input_width; - uint32_t offset = gnne_valid_height * gnne_input_width; - memset(r_addr + offset, PADDING_R, padding); - memset(g_addr + offset, PADDING_G, padding); - memset(b_addr + offset, PADDING_B, padding); + uint32_t padding_t = gnne_input_height - gnne_valid_height; + uint32_t padding_b = padding_t / 2; + padding_t -= padding_b; + padding_t *= gnne_input_width; + padding_b *= gnne_input_width; + uint32_t offset = padding_t + gnne_valid_height * gnne_input_width; + memset(r_addr, PADDING_R, padding_t); + memset(g_addr, PADDING_G, padding_t); + memset(b_addr, PADDING_B, padding_t); + memset(r_addr + offset, PADDING_R, padding_b); + memset(g_addr + offset, PADDING_G, padding_b); + memset(b_addr + offset, PADDING_B, padding_b); } if(enable_dump_image) { @@ -513,48 +523,177 @@ void ai_worker(ai_worker_args ai_args) } } -/****fixed operation for display worker****/ -void display_worker(int enable_profile) +static int video_stop(struct v4l2_device *vdev) { + int ret; + + ret = v4l2_stream_off(vdev); + if (ret < 0) { + printf("error: failed to stop video stream: %s (%d)\n", + strerror(-ret), ret); + return ret; + } + + return 0; +} + +static void video_cleanup(struct v4l2_device *vdev) +{ + if (vdev) { + v4l2_free_buffers(vdev); + v4l2_close(vdev); + } +} + +static int process_ds0_image(struct v4l2_device *vdev,unsigned int width,unsigned int height) +{ + struct v4l2_video_buffer buffer; + int ret; + static struct v4l2_video_buffer old_buffer; + static int screen_init_flag = 0; + mtx.lock(); - cv::VideoCapture capture; - capture.open(3); - capture.set(cv::CAP_PROP_CONVERT_RGB, 0); - capture.set(cv::CAP_PROP_FRAME_WIDTH, (screen_width + 15) / 16 * 16); - capture.set(cv::CAP_PROP_FRAME_HEIGHT, screen_height); - capture.set(cv::CAP_PROP_FOURCC, V4L2_PIX_FMT_NV12); + ret = v4l2_dequeue_buffer(vdev, &buffer); + if (ret < 0) { + printf("error: unable to dequeue buffer: %s (%d)\n", + strerror(-ret), ret); + mtx.unlock(); + return ret; + } mtx.unlock(); - while(quit.load()) - { - drm_bufs_index = !drm_bufs_index; - fbuf_yuv = &drm_dev.drm_bufs[drm_bufs_index]; - cv::Mat org_img(screen_height * 3 / 2, (screen_width + 15) / 16 * 16, CV_8UC1, fbuf_yuv->map); - { - bool ret = false; - ScopedTiming st("capture read",enable_profile); - mtx.lock(); - ret = capture.read(org_img); - mtx.unlock(); - if(ret == false) - { - quit.store(false); - continue; // - } - } + if (buffer.error) { + printf("warning: error in dequeued buffer, skipping\n"); + return 0; + } + fbuf_yuv = &drm_dev.drm_bufs[buffer.index]; + + if (screen_init_flag) { if (drm_dev.req) drm_wait_vsync(); + uint64_t index; struct drm_buffer *fbuf_argb = &drm_dev.drm_bufs_argb[!drm_bufs_argb_index]; - if (drm_dmabuf_set_plane(fbuf_yuv, fbuf_argb)) - { + if (drm_dmabuf_set_plane(fbuf_yuv, fbuf_argb)) { std::cerr << "Flush fail \n"; - goto exit; + return 1; } } -exit: - printf("%s ==========release \n", __func__); + + if(screen_init_flag) { + fbuf_yuv = &drm_dev.drm_bufs[old_buffer.index]; + old_buffer.mem = fbuf_yuv->map; + old_buffer.size = fbuf_yuv->size; + mtx.lock(); + ret = v4l2_queue_buffer(vdev, &old_buffer); + if (ret < 0) { + printf("error: unable to requeue buffer: %s (%d)\n", + strerror(-ret), ret); + mtx.unlock(); + return ret; + } + mtx.unlock(); + } + else { + screen_init_flag = 1; + } + + old_buffer = buffer; + + return 0; +} + +void display_worker(int enable_profile) +{ + int ret; + struct v4l2_device *vdev; + struct v4l2_pix_format format; + fd_set fds; + struct v4l2_video_buffer buffer; + unsigned int i; + mtx.lock(); - capture.release(); + vdev = v4l2_open(dev_info[0].video_name[1]); + if (vdev == NULL) { + printf("error: unable to open video capture device %s\n", + dev_info[0].video_name[1]); + mtx.unlock(); + goto display_cleanup; + } + + memset(&format, 0, sizeof format); + format.pixelformat = dev_info[0].video_out_format[1] ? V4L2_PIX_FMT_NV12 : V4L2_PIX_FMT_NV16; + format.width = dev_info[0].video_width[1]; + format.height = dev_info[0].video_height[1]; + + ret = v4l2_set_format(vdev, &format); + if (ret < 0) + { + printf("%s:v4l2_set_format error\n",__func__); + mtx.unlock(); + goto display_cleanup; + } + + ret = v4l2_alloc_buffers(vdev, V4L2_MEMORY_USERPTR, DRM_BUFFERS_COUNT); + if (ret < 0) + { + printf("%s:v4l2_alloc_buffers error\n",__func__); + mtx.unlock(); + goto display_cleanup; + } + + FD_ZERO(&fds); + FD_SET(vdev->fd, &fds); + + for (i = 0; i < vdev->nbufs; ++i) { + buffer.index = i; + fbuf_yuv = &drm_dev.drm_bufs[buffer.index]; + buffer.mem = fbuf_yuv->map; + buffer.size = fbuf_yuv->size; + + ret = v4l2_queue_buffer(vdev, &buffer); + if (ret < 0) { + printf("error: unable to queue buffer %u\n", i); + mtx.unlock(); + goto display_cleanup; + } + } + + ret = v4l2_stream_on(vdev); + if (ret < 0) { + printf("%s error: failed to start video stream: %s (%d)\n", __func__, + strerror(-ret), ret); + mtx.unlock(); + goto display_cleanup; + } + mtx.unlock(); + + while(quit.load()) { + struct timeval timeout; + fd_set rfds; + + timeout.tv_sec = SELECT_TIMEOUT / 1000; + timeout.tv_usec = (SELECT_TIMEOUT % 1000) * 1000; + rfds = fds; + + ret = select(vdev->fd + 1, &rfds, NULL, NULL, &timeout); + if (ret < 0) { + if (errno == EINTR) + continue; + + printf("error: select failed with %d\n", errno); + goto display_cleanup; + } + if (ret == 0) { + printf("error: select timeout\n"); + goto display_cleanup; + } + process_ds0_image(vdev, format.width, format.height); + } + +display_cleanup: + mtx.lock(); + video_stop(vdev); + video_cleanup(vdev); mtx.unlock(); } @@ -739,7 +878,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/ai/code/head_pose_estimation/main.cc b/package/ai/code/head_pose_estimation/main.cc index 94a3e06..e75f11c 100755 --- a/package/ai/code/head_pose_estimation/main.cc +++ b/package/ai/code/head_pose_estimation/main.cc @@ -653,7 +653,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/ai/code/imx219_0.conf b/package/ai/code/imx219_0.conf index 0df33d8..df76fb4 100644 --- a/package/ai/code/imx219_0.conf +++ b/package/ai/code/imx219_0.conf @@ -1,5 +1,5 @@ { - "isp_general":{ + "isp_general":{ "isp_out_sel":0, "dvp_ch_mode":1, "hist_3a_out_en":0, @@ -33,7 +33,7 @@ }, "wdr":{ "wdr_mode":0, - "wdr_long_ch_mode":0, + "wdr_long_ch_mode":0, "wdr_long_l2_buf_en":0, "wdr_short_s1_buf_en":0, "wdr_dynamic_switch_en":0, @@ -43,8 +43,8 @@ "wdr_long_img_out_format":0, "wdr_long_yuv422_pxl_order":0, "wdr_long_pixel_width":2, - "wdr_buf_base":0, - "wdr_line_stride":0, + "wdr_buf_base":0, + "wdr_line_stride":0, "wdr_frame_buf_size":0 }, "nr3d":{ @@ -52,23 +52,23 @@ "nr3d_fbcd_en":0, "nr3d_mv_out_en":0, "nr3d_y_img_format":0, - "nr3d_y_yuv_in_format":0, - "nr3d_y_img_out_format":0, + "nr3d_y_yuv_in_format":0, + "nr3d_y_img_out_format":0, "nr3d_y_yuv422_pxl_order":0, "nr3d_y_pixel_width":2, "nr3d_uv_img_format":0, - "nr3d_uv_yuv_in_format":0, + "nr3d_uv_yuv_in_format":0, "nr3d_uv_mig_out_format":0, "nr3d_uv_yuv422_pxl_order":0, - "nr3d_uv_pixel_width":2, - "nr3d_frame_buf_size":0 + "nr3d_uv_pixel_width":2, + "nr3d_frame_buf_size":0 }, "ldc":{ "ldc_line_stride":2048, "ldc_frame_buf_size":2048 } }, - "isp_core": { + "isp_core": { "itc": { "hsync_pol":0, "vsync_pol":0, @@ -79,9 +79,9 @@ "itc_ttl_h" :3476, "itc_ttl_v" :1166, "itc_stt_hr" :0, - "itc_stt_vr" :1 + "itc_stt_vr" :1 }, - "tpg": { + "tpg": { "tpg_en":0, "bayer_mode_sel":3, "motion_mode_sel":0, @@ -102,12 +102,12 @@ "lsc_r_ratio" :10, "lsc_g_ratio":6, "lsc_b_ratio" :6, - "lsc_ir_ratio" :6 + "lsc_ir_ratio" :6 }, "ae":{ - "ae_as_en" :1, - "ae_ag_en" :1, - "ae_airis_en" :0, + "ae_as_en" :0, + "ae_ag_en" :0, + "ae_airis_en" :0, "ae_enter_ls_sel" :0, "ae_exit_ls_sel" :0, "ae_win_mode_sel" :0, @@ -119,29 +119,29 @@ "ae_win_endh" :1919, "ae_win_endv" :1079, "ae_yobj" :90, - "ae_av_rg" :13, - "ae_l_ex_time" :1100, + "ae_av_rg" :8, + "ae_l_ex_time" :1000, "ae_m_ex_time" :32, "ae_s_ex_time" :32, "ae_agc" :256, - "ae_ad_shuttle_freq" :1, + "ae_ad_shuttle_freq" :0, "ae_ad_gain_freq" :0, "ae_adjust_step_max":36, "ae_ex_value_max" :1162, "ae_ex_value_mid" :256, - "ae_ex_value_min" :1, - "ae_gain_value_max" :2304, + "ae_ex_value_min" :1, + "ae_gain_value_max" :4095, "ae_gain_value_mid" :512, "ae_gain_value_min" :256, "ae_dn_switch_ad_step_max" :512, - "ae_dn_switch_wait_time" :255, - "ape_max_diff" :12, + "ae_dn_switch_wait_time" :255, + "ape_max_diff" :12, "ape_drv_signal_max" :3840, "ape_coeff_distance" :0, "ape_coeff_speed" :0, "ape_coeff_acceleration" :0, "ape_drv_manual_value" :4095, - "ape_damp_manual_value" :2048 + "ape_damp_manual_value" :2048 }, "awb":{ "awb_d65_en" :1, @@ -181,7 +181,7 @@ "awb_red_min_value" :176, "awb_blue_min_value" :281, "awb_red_obj_value" :256, - "awb_blue_obj_value" :256 + "awb_blue_obj_value" :256 }, "wdr":{ "wdr_fusion_en" :0, @@ -191,18 +191,18 @@ "wdr_en" :0, "wdr_ghost_remove_en" :0, "wdr_3frame_out_mode" :0, - "wdr_mode_sel" :0, + "wdr_mode_sel" :0, "wdr_2frame_ex_ratio" :1, "wdr_3frame_ex_ratio" :1, "wdr_stat_img_sel" :0, "wdr_ltm_data_sel" :1, "wdr_tz_data_sel" :1, - "wdr_remove_purple_en" :0, + "wdr_remove_purple_en" :0, "wdr_over_ex_ratio_th1" :384, "wdr_over_ex_ratio_th2" :32, "wdr_fusion_ratio_th" :192, "wdr_fusion_value1" :64, - "wdr_fusion_value2" :16 + "wdr_fusion_value2" :16 }, "csc":{ "rgb2yuv_00":153, @@ -213,12 +213,12 @@ "rgb2yuv_12":170, "rgb2yuv_20":58, "rgb2yuv_21":42, - "rgb2yuv_22":256 + "rgb2yuv_22":256 }, "ada":{ "gm_rgb_en" :1, "gm_yuv_en" :0, - "ada_en" :0, + "ada_en" :1, "ada_sbz_en" :0, "ada_ccr_en" :0, "ada_adp_en" :0, @@ -226,11 +226,11 @@ "ada_stat_mode_sel" :0, "ada_enh_mode_sel" :0, "ada_hist_max" :128, - "ada_ttl_max" :128, + "ada_ttl_max" :255, "ada_win_stth" :0, "ada_win_sttv" :0, "ada_win_endh" :1919, - "ada_win_endv" :1079 + "ada_win_endv" :1079 }, "rgb-ir":{ "raw_fmt" :0, @@ -242,7 +242,7 @@ "dfc_krb" :0, "dfc_ky" :0, "dfc_th" :256, - "dfc_th_1" :256 + "dfc_th_1" :256 }, "2dnr":{ "dpeak_en" :1, @@ -251,15 +251,15 @@ "nr2d_jl_en" :1, "nr2d_av_en" :1, "nr2d_c_en" :1, - "dpeak_adp_en" :1, - "nr2d_raw_adp_en":1, - "nr2d_y_adp_en" :1, - "nr2d_c_adp_en" :1, + "dpeak_adp_en" :0, + "nr2d_raw_adp_en":0, + "nr2d_y_adp_en" :0, + "nr2d_c_adp_en" :0, "nr2d_raw_kl" :16, "nr2d_jl_th" :511, "nr2d_eg_k" :48, "nr2d_y_k" :64, - "nr2d_c_k" :255 + "nr2d_c_k" :1 }, "3dnr":{ "nr3d_en" :1, @@ -271,8 +271,8 @@ "nr3db_c_en" :1, "nr3dm_nr2d_y_en" :1, "nr3dm_nr2d_c_en" :1, - "core_3dnr_wb_en" :1, - "core_3dnr_wb_sel" :1, + "core_3dnr_wb_en" :0, + "core_3dnr_wb_sel" :0, "core_3dnr_adp_luma_en" :0, "core_3dnr_adp_chroma_en" :0, "nr3dp_thy" :64, @@ -285,10 +285,10 @@ "nr3dm_thy" :64, "nr3dm_min" :0, "nr3dm_thw0" :128, - "core_3dnr_chroma_intensity" :122, + "core_3dnr_chroma_intensity" :16, "nr3db_nr2d_eg_th" :64, "nr3db_thyp" :64, - "nr3db_thcp" :32 + "nr3db_thcp" :32 }, "enh":{ "ltm":{ @@ -299,16 +299,16 @@ }, "sharp":{ "enh_sharp_en" :1, - "enh_adp_sharp_en" :1, + "enh_adp_sharp_en" :0, "shp_core" :8, - "shp_th1" :18, - "shp_th2" :256, + "shp_th1" :3840, + "shp_th2" :4095, "shp_gain" :64 }, "cc":{ - "enh_cc_en" :1, + "enh_cc_en" :0, "enh_adp_cc_en" :0 - } + } }, "post_ctl":{ "otc_ctl":{ @@ -318,19 +318,19 @@ "otc_hs_plt_sl" :0, "otc_vs_plt_sl" :0, "otc_stt_vr" :0, - "otc_stt_hr" :0 + "otc_stt_hr" :0 }, "ctrst":{ "ctrst_en" :1, - "ctrst_gain":128 + "ctrst_gain":128 }, "luma":{ "luma_en" :1, - "luma_gain":128 + "luma_gain":128 }, "strt":{ "strt_en" :1, - "strt_gain":255 + "strt_gain":250 } }, "ldc":{ @@ -341,7 +341,7 @@ "ldc_ch" :960, "ldc_cv" :540, "ldc_cr" :684, - "ldc_cz" :684 + "ldc_cz" :684 }, "af":{ "af_stat_en" :1, @@ -349,7 +349,7 @@ "af_stat_win_h_start":0, "af_stat_win_v_start":0, "af_stat_win_h_end" :1919, - "af_stat_win_v_end" :1079 + "af_stat_win_v_end" :1079 } }, "isp_post":{ @@ -365,7 +365,7 @@ "osd_rgb2yuv_coeff20":523, "osd_rgb2yuv_coeff21":3658, "osd_rgb2yuv_coeff22":4011, - "osd_rgb2yuv_coeff23":128 + "osd_rgb2yuv_coeff23":128 }, "yuv2rgb":{ "out_yuv2rgb_coeff00":1024, @@ -379,7 +379,7 @@ "out_yuv2rgb_coeff20":1024, "out_yuv2rgb_coeff21":1822, "out_yuv2rgb_coeff22":0, - "out_yuv2rgb_coeff23":3868 + "out_yuv2rgb_coeff23":3868 }, "ds0":{ "ds0_out_rgb_mode":0, @@ -528,4 +528,4 @@ } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/package/ai/code/imx219_1.conf b/package/ai/code/imx219_1.conf index 33a5236..900cfd9 100644 --- a/package/ai/code/imx219_1.conf +++ b/package/ai/code/imx219_1.conf @@ -1,5 +1,5 @@ { - "isp_general":{ + "isp_general":{ "isp_out_sel":0, "dvp_ch_mode":1, "hist_3a_out_en":0, @@ -33,7 +33,7 @@ }, "wdr":{ "wdr_mode":0, - "wdr_long_ch_mode":0, + "wdr_long_ch_mode":0, "wdr_long_l2_buf_en":0, "wdr_short_s1_buf_en":0, "wdr_dynamic_switch_en":0, @@ -43,8 +43,8 @@ "wdr_long_img_out_format":0, "wdr_long_yuv422_pxl_order":0, "wdr_long_pixel_width":2, - "wdr_buf_base":0, - "wdr_line_stride":0, + "wdr_buf_base":0, + "wdr_line_stride":0, "wdr_frame_buf_size":0 }, "nr3d":{ @@ -52,23 +52,23 @@ "nr3d_fbcd_en":0, "nr3d_mv_out_en":0, "nr3d_y_img_format":0, - "nr3d_y_yuv_in_format":0, - "nr3d_y_img_out_format":0, + "nr3d_y_yuv_in_format":0, + "nr3d_y_img_out_format":0, "nr3d_y_yuv422_pxl_order":0, "nr3d_y_pixel_width":2, "nr3d_uv_img_format":0, - "nr3d_uv_yuv_in_format":0, + "nr3d_uv_yuv_in_format":0, "nr3d_uv_mig_out_format":0, "nr3d_uv_yuv422_pxl_order":0, - "nr3d_uv_pixel_width":2, - "nr3d_frame_buf_size":0 + "nr3d_uv_pixel_width":2, + "nr3d_frame_buf_size":0 }, "ldc":{ "ldc_line_stride":2048, "ldc_frame_buf_size":2048 } }, - "isp_core": { + "isp_core": { "itc": { "hsync_pol":0, "vsync_pol":0, @@ -79,9 +79,9 @@ "itc_ttl_h" :3476, "itc_ttl_v" :1166, "itc_stt_hr" :0, - "itc_stt_vr" :1 + "itc_stt_vr" :1 }, - "tpg": { + "tpg": { "tpg_en":0, "bayer_mode_sel":3, "motion_mode_sel":0, @@ -92,8 +92,8 @@ }, "blc":{ "blc_en" :1, - "blc_offset" :220, - "blc_ratio" :270 + "blc_offset" :240, + "blc_ratio" :272 }, "lsc":{ "lsc_en" :1, @@ -102,12 +102,12 @@ "lsc_r_ratio" :10, "lsc_g_ratio":6, "lsc_b_ratio" :6, - "lsc_ir_ratio" :6 + "lsc_ir_ratio" :6 }, "ae":{ - "ae_as_en" :1, - "ae_ag_en" :1, - "ae_airis_en" :0, + "ae_as_en" :0, + "ae_ag_en" :0, + "ae_airis_en" :0, "ae_enter_ls_sel" :0, "ae_exit_ls_sel" :0, "ae_win_mode_sel" :0, @@ -118,30 +118,30 @@ "ae_win_sttv" :0, "ae_win_endh" :1919, "ae_win_endv" :1079, - "ae_yobj" :100, - "ae_av_rg" :14, - "ae_l_ex_time" :1100, + "ae_yobj" :90, + "ae_av_rg" :8, + "ae_l_ex_time" :1000, "ae_m_ex_time" :32, "ae_s_ex_time" :32, "ae_agc" :256, - "ae_ad_shuttle_freq" :2, + "ae_ad_shuttle_freq" :0, "ae_ad_gain_freq" :0, "ae_adjust_step_max":36, "ae_ex_value_max" :1162, "ae_ex_value_mid" :256, - "ae_ex_value_min" :1, - "ae_gain_value_max" :2304, + "ae_ex_value_min" :1, + "ae_gain_value_max" :4095, "ae_gain_value_mid" :512, "ae_gain_value_min" :256, "ae_dn_switch_ad_step_max" :512, - "ae_dn_switch_wait_time" :255, - "ape_max_diff" :12, - "ape_drv_signal_max" :3840, + "ae_dn_switch_wait_time" :255, + "ape_max_diff" :12, + "ape_drv_signal_max" :3840, "ape_coeff_distance" :0, "ape_coeff_speed" :0, "ape_coeff_acceleration" :0, "ape_drv_manual_value" :4095, - "ape_damp_manual_value" :2048 + "ape_damp_manual_value" :2048 }, "awb":{ "awb_d65_en" :1, @@ -181,7 +181,7 @@ "awb_red_min_value" :154, "awb_blue_min_value" :258, "awb_red_obj_value" :256, - "awb_blue_obj_value" :256 + "awb_blue_obj_value" :256 }, "wdr":{ "wdr_fusion_en" :0, @@ -191,18 +191,18 @@ "wdr_en" :0, "wdr_ghost_remove_en" :0, "wdr_3frame_out_mode" :0, - "wdr_mode_sel" :0, + "wdr_mode_sel" :0, "wdr_2frame_ex_ratio" :1, "wdr_3frame_ex_ratio" :1, "wdr_stat_img_sel" :0, "wdr_ltm_data_sel" :1, "wdr_tz_data_sel" :1, - "wdr_remove_purple_en" :0, + "wdr_remove_purple_en" :0, "wdr_over_ex_ratio_th1" :384, "wdr_over_ex_ratio_th2" :32, "wdr_fusion_ratio_th" :192, "wdr_fusion_value1" :64, - "wdr_fusion_value2" :16 + "wdr_fusion_value2" :16 }, "csc":{ "rgb2yuv_00":153, @@ -213,12 +213,12 @@ "rgb2yuv_12":170, "rgb2yuv_20":58, "rgb2yuv_21":42, - "rgb2yuv_22":256 + "rgb2yuv_22":256 }, "ada":{ "gm_rgb_en" :1, "gm_yuv_en" :0, - "ada_en" :0, + "ada_en" :1, "ada_sbz_en" :0, "ada_ccr_en" :0, "ada_adp_en" :0, @@ -226,11 +226,11 @@ "ada_stat_mode_sel" :0, "ada_enh_mode_sel" :0, "ada_hist_max" :128, - "ada_ttl_max" :128, + "ada_ttl_max" :255, "ada_win_stth" :0, "ada_win_sttv" :0, "ada_win_endh" :1919, - "ada_win_endv" :1079 + "ada_win_endv" :1079 }, "rgb-ir":{ "raw_fmt" :0, @@ -242,7 +242,7 @@ "dfc_krb" :0, "dfc_ky" :0, "dfc_th" :256, - "dfc_th_1" :256 + "dfc_th_1" :256 }, "2dnr":{ "dpeak_en" :1, @@ -251,15 +251,15 @@ "nr2d_jl_en" :1, "nr2d_av_en" :1, "nr2d_c_en" :1, - "dpeak_adp_en" :1, - "nr2d_raw_adp_en":1, - "nr2d_y_adp_en" :1, - "nr2d_c_adp_en" :1, + "dpeak_adp_en" :0, + "nr2d_raw_adp_en":0, + "nr2d_y_adp_en" :0, + "nr2d_c_adp_en" :0, "nr2d_raw_kl" :16, "nr2d_jl_th" :511, "nr2d_eg_k" :48, "nr2d_y_k" :64, - "nr2d_c_k" :255 + "nr2d_c_k" :1 }, "3dnr":{ "nr3d_en" :1, @@ -271,8 +271,8 @@ "nr3db_c_en" :1, "nr3dm_nr2d_y_en" :1, "nr3dm_nr2d_c_en" :1, - "core_3dnr_wb_en" :1, - "core_3dnr_wb_sel" :1, + "core_3dnr_wb_en" :0, + "core_3dnr_wb_sel" :0, "core_3dnr_adp_luma_en" :0, "core_3dnr_adp_chroma_en" :0, "nr3dp_thy" :64, @@ -285,10 +285,10 @@ "nr3dm_thy" :64, "nr3dm_min" :0, "nr3dm_thw0" :128, - "core_3dnr_chroma_intensity" :144, + "core_3dnr_chroma_intensity" :16, "nr3db_nr2d_eg_th" :64, "nr3db_thyp" :64, - "nr3db_thcp" :32 + "nr3db_thcp" :32 }, "enh":{ "ltm":{ @@ -299,16 +299,16 @@ }, "sharp":{ "enh_sharp_en" :1, - "enh_adp_sharp_en" :1, + "enh_adp_sharp_en" :0, "shp_core" :8, - "shp_th1" :18, - "shp_th2" :256, + "shp_th1" :3840, + "shp_th2" :4095, "shp_gain" :64 }, "cc":{ - "enh_cc_en" :1, + "enh_cc_en" :0, "enh_adp_cc_en" :0 - } + } }, "post_ctl":{ "otc_ctl":{ @@ -318,19 +318,19 @@ "otc_hs_plt_sl" :0, "otc_vs_plt_sl" :0, "otc_stt_vr" :0, - "otc_stt_hr" :0 + "otc_stt_hr" :0 }, "ctrst":{ "ctrst_en" :1, - "ctrst_gain":128 + "ctrst_gain":128 }, "luma":{ "luma_en" :1, - "luma_gain":128 + "luma_gain":128 }, "strt":{ "strt_en" :1, - "strt_gain":248 + "strt_gain":250 } }, "ldc":{ @@ -341,7 +341,7 @@ "ldc_ch" :960, "ldc_cv" :540, "ldc_cr" :684, - "ldc_cz" :684 + "ldc_cz" :684 }, "af":{ "af_stat_en" :1, @@ -349,7 +349,7 @@ "af_stat_win_h_start":0, "af_stat_win_v_start":0, "af_stat_win_h_end" :1919, - "af_stat_win_v_end" :1079 + "af_stat_win_v_end" :1079 } }, "isp_post":{ @@ -365,7 +365,7 @@ "osd_rgb2yuv_coeff20":523, "osd_rgb2yuv_coeff21":3658, "osd_rgb2yuv_coeff22":4011, - "osd_rgb2yuv_coeff23":128 + "osd_rgb2yuv_coeff23":128 }, "yuv2rgb":{ "out_yuv2rgb_coeff00":1024, @@ -379,7 +379,7 @@ "out_yuv2rgb_coeff20":1024, "out_yuv2rgb_coeff21":1822, "out_yuv2rgb_coeff22":0, - "out_yuv2rgb_coeff23":3868 + "out_yuv2rgb_coeff23":3868 }, "ds0":{ "ds0_out_rgb_mode":0, @@ -528,4 +528,4 @@ } } } -} \ No newline at end of file +} diff --git a/package/ai/code/imx219_1080x1920_0.conf b/package/ai/code/imx219_1080x1920_0.conf index b9b9e3b..3aa0260 100644 --- a/package/ai/code/imx219_1080x1920_0.conf +++ b/package/ai/code/imx219_1080x1920_0.conf @@ -1,531 +1,531 @@ { - "isp_general": { - "isp_out_sel": 0, - "dvp_ch_mode": 1, - "hist_3a_out_en": 0, - "main_out": { - "out_img_format": 1, - "out_yuv_in_format": 0, - "out_yuv422_pxl_order": 0, - "out_pxl_width": 0, - "out_frame_buf_size": 2048 + "isp_general":{ + "isp_out_sel":0, + "dvp_ch_mode":1, + "hist_3a_out_en":0, + "main_out":{ + "out_img_format":1, + "out_yuv_in_format":0, + "out_yuv422_pxl_order":0, + "out_pxl_width":0, + "out_frame_buf_size":2048 }, - "out0": { - "ds0_out_img_format": 1, - "ds0_out_yuv_in_format": 0, - "ds0_out_yuv422_pxl_order": 0, - "ds0_out_pxl_width": 0, - "ds0_frame_buf_size": 2048 + "out0":{ + "ds0_out_img_format":1, + "ds0_out_yuv_in_format":0, + "ds0_out_yuv422_pxl_order":0, + "ds0_out_pxl_width":0, + "ds0_frame_buf_size":2048 }, - "out1": { - "ds1_out_img_format": 1, - "ds1_out_yuv_in_format": 0, - "ds1_out_yuv422_pxl_order": 0, - "ds1_out_pxl_width": 0, - "ds1_frame_buf_size": 2048 + "out1":{ + "ds1_out_img_format":1, + "ds1_out_yuv_in_format":0, + "ds1_out_yuv422_pxl_order":0, + "ds1_out_pxl_width":0, + "ds1_frame_buf_size":2048 }, - "out2": { - "ds2_out_img_format": 0, - "ds2_out_yuv_in_format": 0, - "ds2_out_yuv422_pxl_order": 0, - "ds2_out_pxl_width": 0, - "ds2_frame_buf_size": 2048 + "out2":{ + "ds2_out_img_format":0, + "ds2_out_yuv_in_format":0, + "ds2_out_yuv422_pxl_order":0, + "ds2_out_pxl_width":0, + "ds2_frame_buf_size":2048 }, - "wdr": { - "wdr_mode": 0, - "wdr_long_ch_mode": 0, - "wdr_long_l2_buf_en": 0, - "wdr_short_s1_buf_en": 0, - "wdr_dynamic_switch_en": 0, - "wdr_long_l2_buf_depth": 0, - "wdr_long_img_format": 0, - "wdr_long_yuv_in_format": 0, - "wdr_long_img_out_format": 0, - "wdr_long_yuv422_pxl_order": 0, - "wdr_long_pixel_width": 2, - "wdr_buf_base": 0, - "wdr_line_stride": 0, - "wdr_frame_buf_size": 0 - }, - "nr3d": { - "nr3d_en": 0, - "nr3d_fbcd_en": 0, - "nr3d_mv_out_en": 0, - "nr3d_y_img_format": 0, - "nr3d_y_yuv_in_format": 0, - "nr3d_y_img_out_format": 0, - "nr3d_y_yuv422_pxl_order": 0, - "nr3d_y_pixel_width": 2, - "nr3d_uv_img_format": 0, - "nr3d_uv_yuv_in_format": 0, - "nr3d_uv_mig_out_format": 0, - "nr3d_uv_yuv422_pxl_order": 0, - "nr3d_uv_pixel_width": 2, - "nr3d_frame_buf_size": 0 - }, - "ldc": { - "ldc_line_stride": 2048, - "ldc_frame_buf_size": 2048 - } + "wdr":{ + "wdr_mode":0, + "wdr_long_ch_mode":0, + "wdr_long_l2_buf_en":0, + "wdr_short_s1_buf_en":0, + "wdr_dynamic_switch_en":0, + "wdr_long_l2_buf_depth":0, + "wdr_long_img_format":0, + "wdr_long_yuv_in_format":0, + "wdr_long_img_out_format":0, + "wdr_long_yuv422_pxl_order":0, + "wdr_long_pixel_width":2, + "wdr_buf_base":0, + "wdr_line_stride":0, + "wdr_frame_buf_size":0 + }, + "nr3d":{ + "nr3d_en":0, + "nr3d_fbcd_en":0, + "nr3d_mv_out_en":0, + "nr3d_y_img_format":0, + "nr3d_y_yuv_in_format":0, + "nr3d_y_img_out_format":0, + "nr3d_y_yuv422_pxl_order":0, + "nr3d_y_pixel_width":2, + "nr3d_uv_img_format":0, + "nr3d_uv_yuv_in_format":0, + "nr3d_uv_mig_out_format":0, + "nr3d_uv_yuv422_pxl_order":0, + "nr3d_uv_pixel_width":2, + "nr3d_frame_buf_size":0 + }, + "ldc":{ + "ldc_line_stride":2048, + "ldc_frame_buf_size":2048 + } }, "isp_core": { "itc": { - "hsync_pol": 0, - "vsync_pol": 0, - "hsync_input_timing": 2, - "vsync_input_timing": 1, - "flip_ctl": 0, - "video_fmt_sl": 0, - "itc_ttl_h": 3476, - "itc_ttl_v": 1166, - "itc_stt_hr": 0, - "itc_stt_vr": 1 + "hsync_pol":0, + "vsync_pol":0, + "hsync_input_timing":2, + "vsync_input_timing":1, + "flip_ctl" :0, + "video_fmt_sl":0, + "itc_ttl_h" :3453, + "itc_ttl_v" :1977, + "itc_stt_hr" :0, + "itc_stt_vr" :1 }, "tpg": { - "tpg_en": 0, - "bayer_mode_sel": 3, - "motion_mode_sel": 0, - "tpg_sel": 9, - "wdr_l_mul_data": 0, - "wdr_m_mul_data": 0, - "wdr_s_mul_data": 0 + "tpg_en":0, + "bayer_mode_sel":3, + "motion_mode_sel":0, + "tpg_sel":9, + "wdr_l_mul_data":0, + "wdr_m_mul_data":0, + "wdr_s_mul_data":0 }, - "blc": { - "blc_en": 1, - "blc_offset": 220, - "blc_ratio": 270 + "blc":{ + "blc_en" :1, + "blc_offset" :240, + "blc_ratio" :272 }, - "lsc": { - "lsc_en": 1, - "lsc_h_center": 900, - "lsc_v_center": 580, - "lsc_r_ratio": 10, - "lsc_g_ratio": 6, - "lsc_b_ratio": 6, - "lsc_ir_ratio": 6 + "lsc":{ + "lsc_en" :1, + "lsc_h_center" :480, + "lsc_v_center" :1000, + "lsc_r_ratio" :10, + "lsc_g_ratio":6, + "lsc_b_ratio" :6, + "lsc_ir_ratio" :6 }, - "ae": { - "ae_as_en": 1, - "ae_ag_en": 1, - "ae_airis_en": 0, - "ae_enter_ls_sel": 0, - "ae_exit_ls_sel": 0, - "ae_win_mode_sel": 0, - "ae_back_light_mode_sel": 0, - "ae_day_change_en": 0, - "ae_day_change_sel": 0, - "ae_win_stth": 0, - "ae_win_sttv": 0, - "ae_win_endh": 1919, - "ae_win_endv": 1079, - "ae_yobj": 100, - "ae_av_rg": 14, - "ae_l_ex_time": 1100, - "ae_m_ex_time": 32, - "ae_s_ex_time": 32, - "ae_agc": 256, - "ae_ad_shuttle_freq": 2, - "ae_ad_gain_freq": 0, - "ae_adjust_step_max": 36, - "ae_ex_value_max": 1162, - "ae_ex_value_mid": 256, - "ae_ex_value_min": 1, - "ae_gain_value_max": 2304, - "ae_gain_value_mid": 512, - "ae_gain_value_min": 256, - "ae_dn_switch_ad_step_max": 512, - "ae_dn_switch_wait_time": 255, - "ape_max_diff": 12, - "ape_drv_signal_max": 3840, - "ape_coeff_distance": 0, - "ape_coeff_speed": 0, - "ape_coeff_acceleration": 0, - "ape_drv_manual_value": 4095, - "ape_damp_manual_value": 2048 + "ae":{ + "ae_as_en" :0, + "ae_ag_en" :0, + "ae_airis_en" :0, + "ae_enter_ls_sel" :0, + "ae_exit_ls_sel" :0, + "ae_win_mode_sel" :0, + "ae_back_light_mode_sel" :0, + "ae_day_change_en" :0, + "ae_day_change_sel" :0, + "ae_win_stth" :0, + "ae_win_sttv" :0, + "ae_win_endh" :1079, + "ae_win_endv" :1919, + "ae_yobj" :90, + "ae_av_rg" :8, + "ae_l_ex_time" :1000, + "ae_m_ex_time" :32, + "ae_s_ex_time" :32, + "ae_agc" :256, + "ae_ad_shuttle_freq" :0, + "ae_ad_gain_freq" :0, + "ae_adjust_step_max":36, + "ae_ex_value_max" :1973, + "ae_ex_value_mid" :256, + "ae_ex_value_min" :1, + "ae_gain_value_max" :4095, + "ae_gain_value_mid" :512, + "ae_gain_value_min" :256, + "ae_dn_switch_ad_step_max" :1000, + "ae_dn_switch_wait_time" :255, + "ape_max_diff" :12, + "ape_drv_signal_max" :3840, + "ape_coeff_distance" :0, + "ape_coeff_speed" :0, + "ape_coeff_acceleration" :0, + "ape_drv_manual_value" :4095, + "ape_damp_manual_value" :2048 }, - "awb": { - "awb_d65_en": 1, - "awb_ccm_en": 1, - "awb_en": 1, - "awb_mode_sel": 1, - "awb_hist_mode_sel": 0, - "awb_veri_en": 0, - "awb_fb_en": 0, - "awb_value_save_en": 0, - "awb_ccm_adp_adjust_en": 0, - "awb_stab_en": 1, - "awb_d65_red_gain": 466, - "awb_d65_blue_gain": 382, - "ccm_rr": 260, - "ccm_rg": 3, - "ccm_rb": 1, - "ccm_gr": 25, - "ccm_gg": 296, - "ccm_gb": 15, - "ccm_br": 1, - "ccm_bg": 39, - "ccm_bb": 296, - "ccm_correct_coff": 256, - "awb_win_stth": 0, - "awb_win_sttv": 0, - "awb_win_endh": 1919, - "awb_win_endv": 1079, - "awb_correct_diff_th": 8, - "awb_color_changeres_time": 8, - "awb_historgram_th": 4, - "awb_red_gain_adjust": 256, - "awb_green_gain_adjust": 256, - "awb_blue_gain_adjust": 256, - "awb_red_max_value": 256, - "awb_blue_max_value": 423, - "awb_red_min_value": 154, - "awb_blue_min_value": 258, - "awb_red_obj_value": 256, - "awb_blue_obj_value": 256 + "awb":{ + "awb_d65_en" :1, + "awb_ccm_en" :1, + "awb_en" :1, + "awb_mode_sel" :1, + "awb_hist_mode_sel" :0, + "awb_veri_en" :0, + "awb_fb_en" :0, + "awb_value_save_en" :0, + "awb_ccm_adp_adjust_en" :0, + "awb_stab_en" :1, + "awb_d65_red_gain" :466, + "awb_d65_blue_gain" :382, + "ccm_rr" :259, + "ccm_rg" :2, + "ccm_rb" :1, + "ccm_gr" :37, + "ccm_gg" :310, + "ccm_gb" :17, + "ccm_br" :1, + "ccm_bg" :75, + "ccm_bb" :332, + "ccm_correct_coff" :256, + "awb_win_stth" :0, + "awb_win_sttv" :0, + "awb_win_endh" :1079, + "awb_win_endv" :1919, + "awb_correct_diff_th" :8, + "awb_color_changeres_time" :8, + "awb_historgram_th" :4, + "awb_red_gain_adjust" :256, + "awb_green_gain_adjust" :256, + "awb_blue_gain_adjust" :256, + "awb_red_max_value" :259, + "awb_blue_max_value" :388, + "awb_red_min_value" :176, + "awb_blue_min_value" :262, + "awb_red_obj_value" :256, + "awb_blue_obj_value" :256 }, - "wdr": { - "wdr_fusion_en": 0, - "wdr_frame_sel": 0, - "wdr_adp_adjust_en": 0, - "wdr_stab_en": 0, - "wdr_en": 0, - "wdr_ghost_remove_en": 0, - "wdr_3frame_out_mode": 0, - "wdr_mode_sel": 0, - "wdr_2frame_ex_ratio": 1, - "wdr_3frame_ex_ratio": 1, - "wdr_stat_img_sel": 0, - "wdr_ltm_data_sel": 1, - "wdr_tz_data_sel": 1, - "wdr_remove_purple_en": 0, - "wdr_over_ex_ratio_th1": 384, - "wdr_over_ex_ratio_th2": 32, - "wdr_fusion_ratio_th": 192, - "wdr_fusion_value1": 64, - "wdr_fusion_value2": 16 + "wdr":{ + "wdr_fusion_en" :0, + "wdr_frame_sel" :0, + "wdr_adp_adjust_en" :0, + "wdr_stab_en" :0, + "wdr_en" :0, + "wdr_ghost_remove_en" :0, + "wdr_3frame_out_mode" :0, + "wdr_mode_sel" :0, + "wdr_2frame_ex_ratio" :1, + "wdr_3frame_ex_ratio" :1, + "wdr_stat_img_sel" :0, + "wdr_ltm_data_sel" :1, + "wdr_tz_data_sel" :1, + "wdr_remove_purple_en" :0, + "wdr_over_ex_ratio_th1" :384, + "wdr_over_ex_ratio_th2" :32, + "wdr_fusion_ratio_th" :192, + "wdr_fusion_value1" :64, + "wdr_fusion_value2" :16 }, - "csc": { - "rgb2yuv_00": 153, - "rgb2yuv_01": 256, - "rgb2yuv_02": 86, - "rgb2yuv_10": 301, - "rgb2yuv_11": 214, - "rgb2yuv_12": 170, - "rgb2yuv_20": 58, - "rgb2yuv_21": 42, - "rgb2yuv_22": 256 + "csc":{ + "rgb2yuv_00":153, + "rgb2yuv_01":256, + "rgb2yuv_02":86, + "rgb2yuv_10":301, + "rgb2yuv_11":214, + "rgb2yuv_12":170, + "rgb2yuv_20":58, + "rgb2yuv_21":42, + "rgb2yuv_22":256 }, - "ada": { - "gm_rgb_en": 1, - "gm_yuv_en": 0, - "ada_en": 0, - "ada_sbz_en": 0, - "ada_ccr_en": 0, - "ada_adp_en": 0, - "ada_adp_ccr_en": 0, - "ada_stat_mode_sel": 0, - "ada_enh_mode_sel": 0, - "ada_hist_max": 128, - "ada_ttl_max": 128, - "ada_win_stth": 0, - "ada_win_sttv": 0, - "ada_win_endh": 1919, - "ada_win_endv": 1079 + "ada":{ + "gm_rgb_en" :1, + "gm_yuv_en" :0, + "ada_en" :1, + "ada_sbz_en" :0, + "ada_ccr_en" :0, + "ada_adp_en" :0, + "ada_adp_ccr_en" :0, + "ada_stat_mode_sel" :0, + "ada_enh_mode_sel" :0, + "ada_hist_max" :128, + "ada_ttl_max" :255, + "ada_win_stth" :0, + "ada_win_sttv" :0, + "ada_win_endh" :1079, + "ada_win_endv" :1919 }, - "rgb-ir": { - "raw_fmt": 0, - "rgbir_rct_en": 0, - "dfc_en": 0, - "rgbir_fs_en": 0, - "rgbir_ot_sl": 0, - "rgbir_fs_max": 256, - "dfc_krb": 0, - "dfc_ky": 0, - "dfc_th": 256, - "dfc_th_1": 256 + "rgb-ir":{ + "raw_fmt" :0, + "rgbir_rct_en" :0, + "dfc_en" :0, + "rgbir_fs_en" :0, + "rgbir_ot_sl" :0, + "rgbir_fs_max" :256, + "dfc_krb" :0, + "dfc_ky" :0, + "dfc_th" :256, + "dfc_th_1" :256 }, - "2dnr": { - "dpeak_en": 1, - "nr2d_raw_en": 1, - "nr2d_eg_en": 1, - "nr2d_jl_en": 1, - "nr2d_av_en": 1, - "nr2d_c_en": 1, - "dpeak_adp_en": 1, - "nr2d_raw_adp_en": 1, - "nr2d_y_adp_en": 1, - "nr2d_c_adp_en": 1, - "nr2d_raw_kl": 16, - "nr2d_jl_th": 511, - "nr2d_eg_k": 48, - "nr2d_y_k": 64, - "nr2d_c_k": 255 + "2dnr":{ + "dpeak_en" :1, + "nr2d_raw_en" :1, + "nr2d_eg_en" :1, + "nr2d_jl_en" :1, + "nr2d_av_en" :1, + "nr2d_c_en" :1, + "dpeak_adp_en" :0, + "nr2d_raw_adp_en":0, + "nr2d_y_adp_en" :0, + "nr2d_c_adp_en" :0, + "nr2d_raw_kl" :16, + "nr2d_jl_th" :511, + "nr2d_eg_k" :48, + "nr2d_y_k" :64, + "nr2d_c_k" :1 }, - "3dnr": { - "nr3d_en": 1, - "nr3dp_y_en": 1, - "nr3dp_c_en": 1, - "nr3dm_y_en": 1, - "nr3dm_c_en": 1, - "nr3db_y_en": 1, - "nr3db_c_en": 1, - "nr3dm_nr2d_y_en": 1, - "nr3dm_nr2d_c_en": 1, - "core_3dnr_wb_en": 1, - "core_3dnr_wb_sel": 1, - "core_3dnr_adp_luma_en": 0, - "core_3dnr_adp_chroma_en": 0, - "nr3dp_thy": 64, - "nr3dp_thyp": 64, - "nr3dp_thcp": 64, - "nr3dm_mid_th": 128, - "nr3dm_mtp_th": 8, - "nr3dm_mtc_th": 128, - "nr3dm_ym_k": 60, - "nr3dm_thy": 64, - "nr3dm_min": 0, - "nr3dm_thw0": 128, - "core_3dnr_chroma_intensity": 144, - "nr3db_nr2d_eg_th": 64, - "nr3db_thyp": 64, - "nr3db_thcp": 32 + "3dnr":{ + "nr3d_en" :1, + "nr3dp_y_en" :1, + "nr3dp_c_en" :1, + "nr3dm_y_en" :1, + "nr3dm_c_en" :1, + "nr3db_y_en" :1, + "nr3db_c_en" :1, + "nr3dm_nr2d_y_en" :1, + "nr3dm_nr2d_c_en" :1, + "core_3dnr_wb_en" :0, + "core_3dnr_wb_sel" :0, + "core_3dnr_adp_luma_en" :0, + "core_3dnr_adp_chroma_en" :0, + "nr3dp_thy" :64, + "nr3dp_thyp" :64, + "nr3dp_thcp" :64, + "nr3dm_mid_th" :128, + "nr3dm_mtp_th" :8, + "nr3dm_mtc_th" :128, + "nr3dm_ym_k" :60, + "nr3dm_thy" :64, + "nr3dm_min" :0, + "nr3dm_thw0" :128, + "core_3dnr_chroma_intensity" :16, + "nr3db_nr2d_eg_th" :64, + "nr3db_thyp" :64, + "nr3db_thcp" :32 }, - "enh": { - "ltm": { - "enh_ltm_en": 1, - "enh_adp_ltm_en": 0, - "ltm_gain": 128, - "ltm_mm_th": 128 + "enh":{ + "ltm":{ + "enh_ltm_en" :1, + "enh_adp_ltm_en" :0, + "ltm_gain" :128, + "ltm_mm_th" :128 }, - "sharp": { - "enh_sharp_en": 1, - "enh_adp_sharp_en": 1, - "shp_core": 8, - "shp_th1": 18, - "shp_th2": 256, - "shp_gain": 64 + "sharp":{ + "enh_sharp_en" :1, + "enh_adp_sharp_en" :0, + "shp_core" :8, + "shp_th1" :3840, + "shp_th2" :4095, + "shp_gain" :64 }, - "cc": { - "enh_cc_en": 1, - "enh_adp_cc_en": 0 + "cc":{ + "enh_cc_en" :0, + "enh_adp_cc_en" :0 } }, - "post_ctl": { - "otc_ctl": { - "otc_en": 0, - "otc_yc_sl": 0, - "otc_uv_sl": 1, - "otc_hs_plt_sl": 0, - "otc_vs_plt_sl": 0, - "otc_stt_vr": 0, - "otc_stt_hr": 0 + "post_ctl":{ + "otc_ctl":{ + "otc_en" :0, + "otc_yc_sl" :0, + "otc_uv_sl" :1, + "otc_hs_plt_sl" :0, + "otc_vs_plt_sl" :0, + "otc_stt_vr" :0, + "otc_stt_hr" :0 }, - "ctrst": { - "ctrst_en": 1, - "ctrst_gain": 128 + "ctrst":{ + "ctrst_en" :1, + "ctrst_gain":128 }, - "luma": { - "luma_en": 1, - "luma_gain": 128 + "luma":{ + "luma_en" :1, + "luma_gain":128 }, - "strt": { - "strt_en": 1, - "strt_gain": 248 + "strt":{ + "strt_en" :1, + "strt_gain":250 } }, - "ldc": { - "ldc_en": 0, - "ldc_rct_en": 0, - "ldc_rq_frq": 128, - "ldc_stt_ln": 540, - "ldc_ch": 960, - "ldc_cv": 540, - "ldc_cr": 684, - "ldc_cz": 684 + "ldc":{ + "ldc_en" :0, + "ldc_rct_en" :0, + "ldc_rq_frq" :128, + "ldc_stt_ln" :540, + "ldc_ch" :480, + "ldc_cv" :1000, + "ldc_cr" :684, + "ldc_cz" :684 }, - "af": { - "af_stat_en": 1, - "af_stat_mode_sel": 0, - "af_stat_win_h_start": 0, - "af_stat_win_v_start": 0, - "af_stat_win_h_end": 1919, - "af_stat_win_v_end": 1079 + "af":{ + "af_stat_en" :1, + "af_stat_mode_sel" :0, + "af_stat_win_h_start":0, + "af_stat_win_v_start":0, + "af_stat_win_h_end" :1079, + "af_stat_win_v_end" :1919 } }, - "isp_post": { - "rgb2yuv": { - "osd_rgb2yuv_coeff00": 306, - "osd_rgb2yuv_coeff01": 601, - "osd_rgb2yuv_coeff02": 117, - "osd_rgb2yuv_coeff03": 0, - "osd_rgb2yuv_coeff10": 3920, - "osd_rgb2yuv_coeff11": 3749, - "osd_rgb2yuv_coeff12": 523, - "osd_rgb2yuv_coeff13": 128, - "osd_rgb2yuv_coeff20": 523, - "osd_rgb2yuv_coeff21": 3658, - "osd_rgb2yuv_coeff22": 4011, - "osd_rgb2yuv_coeff23": 128 - }, - "yuv2rgb": { - "out_yuv2rgb_coeff00": 1024, - "out_yuv2rgb_coeff01": 0, - "out_yuv2rgb_coeff02": 1441, - "out_yuv2rgb_coeff03": 3916, - "out_yuv2rgb_coeff10": 1024, - "out_yuv2rgb_coeff11": 3742, - "out_yuv2rgb_coeff12": 3362, - "out_yuv2rgb_coeff13": 136, - "out_yuv2rgb_coeff20": 1024, - "out_yuv2rgb_coeff21": 1822, - "out_yuv2rgb_coeff22": 0, - "out_yuv2rgb_coeff23": 3868 - }, - "ds0": { - "ds0_out_rgb_mode": 0, - "ds0_out_rgb_en": 0, - "ds0_out_yuv_mode": 0, - "ds0_out_uv_swap": 0, - "ds0_osd0": { - "ds0_osd0_enable": 0, - "ds0_osd0_type": 0, - "ds0_osd0_alpha_tpye": 0, - "ds0_osd0_vst": 0, - "ds0_osd0_hst": 0, - "ds0_osd0_vend": 0, - "ds0_osd0_hend": 0, - "ds0_osd0_dma_request_length": 0, - "ds0_osd0_dma_map": 0, - "ds0_osd0_rgb_rev": 0, - "ds0_osd0_global_alpha": 0, - "ds0_osd0_swap_64": 0, - "ds0_osd0_outstanding_num": 0, - "ds0_osd0_bd_limit_en": 0 - }, - "ds0_osd1": { - "ds0_osd1_enable": 0, - "ds0_osd1_type": 0, - "ds0_osd1_alpha_tpye": 0, - "ds0_osd1_vst": 0, - "ds0_osd1_hst": 0, - "ds0_osd1_vend": 0, - "ds0_osd1_hend": 0, - "ds0_osd1_dma_request_length": 0, - "ds0_osd1_dma_map": 0, - "ds0_osd1_rgb_rev": 0, - "ds0_osd1_global_alpha": 0, - "ds0_osd1_swap_64": 0, - "ds0_osd1_outstanding_num": 0, - "ds0_osd1_bd_limit_en": 0 - }, - "ds0_osd2": { - "ds0_osd2_enable": 0, - "ds0_osd2_type": 0, - "ds0_osd2_alpha_tpye": 0, - "ds0_osd2_vst": 0, - "ds0_osd2_hst": 0, - "ds0_osd2_vend": 0, - "ds0_osd2_hend": 0, - "ds0_osd2_dma_request_length": 0, - "ds0_osd2_dma_map": 0, - "ds0_osd2_rgb_rev": 0, - "ds0_osd2_global_alpha": 0, - "ds0_osd2_swap_64": 0, - "ds0_osd2_outstanding_num": 0, - "ds0_osd2_bd_limit_en": 0 - } + "isp_post":{ + "rgb2yuv":{ + "osd_rgb2yuv_coeff00":306, + "osd_rgb2yuv_coeff01":601, + "osd_rgb2yuv_coeff02":117, + "osd_rgb2yuv_coeff03":0, + "osd_rgb2yuv_coeff10":3920, + "osd_rgb2yuv_coeff11":3749, + "osd_rgb2yuv_coeff12":523, + "osd_rgb2yuv_coeff13":128, + "osd_rgb2yuv_coeff20":523, + "osd_rgb2yuv_coeff21":3658, + "osd_rgb2yuv_coeff22":4011, + "osd_rgb2yuv_coeff23":128 }, - "ds1": { - "ds1_out_rgb_mode": 0, - "ds1_out_rgb_en": 0, - "ds1_out_yuv_mode": 0, - "ds1_out_uv_swap": 0, - "ds1_osd0": { - "ds1_osd0_enable": 0, - "ds1_osd0_type": 0, - "ds1_osd0_alpha_tpye": 0, - "ds1_osd0_vst": 0, - "ds1_osd0_hst": 0, - "ds1_osd0_vend": 0, - "ds1_osd0_hend": 0, - "ds1_osd0_dma_request_length": 0, - "ds1_osd0_dma_map": 0, - "ds1_osd0_rgb_rev": 0, - "ds1_osd0_global_alpha": 0, - "ds1_osd0_swap_64": 0, - "ds1_osd0_outstanding_num": 0, - "ds1_osd0_bd_limit_en": 0 - }, - "ds1_osd1": { - "ds1_osd1_enable": 0, - "ds1_osd1_type": 0, - "ds1_osd1_alpha_tpye": 0, - "ds1_osd1_vst": 0, - "ds1_osd1_hst": 0, - "ds1_osd1_vend": 0, - "ds1_osd1_hend": 0, - "ds1_osd1_dma_request_length": 0, - "ds1_osd1_dma_map": 0, - "ds1_osd1_rgb_rev": 0, - "ds1_osd1_global_alpha": 0, - "ds1_osd1_swap_64": 0, - "ds1_osd1_outstanding_num": 0, - "ds1_osd1_bd_limit_en": 0 - }, - "ds1_osd2": { - "ds1_osd2_enable": 0, - "ds1_osd2_type": 0, - "ds1_osd2_alpha_tpye": 0, - "ds1_osd2_vst": 0, - "ds1_osd2_hst": 0, - "ds1_osd2_vend": 0, - "ds1_osd2_hend": 0, - "ds1_osd2_dma_request_length": 0, - "ds1_osd2_dma_map": 0, - "ds1_osd2_rgb_rev": 0, - "ds1_osd2_global_alpha": 0, - "ds1_osd2_swap_64": 0, - "ds1_osd2_outstanding_num": 0, - "ds1_osd2_bd_limit_en": 0 - } + "yuv2rgb":{ + "out_yuv2rgb_coeff00":1024, + "out_yuv2rgb_coeff01":0, + "out_yuv2rgb_coeff02":1441, + "out_yuv2rgb_coeff03":3916, + "out_yuv2rgb_coeff10":1024, + "out_yuv2rgb_coeff11":3742, + "out_yuv2rgb_coeff12":3362, + "out_yuv2rgb_coeff13":136, + "out_yuv2rgb_coeff20":1024, + "out_yuv2rgb_coeff21":1822, + "out_yuv2rgb_coeff22":0, + "out_yuv2rgb_coeff23":3868 }, - "ds2": { - "ds2_out_rgb_mode": 0, - "ds2_out_rgb_en": 1, - "ds2_out_yuv_mode": 0, - "ds2_out_uv_swap": 0, - "ds2_osd0": { - "ds2_osd0_enable": 0, - "ds2_osd0_type": 0, - "ds2_osd0_alpha_tpye": 0, - "ds2_osd0_vst": 0, - "ds2_osd0_hst": 0, - "ds2_osd0_vend": 0, - "ds2_osd0_hend": 0, - "ds2_osd0_dma_request_length": 0, - "ds2_osd0_dma_map": 0, - "ds2_osd0_rgb_rev": 0, - "ds2_osd0_global_alpha": 0, - "ds2_osd0_swap_64": 0, - "ds2_osd0_outstanding_num": 0, - "ds2_osd0_bd_limit_en": 0 - }, - "ds2_osd1": { - "ds2_osd1_enable": 0, - "ds2_osd1_type": 0, - "ds2_osd1_alpha_tpye": 0, - "ds2_osd1_vst": 0, - "ds2_osd1_hst": 0, - "ds2_osd1_vend": 0, - "ds2_osd1_hend": 0, - "ds2_osd1_dma_request_length": 0, - "ds2_osd1_dma_map": 0, - "ds2_osd1_rgb_rev": 0, - "ds2_osd1_global_alpha": 0, - "ds2_osd1_swap_64": 0, - "ds2_osd1_outstanding_num": 0, - "ds2_osd1_bd_limit_en": 0 - } - } + "ds0":{ + "ds0_out_rgb_mode":0, + "ds0_out_rgb_en":0, + "ds0_out_yuv_mode":0, + "ds0_out_uv_swap":0, + "ds0_osd0":{ + "ds0_osd0_enable":0, + "ds0_osd0_type":0, + "ds0_osd0_alpha_tpye":0, + "ds0_osd0_vst":0, + "ds0_osd0_hst":0, + "ds0_osd0_vend":0, + "ds0_osd0_hend":0, + "ds0_osd0_dma_request_length":0, + "ds0_osd0_dma_map":0, + "ds0_osd0_rgb_rev":0, + "ds0_osd0_global_alpha":0, + "ds0_osd0_swap_64":0, + "ds0_osd0_outstanding_num":0, + "ds0_osd0_bd_limit_en":0 + }, + "ds0_osd1":{ + "ds0_osd1_enable":0, + "ds0_osd1_type":0, + "ds0_osd1_alpha_tpye":0, + "ds0_osd1_vst":0, + "ds0_osd1_hst":0, + "ds0_osd1_vend":0, + "ds0_osd1_hend":0, + "ds0_osd1_dma_request_length":0, + "ds0_osd1_dma_map":0, + "ds0_osd1_rgb_rev":0, + "ds0_osd1_global_alpha":0, + "ds0_osd1_swap_64":0, + "ds0_osd1_outstanding_num":0, + "ds0_osd1_bd_limit_en":0 + }, + "ds0_osd2":{ + "ds0_osd2_enable":0, + "ds0_osd2_type":0, + "ds0_osd2_alpha_tpye":0, + "ds0_osd2_vst":0, + "ds0_osd2_hst":0, + "ds0_osd2_vend":0, + "ds0_osd2_hend":0, + "ds0_osd2_dma_request_length":0, + "ds0_osd2_dma_map":0, + "ds0_osd2_rgb_rev":0, + "ds0_osd2_global_alpha":0, + "ds0_osd2_swap_64":0, + "ds0_osd2_outstanding_num":0, + "ds0_osd2_bd_limit_en":0 + } + }, + "ds1":{ + "ds1_out_rgb_mode":0, + "ds1_out_rgb_en":0, + "ds1_out_yuv_mode":0, + "ds1_out_uv_swap":0, + "ds1_osd0":{ + "ds1_osd0_enable":0, + "ds1_osd0_type":0, + "ds1_osd0_alpha_tpye":0, + "ds1_osd0_vst":0, + "ds1_osd0_hst":0, + "ds1_osd0_vend":0, + "ds1_osd0_hend":0, + "ds1_osd0_dma_request_length":0, + "ds1_osd0_dma_map":0, + "ds1_osd0_rgb_rev":0, + "ds1_osd0_global_alpha":0, + "ds1_osd0_swap_64":0, + "ds1_osd0_outstanding_num":0, + "ds1_osd0_bd_limit_en":0 + }, + "ds1_osd1":{ + "ds1_osd1_enable":0, + "ds1_osd1_type":0, + "ds1_osd1_alpha_tpye":0, + "ds1_osd1_vst":0, + "ds1_osd1_hst":0, + "ds1_osd1_vend":0, + "ds1_osd1_hend":0, + "ds1_osd1_dma_request_length":0, + "ds1_osd1_dma_map":0, + "ds1_osd1_rgb_rev":0, + "ds1_osd1_global_alpha":0, + "ds1_osd1_swap_64":0, + "ds1_osd1_outstanding_num":0, + "ds1_osd1_bd_limit_en":0 + }, + "ds1_osd2":{ + "ds1_osd2_enable":0, + "ds1_osd2_type":0, + "ds1_osd2_alpha_tpye":0, + "ds1_osd2_vst":0, + "ds1_osd2_hst":0, + "ds1_osd2_vend":0, + "ds1_osd2_hend":0, + "ds1_osd2_dma_request_length":0, + "ds1_osd2_dma_map":0, + "ds1_osd2_rgb_rev":0, + "ds1_osd2_global_alpha":0, + "ds1_osd2_swap_64":0, + "ds1_osd2_outstanding_num":0, + "ds1_osd2_bd_limit_en":0 + } + }, + "ds2":{ + "ds2_out_rgb_mode":0, + "ds2_out_rgb_en":1, + "ds2_out_yuv_mode":0, + "ds2_out_uv_swap":0, + "ds2_osd0":{ + "ds2_osd0_enable":0, + "ds2_osd0_type":0, + "ds2_osd0_alpha_tpye":0, + "ds2_osd0_vst":0, + "ds2_osd0_hst":0, + "ds2_osd0_vend":0, + "ds2_osd0_hend":0, + "ds2_osd0_dma_request_length":0, + "ds2_osd0_dma_map":0, + "ds2_osd0_rgb_rev":0, + "ds2_osd0_global_alpha":0, + "ds2_osd0_swap_64":0, + "ds2_osd0_outstanding_num":0, + "ds2_osd0_bd_limit_en":0 + }, + "ds2_osd1":{ + "ds2_osd1_enable":0, + "ds2_osd1_type":0, + "ds2_osd1_alpha_tpye":0, + "ds2_osd1_vst":0, + "ds2_osd1_hst":0, + "ds2_osd1_vend":0, + "ds2_osd1_hend":0, + "ds2_osd1_dma_request_length":0, + "ds2_osd1_dma_map":0, + "ds2_osd1_rgb_rev":0, + "ds2_osd1_global_alpha":0, + "ds2_osd1_swap_64":0, + "ds2_osd1_outstanding_num":0, + "ds2_osd1_bd_limit_en":0 + } + } } -} \ No newline at end of file +} diff --git a/package/ai/code/imx385_2frame.conf b/package/ai/code/imx385_2frame.conf new file mode 100644 index 0000000..4e6a8a4 --- /dev/null +++ b/package/ai/code/imx385_2frame.conf @@ -0,0 +1,531 @@ +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 1, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 1, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 2200, + "itc_ttl_v": 2250, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 224, + "blc_ratio": 271 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 4, + "lsc_g_ratio": 4, + "lsc_b_ratio": 4, + "lsc_ir_ratio": 4 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 1, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 0, + "ae_win_sttv": 0, + "ae_win_endh": 1919, + "ae_win_endv": 1079, + "ae_yobj": 100, + "ae_av_rg": 14, + "ae_l_ex_time": 675, + "ae_m_ex_time": 34, + "ae_s_ex_time": 32, + "ae_agc": 256, + "ae_ad_shuttle_freq": 1, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 2209, + "ae_ex_value_mid": 34, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 508, + "awb_d65_blue_gain": 423, + "ccm_rr": 256, + "ccm_rg": 0, + "ccm_rb": 0, + "ccm_gr": 83, + "ccm_gg": 361, + "ccm_gb": 22, + "ccm_br": 0, + "ccm_bg": 44, + "ccm_bb": 300, + "ccm_correct_coff": 256, + "awb_win_stth": 0, + "awb_win_sttv": 0, + "awb_win_endh": 1919, + "awb_win_endv": 1079, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 252, + "awb_blue_max_value": 423, + "awb_red_min_value": 174, + "awb_blue_min_value": 265, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 1, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 1, + "wdr_stab_en": 1, + "wdr_en": 1, + "wdr_ghost_remove_en": 1, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 0, + "wdr_3frame_ex_ratio": 0, + "wdr_stat_img_sel": 2, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 1, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 128, + "nr2d_eg_k": 32, + "nr2d_y_k": 32, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 255, + "nr3dp_thyp": 255, + "nr3dp_thcp": 32, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 8, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 4, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 160 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 0, + "otc_yc_sl": 0, + "otc_uv_sl": 1, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 210 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 880, + "ldc_cv": 480, + "ldc_cr": 2000, + "ldc_cz": 2000 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 0, + "af_stat_win_v_start": 0, + "af_stat_win_h_end": 1919, + "af_stat_win_v_end": 1079 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/ai/code/imx385_3frame.conf b/package/ai/code/imx385_3frame.conf new file mode 100644 index 0000000..0326f56 --- /dev/null +++ b/package/ai/code/imx385_3frame.conf @@ -0,0 +1,531 @@ +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 2, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 1, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 2200, + "itc_ttl_v": 4500, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 224, + "blc_ratio": 271 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 4, + "lsc_g_ratio": 4, + "lsc_b_ratio": 4, + "lsc_ir_ratio": 4 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 1, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 0, + "ae_win_sttv": 0, + "ae_win_endh": 1919, + "ae_win_endv": 1079, + "ae_yobj": 100, + "ae_av_rg": 14, + "ae_l_ex_time": 1350, + "ae_m_ex_time": 32, + "ae_s_ex_time": 4, + "ae_agc": 256, + "ae_ad_shuttle_freq": 1, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 4436, + "ae_ex_value_mid": 32, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 508, + "awb_d65_blue_gain": 423, + "ccm_rr": 256, + "ccm_rg": 0, + "ccm_rb": 0, + "ccm_gr": 83, + "ccm_gg": 361, + "ccm_gb": 22, + "ccm_br": 0, + "ccm_bg": 44, + "ccm_bb": 300, + "ccm_correct_coff": 256, + "awb_win_stth": 0, + "awb_win_sttv": 0, + "awb_win_endh": 1919, + "awb_win_endv": 1079, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 252, + "awb_blue_max_value": 423, + "awb_red_min_value": 174, + "awb_blue_min_value": 265, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 1, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 1, + "wdr_stab_en": 1, + "wdr_en": 1, + "wdr_ghost_remove_en": 1, + "wdr_3frame_out_mode": 1, + "wdr_mode_sel": 1, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 2, + "wdr_stat_img_sel": 2, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 1, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 128, + "nr2d_eg_k": 32, + "nr2d_y_k": 32, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 255, + "nr3dp_thyp": 255, + "nr3dp_thcp": 32, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 8, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 4, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 160 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 0, + "otc_yc_sl": 0, + "otc_uv_sl": 1, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 210 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 880, + "ldc_cv": 480, + "ldc_cr": 2000, + "ldc_cz": 2000 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 0, + "af_stat_win_v_start": 0, + "af_stat_win_h_end": 1919, + "af_stat_win_v_end": 1079 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/ai/code/imx385_normal.conf b/package/ai/code/imx385_normal.conf new file mode 100644 index 0000000..08e9215 --- /dev/null +++ b/package/ai/code/imx385_normal.conf @@ -0,0 +1,531 @@ +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 0, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 1, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 2200, + "itc_ttl_v": 1125, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 224, + "blc_ratio": 271 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 4, + "lsc_g_ratio": 4, + "lsc_b_ratio": 4, + "lsc_ir_ratio": 4 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 1, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 0, + "ae_win_sttv": 0, + "ae_win_endh": 1919, + "ae_win_endv": 1079, + "ae_yobj": 100, + "ae_av_rg": 14, + "ae_l_ex_time": 338, + "ae_m_ex_time": 34, + "ae_s_ex_time": 4, + "ae_agc": 256, + "ae_ad_shuttle_freq": 1, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 1122, + "ae_ex_value_mid": 34, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 508, + "awb_d65_blue_gain": 423, + "ccm_rr": 256, + "ccm_rg": 0, + "ccm_rb": 0, + "ccm_gr": 83, + "ccm_gg": 361, + "ccm_gb": 22, + "ccm_br": 0, + "ccm_bg": 44, + "ccm_bb": 300, + "ccm_correct_coff": 256, + "awb_win_stth": 0, + "awb_win_sttv": 0, + "awb_win_endh": 1919, + "awb_win_endv": 1079, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 252, + "awb_blue_max_value": 423, + "awb_red_min_value": 174, + "awb_blue_min_value": 265, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 0, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 0, + "wdr_stab_en": 0, + "wdr_en": 0, + "wdr_ghost_remove_en": 0, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 1, + "wdr_stat_img_sel": 1, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 0, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 128, + "nr2d_eg_k": 32, + "nr2d_y_k": 32, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 255, + "nr3dp_thyp": 255, + "nr3dp_thcp": 32, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 8, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 4, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 160 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 0, + "otc_yc_sl": 0, + "otc_uv_sl": 1, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 210 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 880, + "ldc_cv": 480, + "ldc_cr": 2000, + "ldc_cz": 2000 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 0, + "af_stat_win_v_start": 0, + "af_stat_win_h_end": 1919, + "af_stat_win_v_end": 1079 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/ai/code/license_plate_recog/main.cc b/package/ai/code/license_plate_recog/main.cc index 0e8479a..ae6b9b0 100755 --- a/package/ai/code/license_plate_recog/main.cc +++ b/package/ai/code/license_plate_recog/main.cc @@ -657,7 +657,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/ai/code/object_detect/main.cc b/package/ai/code/object_detect/main.cc index 6385dfa..9a69829 100755 --- a/package/ai/code/object_detect/main.cc +++ b/package/ai/code/object_detect/main.cc @@ -127,7 +127,7 @@ void ai_worker(ai_worker_args ai_args) // define cv::Mat for ai input // padding offset is (net_len - valid_width) / 2 - cv::Mat rgb24_img_for_ai(net_len, net_len, CV_8UC3, od.virtual_addr_input[0] + (net_len - valid_width) / 2); + cv::Mat rgb24_img_for_ai(net_len, net_len, CV_8UC3, od.virtual_addr_input[0] + (net_len - valid_width) / 2 + (net_len - valid_height) / 2 * net_len); while(quit.load()) { bool ret = false; @@ -148,8 +148,9 @@ void ai_worker(ai_worker_args ai_args) if (gnne_valid_width < gnne_input_width) { uint32_t padding_r = (gnne_input_width - gnne_valid_width); uint32_t padding_l = padding_r / 2; + uint32_t row_offset = (gnne_input_height - gnne_valid_height) / 2; padding_r -= padding_l; - for (int row = 0; row < gnne_valid_height; row++) { + for (int row = row_offset; row < row_offset + gnne_valid_height; row++) { uint32_t offset_l = row * gnne_input_width; uint32_t offset_r = offset_l + gnne_valid_width + padding_l; memset(r_addr + offset_l, PADDING_R, padding_l); @@ -161,11 +162,18 @@ void ai_worker(ai_worker_args ai_args) } } if (gnne_valid_height < gnne_input_height) { - uint32_t padding = (gnne_input_height - gnne_valid_height) * gnne_input_width; - uint32_t offset = gnne_valid_height * gnne_input_width; - memset(r_addr + offset, PADDING_R, padding); - memset(g_addr + offset, PADDING_G, padding); - memset(b_addr + offset, PADDING_B, padding); + uint32_t padding_t = gnne_input_height - gnne_valid_height; + uint32_t padding_b = padding_t / 2; + padding_t -= padding_b; + padding_t *= gnne_input_width; + padding_b *= gnne_input_width; + uint32_t offset = padding_t + gnne_valid_height * gnne_input_width; + memset(r_addr, PADDING_R, padding_t); + memset(g_addr, PADDING_G, padding_t); + memset(b_addr, PADDING_B, padding_t); + memset(r_addr + offset, PADDING_R, padding_b); + memset(g_addr + offset, PADDING_G, padding_b); + memset(b_addr + offset, PADDING_B, padding_b); } if(enable_dump_image) { @@ -635,7 +643,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/ai/code/object_detect_demo/main.cc b/package/ai/code/object_detect_demo/main.cc index 96f9995..76ff6ff 100644 --- a/package/ai/code/object_detect_demo/main.cc +++ b/package/ai/code/object_detect_demo/main.cc @@ -122,8 +122,7 @@ void ai_worker() float obj_thresh = 0.2; float nms_thresh = 0.45; int offset_channel = gnne_input_width * gnne_input_height; - uint32_t padding_r, padding_l; - objectDetect od(obj_thresh, nms_thresh); + objectDetect od(obj_thresh, nms_thresh, YOLOV5_FIX_SIZE, {gnne_valid_width, gnne_valid_height}); od.load_model(kmodel_name); @@ -137,15 +136,14 @@ void ai_worker() capture.set(cv::CAP_PROP_FRAME_HEIGHT, gnne_input_height); capture.set(cv::CAP_PROP_FOURCC, dev_info[0].video_out_format[3] ? V4L2_PIX_FMT_ARGB32 : V4L2_PIX_FMT_RGB24); mtx.unlock(); - padding_r = (gnne_input_width - gnne_valid_width); - padding_l = padding_r / 2; - padding_r -= padding_l; - cv::Mat rgb24_img_for_ai(YOLOV5_FIX_SIZE, YOLOV5_FIX_SIZE, CV_8UC3, od.virtual_addr_input[0] + padding_l); + cv::Mat rgb24_img_for_ai(YOLOV5_FIX_SIZE, YOLOV5_FIX_SIZE, CV_8UC3, od.virtual_addr_input[0] + (gnne_input_height - gnne_valid_height) / 2 * gnne_input_width + (gnne_input_width - gnne_valid_width) / 2); while(quit.load()) { bool ret = false; +#if PROFILING ScopedTiming st("total"); +#endif mtx.lock(); ret = capture.read(rgb24_img_for_ai); mtx.unlock(); @@ -163,7 +161,11 @@ void ai_worker() g_addr = (uint8_t *)od.virtual_addr_input[0] + offset_channel; b_addr = (uint8_t *)od.virtual_addr_input[0] + offset_channel * 2; if (gnne_valid_width < gnne_input_width) { - for (int row = 0; row < gnne_valid_height; row++) { + uint32_t padding_r = gnne_input_width - gnne_valid_width; + uint32_t padding_l = padding_r / 2; + uint32_t row_offset = (gnne_input_height - gnne_valid_height) / 2; + padding_r -= padding_l; + for (int row = row_offset; row < row_offset + gnne_valid_height; row++) { uint32_t offset_l = row * gnne_input_width; uint32_t offset_r = offset_l + gnne_valid_width + padding_l; memset(r_addr + offset_l, 114, padding_l); @@ -175,11 +177,18 @@ void ai_worker() } } if (gnne_valid_height < gnne_input_height) { - uint32_t padding = (gnne_input_height - gnne_valid_height) * gnne_input_width; - uint32_t offset = gnne_valid_height * gnne_input_width; - memset(r_addr + offset, 114, padding); - memset(g_addr + offset, 114, padding); - memset(b_addr + offset, 114, padding); + uint32_t padding_t = gnne_input_height - gnne_valid_height; + uint32_t padding_b = padding_t / 2; + padding_t -= padding_b; + padding_t *= gnne_input_width; + padding_b *= gnne_input_width; + uint32_t offset = padding_t + gnne_valid_height * gnne_input_width; + memset(r_addr, 114, padding_t); + memset(g_addr, 114, padding_t); + memset(b_addr, 114, padding_t); + memset(r_addr + offset, 114, padding_b); + memset(g_addr + offset, 114, padding_b); + memset(b_addr + offset, 114, padding_b); } if(display_ds2) { @@ -278,7 +287,9 @@ void ai_worker() origin.y = (int)(r.y1* screen_height / gnne_valid_height - 10); std::string text = od.labels[r.label] + ":" + std::to_string(round(r.score * 100) / 100.0); cv::putText(img_argb, text, origin, cv::FONT_HERSHEY_COMPLEX, 1.5, cv::Scalar(0, 0, 255, 255), 1, 8, 0); + std::cout << obj_cnt << ":" << text<< ":" << frame.line_x_start <<":"<< frame.line_y_start <<":"<< frame.line_x_end <<":"<< frame.line_y_end << std::endl; } + obj_cnt += 1; } } @@ -609,7 +620,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); for(int i = 0; i < DRM_BUFFERS_COUNT; i++) { drm_destory_dumb(&drm_dev.drm_bufs[i]); } diff --git a/package/ai/code/object_detect_demo/object_detect.cc b/package/ai/code/object_detect_demo/object_detect.cc index 418d90d..5282273 100644 --- a/package/ai/code/object_detect_demo/object_detect.cc +++ b/package/ai/code/object_detect_demo/object_detect.cc @@ -167,8 +167,8 @@ void objectDetect::post_process(std::vector &result) nms(result, nms_thresh); } -objectDetect::objectDetect(float obj_thresh, float nms_thresh) -:obj_thresh(obj_thresh), nms_thresh(nms_thresh) +objectDetect::objectDetect(float obj_thresh, float nms_thresh, int net_len, Framesize frame_size) +:obj_thresh(obj_thresh), nms_thresh(nms_thresh), net_len(net_len), frame_size(frame_size) { int first_len = net_len / 8; first_size = first_len * first_len; diff --git a/package/ai/code/object_detect_demo/object_detect.h b/package/ai/code/object_detect_demo/object_detect.h index eb65eaa..012911a 100644 --- a/package/ai/code/object_detect_demo/object_detect.h +++ b/package/ai/code/object_detect_demo/object_detect.h @@ -65,7 +65,7 @@ using namespace std; #define GNNE_INPUT_WIDTH 320 #define GNNE_INPUT_HEIGHT 240 #endif -#define INPUT_SIZE (YOLOV5_FIX_SIZE * YOLOV5_FIX_SIZE * 3) +#define INPUT_SIZE (YOLOV5_FIX_SIZE * YOLOV5_FIX_SIZE * 4) #define OUTPUT_SIZE0 (255*40*40*4) #define OUTPUT_SIZE1 (255*20*20*4) @@ -86,7 +86,7 @@ struct share_memory_alloc_align_args { class objectDetect { public: - objectDetect(float obj_thresh, float nms_thresh); + objectDetect(float obj_thresh, float nms_thresh, int net_len, Framesize frame_size); void prepare_memory(); void set_input(uint32_t index); void set_output(); @@ -123,7 +123,7 @@ class objectDetect private: float obj_thresh; float nms_thresh; - Framesize frame_size = {GNNE_INPUT_WIDTH, GNNE_INPUT_HEIGHT}; + Framesize frame_size; uint32_t output_size[3] = { OUTPUT_SIZE0, OUTPUT_SIZE1, @@ -133,7 +133,7 @@ class objectDetect interpreter interp_od; vector od_model; - int net_len = YOLOV5_FIX_SIZE; + int net_len; int anchors_num = 3; int classes_num = 80; int channels = anchors_num * (5 + classes_num); diff --git a/package/ai/code/openpose/main.cc b/package/ai/code/openpose/main.cc index 6d1e0a1..2adfa05 100755 --- a/package/ai/code/openpose/main.cc +++ b/package/ai/code/openpose/main.cc @@ -653,7 +653,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/ai/code/person_detect/main.cc b/package/ai/code/person_detect/main.cc index 519e9cf..9f9779d 100755 --- a/package/ai/code/person_detect/main.cc +++ b/package/ai/code/person_detect/main.cc @@ -582,7 +582,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/ai/code/retinaface_mb_320/main.cc b/package/ai/code/retinaface_mb_320/main.cc index ac23d19..96a5da1 100644 --- a/package/ai/code/retinaface_mb_320/main.cc +++ b/package/ai/code/retinaface_mb_320/main.cc @@ -142,7 +142,9 @@ void ai_worker() while(quit.load()) { bool ret = false; +#if PROFILING ScopedTiming st("total"); +#endif mtx.lock(); ret = capture.read(rgb24_img_for_ai); mtx.unlock(); @@ -252,6 +254,7 @@ void ai_worker() frame.line_x_end = frame.line_x_end > screen_width ? screen_width : frame.line_x_end; frame.line_y_end = frame.line_y_end > screen_height ? screen_height : frame.line_y_end; draw_frame(&frame); + std::cout << obj_cnt << ":" << frame.line_x_start <<":"<< frame.line_y_start <<":"<< frame.line_x_end <<":"<< frame.line_y_end << std::endl; } obj_cnt += 1; } @@ -263,7 +266,7 @@ void ai_worker() draw_frame(&frame); } } - printf("obj_cnt = %d \n", obj_cnt); + { #if PROFILING ScopedTiming st("draw point"); @@ -280,8 +283,10 @@ void ai_worker() cv::circle(img_argb, cv::Point(x0, y0), 4, cv::Scalar(0, 0, 255, 255), -1); point[index][obj_point[index]][ll] = cv::Point(x0, y0); + std::cout << ":" << x0 <<","<< y0; } } + std::cout << std::endl; obj_point[index] += 1; } } @@ -616,6 +621,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); for(int i = 0; i < DRM_BUFFERS_COUNT; i++) { drm_destory_dumb(&drm_dev.drm_bufs[i]); } diff --git a/package/ai/code/self_learning/main.cc b/package/ai/code/self_learning/main.cc index 2656354..81773ee 100755 --- a/package/ai/code/self_learning/main.cc +++ b/package/ai/code/self_learning/main.cc @@ -744,6 +744,9 @@ int main(int argc, char *argv[]) thread_ds2.join(); // thread_key.join(); thread_key.detach(); + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/ai/code/simple_pose/main.cc b/package/ai/code/simple_pose/main.cc index f1c9c10..88693de 100755 --- a/package/ai/code/simple_pose/main.cc +++ b/package/ai/code/simple_pose/main.cc @@ -131,11 +131,11 @@ void ai_worker(ai_worker_args ai_args) // define cv::Mat for ai input // padding offset is (valid_width - valid_height) / 2 * valid_width - cv::Mat rgb24_img_for_ai(body_net_len, body_net_len, CV_8UC3, od.virtual_addr_input[0] + (body_net_len - valid_width) / 2); + cv::Mat rgb24_img_for_ai(body_net_len, body_net_len, CV_8UC3, od.virtual_addr_input[0] + (body_net_len - valid_width) / 2 + (body_net_len - valid_height) / 2 * body_net_len); // define cv::Mat for post process - cv::Mat ori_img_R = cv::Mat(body_net_len, body_net_len, CV_8UC1, od.virtual_addr_input[0] + (body_net_len - valid_width) / 2); - cv::Mat ori_img_G = cv::Mat(body_net_len, body_net_len, CV_8UC1, od.virtual_addr_input[0] + offset_channel + (body_net_len - valid_width) / 2); - cv::Mat ori_img_B = cv::Mat(body_net_len, body_net_len, CV_8UC1, od.virtual_addr_input[0] + offset_channel * 2 + (body_net_len - valid_width) / 2); + cv::Mat ori_img_R = cv::Mat(body_net_len, body_net_len, CV_8UC1, rgb24_img_for_ai.data); + cv::Mat ori_img_G = cv::Mat(body_net_len, body_net_len, CV_8UC1, rgb24_img_for_ai.data + offset_channel); + cv::Mat ori_img_B = cv::Mat(body_net_len, body_net_len, CV_8UC1, rgb24_img_for_ai.data + offset_channel * 2); cv::Mat spo_img_R = cv::Mat(pose_height, pose_width, CV_8UC1, spo.virtual_addr_input[0]); cv::Mat spo_img_G = cv::Mat(pose_height, pose_width, CV_8UC1, spo.virtual_addr_input[0] + pose_height * pose_width); @@ -165,8 +165,9 @@ void ai_worker(ai_worker_args ai_args) if (gnne_valid_width < gnne_input_width) { uint32_t padding_r = (gnne_input_width - gnne_valid_width); uint32_t padding_l = padding_r / 2; + uint32_t row_offset = (gnne_input_height - gnne_valid_height) / 2; padding_r -= padding_l; - for (int row = 0; row < gnne_valid_height; row++) { + for (int row = row_offset; row < row_offset + gnne_valid_height; row++) { uint32_t offset_l = row * gnne_input_width; uint32_t offset_r = offset_l + gnne_valid_width + padding_l; memset(r_addr + offset_l, PADDING_R, padding_l); @@ -178,11 +179,18 @@ void ai_worker(ai_worker_args ai_args) } } if (gnne_valid_height < gnne_input_height) { - uint32_t padding = (gnne_input_height - gnne_valid_height) * gnne_input_width; - uint32_t offset = gnne_valid_height * gnne_input_width; - memset(r_addr + offset, PADDING_R, padding); - memset(g_addr + offset, PADDING_G, padding); - memset(b_addr + offset, PADDING_B, padding); + uint32_t padding_t = gnne_input_height - gnne_valid_height; + uint32_t padding_b = padding_t / 2; + padding_t -= padding_b; + padding_t *= gnne_input_width; + padding_b *= gnne_input_width; + uint32_t offset = padding_t + gnne_valid_height * gnne_input_width; + memset(r_addr, PADDING_R, padding_t); + memset(g_addr, PADDING_G, padding_t); + memset(b_addr, PADDING_B, padding_t); + memset(r_addr + offset, PADDING_R, padding_b); + memset(g_addr + offset, PADDING_G, padding_b); + memset(b_addr + offset, PADDING_B, padding_b); } if(enable_dump_image) { @@ -278,6 +286,10 @@ void ai_worker(ai_worker_args ai_args) spo.set_valid_box(cropped_box, ori_img_R); } cropped_R = spo.crop_image(ori_img_R); + if (cropped_R.empty()) { + printf("img is empty!\n"); + continue; + } cv::resize(cropped_R, spo_img_R, cv::Size(pose_width, pose_height), cv::INTER_AREA); cropped_G = spo.crop_image(ori_img_G); cv::resize(cropped_G, spo_img_G, cv::Size(pose_width, pose_height), cv::INTER_AREA); @@ -687,7 +699,9 @@ int main(int argc, char *argv[]) thread_ds0.join(); thread_ds2.join(); - + memset(drm_dev.drm_bufs_argb[0].map, 0xff, screen_width * screen_height * 4); + usleep(100000); + drm_dmabuf_set_plane(&drm_dev.drm_bufs[0], &drm_dev.drm_bufs_argb[0]); /****fixed operation for drm deinit****/ for(uint32_t i = 0; i < DRM_BUFFERS_COUNT; i++) { diff --git a/package/alsa_demo/Config.in b/package/alsa_demo/Config.in deleted file mode 100644 index 31fa54b..0000000 --- a/package/alsa_demo/Config.in +++ /dev/null @@ -1,6 +0,0 @@ - -config BR2_PACKAGE_ALSA_DEMO - bool "alsa_demo" - depends on BR2_riscv - help - k510 ALSA for demo diff --git a/package/alsa_demo/alsa_demo.mk b/package/alsa_demo/alsa_demo.mk deleted file mode 100644 index ffd7e9d..0000000 --- a/package/alsa_demo/alsa_demo.mk +++ /dev/null @@ -1,21 +0,0 @@ -################################################################################ -# -# alsa_demo -# -################################################################################ - -ALSA_DEMO_SITE = $(BR2_EXTERNAL_K510_PATH)/package/alsa_demo/src -ALSA_DEMO_SITE_METHOD = local -ALSA_DEMO_INSTALL_STAGING = YES - -ALSA_DEMO_DEPENDENCIES += alsa-lib - -define ALSA_DEMO_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) -endef - -define ALSA_DEMO_INSTALL_TARGET_CMDS - $(INSTALL) -D -m 0755 $(@D)/alsa_demo $(TARGET_DIR)/app/alsa_demo/alsa_demo -endef - -$(eval $(generic-package)) diff --git a/package/alsa_demo/src/Makefile b/package/alsa_demo/src/Makefile deleted file mode 100644 index f16fc6a..0000000 --- a/package/alsa_demo/src/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -CROSS_COMPILE := riscv64-linux- - -CC := $(CROSS_COMPILE)gcc -C++ := $(CROSS_COMPILE)g++ -OBJDUMP := $(CROSS_COMPILE)objdump -OBJCOPY := $(CROSS_COMPILE)objcopy -AR := $(CROSS_COMPILE)ar -AS := $(CROSS_COMPILE)as -LD := $(CROSS_COMPILE)gcc - -CFLAGS = \ - -fomit-frame-pointer -fno-strict-aliasing -fno-builtin \ - -ffunction-sections -fdata-sections \ - -DCFG_MAKEFILE -DTARGET_BOARD_TYPE_def=\"$(BR2_TARGET_BOARD_TYPE)\" - -OBJ ?= alsa_demo - -$(OBJ): alsa_demo.c - $(C++) $(CFLAGS) $^ -L ./ -Wl,-Bdynamic -lasound -g -o $@ - -clean: - rm -f *.o - rm -f *.d - rm -f $(OBJ) - diff --git a/package/alsa_demo/src/alsa_demo.c b/package/alsa_demo/src/alsa_demo.c deleted file mode 100644 index bfacfd5..0000000 --- a/package/alsa_demo/src/alsa_demo.c +++ /dev/null @@ -1,255 +0,0 @@ -/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/*! - ***************************************************************************** - * \file alsa_demo.c - * \author Jiangxb - * \version 1.0 - * \date 2021/11/03 - * \brief 基于alsalib的测试程序,实现录音播放功能, - * 捕获的音频数据为原始的数据,即没有任何头信息的。可以Autacity软件打开分析 - * 文件->导入->原始数据 - * - * change history: - * | | | - *---------------------------------------------------------------------------- - * 2021/11/03 | 1.0 | Jiangxb | creat file - *---------------------------------------------------------------------------- - * - ***************************************************************************** - */ - -#include -#include -#include -#include - -#define TEST_FORMAT SND_PCM_FORMAT_S16_LE //pcm.h:SND_PCM_FORMAT_U32_LE -#define TEST_CHANNEL_SET 2 //K510只有I2S接口,支持2声道,如果需要单声道,可以从用户层对双声道做分离,或复制单声道为双声道。 -#define TEST_RATE_SET 44100 //音频采样率,常用的采样频率: 44100Hz 、16000HZ、8000HZ、48000HZ、22050HZ -#define TEST_DEV "hw:0" //K510默认只有一个声卡设备,为0设备 -#define TEST_FILE "capture.pcm" - -FILE *pcm_data_file=NULL; -int run_flag=0; - -void exit_sighandler(int sig) -{ - run_flag=1; -} - -snd_pcm_t *open_sound_dev(snd_pcm_stream_t type) -{ - int err; - snd_pcm_t *handle; - snd_pcm_hw_params_t *hw_params; - unsigned int rate = TEST_RATE_SET; - - if ((err = snd_pcm_open (&handle, TEST_DEV, type, 0)) < 0) { - return NULL; - } - - if ((err = snd_pcm_hw_params_malloc (&hw_params)) < 0) { - fprintf (stderr, "cannot allocate hardware parameter structure (%s)\n", - snd_strerror (err)); - return NULL; - } - - if ((err = snd_pcm_hw_params_any (handle, hw_params)) < 0) { - fprintf (stderr, "cannot initialize hardware parameter structure (%s)\n", - snd_strerror (err)); - return NULL; - } - - if ((err = snd_pcm_hw_params_set_access (handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) { - fprintf (stderr, "cannot set access type (%s)\n", - snd_strerror (err)); - return NULL; - } - - if ((err = snd_pcm_hw_params_set_format (handle, hw_params, TEST_FORMAT)) < 0) { - fprintf (stderr, "cannot set sample format (%s)\n", - snd_strerror (err)); - return NULL; - } - - if ((err = snd_pcm_hw_params_set_rate_near (handle, hw_params, &rate, 0)) < 0) { - fprintf (stderr, "cannot set sample rate (%s)\n", - snd_strerror (err)); - return NULL; - } - - if ((err = snd_pcm_hw_params_set_channels (handle, hw_params, TEST_CHANNEL_SET)) < 0) { - fprintf (stderr, "cannot set channel count (%s)\n", - snd_strerror (err)); - return NULL; - } - - if ((err = snd_pcm_hw_params (handle, hw_params)) < 0) { - fprintf (stderr, "cannot set parameters (%s)\n", - snd_strerror (err)); - return NULL; - } - - snd_pcm_hw_params_free (hw_params); - - return handle; -} - -void close_sound_dev(snd_pcm_t *handle) -{ - snd_pcm_close (handle); -} - -snd_pcm_t *open_playback(void) -{ - return open_sound_dev(SND_PCM_STREAM_PLAYBACK); -} - -snd_pcm_t *open_capture(void) -{ - return open_sound_dev(SND_PCM_STREAM_CAPTURE); -} - -int main(int argc, char *argv[]) -{ - int i; - int err; - char *buffer; - int buffer_frames = TEST_RATE_SET;//buffer大小为采集1s钟的数据量 - unsigned int rate = TEST_RATE_SET; - snd_pcm_t *capture_handle; - snd_pcm_t *playback_handle; - snd_pcm_hw_params_t *hw_params; - - if(argc!=2) - { - printf("test pcm capture:./alsa_demo c \n"); - printf("test pcm playback:./alsa_demo p \n"); - exit(1); - } - signal(2,exit_sighandler); - int frame_byte=snd_pcm_format_width(TEST_FORMAT)/8; - - buffer=(char *)malloc(buffer_frames*frame_byte*TEST_CHANNEL_SET); - - if(!strncmp(argv[1], "c", 1)) - { - if((pcm_data_file = fopen(TEST_FILE, "wb")) == NULL) - { - printf("open %s error.\n", TEST_FILE); - exit(1); - } - - capture_handle = open_capture(); - if (!capture_handle) - { - fprintf (stderr, "cannot open for capture\n"); - return -1; - } - - if ((err = snd_pcm_prepare (capture_handle)) < 0) { - fprintf (stderr, "cannot prepare audio interface for use (%s)\n", - snd_strerror (err)); - return -1; - } - - printf("capture start...\n"); - int actual; - while(1) - { - if((err=snd_pcm_readi(capture_handle,buffer,buffer_frames))!=buffer_frames) - { - printf("pcm readi(%s)\n",snd_strerror(err)); - exit(1); - } - - fwrite(buffer,(buffer_frames*TEST_CHANNEL_SET), frame_byte, pcm_data_file); - if(run_flag) - { - printf("capture stop.\n"); - break; - } - } - snd_pcm_drain(capture_handle); - snd_pcm_close(capture_handle); - fclose(pcm_data_file); - } - else if(!strncmp(argv[1], "p", 1)) - { - run_flag = 0; - if((pcm_data_file = fopen(TEST_FILE, "rb")) == NULL) - { - printf("open %s error.\n", TEST_FILE); - exit(1); - } - - playback_handle = open_playback(); - if (!playback_handle) - { - fprintf (stderr, "cannot open for playback\n"); - return -1; - } - - if ((err = snd_pcm_prepare (playback_handle)) < 0) { - fprintf (stderr, "cannot prepare audio interface for use (%s)\n", - snd_strerror (err)); - return -1; - } - - printf("playback start...\n"); - int read_cnt; - while(1) - { - read_cnt=fread(buffer,1,frame_byte*(buffer_frames*TEST_CHANNEL_SET), pcm_data_file); - if(read_cnt<=0) break; - - if((err=snd_pcm_writei(playback_handle,buffer,buffer_frames))!=buffer_frames) - { - printf("pcm writei(%s)\n",snd_strerror(err)); - exit(1); - } - if(run_flag) - { - break; - } - } - printf("playback stop.\n"); - - snd_pcm_drain(playback_handle); - snd_pcm_close(playback_handle); - - fclose(pcm_data_file); - free(buffer); - } - else - { - printf("test pcm capture:./alsa_demo c \n"); - printf("test pcm playback:./alsa_demo p \n"); - } - return 0; -} - \ No newline at end of file diff --git a/package/encode_app/encode_app.mk b/package/encode_app/encode_app.mk index fc97f56..368bc71 100644 --- a/package/encode_app/encode_app.mk +++ b/package/encode_app/encode_app.mk @@ -20,13 +20,25 @@ endef define ENCODE_APP_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0755 $(@D)/encode_app $(TARGET_DIR)/app/encode_app/encode_app $(INSTALL) -D -m 0755 $(@D)/video_sample.conf $(TARGET_DIR)/app/encode_app/video_sample.conf + $(INSTALL) -D -m 0755 $(@D)/video_sample_1080x1920.conf $(TARGET_DIR)/app/encode_app/video_sample_1080x1920.conf $(INSTALL) -D -m 0755 $(@D)/video_sample_720p60.conf $(TARGET_DIR)/app/encode_app/video_sample_720p60.conf $(INSTALL) -D -m 0755 $(@D)/video_sample_vga480p75.conf $(TARGET_DIR)/app/encode_app/video_sample_vga480p75.conf $(INSTALL) -D -m 0755 $(@D)/imx219_0.conf $(TARGET_DIR)/app/encode_app/imx219_0.conf $(INSTALL) -D -m 0755 $(@D)/imx219_1.conf $(TARGET_DIR)/app/encode_app/imx219_1.conf + $(INSTALL) -D -m 0755 $(@D)/imx219_1080x1920_0.conf $(TARGET_DIR)/app/encode_app/imx219_1080x1920_0.conf + $(INSTALL) -D -m 0755 $(@D)/imx219_1080x1920_1.conf $(TARGET_DIR)/app/encode_app/imx219_1080x1920_1.conf $(INSTALL) -D -m 0755 $(@D)/roi_1920x1080.conf $(TARGET_DIR)/app/encode_app/roi_1920x1080.conf $(INSTALL) -D -m 0755 $(@D)/imx385_0.conf $(TARGET_DIR)/app/encode_app/imx385_0.conf $(INSTALL) -D -m 0755 $(@D)/imx385_video_1920x1080.conf $(TARGET_DIR)/app/encode_app/imx385_video_1920x1080.conf + $(INSTALL) -D -m 0755 $(@D)/imx385_normal.conf $(TARGET_DIR)/app/encode_app/imx385_normal.conf + $(INSTALL) -D -m 0755 $(@D)/imx385_2frame.conf $(TARGET_DIR)/app/encode_app/imx385_2frame.conf + $(INSTALL) -D -m 0755 $(@D)/imx385_3frame.conf $(TARGET_DIR)/app/encode_app/imx385_3frame.conf + $(INSTALL) -D -m 0755 $(@D)/imx385_video_1920x1080_normal.conf $(TARGET_DIR)/app/encode_app/imx385_video_1920x1080_normal.conf + $(INSTALL) -D -m 0755 $(@D)/imx385_video_1920x1080_2frame.conf $(TARGET_DIR)/app/encode_app/imx385_video_1920x1080_2frame.conf + $(INSTALL) -D -m 0755 $(@D)/imx385_video_1920x1080_3frame.conf $(TARGET_DIR)/app/encode_app/imx385_video_1920x1080_3frame.conf + $(INSTALL) -D -m 0755 $(@D)/gc2053.conf $(TARGET_DIR)/app/encode_app/gc2053.conf + $(INSTALL) -D -m 0755 $(@D)/gc2093.conf $(TARGET_DIR)/app/encode_app/gc2093.conf + $(INSTALL) -D -m 0755 $(@D)/video_drm_gc2093_gc2053_isp_mux.conf $(TARGET_DIR)/app/encode_app/video_drm_gc2093_gc2053_isp_mux.conf endef $(eval $(generic-package)) diff --git a/package/encode_app/src/Makefile b/package/encode_app/src/Makefile index 4cf6670..3c4532b 100644 --- a/package/encode_app/src/Makefile +++ b/package/encode_app/src/Makefile @@ -16,10 +16,9 @@ CFLAGS = \ OBJ ?= encode_app $(OBJ): main.cpp video_app.cc G711Codec.cpp - $(C++) $(CFLAGS) $^ -L ./ -Wl,-Bdynamic -lvenc -L ./ -Wl,-Bstatic -llive555 -L ./ -Wl,-Bdynamic -lmediactl -L ./ -Wl,-Bdynamic -lvideo -L ./ -Wl,-Bdynamic -lasound -lstdc++ -Wl,-rpath . -lpthread -g -o $@ - + $(C++) $(CFLAGS) $^ -L ./ -Wl,-Bdynamic -lvenc -L ./ -Wl,-Bstatic -llive555 -L ./ -Wl,-Bdynamic -lmediactl -ladaptive -l3actl -L ./ -Wl,-Bdynamic -lvideo -L ./ -Wl,-Bdynamic -lasound -lstdc++ -Wl,-rpath . -lpthread -g -o $@ + clean: rm -f *.o rm -f *.d rm -f $(OBJ) - diff --git a/package/encode_app/src/gc2053.conf b/package/encode_app/src/gc2053.conf new file mode 100644 index 0000000..ad24d59 --- /dev/null +++ b/package/encode_app/src/gc2053.conf @@ -0,0 +1,531 @@ +{ + "isp_general":{ + "isp_out_sel":0, + "dvp_ch_mode":1, + "hist_3a_out_en":0, + "main_out":{ + "out_img_format":1, + "out_yuv_in_format":0, + "out_yuv422_pxl_order":0, + "out_pxl_width":0, + "out_frame_buf_size":2048 + }, + "out0":{ + "ds0_out_img_format":1, + "ds0_out_yuv_in_format":0, + "ds0_out_yuv422_pxl_order":0, + "ds0_out_pxl_width":0, + "ds0_frame_buf_size":2048 + }, + "out1":{ + "ds1_out_img_format":1, + "ds1_out_yuv_in_format":0, + "ds1_out_yuv422_pxl_order":0, + "ds1_out_pxl_width":0, + "ds1_frame_buf_size":2048 + }, + "out2":{ + "ds2_out_img_format":0, + "ds2_out_yuv_in_format":0, + "ds2_out_yuv422_pxl_order":0, + "ds2_out_pxl_width":0, + "ds2_frame_buf_size":2048 + }, + "wdr":{ + "wdr_mode":0, + "wdr_long_ch_mode":0, + "wdr_long_l2_buf_en":0, + "wdr_short_s1_buf_en":0, + "wdr_dynamic_switch_en":0, + "wdr_long_l2_buf_depth":0, + "wdr_long_img_format":0, + "wdr_long_yuv_in_format":0, + "wdr_long_img_out_format":0, + "wdr_long_yuv422_pxl_order":0, + "wdr_long_pixel_width":2, + "wdr_buf_base":0, + "wdr_line_stride":0, + "wdr_frame_buf_size":0 + }, + "nr3d":{ + "nr3d_en":0, + "nr3d_fbcd_en":0, + "nr3d_mv_out_en":0, + "nr3d_y_img_format":0, + "nr3d_y_yuv_in_format":0, + "nr3d_y_img_out_format":0, + "nr3d_y_yuv422_pxl_order":0, + "nr3d_y_pixel_width":2, + "nr3d_uv_img_format":0, + "nr3d_uv_yuv_in_format":0, + "nr3d_uv_mig_out_format":0, + "nr3d_uv_yuv422_pxl_order":0, + "nr3d_uv_pixel_width":2, + "nr3d_frame_buf_size":0 + }, + "ldc":{ + "ldc_line_stride":2048, + "ldc_frame_buf_size":2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol":0, + "vsync_pol":0, + "hsync_input_timing":2, + "vsync_input_timing":1, + "flip_ctl" :0, + "video_fmt_sl":0, + "itc_ttl_h" :2200, + "itc_ttl_v" :1125, + "itc_stt_hr" :0, + "itc_stt_vr" :1 + }, + "tpg": { + "tpg_en":0, + "bayer_mode_sel":3, + "motion_mode_sel":0, + "tpg_sel":9, + "wdr_l_mul_data":0, + "wdr_m_mul_data":0, + "wdr_s_mul_data":0 + }, + "blc":{ + "blc_en" :1, + "blc_offset" :240, + "blc_ratio" :272 + }, + "lsc":{ + "lsc_en" :1, + "lsc_h_center" :900, + "lsc_v_center" :580, + "lsc_r_ratio" :8, + "lsc_g_ratio":6, + "lsc_b_ratio" :6, + "lsc_ir_ratio" :6 + }, + "ae":{ + "ae_as_en" :0, + "ae_ag_en" :0, + "ae_airis_en" :0, + "ae_enter_ls_sel" :0, + "ae_exit_ls_sel" :0, + "ae_win_mode_sel" :0, + "ae_back_light_mode_sel" :2, + "ae_day_change_en" :0, + "ae_day_change_sel" :0, + "ae_win_stth" :0, + "ae_win_sttv" :0, + "ae_win_endh" :1919, + "ae_win_endv" :1079, + "ae_yobj" :80, + "ae_av_rg" :11, + "ae_l_ex_time" :1100, + "ae_m_ex_time" :32, + "ae_s_ex_time" :32, + "ae_agc" :256, + "ae_ad_shuttle_freq" :0, + "ae_ad_gain_freq" :0, + "ae_adjust_step_max":36, + "ae_ex_value_max" :1124, + "ae_ex_value_mid" :256, + "ae_ex_value_min" :1, + "ae_gain_value_max" :4095, + "ae_gain_value_mid" :512, + "ae_gain_value_min" :256, + "ae_dn_switch_ad_step_max" :512, + "ae_dn_switch_wait_time" :255, + "ape_max_diff" :12, + "ape_drv_signal_max" :3840, + "ape_coeff_distance" :0, + "ape_coeff_speed" :0, + "ape_coeff_acceleration" :0, + "ape_drv_manual_value" :4095, + "ape_damp_manual_value" :2048 + }, + "awb":{ + "awb_d65_en" :0, + "awb_ccm_en" :0, + "awb_en" :0, + "awb_mode_sel" :0, + "awb_hist_mode_sel" :0, + "awb_veri_en" :0, + "awb_fb_en" :0, + "awb_value_save_en" :0, + "awb_ccm_adp_adjust_en" :0, + "awb_stab_en" :1, + "awb_d65_red_gain" :256, + "awb_d65_blue_gain" :256, + "ccm_rr" :256, + "ccm_rg" :0, + "ccm_rb" :0, + "ccm_gr" :0, + "ccm_gg" :256, + "ccm_gb" :0, + "ccm_br" :0, + "ccm_bg" :0, + "ccm_bb" :256, + "ccm_correct_coff" :256, + "awb_win_stth" :0, + "awb_win_sttv" :0, + "awb_win_endh" :1919, + "awb_win_endv" :1079, + "awb_correct_diff_th" :8, + "awb_color_changeres_time" :8, + "awb_historgram_th" :4, + "awb_red_gain_adjust" :256, + "awb_green_gain_adjust" :256, + "awb_blue_gain_adjust" :256, + "awb_red_max_value" :240, + "awb_blue_max_value" :379, + "awb_red_min_value" :176, + "awb_blue_min_value" :281, + "awb_red_obj_value" :256, + "awb_blue_obj_value" :256 + }, + "wdr":{ + "wdr_fusion_en" :0, + "wdr_frame_sel" :0, + "wdr_adp_adjust_en" :0, + "wdr_stab_en" :0, + "wdr_en" :0, + "wdr_ghost_remove_en" :0, + "wdr_3frame_out_mode" :0, + "wdr_mode_sel" :0, + "wdr_2frame_ex_ratio" :1, + "wdr_3frame_ex_ratio" :1, + "wdr_stat_img_sel" :0, + "wdr_ltm_data_sel" :1, + "wdr_tz_data_sel" :1, + "wdr_remove_purple_en" :0, + "wdr_over_ex_ratio_th1" :384, + "wdr_over_ex_ratio_th2" :32, + "wdr_fusion_ratio_th" :192, + "wdr_fusion_value1" :64, + "wdr_fusion_value2" :16 + }, + "csc":{ + "rgb2yuv_00":153, + "rgb2yuv_01":256, + "rgb2yuv_02":86, + "rgb2yuv_10":301, + "rgb2yuv_11":214, + "rgb2yuv_12":170, + "rgb2yuv_20":58, + "rgb2yuv_21":42, + "rgb2yuv_22":256 + }, + "ada":{ + "gm_rgb_en" :1, + "gm_yuv_en" :0, + "ada_en" :1, + "ada_sbz_en" :0, + "ada_ccr_en" :0, + "ada_adp_en" :0, + "ada_adp_ccr_en" :0, + "ada_stat_mode_sel" :0, + "ada_enh_mode_sel" :0, + "ada_hist_max" :128, + "ada_ttl_max" :255, + "ada_win_stth" :0, + "ada_win_sttv" :0, + "ada_win_endh" :1919, + "ada_win_endv" :1079 + }, + "rgb-ir":{ + "raw_fmt" :0, + "rgbir_rct_en" :0, + "dfc_en" :0, + "rgbir_fs_en" :0, + "rgbir_ot_sl" :0, + "rgbir_fs_max" :256, + "dfc_krb" :0, + "dfc_ky" :0, + "dfc_th" :256, + "dfc_th_1" :256 + }, + "2dnr":{ + "dpeak_en" :1, + "nr2d_raw_en" :1, + "nr2d_eg_en" :1, + "nr2d_jl_en" :1, + "nr2d_av_en" :1, + "nr2d_c_en" :0, + "dpeak_adp_en" :0, + "nr2d_raw_adp_en":0, + "nr2d_y_adp_en" :0, + "nr2d_c_adp_en" :0, + "nr2d_raw_kl" :12, + "nr2d_jl_th" :128, + "nr2d_eg_k" :24, + "nr2d_y_k" :16, + "nr2d_c_k" :1 + }, + "3dnr":{ + "nr3d_en" :1, + "nr3dp_y_en" :1, + "nr3dp_c_en" :0, + "nr3dm_y_en" :1, + "nr3dm_c_en" :0, + "nr3db_y_en" :1, + "nr3db_c_en" :0, + "nr3dm_nr2d_y_en" :1, + "nr3dm_nr2d_c_en" :0, + "core_3dnr_wb_en" :1, + "core_3dnr_wb_sel" :1, + "core_3dnr_adp_luma_en" :0, + "core_3dnr_adp_chroma_en" :0, + "nr3dp_thy" :64, + "nr3dp_thyp" :64, + "nr3dp_thcp" :64, + "nr3dm_mid_th" :128, + "nr3dm_mtp_th" :8, + "nr3dm_mtc_th" :128, + "nr3dm_ym_k" :60, + "nr3dm_thy" :64, + "nr3dm_min" :0, + "nr3dm_thw0" :128, + "core_3dnr_chroma_intensity" :16, + "nr3db_nr2d_eg_th" :64, + "nr3db_thyp" :64, + "nr3db_thcp" :32 + }, + "enh":{ + "ltm":{ + "enh_ltm_en" :1, + "enh_adp_ltm_en" :0, + "ltm_gain" :128, + "ltm_mm_th" :128 + }, + "sharp":{ + "enh_sharp_en" :1, + "enh_adp_sharp_en" :0, + "shp_core" :8, + "shp_th1" :3840, + "shp_th2" :4095, + "shp_gain" :64 + }, + "cc":{ + "enh_cc_en" :0, + "enh_adp_cc_en" :0 + } + }, + "post_ctl":{ + "otc_ctl":{ + "otc_en" :0, + "otc_yc_sl" :0, + "otc_uv_sl" :1, + "otc_hs_plt_sl" :0, + "otc_vs_plt_sl" :0, + "otc_stt_vr" :0, + "otc_stt_hr" :0 + }, + "ctrst":{ + "ctrst_en" :1, + "ctrst_gain":128 + }, + "luma":{ + "luma_en" :1, + "luma_gain":128 + }, + "strt":{ + "strt_en" :1, + "strt_gain":0 + } + }, + "ldc":{ + "ldc_en" :0, + "ldc_rct_en" :0, + "ldc_rq_frq" :128, + "ldc_stt_ln" :540, + "ldc_ch" :960, + "ldc_cv" :540, + "ldc_cr" :684, + "ldc_cz" :684 + }, + "af":{ + "af_stat_en" :1, + "af_stat_mode_sel" :0, + "af_stat_win_h_start":0, + "af_stat_win_v_start":0, + "af_stat_win_h_end" :1919, + "af_stat_win_v_end" :1079 + } + }, + "isp_post":{ + "rgb2yuv":{ + "osd_rgb2yuv_coeff00":306, + "osd_rgb2yuv_coeff01":601, + "osd_rgb2yuv_coeff02":117, + "osd_rgb2yuv_coeff03":0, + "osd_rgb2yuv_coeff10":3920, + "osd_rgb2yuv_coeff11":3749, + "osd_rgb2yuv_coeff12":523, + "osd_rgb2yuv_coeff13":128, + "osd_rgb2yuv_coeff20":523, + "osd_rgb2yuv_coeff21":3658, + "osd_rgb2yuv_coeff22":4011, + "osd_rgb2yuv_coeff23":128 + }, + "yuv2rgb":{ + "out_yuv2rgb_coeff00":1024, + "out_yuv2rgb_coeff01":0, + "out_yuv2rgb_coeff02":1441, + "out_yuv2rgb_coeff03":3916, + "out_yuv2rgb_coeff10":1024, + "out_yuv2rgb_coeff11":3742, + "out_yuv2rgb_coeff12":3362, + "out_yuv2rgb_coeff13":136, + "out_yuv2rgb_coeff20":1024, + "out_yuv2rgb_coeff21":1822, + "out_yuv2rgb_coeff22":0, + "out_yuv2rgb_coeff23":3868 + }, + "ds0":{ + "ds0_out_rgb_mode":0, + "ds0_out_rgb_en":0, + "ds0_out_yuv_mode":0, + "ds0_out_uv_swap":0, + "ds0_osd0":{ + "ds0_osd0_enable":0, + "ds0_osd0_type":0, + "ds0_osd0_alpha_tpye":0, + "ds0_osd0_vst":0, + "ds0_osd0_hst":0, + "ds0_osd0_vend":0, + "ds0_osd0_hend":0, + "ds0_osd0_dma_request_length":0, + "ds0_osd0_dma_map":0, + "ds0_osd0_rgb_rev":0, + "ds0_osd0_global_alpha":0, + "ds0_osd0_swap_64":0, + "ds0_osd0_outstanding_num":0, + "ds0_osd0_bd_limit_en":0 + }, + "ds0_osd1":{ + "ds0_osd1_enable":0, + "ds0_osd1_type":0, + "ds0_osd1_alpha_tpye":0, + "ds0_osd1_vst":0, + "ds0_osd1_hst":0, + "ds0_osd1_vend":0, + "ds0_osd1_hend":0, + "ds0_osd1_dma_request_length":0, + "ds0_osd1_dma_map":0, + "ds0_osd1_rgb_rev":0, + "ds0_osd1_global_alpha":0, + "ds0_osd1_swap_64":0, + "ds0_osd1_outstanding_num":0, + "ds0_osd1_bd_limit_en":0 + }, + "ds0_osd2":{ + "ds0_osd2_enable":0, + "ds0_osd2_type":0, + "ds0_osd2_alpha_tpye":0, + "ds0_osd2_vst":0, + "ds0_osd2_hst":0, + "ds0_osd2_vend":0, + "ds0_osd2_hend":0, + "ds0_osd2_dma_request_length":0, + "ds0_osd2_dma_map":0, + "ds0_osd2_rgb_rev":0, + "ds0_osd2_global_alpha":0, + "ds0_osd2_swap_64":0, + "ds0_osd2_outstanding_num":0, + "ds0_osd2_bd_limit_en":0 + } + }, + "ds1":{ + "ds1_out_rgb_mode":0, + "ds1_out_rgb_en":0, + "ds1_out_yuv_mode":0, + "ds1_out_uv_swap":0, + "ds1_osd0":{ + "ds1_osd0_enable":0, + "ds1_osd0_type":0, + "ds1_osd0_alpha_tpye":0, + "ds1_osd0_vst":0, + "ds1_osd0_hst":0, + "ds1_osd0_vend":0, + "ds1_osd0_hend":0, + "ds1_osd0_dma_request_length":0, + "ds1_osd0_dma_map":0, + "ds1_osd0_rgb_rev":0, + "ds1_osd0_global_alpha":0, + "ds1_osd0_swap_64":0, + "ds1_osd0_outstanding_num":0, + "ds1_osd0_bd_limit_en":0 + }, + "ds1_osd1":{ + "ds1_osd1_enable":0, + "ds1_osd1_type":0, + "ds1_osd1_alpha_tpye":0, + "ds1_osd1_vst":0, + "ds1_osd1_hst":0, + "ds1_osd1_vend":0, + "ds1_osd1_hend":0, + "ds1_osd1_dma_request_length":0, + "ds1_osd1_dma_map":0, + "ds1_osd1_rgb_rev":0, + "ds1_osd1_global_alpha":0, + "ds1_osd1_swap_64":0, + "ds1_osd1_outstanding_num":0, + "ds1_osd1_bd_limit_en":0 + }, + "ds1_osd2":{ + "ds1_osd2_enable":0, + "ds1_osd2_type":0, + "ds1_osd2_alpha_tpye":0, + "ds1_osd2_vst":0, + "ds1_osd2_hst":0, + "ds1_osd2_vend":0, + "ds1_osd2_hend":0, + "ds1_osd2_dma_request_length":0, + "ds1_osd2_dma_map":0, + "ds1_osd2_rgb_rev":0, + "ds1_osd2_global_alpha":0, + "ds1_osd2_swap_64":0, + "ds1_osd2_outstanding_num":0, + "ds1_osd2_bd_limit_en":0 + } + }, + "ds2":{ + "ds2_out_rgb_mode":0, + "ds2_out_rgb_en":1, + "ds2_out_yuv_mode":0, + "ds2_out_uv_swap":0, + "ds2_osd0":{ + "ds2_osd0_enable":0, + "ds2_osd0_type":0, + "ds2_osd0_alpha_tpye":0, + "ds2_osd0_vst":0, + "ds2_osd0_hst":0, + "ds2_osd0_vend":0, + "ds2_osd0_hend":0, + "ds2_osd0_dma_request_length":0, + "ds2_osd0_dma_map":0, + "ds2_osd0_rgb_rev":0, + "ds2_osd0_global_alpha":0, + "ds2_osd0_swap_64":0, + "ds2_osd0_outstanding_num":0, + "ds2_osd0_bd_limit_en":0 + }, + "ds2_osd1":{ + "ds2_osd1_enable":0, + "ds2_osd1_type":0, + "ds2_osd1_alpha_tpye":0, + "ds2_osd1_vst":0, + "ds2_osd1_hst":0, + "ds2_osd1_vend":0, + "ds2_osd1_hend":0, + "ds2_osd1_dma_request_length":0, + "ds2_osd1_dma_map":0, + "ds2_osd1_rgb_rev":0, + "ds2_osd1_global_alpha":0, + "ds2_osd1_swap_64":0, + "ds2_osd1_outstanding_num":0, + "ds2_osd1_bd_limit_en":0 + } + } + } +} diff --git a/package/encode_app/src/gc2093.conf b/package/encode_app/src/gc2093.conf new file mode 100644 index 0000000..a08a526 --- /dev/null +++ b/package/encode_app/src/gc2093.conf @@ -0,0 +1,531 @@ +{ + "isp_general":{ + "isp_out_sel":0, + "dvp_ch_mode":1, + "hist_3a_out_en":0, + "main_out":{ + "out_img_format":1, + "out_yuv_in_format":0, + "out_yuv422_pxl_order":0, + "out_pxl_width":0, + "out_frame_buf_size":2048 + }, + "out0":{ + "ds0_out_img_format":1, + "ds0_out_yuv_in_format":0, + "ds0_out_yuv422_pxl_order":0, + "ds0_out_pxl_width":0, + "ds0_frame_buf_size":2048 + }, + "out1":{ + "ds1_out_img_format":1, + "ds1_out_yuv_in_format":0, + "ds1_out_yuv422_pxl_order":0, + "ds1_out_pxl_width":0, + "ds1_frame_buf_size":2048 + }, + "out2":{ + "ds2_out_img_format":0, + "ds2_out_yuv_in_format":0, + "ds2_out_yuv422_pxl_order":0, + "ds2_out_pxl_width":0, + "ds2_frame_buf_size":2048 + }, + "wdr":{ + "wdr_mode":0, + "wdr_long_ch_mode":0, + "wdr_long_l2_buf_en":0, + "wdr_short_s1_buf_en":0, + "wdr_dynamic_switch_en":0, + "wdr_long_l2_buf_depth":0, + "wdr_long_img_format":0, + "wdr_long_yuv_in_format":0, + "wdr_long_img_out_format":0, + "wdr_long_yuv422_pxl_order":0, + "wdr_long_pixel_width":2, + "wdr_buf_base":0, + "wdr_line_stride":0, + "wdr_frame_buf_size":0 + }, + "nr3d":{ + "nr3d_en":0, + "nr3d_fbcd_en":0, + "nr3d_mv_out_en":0, + "nr3d_y_img_format":0, + "nr3d_y_yuv_in_format":0, + "nr3d_y_img_out_format":0, + "nr3d_y_yuv422_pxl_order":0, + "nr3d_y_pixel_width":2, + "nr3d_uv_img_format":0, + "nr3d_uv_yuv_in_format":0, + "nr3d_uv_mig_out_format":0, + "nr3d_uv_yuv422_pxl_order":0, + "nr3d_uv_pixel_width":2, + "nr3d_frame_buf_size":0 + }, + "ldc":{ + "ldc_line_stride":2048, + "ldc_frame_buf_size":2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol":0, + "vsync_pol":0, + "hsync_input_timing":2, + "vsync_input_timing":1, + "flip_ctl" :0, + "video_fmt_sl":0, + "itc_ttl_h" :2844, + "itc_ttl_v" :1125, + "itc_stt_hr" :0, + "itc_stt_vr" :1 + }, + "tpg": { + "tpg_en":0, + "bayer_mode_sel":3, + "motion_mode_sel":0, + "tpg_sel":9, + "wdr_l_mul_data":0, + "wdr_m_mul_data":0, + "wdr_s_mul_data":0 + }, + "blc":{ + "blc_en" :1, + "blc_offset" :240, + "blc_ratio" :272 + }, + "lsc":{ + "lsc_en" :1, + "lsc_h_center" :900, + "lsc_v_center" :580, + "lsc_r_ratio" :6, + "lsc_g_ratio":6, + "lsc_b_ratio" :4, + "lsc_ir_ratio" :6 + }, + "ae":{ + "ae_as_en" :1, + "ae_ag_en" :1, + "ae_airis_en" :0, + "ae_enter_ls_sel" :0, + "ae_exit_ls_sel" :0, + "ae_win_mode_sel" :0, + "ae_back_light_mode_sel" :2, + "ae_day_change_en" :0, + "ae_day_change_sel" :0, + "ae_win_stth" :0, + "ae_win_sttv" :0, + "ae_win_endh" :1919, + "ae_win_endv" :1079, + "ae_yobj" :100, + "ae_av_rg" :14, + "ae_l_ex_time" :1100, + "ae_m_ex_time" :32, + "ae_s_ex_time" :32, + "ae_agc" :256, + "ae_ad_shuttle_freq" :0, + "ae_ad_gain_freq" :0, + "ae_adjust_step_max":36, + "ae_ex_value_max" :1124, + "ae_ex_value_mid" :256, + "ae_ex_value_min" :1, + "ae_gain_value_max" :4095, + "ae_gain_value_mid" :512, + "ae_gain_value_min" :256, + "ae_dn_switch_ad_step_max" :512, + "ae_dn_switch_wait_time" :255, + "ape_max_diff" :12, + "ape_drv_signal_max" :3840, + "ape_coeff_distance" :0, + "ape_coeff_speed" :0, + "ape_coeff_acceleration" :0, + "ape_drv_manual_value" :4095, + "ape_damp_manual_value" :2048 + }, + "awb":{ + "awb_d65_en" :1, + "awb_ccm_en" :1, + "awb_en" :1, + "awb_mode_sel" :1, + "awb_hist_mode_sel" :0, + "awb_veri_en" :0, + "awb_fb_en" :0, + "awb_value_save_en" :0, + "awb_ccm_adp_adjust_en" :0, + "awb_stab_en" :1, + "awb_d65_red_gain" :487, + "awb_d65_blue_gain" :418, + "ccm_rr" :261, + "ccm_rg" :5, + "ccm_rb" :0, + "ccm_gr" :47, + "ccm_gg" :308, + "ccm_gb" :5, + "ccm_br" :6, + "ccm_bg" :69, + "ccm_bb" :331, + "ccm_correct_coff" :256, + "awb_win_stth" :0, + "awb_win_sttv" :0, + "awb_win_endh" :1919, + "awb_win_endv" :1079, + "awb_correct_diff_th" :8, + "awb_color_changeres_time" :8, + "awb_historgram_th" :4, + "awb_red_gain_adjust" :256, + "awb_green_gain_adjust" :256, + "awb_blue_gain_adjust" :256, + "awb_red_max_value" :258, + "awb_blue_max_value" :450, + "awb_red_min_value" :164, + "awb_blue_min_value" :256, + "awb_red_obj_value" :256, + "awb_blue_obj_value" :256 + }, + "wdr":{ + "wdr_fusion_en" :0, + "wdr_frame_sel" :0, + "wdr_adp_adjust_en" :0, + "wdr_stab_en" :0, + "wdr_en" :0, + "wdr_ghost_remove_en" :0, + "wdr_3frame_out_mode" :0, + "wdr_mode_sel" :0, + "wdr_2frame_ex_ratio" :1, + "wdr_3frame_ex_ratio" :1, + "wdr_stat_img_sel" :0, + "wdr_ltm_data_sel" :1, + "wdr_tz_data_sel" :1, + "wdr_remove_purple_en" :0, + "wdr_over_ex_ratio_th1" :384, + "wdr_over_ex_ratio_th2" :32, + "wdr_fusion_ratio_th" :192, + "wdr_fusion_value1" :64, + "wdr_fusion_value2" :16 + }, + "csc":{ + "rgb2yuv_00":153, + "rgb2yuv_01":256, + "rgb2yuv_02":86, + "rgb2yuv_10":301, + "rgb2yuv_11":214, + "rgb2yuv_12":170, + "rgb2yuv_20":58, + "rgb2yuv_21":42, + "rgb2yuv_22":256 + }, + "ada":{ + "gm_rgb_en" :1, + "gm_yuv_en" :0, + "ada_en" :1, + "ada_sbz_en" :0, + "ada_ccr_en" :0, + "ada_adp_en" :0, + "ada_adp_ccr_en" :0, + "ada_stat_mode_sel" :0, + "ada_enh_mode_sel" :0, + "ada_hist_max" :128, + "ada_ttl_max" :255, + "ada_win_stth" :0, + "ada_win_sttv" :0, + "ada_win_endh" :1919, + "ada_win_endv" :1079 + }, + "rgb-ir":{ + "raw_fmt" :0, + "rgbir_rct_en" :0, + "dfc_en" :0, + "rgbir_fs_en" :0, + "rgbir_ot_sl" :0, + "rgbir_fs_max" :256, + "dfc_krb" :0, + "dfc_ky" :0, + "dfc_th" :256, + "dfc_th_1" :256 + }, + "2dnr":{ + "dpeak_en" :1, + "nr2d_raw_en" :1, + "nr2d_eg_en" :1, + "nr2d_jl_en" :1, + "nr2d_av_en" :1, + "nr2d_c_en" :1, + "dpeak_adp_en" :0, + "nr2d_raw_adp_en":0, + "nr2d_y_adp_en" :0, + "nr2d_c_adp_en" :0, + "nr2d_raw_kl" :16, + "nr2d_jl_th" :128, + "nr2d_eg_k" :24, + "nr2d_y_k" :32, + "nr2d_c_k" :1 + }, + "3dnr":{ + "nr3d_en" :1, + "nr3dp_y_en" :1, + "nr3dp_c_en" :1, + "nr3dm_y_en" :1, + "nr3dm_c_en" :1, + "nr3db_y_en" :1, + "nr3db_c_en" :1, + "nr3dm_nr2d_y_en" :1, + "nr3dm_nr2d_c_en" :1, + "core_3dnr_wb_en" :1, + "core_3dnr_wb_sel" :1, + "core_3dnr_adp_luma_en" :0, + "core_3dnr_adp_chroma_en" :0, + "nr3dp_thy" :255, + "nr3dp_thyp" :255, + "nr3dp_thcp" :32, + "nr3dm_mid_th" :128, + "nr3dm_mtp_th" :8, + "nr3dm_mtc_th" :128, + "nr3dm_ym_k" :30, + "nr3dm_thy" :64, + "nr3dm_min" :0, + "nr3dm_thw0" :128, + "core_3dnr_chroma_intensity" :16, + "nr3db_nr2d_eg_th" :64, + "nr3db_thyp" :64, + "nr3db_thcp" :32 + }, + "enh":{ + "ltm":{ + "enh_ltm_en" :1, + "enh_adp_ltm_en" :0, + "ltm_gain" :128, + "ltm_mm_th" :128 + }, + "sharp":{ + "enh_sharp_en" :1, + "enh_adp_sharp_en" :0, + "shp_core" :8, + "shp_th1" :3840, + "shp_th2" :4095, + "shp_gain" :64 + }, + "cc":{ + "enh_cc_en" :0, + "enh_adp_cc_en" :0 + } + }, + "post_ctl":{ + "otc_ctl":{ + "otc_en" :0, + "otc_yc_sl" :0, + "otc_uv_sl" :1, + "otc_hs_plt_sl" :0, + "otc_vs_plt_sl" :0, + "otc_stt_vr" :0, + "otc_stt_hr" :0 + }, + "ctrst":{ + "ctrst_en" :1, + "ctrst_gain":128 + }, + "luma":{ + "luma_en" :1, + "luma_gain":128 + }, + "strt":{ + "strt_en" :1, + "strt_gain":222 + } + }, + "ldc":{ + "ldc_en" :0, + "ldc_rct_en" :0, + "ldc_rq_frq" :128, + "ldc_stt_ln" :540, + "ldc_ch" :960, + "ldc_cv" :540, + "ldc_cr" :684, + "ldc_cz" :684 + }, + "af":{ + "af_stat_en" :1, + "af_stat_mode_sel" :0, + "af_stat_win_h_start":0, + "af_stat_win_v_start":0, + "af_stat_win_h_end" :1919, + "af_stat_win_v_end" :1079 + } + }, + "isp_post":{ + "rgb2yuv":{ + "osd_rgb2yuv_coeff00":306, + "osd_rgb2yuv_coeff01":601, + "osd_rgb2yuv_coeff02":117, + "osd_rgb2yuv_coeff03":0, + "osd_rgb2yuv_coeff10":3920, + "osd_rgb2yuv_coeff11":3749, + "osd_rgb2yuv_coeff12":523, + "osd_rgb2yuv_coeff13":128, + "osd_rgb2yuv_coeff20":523, + "osd_rgb2yuv_coeff21":3658, + "osd_rgb2yuv_coeff22":4011, + "osd_rgb2yuv_coeff23":128 + }, + "yuv2rgb":{ + "out_yuv2rgb_coeff00":1024, + "out_yuv2rgb_coeff01":0, + "out_yuv2rgb_coeff02":1441, + "out_yuv2rgb_coeff03":3916, + "out_yuv2rgb_coeff10":1024, + "out_yuv2rgb_coeff11":3742, + "out_yuv2rgb_coeff12":3362, + "out_yuv2rgb_coeff13":136, + "out_yuv2rgb_coeff20":1024, + "out_yuv2rgb_coeff21":1822, + "out_yuv2rgb_coeff22":0, + "out_yuv2rgb_coeff23":3868 + }, + "ds0":{ + "ds0_out_rgb_mode":0, + "ds0_out_rgb_en":0, + "ds0_out_yuv_mode":0, + "ds0_out_uv_swap":0, + "ds0_osd0":{ + "ds0_osd0_enable":0, + "ds0_osd0_type":0, + "ds0_osd0_alpha_tpye":0, + "ds0_osd0_vst":0, + "ds0_osd0_hst":0, + "ds0_osd0_vend":0, + "ds0_osd0_hend":0, + "ds0_osd0_dma_request_length":0, + "ds0_osd0_dma_map":0, + "ds0_osd0_rgb_rev":0, + "ds0_osd0_global_alpha":0, + "ds0_osd0_swap_64":0, + "ds0_osd0_outstanding_num":0, + "ds0_osd0_bd_limit_en":0 + }, + "ds0_osd1":{ + "ds0_osd1_enable":0, + "ds0_osd1_type":0, + "ds0_osd1_alpha_tpye":0, + "ds0_osd1_vst":0, + "ds0_osd1_hst":0, + "ds0_osd1_vend":0, + "ds0_osd1_hend":0, + "ds0_osd1_dma_request_length":0, + "ds0_osd1_dma_map":0, + "ds0_osd1_rgb_rev":0, + "ds0_osd1_global_alpha":0, + "ds0_osd1_swap_64":0, + "ds0_osd1_outstanding_num":0, + "ds0_osd1_bd_limit_en":0 + }, + "ds0_osd2":{ + "ds0_osd2_enable":0, + "ds0_osd2_type":0, + "ds0_osd2_alpha_tpye":0, + "ds0_osd2_vst":0, + "ds0_osd2_hst":0, + "ds0_osd2_vend":0, + "ds0_osd2_hend":0, + "ds0_osd2_dma_request_length":0, + "ds0_osd2_dma_map":0, + "ds0_osd2_rgb_rev":0, + "ds0_osd2_global_alpha":0, + "ds0_osd2_swap_64":0, + "ds0_osd2_outstanding_num":0, + "ds0_osd2_bd_limit_en":0 + } + }, + "ds1":{ + "ds1_out_rgb_mode":0, + "ds1_out_rgb_en":0, + "ds1_out_yuv_mode":0, + "ds1_out_uv_swap":0, + "ds1_osd0":{ + "ds1_osd0_enable":0, + "ds1_osd0_type":0, + "ds1_osd0_alpha_tpye":0, + "ds1_osd0_vst":0, + "ds1_osd0_hst":0, + "ds1_osd0_vend":0, + "ds1_osd0_hend":0, + "ds1_osd0_dma_request_length":0, + "ds1_osd0_dma_map":0, + "ds1_osd0_rgb_rev":0, + "ds1_osd0_global_alpha":0, + "ds1_osd0_swap_64":0, + "ds1_osd0_outstanding_num":0, + "ds1_osd0_bd_limit_en":0 + }, + "ds1_osd1":{ + "ds1_osd1_enable":0, + "ds1_osd1_type":0, + "ds1_osd1_alpha_tpye":0, + "ds1_osd1_vst":0, + "ds1_osd1_hst":0, + "ds1_osd1_vend":0, + "ds1_osd1_hend":0, + "ds1_osd1_dma_request_length":0, + "ds1_osd1_dma_map":0, + "ds1_osd1_rgb_rev":0, + "ds1_osd1_global_alpha":0, + "ds1_osd1_swap_64":0, + "ds1_osd1_outstanding_num":0, + "ds1_osd1_bd_limit_en":0 + }, + "ds1_osd2":{ + "ds1_osd2_enable":0, + "ds1_osd2_type":0, + "ds1_osd2_alpha_tpye":0, + "ds1_osd2_vst":0, + "ds1_osd2_hst":0, + "ds1_osd2_vend":0, + "ds1_osd2_hend":0, + "ds1_osd2_dma_request_length":0, + "ds1_osd2_dma_map":0, + "ds1_osd2_rgb_rev":0, + "ds1_osd2_global_alpha":0, + "ds1_osd2_swap_64":0, + "ds1_osd2_outstanding_num":0, + "ds1_osd2_bd_limit_en":0 + } + }, + "ds2":{ + "ds2_out_rgb_mode":0, + "ds2_out_rgb_en":1, + "ds2_out_yuv_mode":0, + "ds2_out_uv_swap":0, + "ds2_osd0":{ + "ds2_osd0_enable":0, + "ds2_osd0_type":0, + "ds2_osd0_alpha_tpye":0, + "ds2_osd0_vst":0, + "ds2_osd0_hst":0, + "ds2_osd0_vend":0, + "ds2_osd0_hend":0, + "ds2_osd0_dma_request_length":0, + "ds2_osd0_dma_map":0, + "ds2_osd0_rgb_rev":0, + "ds2_osd0_global_alpha":0, + "ds2_osd0_swap_64":0, + "ds2_osd0_outstanding_num":0, + "ds2_osd0_bd_limit_en":0 + }, + "ds2_osd1":{ + "ds2_osd1_enable":0, + "ds2_osd1_type":0, + "ds2_osd1_alpha_tpye":0, + "ds2_osd1_vst":0, + "ds2_osd1_hst":0, + "ds2_osd1_vend":0, + "ds2_osd1_hend":0, + "ds2_osd1_dma_request_length":0, + "ds2_osd1_dma_map":0, + "ds2_osd1_rgb_rev":0, + "ds2_osd1_global_alpha":0, + "ds2_osd1_swap_64":0, + "ds2_osd1_outstanding_num":0, + "ds2_osd1_bd_limit_en":0 + } + } + } +} \ No newline at end of file diff --git a/package/encode_app/src/imx219_0.conf b/package/encode_app/src/imx219_0.conf index 9d05d58..1ed1520 100644 --- a/package/encode_app/src/imx219_0.conf +++ b/package/encode_app/src/imx219_0.conf @@ -1,531 +1,531 @@ { - "isp_general":{ - "isp_out_sel":0, - "dvp_ch_mode":1, - "hist_3a_out_en":0, - "main_out":{ - "out_img_format":1, - "out_yuv_in_format":0, - "out_yuv422_pxl_order":0, - "out_pxl_width":0, - "out_frame_buf_size":2048 + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 }, - "out0":{ - "ds0_out_img_format":1, - "ds0_out_yuv_in_format":0, - "ds0_out_yuv422_pxl_order":0, - "ds0_out_pxl_width":0, - "ds0_frame_buf_size":2048 + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 }, - "out1":{ - "ds1_out_img_format":1, - "ds1_out_yuv_in_format":0, - "ds1_out_yuv422_pxl_order":0, - "ds1_out_pxl_width":0, - "ds1_frame_buf_size":2048 + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 }, - "out2":{ - "ds2_out_img_format":0, - "ds2_out_yuv_in_format":0, - "ds2_out_yuv422_pxl_order":0, - "ds2_out_pxl_width":0, - "ds2_frame_buf_size":2048 + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 }, - "wdr":{ - "wdr_mode":0, - "wdr_long_ch_mode":0, - "wdr_long_l2_buf_en":0, - "wdr_short_s1_buf_en":0, - "wdr_dynamic_switch_en":0, - "wdr_long_l2_buf_depth":0, - "wdr_long_img_format":0, - "wdr_long_yuv_in_format":0, - "wdr_long_img_out_format":0, - "wdr_long_yuv422_pxl_order":0, - "wdr_long_pixel_width":2, - "wdr_buf_base":0, - "wdr_line_stride":0, - "wdr_frame_buf_size":0 - }, - "nr3d":{ - "nr3d_en":0, - "nr3d_fbcd_en":0, - "nr3d_mv_out_en":0, - "nr3d_y_img_format":0, - "nr3d_y_yuv_in_format":0, - "nr3d_y_img_out_format":0, - "nr3d_y_yuv422_pxl_order":0, - "nr3d_y_pixel_width":2, - "nr3d_uv_img_format":0, - "nr3d_uv_yuv_in_format":0, - "nr3d_uv_mig_out_format":0, - "nr3d_uv_yuv422_pxl_order":0, - "nr3d_uv_pixel_width":2, - "nr3d_frame_buf_size":0 - }, - "ldc":{ - "ldc_line_stride":2048, - "ldc_frame_buf_size":2048 - } + "wdr": { + "wdr_mode": 0, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } }, - "isp_core": { + "isp_core": { "itc": { - "hsync_pol":0, - "vsync_pol":0, - "hsync_input_timing":2, - "vsync_input_timing":1, - "flip_ctl" :0, - "video_fmt_sl":0, - "itc_ttl_h" :3476, - "itc_ttl_v" :1166, - "itc_stt_hr" :0, - "itc_stt_vr" :1 + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 2, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 3476, + "itc_ttl_v": 1166, + "itc_stt_hr": 0, + "itc_stt_vr": 1 }, - "tpg": { - "tpg_en":0, - "bayer_mode_sel":3, - "motion_mode_sel":0, - "tpg_sel":9, - "wdr_l_mul_data":0, - "wdr_m_mul_data":0, - "wdr_s_mul_data":0 + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 }, - "blc":{ - "blc_en" :1, - "blc_offset" :240, - "blc_ratio" :272 + "blc": { + "blc_en": 1, + "blc_offset": 240, + "blc_ratio": 272 }, - "lsc":{ - "lsc_en" :1, - "lsc_h_center" :900, - "lsc_v_center" :580, - "lsc_r_ratio" :10, - "lsc_g_ratio":6, - "lsc_b_ratio" :6, - "lsc_ir_ratio" :6 + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 10, + "lsc_g_ratio": 6, + "lsc_b_ratio": 6, + "lsc_ir_ratio": 6 }, - "ae":{ - "ae_as_en" :1, - "ae_ag_en" :1, - "ae_airis_en" :0, - "ae_enter_ls_sel" :0, - "ae_exit_ls_sel" :0, - "ae_win_mode_sel" :0, - "ae_back_light_mode_sel" :0, - "ae_day_change_en" :0, - "ae_day_change_sel" :0, - "ae_win_stth" :0, - "ae_win_sttv" :0, - "ae_win_endh" :1919, - "ae_win_endv" :1079, - "ae_yobj" :90, - "ae_av_rg" :8, - "ae_l_ex_time" :1000, - "ae_m_ex_time" :32, - "ae_s_ex_time" :32, - "ae_agc" :256, - "ae_ad_shuttle_freq" :1, - "ae_ad_gain_freq" :0, - "ae_adjust_step_max":36, - "ae_ex_value_max" :1162, - "ae_ex_value_mid" :256, - "ae_ex_value_min" :1, - "ae_gain_value_max" :2304, - "ae_gain_value_mid" :512, - "ae_gain_value_min" :256, - "ae_dn_switch_ad_step_max" :512, - "ae_dn_switch_wait_time" :255, - "ape_max_diff" :12, - "ape_drv_signal_max" :3840, - "ape_coeff_distance" :0, - "ape_coeff_speed" :0, - "ape_coeff_acceleration" :0, - "ape_drv_manual_value" :4095, - "ape_damp_manual_value" :2048 + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 0, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 8, + "ae_win_sttv": 4, + "ae_win_endh": 1927, + "ae_win_endv": 1083, + "ae_yobj": 90, + "ae_av_rg": 8, + "ae_l_ex_time": 1000, + "ae_m_ex_time": 32, + "ae_s_ex_time": 32, + "ae_agc": 256, + "ae_ad_shuttle_freq": 0, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 1162, + "ae_ex_value_mid": 256, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 }, - "awb":{ - "awb_d65_en" :1, - "awb_ccm_en" :1, - "awb_en" :1, - "awb_mode_sel" :1, - "awb_hist_mode_sel" :0, - "awb_veri_en" :0, - "awb_fb_en" :0, - "awb_value_save_en" :0, - "awb_ccm_adp_adjust_en" :0, - "awb_stab_en" :1, - "awb_d65_red_gain" :466, - "awb_d65_blue_gain" :382, - "ccm_rr" :259, - "ccm_rg" :2, - "ccm_rb" :1, - "ccm_gr" :37, - "ccm_gg" :310, - "ccm_gb" :17, - "ccm_br" :1, - "ccm_bg" :75, - "ccm_bb" :332, - "ccm_correct_coff" :256, - "awb_win_stth" :0, - "awb_win_sttv" :0, - "awb_win_endh" :1919, - "awb_win_endv" :1079, - "awb_correct_diff_th" :8, - "awb_color_changeres_time" :8, - "awb_historgram_th" :4, - "awb_red_gain_adjust" :256, - "awb_green_gain_adjust" :256, - "awb_blue_gain_adjust" :256, - "awb_red_max_value" :259, - "awb_blue_max_value" :388, - "awb_red_min_value" :176, - "awb_blue_min_value" :262, - "awb_red_obj_value" :256, - "awb_blue_obj_value" :256 + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 466, + "awb_d65_blue_gain": 382, + "ccm_rr": 259, + "ccm_rg": 2, + "ccm_rb": 1, + "ccm_gr": 37, + "ccm_gg": 310, + "ccm_gb": 17, + "ccm_br": 1, + "ccm_bg": 75, + "ccm_bb": 332, + "ccm_correct_coff": 256, + "awb_win_stth": 8, + "awb_win_sttv": 4, + "awb_win_endh": 1927, + "awb_win_endv": 1083, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 259, + "awb_blue_max_value": 388, + "awb_red_min_value": 176, + "awb_blue_min_value": 262, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 }, - "wdr":{ - "wdr_fusion_en" :0, - "wdr_frame_sel" :0, - "wdr_adp_adjust_en" :0, - "wdr_stab_en" :0, - "wdr_en" :0, - "wdr_ghost_remove_en" :0, - "wdr_3frame_out_mode" :0, - "wdr_mode_sel" :0, - "wdr_2frame_ex_ratio" :1, - "wdr_3frame_ex_ratio" :1, - "wdr_stat_img_sel" :0, - "wdr_ltm_data_sel" :1, - "wdr_tz_data_sel" :1, - "wdr_remove_purple_en" :0, - "wdr_over_ex_ratio_th1" :384, - "wdr_over_ex_ratio_th2" :32, - "wdr_fusion_ratio_th" :192, - "wdr_fusion_value1" :64, - "wdr_fusion_value2" :16 + "wdr": { + "wdr_fusion_en": 0, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 0, + "wdr_stab_en": 0, + "wdr_en": 0, + "wdr_ghost_remove_en": 0, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 1, + "wdr_stat_img_sel": 0, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 0, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 }, - "csc":{ - "rgb2yuv_00":153, - "rgb2yuv_01":256, - "rgb2yuv_02":86, - "rgb2yuv_10":301, - "rgb2yuv_11":214, - "rgb2yuv_12":170, - "rgb2yuv_20":58, - "rgb2yuv_21":42, - "rgb2yuv_22":256 + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 }, - "ada":{ - "gm_rgb_en" :1, - "gm_yuv_en" :0, - "ada_en" :1, - "ada_sbz_en" :0, - "ada_ccr_en" :0, - "ada_adp_en" :0, - "ada_adp_ccr_en" :0, - "ada_stat_mode_sel" :0, - "ada_enh_mode_sel" :0, - "ada_hist_max" :128, - "ada_ttl_max" :255, - "ada_win_stth" :0, - "ada_win_sttv" :0, - "ada_win_endh" :1919, - "ada_win_endv" :1079 + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 }, - "rgb-ir":{ - "raw_fmt" :0, - "rgbir_rct_en" :0, - "dfc_en" :0, - "rgbir_fs_en" :0, - "rgbir_ot_sl" :0, - "rgbir_fs_max" :256, - "dfc_krb" :0, - "dfc_ky" :0, - "dfc_th" :256, - "dfc_th_1" :256 + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 }, - "2dnr":{ - "dpeak_en" :1, - "nr2d_raw_en" :1, - "nr2d_eg_en" :1, - "nr2d_jl_en" :1, - "nr2d_av_en" :1, - "nr2d_c_en" :1, - "dpeak_adp_en" :1, - "nr2d_raw_adp_en":1, - "nr2d_y_adp_en" :1, - "nr2d_c_adp_en" :1, - "nr2d_raw_kl" :16, - "nr2d_jl_th" :511, - "nr2d_eg_k" :48, - "nr2d_y_k" :64, - "nr2d_c_k" :1 + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 511, + "nr2d_eg_k": 48, + "nr2d_y_k": 64, + "nr2d_c_k": 1 }, - "3dnr":{ - "nr3d_en" :1, - "nr3dp_y_en" :1, - "nr3dp_c_en" :1, - "nr3dm_y_en" :1, - "nr3dm_c_en" :1, - "nr3db_y_en" :1, - "nr3db_c_en" :1, - "nr3dm_nr2d_y_en" :1, - "nr3dm_nr2d_c_en" :1, - "core_3dnr_wb_en" :0, - "core_3dnr_wb_sel" :0, - "core_3dnr_adp_luma_en" :0, - "core_3dnr_adp_chroma_en" :0, - "nr3dp_thy" :64, - "nr3dp_thyp" :64, - "nr3dp_thcp" :64, - "nr3dm_mid_th" :128, - "nr3dm_mtp_th" :8, - "nr3dm_mtc_th" :128, - "nr3dm_ym_k" :60, - "nr3dm_thy" :64, - "nr3dm_min" :0, - "nr3dm_thw0" :128, - "core_3dnr_chroma_intensity" :16, - "nr3db_nr2d_eg_th" :64, - "nr3db_thyp" :64, - "nr3db_thcp" :32 + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 64, + "nr3dp_thyp": 64, + "nr3dp_thcp": 64, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 60, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 }, - "enh":{ - "ltm":{ - "enh_ltm_en" :1, - "enh_adp_ltm_en" :0, - "ltm_gain" :128, - "ltm_mm_th" :128 + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 }, - "sharp":{ - "enh_sharp_en" :1, - "enh_adp_sharp_en" :1, - "shp_core" :8, - "shp_th1" :3840, - "shp_th2" :4095, - "shp_gain" :64 + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 8, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 64 }, - "cc":{ - "enh_cc_en" :0, - "enh_adp_cc_en" :0 - } + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } }, - "post_ctl":{ - "otc_ctl":{ - "otc_en" :0, - "otc_yc_sl" :0, - "otc_uv_sl" :1, - "otc_hs_plt_sl" :0, - "otc_vs_plt_sl" :0, - "otc_stt_vr" :0, - "otc_stt_hr" :0 + "post_ctl": { + "otc_ctl": { + "otc_en": 1, + "otc_yc_sl": 0, + "otc_uv_sl": 0, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 }, - "ctrst":{ - "ctrst_en" :1, - "ctrst_gain":128 + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 }, - "luma":{ - "luma_en" :1, - "luma_gain":128 + "luma": { + "luma_en": 1, + "luma_gain": 128 }, - "strt":{ - "strt_en" :1, - "strt_gain":250 + "strt": { + "strt_en": 1, + "strt_gain": 250 } }, - "ldc":{ - "ldc_en" :0, - "ldc_rct_en" :0, - "ldc_rq_frq" :128, - "ldc_stt_ln" :540, - "ldc_ch" :960, - "ldc_cv" :540, - "ldc_cr" :684, - "ldc_cz" :684 + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 960, + "ldc_cv": 540, + "ldc_cr": 684, + "ldc_cz": 684 }, - "af":{ - "af_stat_en" :1, - "af_stat_mode_sel" :0, - "af_stat_win_h_start":0, - "af_stat_win_v_start":0, - "af_stat_win_h_end" :1919, - "af_stat_win_v_end" :1079 + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 8, + "af_stat_win_v_start": 4, + "af_stat_win_h_end": 1927, + "af_stat_win_v_end": 1083 } }, - "isp_post":{ - "rgb2yuv":{ - "osd_rgb2yuv_coeff00":306, - "osd_rgb2yuv_coeff01":601, - "osd_rgb2yuv_coeff02":117, - "osd_rgb2yuv_coeff03":0, - "osd_rgb2yuv_coeff10":3920, - "osd_rgb2yuv_coeff11":3749, - "osd_rgb2yuv_coeff12":523, - "osd_rgb2yuv_coeff13":128, - "osd_rgb2yuv_coeff20":523, - "osd_rgb2yuv_coeff21":3658, - "osd_rgb2yuv_coeff22":4011, - "osd_rgb2yuv_coeff23":128 + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 }, - "yuv2rgb":{ - "out_yuv2rgb_coeff00":1024, - "out_yuv2rgb_coeff01":0, - "out_yuv2rgb_coeff02":1441, - "out_yuv2rgb_coeff03":3916, - "out_yuv2rgb_coeff10":1024, - "out_yuv2rgb_coeff11":3742, - "out_yuv2rgb_coeff12":3362, - "out_yuv2rgb_coeff13":136, - "out_yuv2rgb_coeff20":1024, - "out_yuv2rgb_coeff21":1822, - "out_yuv2rgb_coeff22":0, - "out_yuv2rgb_coeff23":3868 + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } }, - "ds0":{ - "ds0_out_rgb_mode":0, - "ds0_out_rgb_en":0, - "ds0_out_yuv_mode":0, - "ds0_out_uv_swap":0, - "ds0_osd0":{ - "ds0_osd0_enable":0, - "ds0_osd0_type":0, - "ds0_osd0_alpha_tpye":0, - "ds0_osd0_vst":0, - "ds0_osd0_hst":0, - "ds0_osd0_vend":0, - "ds0_osd0_hend":0, - "ds0_osd0_dma_request_length":0, - "ds0_osd0_dma_map":0, - "ds0_osd0_rgb_rev":0, - "ds0_osd0_global_alpha":0, - "ds0_osd0_swap_64":0, - "ds0_osd0_outstanding_num":0, - "ds0_osd0_bd_limit_en":0 - }, - "ds0_osd1":{ - "ds0_osd1_enable":0, - "ds0_osd1_type":0, - "ds0_osd1_alpha_tpye":0, - "ds0_osd1_vst":0, - "ds0_osd1_hst":0, - "ds0_osd1_vend":0, - "ds0_osd1_hend":0, - "ds0_osd1_dma_request_length":0, - "ds0_osd1_dma_map":0, - "ds0_osd1_rgb_rev":0, - "ds0_osd1_global_alpha":0, - "ds0_osd1_swap_64":0, - "ds0_osd1_outstanding_num":0, - "ds0_osd1_bd_limit_en":0 - }, - "ds0_osd2":{ - "ds0_osd2_enable":0, - "ds0_osd2_type":0, - "ds0_osd2_alpha_tpye":0, - "ds0_osd2_vst":0, - "ds0_osd2_hst":0, - "ds0_osd2_vend":0, - "ds0_osd2_hend":0, - "ds0_osd2_dma_request_length":0, - "ds0_osd2_dma_map":0, - "ds0_osd2_rgb_rev":0, - "ds0_osd2_global_alpha":0, - "ds0_osd2_swap_64":0, - "ds0_osd2_outstanding_num":0, - "ds0_osd2_bd_limit_en":0 - } - }, - "ds1":{ - "ds1_out_rgb_mode":0, - "ds1_out_rgb_en":0, - "ds1_out_yuv_mode":0, - "ds1_out_uv_swap":0, - "ds1_osd0":{ - "ds1_osd0_enable":0, - "ds1_osd0_type":0, - "ds1_osd0_alpha_tpye":0, - "ds1_osd0_vst":0, - "ds1_osd0_hst":0, - "ds1_osd0_vend":0, - "ds1_osd0_hend":0, - "ds1_osd0_dma_request_length":0, - "ds1_osd0_dma_map":0, - "ds1_osd0_rgb_rev":0, - "ds1_osd0_global_alpha":0, - "ds1_osd0_swap_64":0, - "ds1_osd0_outstanding_num":0, - "ds1_osd0_bd_limit_en":0 - }, - "ds1_osd1":{ - "ds1_osd1_enable":0, - "ds1_osd1_type":0, - "ds1_osd1_alpha_tpye":0, - "ds1_osd1_vst":0, - "ds1_osd1_hst":0, - "ds1_osd1_vend":0, - "ds1_osd1_hend":0, - "ds1_osd1_dma_request_length":0, - "ds1_osd1_dma_map":0, - "ds1_osd1_rgb_rev":0, - "ds1_osd1_global_alpha":0, - "ds1_osd1_swap_64":0, - "ds1_osd1_outstanding_num":0, - "ds1_osd1_bd_limit_en":0 - }, - "ds1_osd2":{ - "ds1_osd2_enable":0, - "ds1_osd2_type":0, - "ds1_osd2_alpha_tpye":0, - "ds1_osd2_vst":0, - "ds1_osd2_hst":0, - "ds1_osd2_vend":0, - "ds1_osd2_hend":0, - "ds1_osd2_dma_request_length":0, - "ds1_osd2_dma_map":0, - "ds1_osd2_rgb_rev":0, - "ds1_osd2_global_alpha":0, - "ds1_osd2_swap_64":0, - "ds1_osd2_outstanding_num":0, - "ds1_osd2_bd_limit_en":0 - } - }, - "ds2":{ - "ds2_out_rgb_mode":0, - "ds2_out_rgb_en":1, - "ds2_out_yuv_mode":0, - "ds2_out_uv_swap":0, - "ds2_osd0":{ - "ds2_osd0_enable":0, - "ds2_osd0_type":0, - "ds2_osd0_alpha_tpye":0, - "ds2_osd0_vst":0, - "ds2_osd0_hst":0, - "ds2_osd0_vend":0, - "ds2_osd0_hend":0, - "ds2_osd0_dma_request_length":0, - "ds2_osd0_dma_map":0, - "ds2_osd0_rgb_rev":0, - "ds2_osd0_global_alpha":0, - "ds2_osd0_swap_64":0, - "ds2_osd0_outstanding_num":0, - "ds2_osd0_bd_limit_en":0 - }, - "ds2_osd1":{ - "ds2_osd1_enable":0, - "ds2_osd1_type":0, - "ds2_osd1_alpha_tpye":0, - "ds2_osd1_vst":0, - "ds2_osd1_hst":0, - "ds2_osd1_vend":0, - "ds2_osd1_hend":0, - "ds2_osd1_dma_request_length":0, - "ds2_osd1_dma_map":0, - "ds2_osd1_rgb_rev":0, - "ds2_osd1_global_alpha":0, - "ds2_osd1_swap_64":0, - "ds2_osd1_outstanding_num":0, - "ds2_osd1_bd_limit_en":0 - } - } + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } } -} \ No newline at end of file +} diff --git a/package/encode_app/src/imx219_1.conf b/package/encode_app/src/imx219_1.conf index 9d05d58..1ed1520 100644 --- a/package/encode_app/src/imx219_1.conf +++ b/package/encode_app/src/imx219_1.conf @@ -1,531 +1,531 @@ { - "isp_general":{ - "isp_out_sel":0, - "dvp_ch_mode":1, - "hist_3a_out_en":0, - "main_out":{ - "out_img_format":1, - "out_yuv_in_format":0, - "out_yuv422_pxl_order":0, - "out_pxl_width":0, - "out_frame_buf_size":2048 + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 }, - "out0":{ - "ds0_out_img_format":1, - "ds0_out_yuv_in_format":0, - "ds0_out_yuv422_pxl_order":0, - "ds0_out_pxl_width":0, - "ds0_frame_buf_size":2048 + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 }, - "out1":{ - "ds1_out_img_format":1, - "ds1_out_yuv_in_format":0, - "ds1_out_yuv422_pxl_order":0, - "ds1_out_pxl_width":0, - "ds1_frame_buf_size":2048 + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 }, - "out2":{ - "ds2_out_img_format":0, - "ds2_out_yuv_in_format":0, - "ds2_out_yuv422_pxl_order":0, - "ds2_out_pxl_width":0, - "ds2_frame_buf_size":2048 + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 }, - "wdr":{ - "wdr_mode":0, - "wdr_long_ch_mode":0, - "wdr_long_l2_buf_en":0, - "wdr_short_s1_buf_en":0, - "wdr_dynamic_switch_en":0, - "wdr_long_l2_buf_depth":0, - "wdr_long_img_format":0, - "wdr_long_yuv_in_format":0, - "wdr_long_img_out_format":0, - "wdr_long_yuv422_pxl_order":0, - "wdr_long_pixel_width":2, - "wdr_buf_base":0, - "wdr_line_stride":0, - "wdr_frame_buf_size":0 - }, - "nr3d":{ - "nr3d_en":0, - "nr3d_fbcd_en":0, - "nr3d_mv_out_en":0, - "nr3d_y_img_format":0, - "nr3d_y_yuv_in_format":0, - "nr3d_y_img_out_format":0, - "nr3d_y_yuv422_pxl_order":0, - "nr3d_y_pixel_width":2, - "nr3d_uv_img_format":0, - "nr3d_uv_yuv_in_format":0, - "nr3d_uv_mig_out_format":0, - "nr3d_uv_yuv422_pxl_order":0, - "nr3d_uv_pixel_width":2, - "nr3d_frame_buf_size":0 - }, - "ldc":{ - "ldc_line_stride":2048, - "ldc_frame_buf_size":2048 - } + "wdr": { + "wdr_mode": 0, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } }, - "isp_core": { + "isp_core": { "itc": { - "hsync_pol":0, - "vsync_pol":0, - "hsync_input_timing":2, - "vsync_input_timing":1, - "flip_ctl" :0, - "video_fmt_sl":0, - "itc_ttl_h" :3476, - "itc_ttl_v" :1166, - "itc_stt_hr" :0, - "itc_stt_vr" :1 + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 2, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 3476, + "itc_ttl_v": 1166, + "itc_stt_hr": 0, + "itc_stt_vr": 1 }, - "tpg": { - "tpg_en":0, - "bayer_mode_sel":3, - "motion_mode_sel":0, - "tpg_sel":9, - "wdr_l_mul_data":0, - "wdr_m_mul_data":0, - "wdr_s_mul_data":0 + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 }, - "blc":{ - "blc_en" :1, - "blc_offset" :240, - "blc_ratio" :272 + "blc": { + "blc_en": 1, + "blc_offset": 240, + "blc_ratio": 272 }, - "lsc":{ - "lsc_en" :1, - "lsc_h_center" :900, - "lsc_v_center" :580, - "lsc_r_ratio" :10, - "lsc_g_ratio":6, - "lsc_b_ratio" :6, - "lsc_ir_ratio" :6 + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 10, + "lsc_g_ratio": 6, + "lsc_b_ratio": 6, + "lsc_ir_ratio": 6 }, - "ae":{ - "ae_as_en" :1, - "ae_ag_en" :1, - "ae_airis_en" :0, - "ae_enter_ls_sel" :0, - "ae_exit_ls_sel" :0, - "ae_win_mode_sel" :0, - "ae_back_light_mode_sel" :0, - "ae_day_change_en" :0, - "ae_day_change_sel" :0, - "ae_win_stth" :0, - "ae_win_sttv" :0, - "ae_win_endh" :1919, - "ae_win_endv" :1079, - "ae_yobj" :90, - "ae_av_rg" :8, - "ae_l_ex_time" :1000, - "ae_m_ex_time" :32, - "ae_s_ex_time" :32, - "ae_agc" :256, - "ae_ad_shuttle_freq" :1, - "ae_ad_gain_freq" :0, - "ae_adjust_step_max":36, - "ae_ex_value_max" :1162, - "ae_ex_value_mid" :256, - "ae_ex_value_min" :1, - "ae_gain_value_max" :2304, - "ae_gain_value_mid" :512, - "ae_gain_value_min" :256, - "ae_dn_switch_ad_step_max" :512, - "ae_dn_switch_wait_time" :255, - "ape_max_diff" :12, - "ape_drv_signal_max" :3840, - "ape_coeff_distance" :0, - "ape_coeff_speed" :0, - "ape_coeff_acceleration" :0, - "ape_drv_manual_value" :4095, - "ape_damp_manual_value" :2048 + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 0, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 8, + "ae_win_sttv": 4, + "ae_win_endh": 1927, + "ae_win_endv": 1083, + "ae_yobj": 90, + "ae_av_rg": 8, + "ae_l_ex_time": 1000, + "ae_m_ex_time": 32, + "ae_s_ex_time": 32, + "ae_agc": 256, + "ae_ad_shuttle_freq": 0, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 1162, + "ae_ex_value_mid": 256, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 }, - "awb":{ - "awb_d65_en" :1, - "awb_ccm_en" :1, - "awb_en" :1, - "awb_mode_sel" :1, - "awb_hist_mode_sel" :0, - "awb_veri_en" :0, - "awb_fb_en" :0, - "awb_value_save_en" :0, - "awb_ccm_adp_adjust_en" :0, - "awb_stab_en" :1, - "awb_d65_red_gain" :466, - "awb_d65_blue_gain" :382, - "ccm_rr" :259, - "ccm_rg" :2, - "ccm_rb" :1, - "ccm_gr" :37, - "ccm_gg" :310, - "ccm_gb" :17, - "ccm_br" :1, - "ccm_bg" :75, - "ccm_bb" :332, - "ccm_correct_coff" :256, - "awb_win_stth" :0, - "awb_win_sttv" :0, - "awb_win_endh" :1919, - "awb_win_endv" :1079, - "awb_correct_diff_th" :8, - "awb_color_changeres_time" :8, - "awb_historgram_th" :4, - "awb_red_gain_adjust" :256, - "awb_green_gain_adjust" :256, - "awb_blue_gain_adjust" :256, - "awb_red_max_value" :259, - "awb_blue_max_value" :388, - "awb_red_min_value" :176, - "awb_blue_min_value" :262, - "awb_red_obj_value" :256, - "awb_blue_obj_value" :256 + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 466, + "awb_d65_blue_gain": 382, + "ccm_rr": 259, + "ccm_rg": 2, + "ccm_rb": 1, + "ccm_gr": 37, + "ccm_gg": 310, + "ccm_gb": 17, + "ccm_br": 1, + "ccm_bg": 75, + "ccm_bb": 332, + "ccm_correct_coff": 256, + "awb_win_stth": 8, + "awb_win_sttv": 4, + "awb_win_endh": 1927, + "awb_win_endv": 1083, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 259, + "awb_blue_max_value": 388, + "awb_red_min_value": 176, + "awb_blue_min_value": 262, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 }, - "wdr":{ - "wdr_fusion_en" :0, - "wdr_frame_sel" :0, - "wdr_adp_adjust_en" :0, - "wdr_stab_en" :0, - "wdr_en" :0, - "wdr_ghost_remove_en" :0, - "wdr_3frame_out_mode" :0, - "wdr_mode_sel" :0, - "wdr_2frame_ex_ratio" :1, - "wdr_3frame_ex_ratio" :1, - "wdr_stat_img_sel" :0, - "wdr_ltm_data_sel" :1, - "wdr_tz_data_sel" :1, - "wdr_remove_purple_en" :0, - "wdr_over_ex_ratio_th1" :384, - "wdr_over_ex_ratio_th2" :32, - "wdr_fusion_ratio_th" :192, - "wdr_fusion_value1" :64, - "wdr_fusion_value2" :16 + "wdr": { + "wdr_fusion_en": 0, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 0, + "wdr_stab_en": 0, + "wdr_en": 0, + "wdr_ghost_remove_en": 0, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 1, + "wdr_stat_img_sel": 0, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 0, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 }, - "csc":{ - "rgb2yuv_00":153, - "rgb2yuv_01":256, - "rgb2yuv_02":86, - "rgb2yuv_10":301, - "rgb2yuv_11":214, - "rgb2yuv_12":170, - "rgb2yuv_20":58, - "rgb2yuv_21":42, - "rgb2yuv_22":256 + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 }, - "ada":{ - "gm_rgb_en" :1, - "gm_yuv_en" :0, - "ada_en" :1, - "ada_sbz_en" :0, - "ada_ccr_en" :0, - "ada_adp_en" :0, - "ada_adp_ccr_en" :0, - "ada_stat_mode_sel" :0, - "ada_enh_mode_sel" :0, - "ada_hist_max" :128, - "ada_ttl_max" :255, - "ada_win_stth" :0, - "ada_win_sttv" :0, - "ada_win_endh" :1919, - "ada_win_endv" :1079 + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 }, - "rgb-ir":{ - "raw_fmt" :0, - "rgbir_rct_en" :0, - "dfc_en" :0, - "rgbir_fs_en" :0, - "rgbir_ot_sl" :0, - "rgbir_fs_max" :256, - "dfc_krb" :0, - "dfc_ky" :0, - "dfc_th" :256, - "dfc_th_1" :256 + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 }, - "2dnr":{ - "dpeak_en" :1, - "nr2d_raw_en" :1, - "nr2d_eg_en" :1, - "nr2d_jl_en" :1, - "nr2d_av_en" :1, - "nr2d_c_en" :1, - "dpeak_adp_en" :1, - "nr2d_raw_adp_en":1, - "nr2d_y_adp_en" :1, - "nr2d_c_adp_en" :1, - "nr2d_raw_kl" :16, - "nr2d_jl_th" :511, - "nr2d_eg_k" :48, - "nr2d_y_k" :64, - "nr2d_c_k" :1 + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 511, + "nr2d_eg_k": 48, + "nr2d_y_k": 64, + "nr2d_c_k": 1 }, - "3dnr":{ - "nr3d_en" :1, - "nr3dp_y_en" :1, - "nr3dp_c_en" :1, - "nr3dm_y_en" :1, - "nr3dm_c_en" :1, - "nr3db_y_en" :1, - "nr3db_c_en" :1, - "nr3dm_nr2d_y_en" :1, - "nr3dm_nr2d_c_en" :1, - "core_3dnr_wb_en" :0, - "core_3dnr_wb_sel" :0, - "core_3dnr_adp_luma_en" :0, - "core_3dnr_adp_chroma_en" :0, - "nr3dp_thy" :64, - "nr3dp_thyp" :64, - "nr3dp_thcp" :64, - "nr3dm_mid_th" :128, - "nr3dm_mtp_th" :8, - "nr3dm_mtc_th" :128, - "nr3dm_ym_k" :60, - "nr3dm_thy" :64, - "nr3dm_min" :0, - "nr3dm_thw0" :128, - "core_3dnr_chroma_intensity" :16, - "nr3db_nr2d_eg_th" :64, - "nr3db_thyp" :64, - "nr3db_thcp" :32 + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 64, + "nr3dp_thyp": 64, + "nr3dp_thcp": 64, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 60, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 }, - "enh":{ - "ltm":{ - "enh_ltm_en" :1, - "enh_adp_ltm_en" :0, - "ltm_gain" :128, - "ltm_mm_th" :128 + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 }, - "sharp":{ - "enh_sharp_en" :1, - "enh_adp_sharp_en" :1, - "shp_core" :8, - "shp_th1" :3840, - "shp_th2" :4095, - "shp_gain" :64 + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 8, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 64 }, - "cc":{ - "enh_cc_en" :0, - "enh_adp_cc_en" :0 - } + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } }, - "post_ctl":{ - "otc_ctl":{ - "otc_en" :0, - "otc_yc_sl" :0, - "otc_uv_sl" :1, - "otc_hs_plt_sl" :0, - "otc_vs_plt_sl" :0, - "otc_stt_vr" :0, - "otc_stt_hr" :0 + "post_ctl": { + "otc_ctl": { + "otc_en": 1, + "otc_yc_sl": 0, + "otc_uv_sl": 0, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 }, - "ctrst":{ - "ctrst_en" :1, - "ctrst_gain":128 + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 }, - "luma":{ - "luma_en" :1, - "luma_gain":128 + "luma": { + "luma_en": 1, + "luma_gain": 128 }, - "strt":{ - "strt_en" :1, - "strt_gain":250 + "strt": { + "strt_en": 1, + "strt_gain": 250 } }, - "ldc":{ - "ldc_en" :0, - "ldc_rct_en" :0, - "ldc_rq_frq" :128, - "ldc_stt_ln" :540, - "ldc_ch" :960, - "ldc_cv" :540, - "ldc_cr" :684, - "ldc_cz" :684 + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 960, + "ldc_cv": 540, + "ldc_cr": 684, + "ldc_cz": 684 }, - "af":{ - "af_stat_en" :1, - "af_stat_mode_sel" :0, - "af_stat_win_h_start":0, - "af_stat_win_v_start":0, - "af_stat_win_h_end" :1919, - "af_stat_win_v_end" :1079 + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 8, + "af_stat_win_v_start": 4, + "af_stat_win_h_end": 1927, + "af_stat_win_v_end": 1083 } }, - "isp_post":{ - "rgb2yuv":{ - "osd_rgb2yuv_coeff00":306, - "osd_rgb2yuv_coeff01":601, - "osd_rgb2yuv_coeff02":117, - "osd_rgb2yuv_coeff03":0, - "osd_rgb2yuv_coeff10":3920, - "osd_rgb2yuv_coeff11":3749, - "osd_rgb2yuv_coeff12":523, - "osd_rgb2yuv_coeff13":128, - "osd_rgb2yuv_coeff20":523, - "osd_rgb2yuv_coeff21":3658, - "osd_rgb2yuv_coeff22":4011, - "osd_rgb2yuv_coeff23":128 + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 }, - "yuv2rgb":{ - "out_yuv2rgb_coeff00":1024, - "out_yuv2rgb_coeff01":0, - "out_yuv2rgb_coeff02":1441, - "out_yuv2rgb_coeff03":3916, - "out_yuv2rgb_coeff10":1024, - "out_yuv2rgb_coeff11":3742, - "out_yuv2rgb_coeff12":3362, - "out_yuv2rgb_coeff13":136, - "out_yuv2rgb_coeff20":1024, - "out_yuv2rgb_coeff21":1822, - "out_yuv2rgb_coeff22":0, - "out_yuv2rgb_coeff23":3868 + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } }, - "ds0":{ - "ds0_out_rgb_mode":0, - "ds0_out_rgb_en":0, - "ds0_out_yuv_mode":0, - "ds0_out_uv_swap":0, - "ds0_osd0":{ - "ds0_osd0_enable":0, - "ds0_osd0_type":0, - "ds0_osd0_alpha_tpye":0, - "ds0_osd0_vst":0, - "ds0_osd0_hst":0, - "ds0_osd0_vend":0, - "ds0_osd0_hend":0, - "ds0_osd0_dma_request_length":0, - "ds0_osd0_dma_map":0, - "ds0_osd0_rgb_rev":0, - "ds0_osd0_global_alpha":0, - "ds0_osd0_swap_64":0, - "ds0_osd0_outstanding_num":0, - "ds0_osd0_bd_limit_en":0 - }, - "ds0_osd1":{ - "ds0_osd1_enable":0, - "ds0_osd1_type":0, - "ds0_osd1_alpha_tpye":0, - "ds0_osd1_vst":0, - "ds0_osd1_hst":0, - "ds0_osd1_vend":0, - "ds0_osd1_hend":0, - "ds0_osd1_dma_request_length":0, - "ds0_osd1_dma_map":0, - "ds0_osd1_rgb_rev":0, - "ds0_osd1_global_alpha":0, - "ds0_osd1_swap_64":0, - "ds0_osd1_outstanding_num":0, - "ds0_osd1_bd_limit_en":0 - }, - "ds0_osd2":{ - "ds0_osd2_enable":0, - "ds0_osd2_type":0, - "ds0_osd2_alpha_tpye":0, - "ds0_osd2_vst":0, - "ds0_osd2_hst":0, - "ds0_osd2_vend":0, - "ds0_osd2_hend":0, - "ds0_osd2_dma_request_length":0, - "ds0_osd2_dma_map":0, - "ds0_osd2_rgb_rev":0, - "ds0_osd2_global_alpha":0, - "ds0_osd2_swap_64":0, - "ds0_osd2_outstanding_num":0, - "ds0_osd2_bd_limit_en":0 - } - }, - "ds1":{ - "ds1_out_rgb_mode":0, - "ds1_out_rgb_en":0, - "ds1_out_yuv_mode":0, - "ds1_out_uv_swap":0, - "ds1_osd0":{ - "ds1_osd0_enable":0, - "ds1_osd0_type":0, - "ds1_osd0_alpha_tpye":0, - "ds1_osd0_vst":0, - "ds1_osd0_hst":0, - "ds1_osd0_vend":0, - "ds1_osd0_hend":0, - "ds1_osd0_dma_request_length":0, - "ds1_osd0_dma_map":0, - "ds1_osd0_rgb_rev":0, - "ds1_osd0_global_alpha":0, - "ds1_osd0_swap_64":0, - "ds1_osd0_outstanding_num":0, - "ds1_osd0_bd_limit_en":0 - }, - "ds1_osd1":{ - "ds1_osd1_enable":0, - "ds1_osd1_type":0, - "ds1_osd1_alpha_tpye":0, - "ds1_osd1_vst":0, - "ds1_osd1_hst":0, - "ds1_osd1_vend":0, - "ds1_osd1_hend":0, - "ds1_osd1_dma_request_length":0, - "ds1_osd1_dma_map":0, - "ds1_osd1_rgb_rev":0, - "ds1_osd1_global_alpha":0, - "ds1_osd1_swap_64":0, - "ds1_osd1_outstanding_num":0, - "ds1_osd1_bd_limit_en":0 - }, - "ds1_osd2":{ - "ds1_osd2_enable":0, - "ds1_osd2_type":0, - "ds1_osd2_alpha_tpye":0, - "ds1_osd2_vst":0, - "ds1_osd2_hst":0, - "ds1_osd2_vend":0, - "ds1_osd2_hend":0, - "ds1_osd2_dma_request_length":0, - "ds1_osd2_dma_map":0, - "ds1_osd2_rgb_rev":0, - "ds1_osd2_global_alpha":0, - "ds1_osd2_swap_64":0, - "ds1_osd2_outstanding_num":0, - "ds1_osd2_bd_limit_en":0 - } - }, - "ds2":{ - "ds2_out_rgb_mode":0, - "ds2_out_rgb_en":1, - "ds2_out_yuv_mode":0, - "ds2_out_uv_swap":0, - "ds2_osd0":{ - "ds2_osd0_enable":0, - "ds2_osd0_type":0, - "ds2_osd0_alpha_tpye":0, - "ds2_osd0_vst":0, - "ds2_osd0_hst":0, - "ds2_osd0_vend":0, - "ds2_osd0_hend":0, - "ds2_osd0_dma_request_length":0, - "ds2_osd0_dma_map":0, - "ds2_osd0_rgb_rev":0, - "ds2_osd0_global_alpha":0, - "ds2_osd0_swap_64":0, - "ds2_osd0_outstanding_num":0, - "ds2_osd0_bd_limit_en":0 - }, - "ds2_osd1":{ - "ds2_osd1_enable":0, - "ds2_osd1_type":0, - "ds2_osd1_alpha_tpye":0, - "ds2_osd1_vst":0, - "ds2_osd1_hst":0, - "ds2_osd1_vend":0, - "ds2_osd1_hend":0, - "ds2_osd1_dma_request_length":0, - "ds2_osd1_dma_map":0, - "ds2_osd1_rgb_rev":0, - "ds2_osd1_global_alpha":0, - "ds2_osd1_swap_64":0, - "ds2_osd1_outstanding_num":0, - "ds2_osd1_bd_limit_en":0 - } - } + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } } -} \ No newline at end of file +} diff --git a/package/encode_app/src/imx219_1080x1920_0.conf b/package/encode_app/src/imx219_1080x1920_0.conf new file mode 100644 index 0000000..7a46fb2 --- /dev/null +++ b/package/encode_app/src/imx219_1080x1920_0.conf @@ -0,0 +1,531 @@ +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 0, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 2, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 3453, + "itc_ttl_v": 1977, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 240, + "blc_ratio": 272 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 480, + "lsc_v_center": 1000, + "lsc_r_ratio": 10, + "lsc_g_ratio": 6, + "lsc_b_ratio": 6, + "lsc_ir_ratio": 6 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 0, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 4, + "ae_win_sttv": 4, + "ae_win_endh": 1083, + "ae_win_endv": 1923, + "ae_yobj": 90, + "ae_av_rg": 8, + "ae_l_ex_time": 1000, + "ae_m_ex_time": 32, + "ae_s_ex_time": 32, + "ae_agc": 256, + "ae_ad_shuttle_freq": 0, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 1973, + "ae_ex_value_mid": 256, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 1000, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 466, + "awb_d65_blue_gain": 382, + "ccm_rr": 259, + "ccm_rg": 2, + "ccm_rb": 1, + "ccm_gr": 37, + "ccm_gg": 310, + "ccm_gb": 17, + "ccm_br": 1, + "ccm_bg": 75, + "ccm_bb": 332, + "ccm_correct_coff": 256, + "awb_win_stth": 4, + "awb_win_sttv": 4, + "awb_win_endh": 1083, + "awb_win_endv": 1923, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 259, + "awb_blue_max_value": 388, + "awb_red_min_value": 176, + "awb_blue_min_value": 262, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 0, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 0, + "wdr_stab_en": 0, + "wdr_en": 0, + "wdr_ghost_remove_en": 0, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 1, + "wdr_stat_img_sel": 0, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 0, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1079, + "ada_win_endv": 1919 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 511, + "nr2d_eg_k": 48, + "nr2d_y_k": 64, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 64, + "nr3dp_thyp": 64, + "nr3dp_thcp": 64, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 60, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 8, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 64 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 1, + "otc_yc_sl": 0, + "otc_uv_sl": 0, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 250 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 480, + "ldc_cv": 1000, + "ldc_cr": 684, + "ldc_cz": 684 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 4, + "af_stat_win_v_start": 4, + "af_stat_win_h_end": 1083, + "af_stat_win_v_end": 1923 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/encode_app/src/imx219_1080x1920_1.conf b/package/encode_app/src/imx219_1080x1920_1.conf new file mode 100644 index 0000000..7a46fb2 --- /dev/null +++ b/package/encode_app/src/imx219_1080x1920_1.conf @@ -0,0 +1,531 @@ +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 0, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 2, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 3453, + "itc_ttl_v": 1977, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 240, + "blc_ratio": 272 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 480, + "lsc_v_center": 1000, + "lsc_r_ratio": 10, + "lsc_g_ratio": 6, + "lsc_b_ratio": 6, + "lsc_ir_ratio": 6 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 0, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 4, + "ae_win_sttv": 4, + "ae_win_endh": 1083, + "ae_win_endv": 1923, + "ae_yobj": 90, + "ae_av_rg": 8, + "ae_l_ex_time": 1000, + "ae_m_ex_time": 32, + "ae_s_ex_time": 32, + "ae_agc": 256, + "ae_ad_shuttle_freq": 0, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 1973, + "ae_ex_value_mid": 256, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 1000, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 466, + "awb_d65_blue_gain": 382, + "ccm_rr": 259, + "ccm_rg": 2, + "ccm_rb": 1, + "ccm_gr": 37, + "ccm_gg": 310, + "ccm_gb": 17, + "ccm_br": 1, + "ccm_bg": 75, + "ccm_bb": 332, + "ccm_correct_coff": 256, + "awb_win_stth": 4, + "awb_win_sttv": 4, + "awb_win_endh": 1083, + "awb_win_endv": 1923, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 259, + "awb_blue_max_value": 388, + "awb_red_min_value": 176, + "awb_blue_min_value": 262, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 0, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 0, + "wdr_stab_en": 0, + "wdr_en": 0, + "wdr_ghost_remove_en": 0, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 1, + "wdr_stat_img_sel": 0, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 0, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1079, + "ada_win_endv": 1919 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 511, + "nr2d_eg_k": 48, + "nr2d_y_k": 64, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 64, + "nr3dp_thyp": 64, + "nr3dp_thcp": 64, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 60, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 8, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 64 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 1, + "otc_yc_sl": 0, + "otc_uv_sl": 0, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 250 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 480, + "ldc_cv": 1000, + "ldc_cr": 684, + "ldc_cz": 684 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 4, + "af_stat_win_v_start": 4, + "af_stat_win_h_end": 1083, + "af_stat_win_v_end": 1923 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/encode_app/src/imx385_2frame.conf b/package/encode_app/src/imx385_2frame.conf new file mode 100644 index 0000000..4e6a8a4 --- /dev/null +++ b/package/encode_app/src/imx385_2frame.conf @@ -0,0 +1,531 @@ +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 1, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 1, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 2200, + "itc_ttl_v": 2250, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 224, + "blc_ratio": 271 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 4, + "lsc_g_ratio": 4, + "lsc_b_ratio": 4, + "lsc_ir_ratio": 4 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 1, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 0, + "ae_win_sttv": 0, + "ae_win_endh": 1919, + "ae_win_endv": 1079, + "ae_yobj": 100, + "ae_av_rg": 14, + "ae_l_ex_time": 675, + "ae_m_ex_time": 34, + "ae_s_ex_time": 32, + "ae_agc": 256, + "ae_ad_shuttle_freq": 1, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 2209, + "ae_ex_value_mid": 34, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 508, + "awb_d65_blue_gain": 423, + "ccm_rr": 256, + "ccm_rg": 0, + "ccm_rb": 0, + "ccm_gr": 83, + "ccm_gg": 361, + "ccm_gb": 22, + "ccm_br": 0, + "ccm_bg": 44, + "ccm_bb": 300, + "ccm_correct_coff": 256, + "awb_win_stth": 0, + "awb_win_sttv": 0, + "awb_win_endh": 1919, + "awb_win_endv": 1079, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 252, + "awb_blue_max_value": 423, + "awb_red_min_value": 174, + "awb_blue_min_value": 265, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 1, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 1, + "wdr_stab_en": 1, + "wdr_en": 1, + "wdr_ghost_remove_en": 1, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 0, + "wdr_3frame_ex_ratio": 0, + "wdr_stat_img_sel": 2, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 1, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 128, + "nr2d_eg_k": 32, + "nr2d_y_k": 32, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 255, + "nr3dp_thyp": 255, + "nr3dp_thcp": 32, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 8, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 4, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 160 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 0, + "otc_yc_sl": 0, + "otc_uv_sl": 1, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 210 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 880, + "ldc_cv": 480, + "ldc_cr": 2000, + "ldc_cz": 2000 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 0, + "af_stat_win_v_start": 0, + "af_stat_win_h_end": 1919, + "af_stat_win_v_end": 1079 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/encode_app/src/imx385_3frame.conf b/package/encode_app/src/imx385_3frame.conf new file mode 100644 index 0000000..0326f56 --- /dev/null +++ b/package/encode_app/src/imx385_3frame.conf @@ -0,0 +1,531 @@ +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 2, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 1, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 2200, + "itc_ttl_v": 4500, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 224, + "blc_ratio": 271 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 4, + "lsc_g_ratio": 4, + "lsc_b_ratio": 4, + "lsc_ir_ratio": 4 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 1, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 0, + "ae_win_sttv": 0, + "ae_win_endh": 1919, + "ae_win_endv": 1079, + "ae_yobj": 100, + "ae_av_rg": 14, + "ae_l_ex_time": 1350, + "ae_m_ex_time": 32, + "ae_s_ex_time": 4, + "ae_agc": 256, + "ae_ad_shuttle_freq": 1, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 4436, + "ae_ex_value_mid": 32, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 508, + "awb_d65_blue_gain": 423, + "ccm_rr": 256, + "ccm_rg": 0, + "ccm_rb": 0, + "ccm_gr": 83, + "ccm_gg": 361, + "ccm_gb": 22, + "ccm_br": 0, + "ccm_bg": 44, + "ccm_bb": 300, + "ccm_correct_coff": 256, + "awb_win_stth": 0, + "awb_win_sttv": 0, + "awb_win_endh": 1919, + "awb_win_endv": 1079, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 252, + "awb_blue_max_value": 423, + "awb_red_min_value": 174, + "awb_blue_min_value": 265, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 1, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 1, + "wdr_stab_en": 1, + "wdr_en": 1, + "wdr_ghost_remove_en": 1, + "wdr_3frame_out_mode": 1, + "wdr_mode_sel": 1, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 2, + "wdr_stat_img_sel": 2, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 1, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 128, + "nr2d_eg_k": 32, + "nr2d_y_k": 32, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 255, + "nr3dp_thyp": 255, + "nr3dp_thcp": 32, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 8, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 4, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 160 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 0, + "otc_yc_sl": 0, + "otc_uv_sl": 1, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 210 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 880, + "ldc_cv": 480, + "ldc_cr": 2000, + "ldc_cz": 2000 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 0, + "af_stat_win_v_start": 0, + "af_stat_win_h_end": 1919, + "af_stat_win_v_end": 1079 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/encode_app/src/imx385_normal.conf b/package/encode_app/src/imx385_normal.conf new file mode 100644 index 0000000..08e9215 --- /dev/null +++ b/package/encode_app/src/imx385_normal.conf @@ -0,0 +1,531 @@ +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 0, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 1, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 2200, + "itc_ttl_v": 1125, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 224, + "blc_ratio": 271 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 4, + "lsc_g_ratio": 4, + "lsc_b_ratio": 4, + "lsc_ir_ratio": 4 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 1, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 0, + "ae_win_sttv": 0, + "ae_win_endh": 1919, + "ae_win_endv": 1079, + "ae_yobj": 100, + "ae_av_rg": 14, + "ae_l_ex_time": 338, + "ae_m_ex_time": 34, + "ae_s_ex_time": 4, + "ae_agc": 256, + "ae_ad_shuttle_freq": 1, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 1122, + "ae_ex_value_mid": 34, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 508, + "awb_d65_blue_gain": 423, + "ccm_rr": 256, + "ccm_rg": 0, + "ccm_rb": 0, + "ccm_gr": 83, + "ccm_gg": 361, + "ccm_gb": 22, + "ccm_br": 0, + "ccm_bg": 44, + "ccm_bb": 300, + "ccm_correct_coff": 256, + "awb_win_stth": 0, + "awb_win_sttv": 0, + "awb_win_endh": 1919, + "awb_win_endv": 1079, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 252, + "awb_blue_max_value": 423, + "awb_red_min_value": 174, + "awb_blue_min_value": 265, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 0, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 0, + "wdr_stab_en": 0, + "wdr_en": 0, + "wdr_ghost_remove_en": 0, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 1, + "wdr_stat_img_sel": 1, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 0, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 128, + "nr2d_eg_k": 32, + "nr2d_y_k": 32, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 255, + "nr3dp_thyp": 255, + "nr3dp_thcp": 32, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 8, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 4, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 160 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 0, + "otc_yc_sl": 0, + "otc_uv_sl": 1, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 210 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 880, + "ldc_cv": 480, + "ldc_cr": 2000, + "ldc_cz": 2000 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 0, + "af_stat_win_v_start": 0, + "af_stat_win_h_end": 1919, + "af_stat_win_v_end": 1079 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/encode_app/src/imx385_video_1920x1080_2frame.conf b/package/encode_app/src/imx385_video_1920x1080_2frame.conf new file mode 100644 index 0000000..739f3a3 --- /dev/null +++ b/package/encode_app/src/imx385_video_1920x1080_2frame.conf @@ -0,0 +1,322 @@ +{ + "sensor0": { + "sensor0_name": "m00_f_IMX385 0-001a", + "sensor0_cfg_file": "imx385_2frame.conf", + "sensor0_total_size": { + "sensor0_total_width": 2200, + "sensor0_total_height": 1125 + }, + "sensor0_active_size": { + "sensor0_active_width": 1920, + "sensor0_active_height": 1080 + }, + "/dev/video2": { + "video2_used": 0, + "video2_width": 1920, + "video2_height": 1080, + "video2_out_format": 1 + }, + "/dev/video3": { + "video3_used": 1, + "video3_width": 1080, + "video3_height": 608, + "video3_out_format": 1 + }, + "/dev/video4": { + "video4_used": 0, + "video4_width": 800, + "video4_height": 1080, + "video4_out_format": 1 + }, + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 + } + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3476, + "sensor1_total_height": 1166 + }, + "sensor1_active_size": { + "sensor1_active_width": 1920, + "sensor1_active_height": 1080 + }, + "/dev/video6": { + "video6_used": 0, + "video6_width": 1920, + "video6_height": 1080, + "video6_out_format": 1 + }, + "/dev/video7": { + "video7_used": 0, + "video7_width": 1080, + "video7_height": 720, + "video7_out_format": 1 + }, + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 + }, + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 + } + }, + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 1, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 44, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 44, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 44, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 1, + "csi1_dl1_map": 2, + "csi1_dl2_map": 3, + "csi1_dl3_map": 4, + "csi10_datatype_select0": 44, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 1, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 2, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 2, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 2200, + "p01_total_height": 1125, + "p01_in_width": 1920, + "p01_in_height": 1080, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 2, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 2200, + "p02_total_height": 1125, + "p02_in_width": 1920, + "p02_in_height": 1080, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 2, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 2200, + "p10_total_height": 1125, + "p10_in_width": 1920, + "p10_in_height": 1080, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 2, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 2200, + "dvp00_total_height": 1125, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} \ No newline at end of file diff --git a/package/encode_app/src/imx385_video_1920x1080_3frame.conf b/package/encode_app/src/imx385_video_1920x1080_3frame.conf new file mode 100644 index 0000000..bccac5d --- /dev/null +++ b/package/encode_app/src/imx385_video_1920x1080_3frame.conf @@ -0,0 +1,322 @@ +{ + "sensor0": { + "sensor0_name": "m00_f_IMX385 0-001a", + "sensor0_cfg_file": "imx385_3frame.conf", + "sensor0_total_size": { + "sensor0_total_width": 2200, + "sensor0_total_height": 1125 + }, + "sensor0_active_size": { + "sensor0_active_width": 1920, + "sensor0_active_height": 1080 + }, + "/dev/video2": { + "video2_used": 0, + "video2_width": 1920, + "video2_height": 1080, + "video2_out_format": 1 + }, + "/dev/video3": { + "video3_used": 0, + "video3_width": 1080, + "video3_height": 720, + "video3_out_format": 1 + }, + "/dev/video4": { + "video4_used": 1, + "video4_width": 1080, + "video4_height": 608, + "video4_out_format": 1 + }, + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 + } + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3476, + "sensor1_total_height": 1166 + }, + "sensor1_active_size": { + "sensor1_active_width": 1920, + "sensor1_active_height": 1080 + }, + "/dev/video6": { + "video6_used": 0, + "video6_width": 1920, + "video6_height": 1080, + "video6_out_format": 1 + }, + "/dev/video7": { + "video7_used": 0, + "video7_width": 1080, + "video7_height": 720, + "video7_out_format": 1 + }, + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 + }, + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 + } + }, + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 1, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 44, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 44, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 44, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 1, + "csi1_dl1_map": 2, + "csi1_dl2_map": 3, + "csi1_dl3_map": 4, + "csi10_datatype_select0": 44, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 1, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 2, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 2, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 2200, + "p01_total_height": 1125, + "p01_in_width": 1920, + "p01_in_height": 1080, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 2, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 2200, + "p02_total_height": 1125, + "p02_in_width": 1920, + "p02_in_height": 1080, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 2, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 2200, + "p10_total_height": 1125, + "p10_in_width": 1920, + "p10_in_height": 1080, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 2, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 2200, + "dvp00_total_height": 1125, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} \ No newline at end of file diff --git a/package/encode_app/src/imx385_video_1920x1080_normal.conf b/package/encode_app/src/imx385_video_1920x1080_normal.conf new file mode 100644 index 0000000..9369975 --- /dev/null +++ b/package/encode_app/src/imx385_video_1920x1080_normal.conf @@ -0,0 +1,322 @@ +{ + "sensor0": { + "sensor0_name": "m00_f_IMX385 0-001a", + "sensor0_cfg_file": "imx385_normal.conf", + "sensor0_total_size": { + "sensor0_total_width": 2200, + "sensor0_total_height": 1125 + }, + "sensor0_active_size": { + "sensor0_active_width": 1920, + "sensor0_active_height": 1080 + }, + "/dev/video2": { + "video2_used": 0, + "video2_width": 1920, + "video2_height": 1080, + "video2_out_format": 1 + }, + "/dev/video3": { + "video3_used": 0, + "video3_width": 1080, + "video3_height": 720, + "video3_out_format": 1 + }, + "/dev/video4": { + "video4_used": 1, + "video4_width": 1080, + "video4_height": 608, + "video4_out_format": 1 + }, + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 + } + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3476, + "sensor1_total_height": 1166 + }, + "sensor1_active_size": { + "sensor1_active_width": 1920, + "sensor1_active_height": 1080 + }, + "/dev/video6": { + "video6_used": 0, + "video6_width": 1920, + "video6_height": 1080, + "video6_out_format": 1 + }, + "/dev/video7": { + "video7_used": 0, + "video7_width": 1080, + "video7_height": 720, + "video7_out_format": 1 + }, + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 + }, + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 + } + }, + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 0, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 44, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 44, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 44, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 1, + "csi1_dl1_map": 2, + "csi1_dl2_map": 3, + "csi1_dl3_map": 4, + "csi10_datatype_select0": 44, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 0, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 2, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 2, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 2200, + "p01_total_height": 1125, + "p01_in_width": 1920, + "p01_in_height": 1080, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 2, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 2200, + "p02_total_height": 1125, + "p02_in_width": 1920, + "p02_in_height": 1080, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 2, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 2200, + "p10_total_height": 1125, + "p10_in_width": 1920, + "p10_in_height": 1080, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 2, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 2200, + "dvp00_total_height": 1125, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} \ No newline at end of file diff --git a/package/encode_app/src/main.cpp b/package/encode_app/src/main.cpp index 439cac5..bdb646c 100755 --- a/package/encode_app/src/main.cpp +++ b/package/encode_app/src/main.cpp @@ -115,6 +115,7 @@ typedef struct int *isp_wp; long (*isp_addr)[ISP_ADDR_BUFFER_CNT]; int *isp_pic_cnt; + int *overflow; V4L2_BUF **v4l2_buf; V4L2_REV **v4l2_rev; sem_t * pSemGetData; @@ -154,8 +155,6 @@ typedef struct long *shared_phyAddr; void **shared_vAddr; unsigned int *shared_size; - unsigned int *exp; - unsigned int *agc; int *stride; int *width; int *height; @@ -190,10 +189,9 @@ typedef struct uint32_t *drop; uint32_t *drop_en; uint32_t *framerate_mod; - int *set_ae; unsigned char *out_framerate; int video_enabled; - int ae_enable; + uint32_t *ae_disable; int setQos; /* audio */ @@ -462,19 +460,6 @@ static void enqueue_buf(unsigned char index, int channel) } } -static void set_ae(char* dev_name, int ae_enable) -{ - if((dev_name[10] >= '2') && (dev_name[10] <= '5') && (ae_enable & 0x1)) - { - mediactl_set_ae(ISP_F2K_PIPELINE); - } - else if((dev_name[10] >= '6') && (dev_name[10] <= '9') && (ae_enable & 0x1)) - { - mediactl_set_ae(ISP_R2K_PIPELINE); - } - return; -} - static void *v4l2_output(void *arg) { printf("%s\n", __FUNCTION__); @@ -495,8 +480,36 @@ static void *v4l2_output(void *arg) iRet = poll(tFds, 1, /*-1*/3000);//3000ms if (iRet <= 0) { - printf("poll error!\n"); - continue; + if(received_sigterm == 1) + { + sem_post(&pCtx->pSemGetData[channel]); + break; + } + else + { + int fullness; + if(pCtx->v4l2_wp[channel] > pCtx->v4l2_rp[channel]) + { + fullness = pCtx->v4l2_wp[channel] - pCtx->v4l2_rp[channel]; + } + else + { + fullness = ISP_ADDR_BUFFER_CNT - (pCtx->v4l2_rp[channel] - pCtx->v4l2_wp[channel]); + } + printf("ch %d, out_pic %d, fullness %d\n", channel,pCtx->out_pic[channel], fullness); + + for(int i=0; iv4l2_rev[channel][i].addr != V4L2_INVALID_INDEX) + { + enqueue_buf(pCtx->v4l2_rev[channel][i].addr, channel); + pCtx->v4l2_rev[channel][i].addr = V4L2_INVALID_INDEX; + } + } + pCtx->v4l2_wp[channel] = 0; + pCtx->v4l2_rp[channel] = 0; //fixme: need mutex + continue; + } } struct v4l2_buffer buf; @@ -506,8 +519,6 @@ static void *v4l2_output(void *arg) buf.memory = V4L2_MEMORY_USERPTR; res = ioctl(pCtx->fd_v4l2[channel], VIDIOC_DQBUF, &buf); - - set_ae(pCtx->dev_name[channel], pCtx->ae_enable); if (res < 0 || errno == EINTR) { @@ -529,8 +540,10 @@ static void *v4l2_output(void *arg) if(pCtx->v4l2_rev[channel][pCtx->v4l2_wp[channel]].addr != V4L2_INVALID_INDEX) { - printf("v4l2 buffer overflow\n"); + pCtx->overflow[channel]++; enqueue_buf(buf.index, channel); + if(pCtx->overflow[channel] % 100 == 1) + printf("ch %d: v4l2 buffer overflow\n", channel); } else if(time - start_time < 1000000000) { @@ -690,6 +703,40 @@ static void *encode_ch(void *arg) input.stride = stride; index = pCtx->v4l2_rev[channel][pCtx->v4l2_rp[channel]].addr & V4L2_INVALID_INDEX; input.data = (unsigned char *)pCtx->v4l2_buf[channel][index].paddr; + +#ifdef ISP_OUTPUT_DUMP + static FILE *dump_file=NULL; + + if(dump_file == NULL) + { + unsigned char *pSrc; + unsigned int size; + int i; + + size = input.stride*input.height*3/2; + pSrc = (unsigned char * )mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, pCtx->fd_ddr, pCtx->v4l2_buf[channel][index].paddr); + + if((dump_file=fopen("isp_dump.yuv","w+b")) == NULL ) + { + printf("Cannot open output file!\n"); + } + //write Y + for(i=0; ihEnc[channel], &output); + time1 = get_time(); if (1 == pCtx->enable_rtsp[channel]) { if (NULL != pCtx->pRtspServer[channel]) { pCtx->pRtspServer[channel]->PushVideoData(output.bufAddr, output.bufSize,0); } + time2 = get_time(); } // printf("%s>bufAddr %p, bufSize %d\n", __FUNCTION__, output.bufAddr, output.bufSize); @@ -974,8 +1023,6 @@ int free_context(void *arg) free(pCtx->shared_phyAddr ); free(pCtx->shared_vAddr ); free(pCtx->shared_size ); - free(pCtx->exp ); - free(pCtx->agc ); free(pCtx->stride ); free(pCtx->width ); free(pCtx->height ); @@ -1000,7 +1047,8 @@ int free_context(void *arg) free(pCtx->drop ); free(pCtx->drop_en ); free(pCtx->out_framerate ); - free(pCtx->set_ae ); + free(pCtx->ae_disable ); + free(pCtx->overflow ); return 0; } @@ -1241,17 +1289,6 @@ static int init_isp() pCtx->fd_isp = isp_video(&ds1_info, sensor_type, lcd_type); - if(pCtx->exp[0] > 0) - { - printf("isp exp = %d\n", pCtx->exp[0]); - video_set_ae_dgain_cfg(pCtx->exp[0]); - } - if(pCtx->agc[0] > 0) - { - printf("isp agc = %d\n", pCtx->agc[0]); - video_set_ae_again_cfg(pCtx->agc[0]); - } - printf("%s>fd_isp: 0x%x\n", __FUNCTION__, pCtx->fd_isp); sleep(1); //It seems ISP output is not stable at the beginning @@ -1309,6 +1346,7 @@ int init_v4l2() struct v4l2_format fmt; int i; int f2k=0, r2k=0; + int ae_disabled[2] = {0}; for(int j = 0; j < pCtx->ch_cnt; j++) { @@ -1324,6 +1362,23 @@ int init_v4l2() sem_init(&pCtx->pSemGetData[i],0,0); } + for(i = 0; i < pCtx->ch_cnt; i++) + { + if(pCtx->ae_disable[i]) + { + if((pCtx->dev_name[i][10] >= '2') && (pCtx->dev_name[i][10] <= '5') && (!ae_disabled[0])) + { + mediactl_disable_ae(ISP_F2K_PIPELINE); + ae_disabled[0] = 1; + } + else if((pCtx->dev_name[i][10] >= '6') && (pCtx->dev_name[i][10] <= '9') && (!ae_disabled[1])) + { + mediactl_disable_ae(ISP_R2K_PIPELINE); + ae_disabled[1] = 1; + } + } + } + if(mediactl_init(REAL_CONF_FILENAME, &(pCtx->dev_info[0])) < 0) { printf("mediactl_init error!\n"); @@ -1615,8 +1670,8 @@ static void *audio_process(void *arg) nG711Len = encode(pCtx->audio_buffer,(char*)sEncAudioBuf,pCtx->audio_size,G711_A_LAW); if(nG711Len > 0) { - //printf("=========audio g711 size:%d\n",nG711Len); - pCtx->pRtspServer[0]->PushAudioData(sEncAudioBuf, nG711Len, 0); + for(int i =0;i ch_cnt; i++) + pCtx->pRtspServer[i]->PushAudioData(sEncAudioBuf, nG711Len, 0); } if(received_sigterm == 1) @@ -1820,7 +1875,6 @@ int parse_conf() } item = cJSON_GetObjectItem(video, video_used_name); cJSON_SetIntValue(item, 1); - item = cJSON_GetObjectItem(video, video_width_name); cJSON_SetIntValue(item, pCtx->width[i]); @@ -1905,8 +1959,6 @@ int alloc_context(void *arg) pCtx->shared_phyAddr = (long*)malloc(sizeof(long) * pCtx->ch_cnt); pCtx->shared_vAddr = (void**)malloc(sizeof(void*) * pCtx->ch_cnt); pCtx->shared_size = (unsigned int*)malloc(sizeof(unsigned int) * pCtx->ch_cnt); - pCtx->exp = (unsigned int*)malloc(sizeof(unsigned int) * pCtx->ch_cnt); - pCtx->agc = (unsigned int*)malloc(sizeof(unsigned int) * pCtx->ch_cnt); pCtx->stride = (int*)malloc(sizeof(int) * pCtx->ch_cnt); pCtx->width = (int*)malloc(sizeof(int) * pCtx->ch_cnt); pCtx->height = (int*)malloc(sizeof(int) * pCtx->ch_cnt); @@ -1931,10 +1983,18 @@ int alloc_context(void *arg) pCtx->drop = (uint32_t*)malloc(sizeof(uint32_t) * pCtx->ch_cnt); pCtx->drop_en = (uint32_t*)malloc(sizeof(uint32_t) * pCtx->ch_cnt); pCtx->framerate_mod = (uint32_t*)malloc(sizeof(uint32_t) * pCtx->ch_cnt); + pCtx->ae_disable = (uint32_t*)malloc(sizeof(uint32_t) * pCtx->ch_cnt); pCtx->out_framerate = (unsigned char*)malloc(sizeof(unsigned char) * pCtx->ch_cnt); - pCtx->set_ae = (int*)malloc(sizeof(int) * pCtx->ch_cnt); + pCtx->overflow = (int*)malloc(sizeof(int) * pCtx->ch_cnt); - memset(pCtx->Cfg,0,sizeof(EncSettings)); + memset(pCtx->Cfg, 0, sizeof(EncSettings)*pCtx->ch_cnt); + + for(int i = 0; i < pCtx->ch_cnt; i++) + { + pCtx->Cfg[i].profile = (AVC_Profile)0xff; + pCtx->Cfg[i].rcMode = (RateCtrlMode)0xff; + pCtx->Cfg[i].AspectRatio = (AVC_AspectRatio)0xff; + } return 0; } @@ -1957,14 +2017,12 @@ int parse_cmd(int argc, char *argv[]) printf("-o: output file name or rtsp\n"); printf("-w: width\n"); printf("-h: height\n"); - printf("-e: set sensor exposure rate\n"); - printf("-ag: analog gain\n"); printf("-fps: sensor input framerate\n"); printf("-r: encoder output framrate\n"); printf("-inframes: input frames for input file\n"); printf("-outframes: output frames for output file\n"); printf("-gop: gop length in frames including the I picture,use in IDR\n"); - printf("-rcmode: 0:CONST_QP 1:CBR 2:VBR 3:jpg\n"); + printf("-rcmode: 0:CONST_QP 1:CBR 2:VBR\n"); printf("-bitrate: bitrate(Kb)\n"); printf("-maxbitrate: max bitrate(Kb),use in vbr\n"); printf("-profile: 0: base 1:main 2:high\n"); @@ -1976,7 +2034,7 @@ int parse_cmd(int argc, char *argv[]) printf("-GDRMode: GDR mode 0:GDR_VERTICAL 1:GDR_HORIZONTAL\n"); printf("-enableLTR: enbale long term reference picture and specifies LTR refresh frequency in number of frames,0 to disable use refresh frequency\n"); printf("-roi: roi config file\n"); - printf("-ae: enable ae\n"); + printf("-disableAE: disable ae\n"); printf("-conf: v4l2 config file\n"); /* audio */ printf("-alsa: enable audio\n"); @@ -1984,7 +2042,6 @@ int parse_cmd(int argc, char *argv[]) printf("-ar: audio sample rate\n"); printf("-af: auido sample format\n"); printf("-ad: audio device"); - printf("-lossless: enable jpeg lossless encode"); // printf("-aof: audio output frames\n"); return 1; } @@ -2003,7 +2060,6 @@ int parse_cmd(int argc, char *argv[]) } pCtx->ch_en[cur_ch] = 1; printf("-ch%d: %d\n", cur_ch, pCtx->ch_en[cur_ch]); - memset(&pCtx->Cfg[cur_ch],0,sizeof(EncSettings)); } else if(strcmp(argv[i], "-i") == 0) { @@ -2055,16 +2111,7 @@ int parse_cmd(int argc, char *argv[]) printf("Cannot open output file!\n"); return -1; } - pCtx->outfilename[cur_ch] = argv[i+1]; -#if 0 - char *ptr=strchr(pCtx->outfilename[cur_ch], '.'); - if(strcmp(ptr, ".jpg") == 0 || strcmp(ptr, ".mjpeg") == 0) - { - pCtx->Cfg[cur_ch].profile = JPEG; - pCtx->Cfg[cur_ch].rcMode = CONST_QP; - printf("JPEG encode\n"); - } -#endif + pCtx->outfilename[cur_ch] = argv[i+1]; } } else if(strcmp(argv[i], "-w") == 0) @@ -2077,27 +2124,6 @@ int parse_cmd(int argc, char *argv[]) pCtx->Cfg[cur_ch].height = atoi(argv[i+1]); printf("height %d\n", pCtx->Cfg[cur_ch].height); } - else if(strcmp(argv[i], "-e") == 0) - { - pCtx->exp[cur_ch] = atoi(argv[i+1]); - printf("exp = %d\n", pCtx->exp[cur_ch]); - if(pCtx->exp[cur_ch] <= 0 || pCtx->exp[cur_ch] > 128) - { - printf("wrong exp = %d\n", pCtx->exp[cur_ch]); - return -1; - } - pCtx->exp[cur_ch] *= 8; - } - else if(strcmp(argv[i], "-ag") == 0) - { - pCtx->agc[cur_ch] = atoi(argv[i+1]); - printf("agc = %d\n", pCtx->agc[cur_ch]); - if(pCtx->agc[cur_ch] < 0 || pCtx->agc[cur_ch] > 232) - { - printf("wrong agc = %d\n", pCtx->agc[cur_ch]); - return -1; - } - } else if(strcmp(argv[i], "-fps") == 0) { pCtx->framerate[cur_ch] = atoi(argv[i+1]); @@ -2142,7 +2168,7 @@ int parse_cmd(int argc, char *argv[]) else if (strcmp(argv[i],"-profile") == 0 ) { int nProfile = atoi(argv[i+1]); - if (nProfile > 2 || nProfile < 0) + if (nProfile > 3 || nProfile < 0) { printf("profile:%d error\n",nProfile); return -1; @@ -2167,12 +2193,6 @@ int parse_cmd(int argc, char *argv[]) pCtx->Cfg[cur_ch].SliceQP = nqp; printf("sliceqp %d\n", nqp); } - else if (strcmp(argv[i],"-lossless") == 0 ) - { - int lossless = atoi(argv[i+1]); - pCtx->Cfg[cur_ch].lossless = lossless; - printf("lossless %d\n", lossless); - } else if (strcmp(argv[i],"-minqp") == 0 ) { int nqp = atoi(argv[i+1]); @@ -2198,15 +2218,20 @@ int parse_cmd(int argc, char *argv[]) } else if(strcmp(argv[i], "-enableGDR") == 0) { - pCtx->Cfg[cur_ch].bEnableGDR = true; - pCtx->Cfg[cur_ch].FreqIDR = atoi(argv[i+1]); - if (pCtx->Cfg[cur_ch].FreqIDR <= 0) + int nFreqIDR = atoi(argv[i+1]); + if (nFreqIDR < 0) { printf("gdr fresh period error\n"); return -1; } + else if (nFreqIDR > 0) + { + pCtx->Cfg[cur_ch].bEnableGDR = true; + pCtx->Cfg[cur_ch].FreqIDR = nFreqIDR; - printf("enable gdr and fresh peroid %d\n", pCtx->Cfg[cur_ch].FreqIDR); + + printf("enable gdr and fresh peroid %d\n", nFreqIDR); + } } else if (strcmp(argv[i], "-GDRMode") == 0) { @@ -2240,9 +2265,9 @@ int parse_cmd(int argc, char *argv[]) printf("roi_parse_conf ok\n"); } } - else if(strcmp(argv[i], "-ae") == 0) + else if(strcmp(argv[i], "-disableAE") == 0) { - pCtx->ae_enable = atoi(argv[i+1]); + pCtx->ae_disable[cur_ch] = atoi(argv[i+1]); } else if(strcmp(argv[i], "-conf") == 0) { @@ -2327,30 +2352,29 @@ int main(int argc, char *argv[]) { pCtx->ch[i] = i; pCtx->Cfg[i].channel = i; - if(!pCtx->framerate[i]) pCtx->framerate[i] = 30; - if(!pCtx->out_framerate[i]) pCtx->out_framerate[i] = pCtx->framerate[i]; - if(!pCtx->Cfg[i].width) pCtx->Cfg[i].width = 1920; - if(!pCtx->Cfg[i].height) pCtx->Cfg[i].height = 1080; - if(!pCtx->Cfg[i].BitRate) pCtx->Cfg[i].BitRate = 4000000; - if(!pCtx->Cfg[i].MaxBitRate) pCtx->Cfg[i].MaxBitRate = 4000000; - if(!pCtx->Cfg[i].level) pCtx->Cfg[i].level = 42; - if(!pCtx->Cfg[i].profile) pCtx->Cfg[i].profile = AVC_HIGH; - if(!pCtx->Cfg[i].rcMode) pCtx->Cfg[i].rcMode = CBR; - if(!pCtx->Cfg[i].SliceQP) pCtx->Cfg[i].SliceQP = 25; - if(!pCtx->Cfg[i].FreqIDR) pCtx->Cfg[i].FreqIDR = 25; - if(!pCtx->Cfg[i].gopLen) pCtx->Cfg[i].gopLen = 25; - if(!pCtx->Cfg[i].AspectRatio) pCtx->Cfg[i].AspectRatio = ASPECT_RATIO_AUTO; - if(!pCtx->Cfg[i].MinQP) pCtx->Cfg[i].MinQP = 0;//from 0 to SliceQP - if(!pCtx->Cfg[i].MaxQP) pCtx->Cfg[i].MaxQP = 51;//from SliceQP to 51 - if(!pCtx->Cfg[i].roiCtrlMode) pCtx->Cfg[i].roiCtrlMode = ROI_QP_TABLE_NONE; + if(!pCtx->framerate[i]) pCtx->framerate[i] = 30; + if(!pCtx->out_framerate[i]) pCtx->out_framerate[i] = pCtx->framerate[i]; + if(!pCtx->Cfg[i].width) pCtx->Cfg[i].width = 1920; + if(!pCtx->Cfg[i].height) pCtx->Cfg[i].height = 1080; + if(!pCtx->Cfg[i].BitRate) pCtx->Cfg[i].BitRate = 4000000; + if(!pCtx->Cfg[i].MaxBitRate) pCtx->Cfg[i].MaxBitRate = 4000000; + if(!pCtx->Cfg[i].level) pCtx->Cfg[i].level = 42; + if(pCtx->Cfg[i].profile == 0xff) pCtx->Cfg[i].profile = AVC_HIGH; + if(pCtx->Cfg[i].rcMode == 0xff) pCtx->Cfg[i].rcMode = CBR; + if(!pCtx->Cfg[i].SliceQP) pCtx->Cfg[i].SliceQP = 25; + if(!pCtx->Cfg[i].FreqIDR) pCtx->Cfg[i].FreqIDR = 25; + if(!pCtx->Cfg[i].gopLen) pCtx->Cfg[i].gopLen = 25; + if(pCtx->Cfg[i].AspectRatio == 0xff) pCtx->Cfg[i].AspectRatio = ASPECT_RATIO_AUTO; + if(!pCtx->Cfg[i].MinQP) pCtx->Cfg[i].MinQP = 0;//from 0 to SliceQP + if(!pCtx->Cfg[i].MaxQP) pCtx->Cfg[i].MaxQP = 51;//from SliceQP to 51 + if(!pCtx->Cfg[i].roiCtrlMode) pCtx->Cfg[i].roiCtrlMode = ROI_QP_TABLE_NONE; pCtx->Cfg[i].encDblkCfg.disable_deblocking_filter_idc = 0; pCtx->Cfg[i].encDblkCfg.slice_beta_offset_div2 = 1; pCtx->Cfg[i].encDblkCfg.slice_alpha_c0_offset_div2 = 1; - pCtx->Cfg[i].entropyMode = ENTROPY_MODE_CAVLC; + pCtx->Cfg[i].entropyMode = ENTROPY_MODE_CABAC; pCtx->Cfg[i].sliceSplitCfg.bSplitEnable = false; - } for(int i =0;i < pCtx->ch_cnt; i++) @@ -2382,6 +2406,8 @@ int main(int argc, char *argv[]) printf("slice qp error\n"); return -1; } + if (pCtx->Cfg[i].SliceQP > pCtx->Cfg[i].MaxQP) + pCtx->Cfg[i].MaxQP = pCtx->Cfg[i].SliceQP; } else { @@ -2484,7 +2510,64 @@ int main(int argc, char *argv[]) } } - + FILE *fp=NULL; + + fp = fopen("/proc/cmdline", "rb"); + if (fp == NULL) + { + printf("can not find /proc/cmdline\n"); + } + else + { + char ch; + int isolcpus=0; + int index=0; + char name[10]; + + sprintf(name, "isolcpus=1"); + while(1) + { + ch = fgetc(fp); + if(ch == EOF || ch == 0xff) + break; + + if(ch == name[index]) + { + index++; + if(index >= 10) + { + isolcpus = 1; + break; + } + } + else + { + if(index > 0) + index--; + } + } + fclose(fp); + + printf("isolcpus = %d\n", isolcpus); + + if(isolcpus == 1 && pCtx->enable_rtsp[pCtx->ch_cnt-1] == 1) + { + cpu_set_t cpuset; + int ret; + pthread_t tid; + + CPU_ZERO(&cpuset); + CPU_SET(1, &cpuset); + + pCtx->pRtspServer[pCtx->ch_cnt-1]->GetThreadId(&tid); + + ret = pthread_setaffinity_np(tid, sizeof(cpu_set_t), &cpuset); + if (ret != 0) + printf("rtsp:pthread_setaffinity_np: fail\n"); + else + printf("rtsp:pthread_setaffinity_np: ok\n"); + } + } pCtx->fd_share_memory = open(SHARE_MEMORY_DEV,O_RDWR | O_SYNC); if(pCtx->fd_share_memory < 0) diff --git a/package/encode_app/src/video_drm_gc2093_gc2053_isp_mux.conf b/package/encode_app/src/video_drm_gc2093_gc2053_isp_mux.conf new file mode 100644 index 0000000..b306991 --- /dev/null +++ b/package/encode_app/src/video_drm_gc2093_gc2053_isp_mux.conf @@ -0,0 +1,322 @@ +{ + "sensor0":{ + "sensor0_name":"m00_f_gc2093 0-007e", + "sensor0_cfg_file":"gc2093.conf", + "sensor0_total_size":{ + "sensor0_total_width":2640, + "sensor0_total_height":1125 + }, + "sensor0_active_size":{ + "sensor0_active_width":1920, + "sensor0_active_height":1080 + }, + "/dev/video2":{ + "video2_used":0, + "video2_width":1920, + "video2_height":1080, + "video2_out_format":1 + }, + "/dev/video3":{ + "video3_used":1, + "video3_width":1080, + "video3_height":720, + "video3_out_format":1 + }, + "/dev/video4":{ + "video4_used":0, + "video4_width":640, + "video4_height":480, + "video4_out_format":1 + }, + "/dev/video5":{ + "video5_used":0, + "video5_width":320, + "video5_height":320, + "video5_height_r":240, + "video5_out_format":1, + "video5_pitch":320 + } + }, + "sensor1":{ + "sensor1_name":"m01_f_gc2053 0-0037", + "sensor1_cfg_file":"gc2053.conf", + "sensor1_total_size":{ + "sensor1_total_width":2200, + "sensor1_total_height":1125 + }, + "sensor1_active_size":{ + "sensor1_active_width":1920, + "sensor1_active_height":1080 + }, + "/dev/video6":{ + "video6_used":0, + "video6_width":1920, + "video6_height":1080, + "video6_out_format":1 + }, + "/dev/video7":{ + "video7_used":1, + "video7_width":1080, + "video7_height":720, + "video7_out_format":1 + }, + "/dev/video8":{ + "video8_used":0, + "video8_width":640, + "video8_height":480, + "video8_out_format":1 + }, + "/dev/video9":{ + "video9_used":0, + "video9_width":320, + "video9_height":240, + "video9_height_r":240, + "video9_out_format":1, + "video9_pitch":320 + } + }, + "mipi_csi2":{ + "csi0_used":1, + "csi0_sony_wdr":0, + "csi0_lane_nb":2, + "csi0_dl0_map":1, + "csi0_dl1_map":2, + "csi0_dl2_map":3, + "csi0_dl3_map":4, + "csi00_datatype_select0":43, + "csi00_datatype_select1":42, + "csi00_vc_select":1, + "csi01_datatype_select0":43, + "csi01_datatype_select1":42, + "csi01_vc_select":2, + "csi02_datatype_select0":43, + "csi02_datatype_select1":42, + "csi02_vc_select":4, + "csi1_used":1, + "csi1_sony_wdr":0, + "csi1_lane_nb":2, + "csi1_dl0_map":3, + "csi1_dl1_map":4, + "csi1_dl2_map":1, + "csi1_dl3_map":2, + "csi10_datatype_select0":43, + "csi10_datatype_select1":42, + "csi10_vc_select":1 + }, + "isp_vi":{ + "vi_wrap":{ + "dphy_mode":0, + "sony_mode":0, + "sensor0_interface_en":1, + "sensor0_tpg_w_en":0, + "sensor0_tpg_r_en":0, + "sensor0_wdr_sensor_vendor":0, + "sensor0_wdr_mode":0, + "sensor0_mipi_mode":0, + "sensor0_isp_pipeline":2, + "sensor1_interface_en":1, + "sensor1_tpg_w_en":0, + "sensor1_tpg_r_en":0, + "sensor1_wdr_sensor_vendor":0, + "sensor1_wdr_mode":0, + "sensor1_mipi_mode":0, + "sensor1_isp_pipeline":1, + "sensor2_interface_en":0, + "sensor2_tpg_w_en":0, + "sensor2_tpg_r_en":0, + "sensor2_wdr_sensor_vendor":0, + "sensor2_wdr_mode":0, + "sensor2_mipi_mode":0, + "sensor2_isp_pipeline":2 + }, + "vi_pipe00":{ + "p00_win_mode_en":1, + "p00_input_ch_sel":1, + "p00_ch_mode_sel":1, + "p00_pixel_type":0, + "p00_yuv_in_format":0, + "p00_yuv_out_format":0, + "p00_yuv422_order":0, + "p00_pixel_width":1, + "p00_data_out_timming_ctrl":3, + "p00_sync_pulse_mode":0, + "p00_sen_mipi_clk_pol":1, + "p00_sen_mipi_vsync_pol":0, + "p00_sen_mipi_hsync_pol":0, + "p00_sen_mipi_field_pol":1, + "p00_isp_clk_pol":1, + "p00_isp_vsync_pol":1, + "p00_isp_hsync_pol":1, + "p00_isp_field_pol":1, + "p00_tpg_w_en":0, + "p00_tpg_r_en":0, + "p00_w_st_width":0, + "p00_w_st_height":16383, + "p00_r_st_width":279, + "p00_r_st_height":44, + "p00_tof_mode_enable":0, + "p00_vi_pipe_tpg_tof_frm_num":3, + "p00_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe01":{ + "p01_win_mode_en":1, + "p01_input_ch_sel":1, + "p01_ch_mode_sel":1, + "p01_pixel_type":0, + "p01_yuv_in_format":0, + "p01_yuv_out_format":0, + "p01_yuv422_order":0, + "p01_pixel_width":1, + "p01_data_out_timming_ctrl":3, + "p01_sync_pulse_mode":0, + "p01_sen_mipi_clk_pol":1, + "p01_sen_mipi_vsync_pol":0, + "p01_sen_mipi_hsync_pol":0, + "p01_sen_mipi_field_pol":1, + "p01_isp_clk_pol":1, + "p01_isp_vsync_pol":1, + "p01_isp_hsync_pol":1, + "p01_isp_field_pol":1, + "p01_tpg_w_en":0, + "p01_tpg_r_en":0, + "p01_total_width":3476, + "p01_total_height":1166, + "p01_in_width":1920, + "p01_in_height":1080, + "p01_w_st_width":0, + "p01_w_st_height":16383, + "p01_r_st_width":279, + "p01_r_st_height":44, + "p01_vi_pipe_w_addr_y0 ":0, + "p01_vi_pipe_w_addr_y1 ":0, + "p01_vi_pipe_w_addr_uv0":0, + "p01_vi_pipe_w_addr_uv1":0, + "p01_vi_pipe_r_addr_y0 ":0, + "p01_vi_pipe_r_addr_y1 ":0, + "p01_vi_pipe_addr_stride":0, + "p01_tof_mode_enable":0, + "p01_vi_pipe_tpg_tof_frm_num":3, + "p01_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe02":{ + "p02_win_mode_en":1, + "p02_input_ch_sel":1, + "p02_ch_mode_sel":1, + "p02_pixel_type":0, + "p02_yuv_in_format":0, + "p02_yuv_out_format":0, + "p02_yuv422_order":0, + "p02_pixel_width":1, + "p02_data_out_timming_ctrl":3, + "p02_sync_pulse_mode":0, + "p02_sen_mipi_clk_pol":1, + "p02_sen_mipi_vsync_pol":0, + "p02_sen_mipi_hsync_pol":0, + "p02_sen_mipi_field_pol":1, + "p02_isp_clk_pol":1, + "p02_isp_vsync_pol":1, + "p02_isp_hsync_pol":1, + "p02_isp_field_pol":1, + "p02_tpg_w_en":0, + "p02_tpg_r_en":0, + "p02_total_width":3476, + "p02_total_height":1166, + "p02_in_width":1920, + "p02_in_height":1080, + "p02_w_st_width":0, + "p02_w_st_height":16383, + "p02_r_st_width":279, + "p02_r_st_height":44, + "p02_vi_pipe_w_addr_y0 ":0, + "p02_vi_pipe_w_addr_y1 ":0, + "p02_vi_pipe_w_addr_uv0":0, + "p02_vi_pipe_w_addr_uv1":0, + "p02_vi_pipe_r_addr_y0 ":0, + "p02_vi_pipe_r_addr_y1 ":0, + "p02_vi_pipe_addr_stride":0, + "p02_tof_mode_enable":0, + "p02_vi_pipe_tpg_tof_frm_num":3, + "p02_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe10":{ + "p10_win_mode_en":1, + "p10_input_ch_sel":1, + "p10_ch_mode_sel":1, + "p10_pixel_type":0, + "p10_yuv_in_format":0, + "p10_yuv_out_format":0, + "p10_yuv422_order":0, + "p10_pixel_width":1, + "p10_data_out_timming_ctrl":3, + "p10_sync_pulse_mode":0, + "p10_sen_mipi_clk_pol":1, + "p10_sen_mipi_vsync_pol":0, + "p10_sen_mipi_hsync_pol":0, + "p10_sen_mipi_field_pol":1, + "p10_isp_clk_pol":1, + "p10_isp_vsync_pol":1, + "p10_isp_hsync_pol":1, + "p10_isp_field_pol":1, + "p10_tpg_w_en":0, + "p10_tpg_r_en":0, + "p10_total_width":3476, + "p10_total_height":1166, + "p10_in_width":1920, + "p10_in_height":1080, + "p10_w_st_width":0, + "p10_w_st_height":16383, + "p10_r_st_width":279, + "p10_r_st_height":44, + "p10_vi_pipe_w_addr_y0 ":0, + "p10_vi_pipe_w_addr_y1 ":0, + "p10_vi_pipe_w_addr_uv0":0, + "p10_vi_pipe_w_addr_uv1":0, + "p10_vi_pipe_r_addr_y0 ":0, + "p10_vi_pipe_r_addr_y1 ":0, + "p10_vi_pipe_addr_stride":0, + "p10_tof_mode_enable":0, + "p10_vi_pipe_tpg_tof_frm_num":3, + "p10_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_dvp00":{ + "dvp00_win_mode_en":1, + "dvp00_input_ch_sel":1, + "dvp00_ch_mode_sel":1, + "dvp00_pixel_type":0, + "dvp00_yuv_in_format":0, + "dvp00_yuv_out_format":0, + "dvp00_yuv422_order":0, + "dvp00_pixel_width":1, + "dvp00_data_out_timming_ctrl":3, + "dvp00_sync_pulse_mode":0, + "dvp00_sen_mipi_clk_pol":1, + "dvp00_sen_mipi_vsync_pol":0, + "dvp00_sen_mipi_hsync_pol":0, + "dvp00_sen_mipi_field_pol":1, + "dvp00_isp_clk_pol":1, + "dvp00_isp_vsync_pol":1, + "dvp00_isp_hsync_pol":1, + "dvp00_isp_field_pol":1, + "dvp00_tpg_w_en":0, + "dvp00_tpg_r_en":0, + "dvp00_total_width":3476, + "dvp00_total_height":1166, + "dvp00_in_width":1920, + "dvp00_in_height":1080, + "dvp00_w_st_width":0, + "dvp00_w_st_height":16383, + "dvp00_r_st_width":279, + "dvp00_r_st_height":44, + "dvp00_vi_pipe_w_addr_y0 ":0, + "dvp00_vi_pipe_w_addr_y1 ":0, + "dvp00_vi_pipe_w_addr_uv0":0, + "dvp00_vi_pipe_w_addr_uv1":0, + "dvp00_vi_pipe_r_addr_y0 ":0, + "dvp00_vi_pipe_r_addr_y1 ":0, + "dvp00_vi_pipe_addr_stride":0, + "dvp00_tof_mode_enable":0, + "dvp00_vi_pipe_tpg_tof_frm_num":3, + "dvp00_vi_pipe_tpg_tof_frm_stride":66432 + } + } +} diff --git a/package/encode_app/src/video_sample.conf b/package/encode_app/src/video_sample.conf index c51b4e7..9ef6725 100644 --- a/package/encode_app/src/video_sample.conf +++ b/package/encode_app/src/video_sample.conf @@ -1,322 +1,322 @@ { - "sensor0":{ - "sensor0_name":"m00_f_imx219_0 0-0010", - "sensor0_cfg_file":"imx219_0.conf", - "sensor0_total_size":{ - "sensor0_total_width":3476, - "sensor0_total_height":1166 + "sensor0": { + "sensor0_name": "m00_f_imx219_0 0-0010", + "sensor0_cfg_file": "imx219_0.conf", + "sensor0_total_size": { + "sensor0_total_width": 3476, + "sensor0_total_height": 1166 }, - "sensor0_active_size":{ - "sensor0_active_width":1920, - "sensor0_active_height":1080 + "sensor0_active_size": { + "sensor0_active_width": 1936, + "sensor0_active_height": 1088 }, - "/dev/video2":{ - "video2_used":0, - "video2_width":1920, - "video2_height":1080, - "video2_out_format":1 + "/dev/video2": { + "video2_used": 0, + "video2_width": 1920, + "video2_height": 1080, + "video2_out_format": 1 }, - "/dev/video3":{ - "video3_used":0, - "video3_width":1080, - "video3_height":720, - "video3_out_format":1 + "/dev/video3": { + "video3_used": 0, + "video3_width": 1080, + "video3_height": 720, + "video3_out_format": 1 }, - "/dev/video4":{ - "video4_used":0, - "video4_width":640, - "video4_height":480, - "video4_out_format":1 + "/dev/video4": { + "video4_used": 0, + "video4_width": 640, + "video4_height": 480, + "video4_out_format": 1 }, - "/dev/video5":{ - "video5_used":0, - "video5_width":320, - "video5_height":320, - "video5_height_r":240, - "video5_out_format":1, - "video5_pitch":320 + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 } - }, - "sensor1":{ - "sensor1_name":"m01_f_imx219_1 3-0010", - "sensor1_cfg_file":"imx219_1.conf", - "sensor1_total_size":{ - "sensor1_total_width":3476, - "sensor1_total_height":1166 + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3476, + "sensor1_total_height": 1166 }, - "sensor1_active_size":{ - "sensor1_active_width":1920, - "sensor1_active_height":1080 + "sensor1_active_size": { + "sensor1_active_width": 1936, + "sensor1_active_height": 1088 }, - "/dev/video6":{ - "video6_used":0, - "video6_width":1920, - "video6_height":1080, - "video6_out_format":1 + "/dev/video6": { + "video6_used": 0, + "video6_width": 1920, + "video6_height": 1080, + "video6_out_format": 1 }, - "/dev/video7":{ - "video7_used":0, - "video7_width":1080, - "video7_height":720, - "video7_out_format":1 + "/dev/video7": { + "video7_used": 0, + "video7_width": 1080, + "video7_height": 720, + "video7_out_format": 1 }, - "/dev/video8":{ - "video8_used":0, - "video8_width":640, - "video8_height":480, - "video8_out_format":1 + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 }, - "/dev/video9":{ - "video9_used":0, - "video9_width":320, - "video9_height":240, - "video9_height_r":240, - "video9_out_format":1, - "video9_pitch":320 + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 } }, - "mipi_csi2":{ - "csi0_used":1, - "csi0_sony_wdr":0, - "csi0_lane_nb":2, - "csi0_dl0_map":1, - "csi0_dl1_map":2, - "csi0_dl2_map":3, - "csi0_dl3_map":4, - "csi00_datatype_select0":43, - "csi00_datatype_select1":42, - "csi00_vc_select":1, - "csi01_datatype_select0":43, - "csi01_datatype_select1":42, - "csi01_vc_select":2, - "csi02_datatype_select0":43, - "csi02_datatype_select1":42, - "csi02_vc_select":4, - "csi1_used":1, - "csi1_sony_wdr":0, - "csi1_lane_nb":2, - "csi1_dl0_map":3, - "csi1_dl1_map":4, - "csi1_dl2_map":1, - "csi1_dl3_map":2, - "csi10_datatype_select0":43, - "csi10_datatype_select1":42, - "csi10_vc_select":1 - }, - "isp_vi":{ - "vi_wrap":{ - "dphy_mode":0, - "sony_mode":0, - "sensor0_interface_en":1, - "sensor0_tpg_w_en":0, - "sensor0_tpg_r_en":0, - "sensor0_wdr_sensor_vendor":0, - "sensor0_wdr_mode":0, - "sensor0_mipi_mode":0, - "sensor0_isp_pipeline":1, - "sensor1_interface_en":1, - "sensor1_tpg_w_en":0, - "sensor1_tpg_r_en":0, - "sensor1_wdr_sensor_vendor":0, - "sensor1_wdr_mode":0, - "sensor1_mipi_mode":0, - "sensor1_isp_pipeline":2, - "sensor2_interface_en":0, - "sensor2_tpg_w_en":0, - "sensor2_tpg_r_en":0, - "sensor2_wdr_sensor_vendor":0, - "sensor2_wdr_mode":0, - "sensor2_mipi_mode":0, - "sensor2_isp_pipeline":2 - }, - "vi_pipe00":{ - "p00_win_mode_en":1, - "p00_input_ch_sel":1, - "p00_ch_mode_sel":1, - "p00_pixel_type":0, - "p00_yuv_in_format":0, - "p00_yuv_out_format":0, - "p00_yuv422_order":0, - "p00_pixel_width":1, - "p00_data_out_timming_ctrl":3, - "p00_sync_pulse_mode":0, - "p00_sen_mipi_clk_pol":1, - "p00_sen_mipi_vsync_pol":0, - "p00_sen_mipi_hsync_pol":0, - "p00_sen_mipi_field_pol":1, - "p00_isp_clk_pol":1, - "p00_isp_vsync_pol":1, - "p00_isp_hsync_pol":1, - "p00_isp_field_pol":1, - "p00_tpg_w_en":0, - "p00_tpg_r_en":0, - "p00_w_st_width":0, - "p00_w_st_height":16383, - "p00_r_st_width":279, - "p00_r_st_height":44, - "p00_tof_mode_enable":0, - "p00_vi_pipe_tpg_tof_frm_num":3, - "p00_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe01":{ - "p01_win_mode_en":1, - "p01_input_ch_sel":1, - "p01_ch_mode_sel":1, - "p01_pixel_type":0, - "p01_yuv_in_format":0, - "p01_yuv_out_format":0, - "p01_yuv422_order":0, - "p01_pixel_width":1, - "p01_data_out_timming_ctrl":3, - "p01_sync_pulse_mode":0, - "p01_sen_mipi_clk_pol":1, - "p01_sen_mipi_vsync_pol":0, - "p01_sen_mipi_hsync_pol":0, - "p01_sen_mipi_field_pol":1, - "p01_isp_clk_pol":1, - "p01_isp_vsync_pol":1, - "p01_isp_hsync_pol":1, - "p01_isp_field_pol":1, - "p01_tpg_w_en":0, - "p01_tpg_r_en":0, - "p01_total_width":3476, - "p01_total_height":1166, - "p01_in_width":1920, - "p01_in_height":1080, - "p01_w_st_width":0, - "p01_w_st_height":16383, - "p01_r_st_width":279, - "p01_r_st_height":44, - "p01_vi_pipe_w_addr_y0 ":0, - "p01_vi_pipe_w_addr_y1 ":0, - "p01_vi_pipe_w_addr_uv0":0, - "p01_vi_pipe_w_addr_uv1":0, - "p01_vi_pipe_r_addr_y0 ":0, - "p01_vi_pipe_r_addr_y1 ":0, - "p01_vi_pipe_addr_stride":0, - "p01_tof_mode_enable":0, - "p01_vi_pipe_tpg_tof_frm_num":3, - "p01_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe02":{ - "p02_win_mode_en":1, - "p02_input_ch_sel":1, - "p02_ch_mode_sel":1, - "p02_pixel_type":0, - "p02_yuv_in_format":0, - "p02_yuv_out_format":0, - "p02_yuv422_order":0, - "p02_pixel_width":1, - "p02_data_out_timming_ctrl":3, - "p02_sync_pulse_mode":0, - "p02_sen_mipi_clk_pol":1, - "p02_sen_mipi_vsync_pol":0, - "p02_sen_mipi_hsync_pol":0, - "p02_sen_mipi_field_pol":1, - "p02_isp_clk_pol":1, - "p02_isp_vsync_pol":1, - "p02_isp_hsync_pol":1, - "p02_isp_field_pol":1, - "p02_tpg_w_en":0, - "p02_tpg_r_en":0, - "p02_total_width":3476, - "p02_total_height":1166, - "p02_in_width":1920, - "p02_in_height":1080, - "p02_w_st_width":0, - "p02_w_st_height":16383, - "p02_r_st_width":279, - "p02_r_st_height":44, - "p02_vi_pipe_w_addr_y0 ":0, - "p02_vi_pipe_w_addr_y1 ":0, - "p02_vi_pipe_w_addr_uv0":0, - "p02_vi_pipe_w_addr_uv1":0, - "p02_vi_pipe_r_addr_y0 ":0, - "p02_vi_pipe_r_addr_y1 ":0, - "p02_vi_pipe_addr_stride":0, - "p02_tof_mode_enable":0, - "p02_vi_pipe_tpg_tof_frm_num":3, - "p02_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe10":{ - "p10_win_mode_en":1, - "p10_input_ch_sel":1, - "p10_ch_mode_sel":1, - "p10_pixel_type":0, - "p10_yuv_in_format":0, - "p10_yuv_out_format":0, - "p10_yuv422_order":0, - "p10_pixel_width":1, - "p10_data_out_timming_ctrl":3, - "p10_sync_pulse_mode":0, - "p10_sen_mipi_clk_pol":1, - "p10_sen_mipi_vsync_pol":0, - "p10_sen_mipi_hsync_pol":0, - "p10_sen_mipi_field_pol":1, - "p10_isp_clk_pol":1, - "p10_isp_vsync_pol":1, - "p10_isp_hsync_pol":1, - "p10_isp_field_pol":1, - "p10_tpg_w_en":0, - "p10_tpg_r_en":0, - "p10_total_width":3476, - "p10_total_height":1166, - "p10_in_width":1920, - "p10_in_height":1080, - "p10_w_st_width":0, - "p10_w_st_height":16383, - "p10_r_st_width":279, - "p10_r_st_height":44, - "p10_vi_pipe_w_addr_y0 ":0, - "p10_vi_pipe_w_addr_y1 ":0, - "p10_vi_pipe_w_addr_uv0":0, - "p10_vi_pipe_w_addr_uv1":0, - "p10_vi_pipe_r_addr_y0 ":0, - "p10_vi_pipe_r_addr_y1 ":0, - "p10_vi_pipe_addr_stride":0, - "p10_tof_mode_enable":0, - "p10_vi_pipe_tpg_tof_frm_num":3, - "p10_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_dvp00":{ - "dvp00_win_mode_en":1, - "dvp00_input_ch_sel":1, - "dvp00_ch_mode_sel":1, - "dvp00_pixel_type":0, - "dvp00_yuv_in_format":0, - "dvp00_yuv_out_format":0, - "dvp00_yuv422_order":0, - "dvp00_pixel_width":1, - "dvp00_data_out_timming_ctrl":3, - "dvp00_sync_pulse_mode":0, - "dvp00_sen_mipi_clk_pol":1, - "dvp00_sen_mipi_vsync_pol":0, - "dvp00_sen_mipi_hsync_pol":0, - "dvp00_sen_mipi_field_pol":1, - "dvp00_isp_clk_pol":1, - "dvp00_isp_vsync_pol":1, - "dvp00_isp_hsync_pol":1, - "dvp00_isp_field_pol":1, - "dvp00_tpg_w_en":0, - "dvp00_tpg_r_en":0, - "dvp00_total_width":3476, - "dvp00_total_height":1166, - "dvp00_in_width":1920, - "dvp00_in_height":1080, - "dvp00_w_st_width":0, - "dvp00_w_st_height":16383, - "dvp00_r_st_width":279, - "dvp00_r_st_height":44, - "dvp00_vi_pipe_w_addr_y0 ":0, - "dvp00_vi_pipe_w_addr_y1 ":0, - "dvp00_vi_pipe_w_addr_uv0":0, - "dvp00_vi_pipe_w_addr_uv1":0, - "dvp00_vi_pipe_r_addr_y0 ":0, - "dvp00_vi_pipe_r_addr_y1 ":0, - "dvp00_vi_pipe_addr_stride":0, - "dvp00_tof_mode_enable":0, - "dvp00_vi_pipe_tpg_tof_frm_num":3, - "dvp00_vi_pipe_tpg_tof_frm_stride":66432 - } - } -} \ No newline at end of file + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 0, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 43, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 43, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 43, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 3, + "csi1_dl1_map": 4, + "csi1_dl2_map": 1, + "csi1_dl3_map": 2, + "csi10_datatype_select0": 43, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 0, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 1, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 1, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 3476, + "p01_total_height": 1166, + "p01_in_width": 1920, + "p01_in_height": 1080, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 1, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 3476, + "p02_total_height": 1166, + "p02_in_width": 1920, + "p02_in_height": 1080, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 1, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 3476, + "p10_total_height": 1166, + "p10_in_width": 1920, + "p10_in_height": 1080, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 1, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 3476, + "dvp00_total_height": 1166, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} diff --git a/package/encode_app/src/video_sample_1080x1920.conf b/package/encode_app/src/video_sample_1080x1920.conf new file mode 100644 index 0000000..5de3602 --- /dev/null +++ b/package/encode_app/src/video_sample_1080x1920.conf @@ -0,0 +1,322 @@ +{ + "sensor0": { + "sensor0_name": "m00_f_imx219_0 0-0010", + "sensor0_cfg_file": "imx219_1080x1920_0.conf", + "sensor0_total_size": { + "sensor0_total_width": 3453, + "sensor0_total_height": 1979 + }, + "sensor0_active_size": { + "sensor0_active_width": 1088, + "sensor0_active_height": 1928 + }, + "/dev/video2": { + "video2_used": 0, + "video2_width": 1080, + "video2_height": 1920, + "video2_out_format": 1 + }, + "/dev/video3": { + "video3_used": 0, + "video3_width": 1080, + "video3_height": 1920, + "video3_out_format": 1 + }, + "/dev/video4": { + "video4_used": 0, + "video4_width": 640, + "video4_height": 480, + "video4_out_format": 1 + }, + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 + } + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3459, + "sensor1_total_height": 1173 + }, + "sensor1_active_size": { + "sensor1_active_width": 1936, + "sensor1_active_height": 1088 + }, + "/dev/video6": { + "video6_used": 0, + "video6_width": 1920, + "video6_height": 1080, + "video6_out_format": 1 + }, + "/dev/video7": { + "video7_used": 0, + "video7_width": 1080, + "video7_height": 720, + "video7_out_format": 1 + }, + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 + }, + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 + } + }, + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 0, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 43, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 43, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 43, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 3, + "csi1_dl1_map": 4, + "csi1_dl2_map": 1, + "csi1_dl3_map": 2, + "csi10_datatype_select0": 43, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 0, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 1, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 1, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 3453, + "p01_total_height": 1977, + "p01_in_width": 1920, + "p01_in_height": 1080, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 1, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 3453, + "p02_total_height": 1977, + "p02_in_width": 1920, + "p02_in_height": 1080, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 1, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 3453, + "p10_total_height": 1977, + "p10_in_width": 1920, + "p10_in_height": 1080, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 1, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 3453, + "dvp00_total_height": 1977, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} diff --git a/package/ffmpeg_canaan/0032-buildroot-ffmpeg.patch b/package/ffmpeg_canaan/0032-buildroot-ffmpeg.patch new file mode 100644 index 0000000..3b79fe1 --- /dev/null +++ b/package/ffmpeg_canaan/0032-buildroot-ffmpeg.patch @@ -0,0 +1,64 @@ +Index: b/libavcodec/libk510_h264.c +=================================================================== +--- a/libavcodec/libk510_h264.c ++++ b/libavcodec/libk510_h264.c +@@ -177,9 +177,9 @@ static av_cold int k510_h264_encode_init + Cfg.MaxQP = 51;//from SliceQP to 51 + Cfg.roiCtrlMode = ROI_QP_TABLE_NONE; + Cfg.encDblkCfg.disable_deblocking_filter_idc = 0; +- Cfg.encDblkCfg.slice_beta_offset_div2 = 1; +- Cfg.encDblkCfg.slice_alpha_c0_offset_div2 = 1; +- Cfg.entropyMode = ENTROPY_MODE_CAVLC; ++ Cfg.encDblkCfg.slice_beta_offset_div2 = 1; ++ Cfg.encDblkCfg.slice_alpha_c0_offset_div2 = 1; ++ Cfg.entropyMode = ENTROPY_MODE_CAVLC; + Cfg.sliceSplitCfg.bSplitEnable = false; + + printf("Encoder Settings:\n"); +@@ -421,10 +421,10 @@ static const AVOption options[] = + { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVC_MAIN }, 0, 0, FLAGS, "profile_flags" }, + { "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVC_HIGH }, 0, 0, FLAGS, "profile_flags" }, + { "level", "Specify level", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 42}, 10, 42, FLAGS, "level_flags"}, +- { "ar", "Set aspect ratio", OFFSET(ar), AV_OPT_TYPE_INT, {.i64 = ASPECT_RATIO_AUTO}, ASPECT_RATIO_AUTO, ASPECT_RATIO_16_9, FLAGS, "profile_flags"}, +- { "auto", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_AUTO }, 0, 0, FLAGS, "profile_flags" }, +- { "4:3", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_4_3 }, 0, 0, FLAGS, "profile_flags" }, +- { "16:9", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_16_9 }, 0, 0, FLAGS, "profile_flags" }, ++ { "ar", "Set aspect ratio", OFFSET(ar), AV_OPT_TYPE_INT, {.i64 = ASPECT_RATIO_AUTO}, ASPECT_RATIO_AUTO, ASPECT_RATIO_16_9, FLAGS, "ar_flags"}, ++ { "auto", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_AUTO }, 0, 0, FLAGS, "ar_flags" }, ++ { "4:3", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_4_3 }, 0, 0, FLAGS, "ar_flags" }, ++ { "16:9", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_16_9 }, 0, 0, FLAGS, "ar_flags" }, + { "framesToEncode", "set the libk510_h264 framesToEncode", OFFSET(framesToEncode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS }, + {NULL} + }; +Index: b/libavcodec/libk510_jpeg.c +=================================================================== +--- a/libavcodec/libk510_jpeg.c ++++ b/libavcodec/libk510_jpeg.c +@@ -141,9 +141,9 @@ static av_cold int k510_jpeg_encode_init + Cfg.MaxQP = 51;//from SliceQP to 51 + Cfg.roiCtrlMode = ROI_QP_TABLE_NONE; + Cfg.encDblkCfg.disable_deblocking_filter_idc = 0; +- Cfg.encDblkCfg.slice_beta_offset_div2 = 1; +- Cfg.encDblkCfg.slice_alpha_c0_offset_div2 = 1; +- Cfg.entropyMode = ENTROPY_MODE_CAVLC; ++ Cfg.encDblkCfg.slice_beta_offset_div2 = 1; ++ Cfg.encDblkCfg.slice_alpha_c0_offset_div2 = 1; ++ Cfg.entropyMode = ENTROPY_MODE_CAVLC; + Cfg.sliceSplitCfg.bSplitEnable = false; + + printf("Encoder Settings:\n"); +@@ -312,10 +312,10 @@ static const AVOption options[] = + { "b", "Set video bitrate", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = 4000000}, 0, 100000000, FLAGS }, + { "ch", "Set encode channel ", OFFSET(channel), AV_OPT_TYPE_INT, {.i64 = 0}, 0, (VENC_MAX_CHANNELS-1), FLAGS }, + { "maxrate", "Maximum bitrate. (0=ignore)", OFFSET(maxrate), AV_OPT_TYPE_INT, {.i64 = 4000000}, 0, 100000000, FLAGS }, +- { "ar", "Set aspect ratio", OFFSET(ar), AV_OPT_TYPE_INT, {.i64 = ASPECT_RATIO_AUTO}, ASPECT_RATIO_AUTO, ASPECT_RATIO_16_9, FLAGS, "profile_flags"}, +- { "auto", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_AUTO }, 0, 0, FLAGS, "profile_flags" }, +- { "4:3", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_4_3 }, 0, 0, FLAGS, "profile_flags" }, +- { "16:9", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_16_9 }, 0, 0, FLAGS, "profile_flags" }, ++ { "ar", "Set aspect ratio", OFFSET(ar), AV_OPT_TYPE_INT, {.i64 = ASPECT_RATIO_AUTO}, ASPECT_RATIO_AUTO, ASPECT_RATIO_16_9, FLAGS, "ar_flags"}, ++ { "auto", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_AUTO }, 0, 0, FLAGS, "ar_flags" }, ++ { "4:3", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_4_3 }, 0, 0, FLAGS, "ar_flags" }, ++ { "16:9", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_16_9 }, 0, 0, FLAGS, "ar_flags" }, + {NULL} + }; + diff --git a/package/ffmpeg_canaan/0033-buildroot-ffmpeg.patch b/package/ffmpeg_canaan/0033-buildroot-ffmpeg.patch new file mode 100755 index 0000000..34bcf7e --- /dev/null +++ b/package/ffmpeg_canaan/0033-buildroot-ffmpeg.patch @@ -0,0 +1,116 @@ +Index: b/libavcodec/libk510_h264.c +=================================================================== +--- a/libavcodec/libk510_h264.c ++++ b/libavcodec/libk510_h264.c +@@ -55,7 +55,7 @@ typedef struct libk510_h264Context { + int idrFreq; + int profile; + int level; +- AVC_AspectRatio ar; ++ AVC_AspectRatio aratio; + int framesToEncode; + int out_pic; + int in_pic; +@@ -172,7 +172,7 @@ static av_cold int k510_h264_encode_init + Cfg.FreqIDR = pCtx->idrFreq; + Cfg.gopLen = pCtx->gop_size; + Cfg.FrameRate = pCtx->framerate; +- Cfg.AspectRatio = pCtx->ar; ++ Cfg.AspectRatio = pCtx->aratio; + Cfg.MinQP = 0;//from 0 to SliceQP + Cfg.MaxQP = 51;//from SliceQP to 51 + Cfg.roiCtrlMode = ROI_QP_TABLE_NONE; +@@ -194,6 +194,7 @@ static av_cold int k510_h264_encode_init + printf(" SliceQP : %d\n", Cfg.SliceQP); + printf(" bitrate : %d\n", Cfg.BitRate); + printf(" maxbitrate : %d\n", Cfg.MaxBitRate); ++ printf(" AspectRatio : %d\n", Cfg.AspectRatio); + pCtx->hEnc = VideoEncoder_Create(&Cfg); + + pCtx->pts = 0; +@@ -408,23 +409,25 @@ static const AVOption options[] = + //{ option name, description, offset in the context object, type default, min, max, flags, unit} + // ***** GOP options ****** + { "g", "Set gop size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 25}, 0, 1000, FLAGS }, +- { "b", "Set video bitrate", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = 4000000}, 0, 100000000, FLAGS }, +- { "r", "Set video framerate", OFFSET(framerate), AV_OPT_TYPE_INT, {.i64 = 30}, 25, 60, FLAGS }, ++ { "b", "Set video bitrate", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = 4000000}, 0, 20000000, FLAGS }, ++ { "r", "Set video framerate", OFFSET(framerate), AV_OPT_TYPE_INT, {.i64 = 30}, 30, 30, FLAGS }, + { "ch", "Set encode channel ", OFFSET(channel), AV_OPT_TYPE_INT, {.i64 = 0}, 0, (VENC_MAX_CHANNELS-1), FLAGS }, + { "idr_freq", "IDR frequency. -1=No IDRs", OFFSET(idrFreq), AV_OPT_TYPE_INT, {.i64 = 25 }, -1, 256, FLAGS }, + // ***** Rate Control options ****** +- { "qp", "Use constant QP for encoding.", OFFSET(cqp), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 100, FLAGS }, +- { "maxrate", "Maximum bitrate. (0=ignore)", OFFSET(maxrate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 100000000, FLAGS }, ++ { "qp", "Use constant QP for encoding.", OFFSET(cqp), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 51, FLAGS }, ++ { "maxrate", "Maximum bitrate. (0=ignore)", OFFSET(maxrate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 20000000, FLAGS }, + // ***** Input/Output options ****** + { "profile", "Set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = AVC_HIGH}, AVC_C_BASELINE, AVC_HIGH, FLAGS, "profile_flags"}, +- { "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVC_C_BASELINE }, 0, 0, FLAGS, "profile_flags" }, ++ { "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVC_C_BASELINE }, 0, 0, FLAGS, "profile_flags" }, + { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVC_MAIN }, 0, 0, FLAGS, "profile_flags" }, + { "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVC_HIGH }, 0, 0, FLAGS, "profile_flags" }, + { "level", "Specify level", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 42}, 10, 42, FLAGS, "level_flags"}, +- { "ar", "Set aspect ratio", OFFSET(ar), AV_OPT_TYPE_INT, {.i64 = ASPECT_RATIO_AUTO}, ASPECT_RATIO_AUTO, ASPECT_RATIO_16_9, FLAGS, "ar_flags"}, ++ { "aratio", "Set aspect ratio", OFFSET(aratio), AV_OPT_TYPE_INT, {.i64 = ASPECT_RATIO_AUTO}, ASPECT_RATIO_AUTO, ASPECT_RATIO_MAX, FLAGS, "ar_flags"}, + { "auto", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_AUTO }, 0, 0, FLAGS, "ar_flags" }, ++ { "1:1", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_1_1 }, 0, 0, FLAGS, "ar_flags" }, + { "4:3", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_4_3 }, 0, 0, FLAGS, "ar_flags" }, + { "16:9", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_16_9 }, 0, 0, FLAGS, "ar_flags" }, ++ { "none", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_NONE }, 0, 0, FLAGS, "ar_flags" }, + { "framesToEncode", "set the libk510_h264 framesToEncode", OFFSET(framesToEncode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS }, + {NULL} + }; +Index: b/libavcodec/libk510_jpeg.c +=================================================================== +--- a/libavcodec/libk510_jpeg.c ++++ b/libavcodec/libk510_jpeg.c +@@ -129,16 +129,16 @@ static av_cold int k510_jpeg_encode_init + Cfg.height = avctx->height; + Cfg.profile = JPEG; + Cfg.FrameRate = pCtx->framerate; +- Cfg.AspectRatio = pCtx->ar; ++ Cfg.AspectRatio = ASPECT_RATIO_AUTO; + Cfg.rcMode = CONST_QP; + Cfg.SliceQP = pCtx->cqp; +- Cfg.BitRate = pCtx->bit_rate; +- Cfg.MaxBitRate = pCtx->maxrate; ++ Cfg.BitRate = 4000000; ++ Cfg.MaxBitRate = 4000000; + Cfg.level = 42; + Cfg.FreqIDR = 25; + Cfg.gopLen = 25; +- Cfg.MinQP = 0;//from 0 to SliceQP +- Cfg.MaxQP = 51;//from SliceQP to 51 ++ Cfg.MinQP = 0; ++ Cfg.MaxQP = 100; + Cfg.roiCtrlMode = ROI_QP_TABLE_NONE; + Cfg.encDblkCfg.disable_deblocking_filter_idc = 0; + Cfg.encDblkCfg.slice_beta_offset_div2 = 1; +@@ -151,11 +151,7 @@ static av_cold int k510_jpeg_encode_init + printf(" height : %d\n", Cfg.height); + printf(" profile : %d\n", Cfg.profile); + printf(" FrameRate : %d\n", Cfg.FrameRate); +- printf(" rcMode : %d\n", Cfg.rcMode); + printf(" SliceQP : %d\n", Cfg.SliceQP); +- printf(" bitrate : %d\n", Cfg.BitRate); +- printf(" maxbitrate : %d\n", Cfg.MaxBitRate); +- printf(" AspectRatio : %d\n", Cfg.AspectRatio); + + pCtx->hEnc = VideoEncoder_Create(&Cfg); + +@@ -308,14 +304,8 @@ static const AVOption options[] = + { + //{ option name, description, offset in the context object, type default, min, max, flags, unit} + { "qp", "Use constant QP for encoding.", OFFSET(cqp), AV_OPT_TYPE_INT, {.i64 = 25}, -1, 100, FLAGS }, +- { "r", "Set video framerate", OFFSET(framerate), AV_OPT_TYPE_INT, {.i64 = 30}, 25, 60, FLAGS }, +- { "b", "Set video bitrate", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = 4000000}, 0, 100000000, FLAGS }, ++ { "r", "Set video framerate", OFFSET(framerate), AV_OPT_TYPE_INT, {.i64 = 30}, 30, 30, FLAGS }, + { "ch", "Set encode channel ", OFFSET(channel), AV_OPT_TYPE_INT, {.i64 = 0}, 0, (VENC_MAX_CHANNELS-1), FLAGS }, +- { "maxrate", "Maximum bitrate. (0=ignore)", OFFSET(maxrate), AV_OPT_TYPE_INT, {.i64 = 4000000}, 0, 100000000, FLAGS }, +- { "ar", "Set aspect ratio", OFFSET(ar), AV_OPT_TYPE_INT, {.i64 = ASPECT_RATIO_AUTO}, ASPECT_RATIO_AUTO, ASPECT_RATIO_16_9, FLAGS, "ar_flags"}, +- { "auto", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_AUTO }, 0, 0, FLAGS, "ar_flags" }, +- { "4:3", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_4_3 }, 0, 0, FLAGS, "ar_flags" }, +- { "16:9", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_16_9 }, 0, 0, FLAGS, "ar_flags" }, + {NULL} + }; + diff --git a/package/ffmpeg_canaan/0034-buildroot-ffmpeg.patch b/package/ffmpeg_canaan/0034-buildroot-ffmpeg.patch new file mode 100755 index 0000000..f828290 --- /dev/null +++ b/package/ffmpeg_canaan/0034-buildroot-ffmpeg.patch @@ -0,0 +1,47 @@ +Index: b/libavcodec/libk510_h264.c +=================================================================== +--- a/libavcodec/libk510_h264.c ++++ b/libavcodec/libk510_h264.c +@@ -179,7 +179,7 @@ static av_cold int k510_h264_encode_init + Cfg.encDblkCfg.disable_deblocking_filter_idc = 0; + Cfg.encDblkCfg.slice_beta_offset_div2 = 1; + Cfg.encDblkCfg.slice_alpha_c0_offset_div2 = 1; +- Cfg.entropyMode = ENTROPY_MODE_CAVLC; ++ Cfg.entropyMode = ENTROPY_MODE_CABAC; + Cfg.sliceSplitCfg.bSplitEnable = false; + + printf("Encoder Settings:\n"); +@@ -428,7 +428,6 @@ static const AVOption options[] = + { "4:3", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_4_3 }, 0, 0, FLAGS, "ar_flags" }, + { "16:9", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_16_9 }, 0, 0, FLAGS, "ar_flags" }, + { "none", "", 0, AV_OPT_TYPE_CONST, { .i64 = ASPECT_RATIO_NONE }, 0, 0, FLAGS, "ar_flags" }, +- { "framesToEncode", "set the libk510_h264 framesToEncode", OFFSET(framesToEncode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS }, + {NULL} + }; + +Index: b/libavcodec/libk510_jpeg.c +=================================================================== +--- a/libavcodec/libk510_jpeg.c ++++ b/libavcodec/libk510_jpeg.c +@@ -143,7 +143,7 @@ static av_cold int k510_jpeg_encode_init + Cfg.encDblkCfg.disable_deblocking_filter_idc = 0; + Cfg.encDblkCfg.slice_beta_offset_div2 = 1; + Cfg.encDblkCfg.slice_alpha_c0_offset_div2 = 1; +- Cfg.entropyMode = ENTROPY_MODE_CAVLC; ++ Cfg.entropyMode = ENTROPY_MODE_CABAC; + Cfg.sliceSplitCfg.bSplitEnable = false; + + printf("Encoder Settings:\n"); +Index: b/libavfilter/af_audio3a.c +=================================================================== +--- a/libavfilter/af_audio3a.c ++++ b/libavfilter/af_audio3a.c +@@ -143,7 +143,7 @@ typedef struct Audio3aContext { + #define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM + + static const AVOption audio3a_options[] = { +- {"sample_rate", "set sample_rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 16000}, 1, INT_MAX, AF}, ++ {"sample_rate", "set sample_rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 16000}, 16000, 16000, AF}, + {"agc", "set agc mode", OFFSET(agc_mode), AV_OPT_TYPE_INT, {.i64 = AgcModeFixedDigital}, AgcModeUnchanged, AgcModeFixedDigital, AF, "agc_mode"}, + { "AgcModeUnchanged", "", 0, AV_OPT_TYPE_CONST, {.i64 = AgcModeUnchanged}, 0, 0, AF, "agc_mode"}, + { "AgcModeAdaptiveAnalog", "", 0, AV_OPT_TYPE_CONST, {.i64 = AgcModeAdaptiveAnalog}, 0, 0, AF, "agc_mode"}, diff --git a/package/ffmpeg_canaan/0035-buildroot-ffmpeg.patch b/package/ffmpeg_canaan/0035-buildroot-ffmpeg.patch new file mode 100755 index 0000000..8b338ba --- /dev/null +++ b/package/ffmpeg_canaan/0035-buildroot-ffmpeg.patch @@ -0,0 +1,13 @@ +Index: b/libavcodec/libk510_h264.c +=================================================================== +--- a/libavcodec/libk510_h264.c ++++ b/libavcodec/libk510_h264.c +@@ -409,7 +409,7 @@ static const AVOption options[] = + //{ option name, description, offset in the context object, type default, min, max, flags, unit} + // ***** GOP options ****** + { "g", "Set gop size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 25}, 0, 1000, FLAGS }, +- { "b", "Set video bitrate", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = 4000000}, 0, 20000000, FLAGS }, ++ { "b", "Set video bitrate", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = 4000000}, 1000, 20000000, FLAGS }, + { "r", "Set video framerate", OFFSET(framerate), AV_OPT_TYPE_INT, {.i64 = 30}, 30, 30, FLAGS }, + { "ch", "Set encode channel ", OFFSET(channel), AV_OPT_TYPE_INT, {.i64 = 0}, 0, (VENC_MAX_CHANNELS-1), FLAGS }, + { "idr_freq", "IDR frequency. -1=No IDRs", OFFSET(idrFreq), AV_OPT_TYPE_INT, {.i64 = 25 }, -1, 256, FLAGS }, diff --git a/package/ffmpeg_canaan/0036-buildroot-ffmpeg.patch b/package/ffmpeg_canaan/0036-buildroot-ffmpeg.patch new file mode 100644 index 0000000..bc64255 --- /dev/null +++ b/package/ffmpeg_canaan/0036-buildroot-ffmpeg.patch @@ -0,0 +1,20 @@ +Index: b/libavdevice/v4l2.c +=================================================================== +--- a/libavdevice/v4l2.c ++++ b/libavdevice/v4l2.c +@@ -1195,6 +1195,7 @@ static void mmap_close(struct video_data + + if(s->memory == V4L2_MEMORY_USERPTR) + { ++ munmap(s->buf_start[i], s->buf_len[i]); + if(ioctl(s->fd_share_memory, SHARE_MEMORY_FREE, &s->buf_paddr[i]) < 0) + { + printf("%s>Error!\n", __FUNCTION__); +@@ -1621,6 +1622,7 @@ static int v4l2_read_close(AVFormatConte + isp_deinit(ctx); + } + ++ mediactl_exit(); + return 0; + } + diff --git a/package/isp-tuningd/src/isp-tuningd.c b/package/isp-tuningd/src/isp-tuningd.c index 30f1053..1c90c35 100644 --- a/package/isp-tuningd/src/isp-tuningd.c +++ b/package/isp-tuningd/src/isp-tuningd.c @@ -24,6 +24,7 @@ */ #include "uv/unix.h" +#include #include #include #include @@ -65,9 +66,9 @@ #define ISP_TOF_ADDR_END (ISP_TOF_ADDR_START + 0x0400 + 0x0324) #define REGISTER_END_ADDR (0x0324 + 0x0400 + 0x92670000) #define DEFAULT_PORT 9982 -#define PIC_YUV_WIDTH 1088 -#define PIC_YUV_HEIGHT 1920 -#define PIC_YUV_SIZE (PIC_YUV_WIDTH * PIC_YUV_HEIGHT * 3 / 2) + +unsigned pic_yuv_width = 0, pic_yuv_height = 0, active_yuv_width = 0; +unsigned pic_yuv_size = 0; int page_size = 4096; unsigned offset_in_page = 0; @@ -75,13 +76,14 @@ unsigned map_size = 1048576; void* map_base = MAP_FAILED; EncoderHandle* henc = NULL; EncoderHandle* henc_h264 = NULL; -uint8_t pic_write_buffer_select = 0; -uint8_t pic_write_buffer[2][PIC_YUV_SIZE + 6] = { - {0x99, 0x9a, PIC_YUV_SIZE & 0xff, (PIC_YUV_SIZE >> 8) & 0xff, - (PIC_YUV_SIZE >> 16) & 0xff, (PIC_YUV_SIZE >> 24) & 0xff}, - {0x99, 0x9a, PIC_YUV_SIZE & 0xff, (PIC_YUV_SIZE >> 8) & 0xff, - (PIC_YUV_SIZE >> 16) & 0xff, (PIC_YUV_SIZE >> 24) & 0xff}, +struct __attribute__((__packed__)) command_buffer { + uint8_t head; + uint8_t command; + uint32_t size; + uint8_t buffer[0]; }; +uint8_t pic_write_buffer_select = 0; +struct command_buffer* pic_write_buffer[2]; uint8_t* mem_yuv_logic_addr = MAP_FAILED; unsigned int mem_yuv_map_size = 0; unsigned int mem_yuv_phy_addr = 0; @@ -436,14 +438,13 @@ void exec_cmd(void) { } else if (cmd == CMD_JPEG) { if (henc != NULL) { // encode JPEG - uint8_t *pic_nv12_buffer = - pic_write_buffer[pic_write_buffer_select ^ 1] + 6; - memcpy(mem_yuv_logic_addr, pic_nv12_buffer, PIC_YUV_SIZE); + uint8_t *pic_nv12_buffer = pic_write_buffer[pic_write_buffer_select ^ 1]->buffer; + memcpy(mem_yuv_logic_addr, pic_nv12_buffer, pic_yuv_size); EncInputFrame frame = { - .width = PIC_YUV_WIDTH, - .height = PIC_YUV_HEIGHT, - .stride = (PIC_YUV_WIDTH + 0x1F) & (~0x1F), - .data = (unsigned char *)mem_yuv_phy_addr + .width = active_yuv_width, + .height = pic_yuv_height, + .stride = pic_yuv_width, + .data = (unsigned char *)(uint64_t)mem_yuv_phy_addr }; // FIXME: async printf("encode jpeg start...\n"); @@ -457,14 +458,13 @@ void exec_cmd(void) { // encode h264 if (henc_h264 != NULL) { // encode h264 - uint8_t *pic_nv12_buffer = - pic_write_buffer[pic_write_buffer_select ^ 1] + 6; - memcpy(mem_yuv_logic_addr, pic_nv12_buffer, PIC_YUV_SIZE); + uint8_t *pic_nv12_buffer = pic_write_buffer[pic_write_buffer_select ^ 1]->buffer; + memcpy(mem_yuv_logic_addr, pic_nv12_buffer, pic_yuv_size); EncInputFrame frame = { - .width = PIC_YUV_WIDTH, - .height = PIC_YUV_HEIGHT, - .stride = (PIC_YUV_WIDTH + 0x1F) & (~0x1F), - .data = (unsigned char *)mem_yuv_phy_addr + .width = active_yuv_width, + .height = pic_yuv_height, + .stride = pic_yuv_width, + .data = (unsigned char *)(uint64_t)mem_yuv_phy_addr }; // FIXME: async printf("encode h264 start...\n"); @@ -551,6 +551,13 @@ void sock_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { } } +void sock_report_write_done (uv_write_t *req, int status) { + if (status) { + fprintf(stderr, "Write error %s\n", uv_strerror(status)); + } + free(req); +} + void on_new_connection(uv_stream_t *server, int status) { if (status < 0) { fprintf(stderr, "New connection error %s\n", uv_strerror(status)); @@ -562,6 +569,19 @@ void on_new_connection(uv_stream_t *server, int status) { struct list_node* n = &cw->node; uv_tcp_init(loop, client); if (uv_accept(server, (uv_stream_t*) client) == 0) { + // write message + struct command_buffer report_command = { + .head = 0x99, + .command = 0x91, + .size = 4 + }; + uint16_t report_data[2] = {active_yuv_width, pic_yuv_height}; + uv_buf_t buf[2] = { + uv_buf_init((char*)&report_command, sizeof(struct command_buffer)), + uv_buf_init((char*)report_data, 4) + }; + uv_write_t* write_req = malloc(sizeof(uv_write_t)); + uv_write(write_req, (uv_stream_t*)client, buf, 2, sock_report_write_done); uv_read_start((uv_stream_t*)client, alloc_buffer, sock_read); // insert to clients list_push_front(clients, n); @@ -578,14 +598,14 @@ void stdin_read(uv_stream_t *stream, ssize_t nread, const uv_buf_t* buf) return; } static uint32_t ptr = 0; - uint8_t* pic_nv12_buffer = pic_write_buffer[pic_write_buffer_select] + 6; - size_t lack = PIC_YUV_SIZE - ptr; + uint8_t* pic_nv12_buffer = pic_write_buffer[pic_write_buffer_select]->buffer; + size_t lack = pic_yuv_size - ptr; if (nread >= lack) { static time_t last_time = 0; if (flag_send_pic && time(NULL) - last_time >= 1) { memcpy(pic_nv12_buffer + ptr, buf->base, lack); // broadcast - broadcast(pic_write_buffer[pic_write_buffer_select], sizeof(pic_write_buffer[0]), 1); + broadcast(pic_write_buffer[pic_write_buffer_select], sizeof(struct command_buffer) + pic_yuv_size, 1); static uint32_t pic_num = 0; printf("received pictures, #%d\r", pic_num++); fflush(stdout); @@ -593,9 +613,9 @@ void stdin_read(uv_stream_t *stream, ssize_t nread, const uv_buf_t* buf) } // reset pic_write_buffer_select ^= 1; - pic_nv12_buffer = pic_write_buffer[pic_write_buffer_select] + 6; - // drop on too much data, align PIC_YUV_SIZE - ptr = (nread - lack) % PIC_YUV_SIZE; + pic_nv12_buffer = pic_write_buffer[pic_write_buffer_select]->buffer; + // drop on too much data, align pic_yuv_size + ptr = (nread - lack) % pic_yuv_size; if (flag_send_pic) { memcpy(pic_nv12_buffer, buf->base + (nread - ptr), ptr); } @@ -612,9 +632,9 @@ void stdin_read(uv_stream_t *stream, ssize_t nread, const uv_buf_t* buf) } void idle_mock_stdin (uv_idle_t* idle) { - char *stack_dirty = malloc(PIC_YUV_SIZE); - uv_buf_t buf = {.base = stack_dirty, .len = PIC_YUV_SIZE}; - stdin_read(NULL, PIC_YUV_SIZE, &buf); + char *stack_dirty = malloc(pic_yuv_size); + uv_buf_t buf = {.base = stack_dirty, .len = pic_yuv_size}; + stdin_read(NULL, pic_yuv_size, &buf); } int share_mem_fd = -1, mem_fd = -1; @@ -643,6 +663,56 @@ void before_exit(int sig) { } int main(int argc, char *argv[]) { + uint8_t flag_enable_codec = 0; + const char shortopts[] = "jw:h:"; + int c = 0; + while (c != -1) { + c = getopt(argc, argv, shortopts); + switch (c) { + case -1: break; + case 'j': { + flag_enable_codec = 1; + break; + } + case 'w': { + active_yuv_width = atol(optarg); + break; + } + case 'h': { + pic_yuv_height = atol(optarg); + break; + } + case '?': + default: { + fprintf(stderr, + "Usage: %s [options]\n\n" + "-w \tImage width\n" + "-h \tImage height\n" + "-j\tEnable hardware codec\n", + argv[0]); + return -1; + } + } + } + pic_yuv_width = (active_yuv_width + 15) / 16 * 16; + pic_yuv_size = pic_yuv_width * pic_yuv_height * 3 / 2; + if (pic_yuv_size > 0) { + pic_write_buffer[0] = malloc(sizeof(struct command_buffer) + pic_yuv_size); + pic_write_buffer[1] = malloc(sizeof(struct command_buffer) + pic_yuv_size); + pic_write_buffer[0]->head = 0x99; + pic_write_buffer[0]->command = 0x9A; + pic_write_buffer[0]->size = pic_yuv_size; + pic_write_buffer[1]->head = 0x99; + pic_write_buffer[1]->command = 0x9A; + pic_write_buffer[1]->size = pic_yuv_size; + } + + fprintf( + stderr, + "active_width: %u, width: %u, height: %u, frame size: %u\n", + active_yuv_width, pic_yuv_width, pic_yuv_height, pic_yuv_size + ); + // uv loop = uv_default_loop(); signal(SIGINT, before_exit); signal(SIGTERM, before_exit); @@ -663,23 +733,23 @@ int main(int argc, char *argv[]) { assert(mem_fd >= 0); map_base = mmap(NULL, map_size, PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, REGISTER_BASE_ADDR & ~(off_t)(page_size - 1)); assert(map_base != MAP_FAILED); - // for hd encoder - share_mem_fd = open("/dev/k510-share-memory", O_RDWR | O_SYNC); - assert(share_mem_fd >= 0); - assert(alloc_memory(share_mem_fd, PIC_YUV_SIZE, &mem_yuv_phy_addr, - &mem_yuv_map_size) == 0); - mem_yuv_logic_addr = mmap(NULL, mem_yuv_map_size, - PROT_READ | PROT_WRITE, MAP_SHARED, - mem_fd, (uint64_t)mem_yuv_phy_addr | 0x100000000); - assert(mem_yuv_logic_addr != MAP_FAILED); - fprintf(stderr, "map share mem phy addr: 0x%08X, size: %u\n", mem_yuv_phy_addr, mem_yuv_map_size); - - if (argc > 1 && strcmp(argv[1], "-j") == 0) { + + if (flag_enable_codec && pic_yuv_size > 0) { + // for hd encoder + share_mem_fd = open("/dev/k510-share-memory", O_RDWR | O_SYNC); + assert(share_mem_fd >= 0); + assert(alloc_memory(share_mem_fd, pic_yuv_size, &mem_yuv_phy_addr, + &mem_yuv_map_size) == 0); + mem_yuv_logic_addr = mmap(NULL, mem_yuv_map_size, + PROT_READ | PROT_WRITE, MAP_SHARED, + mem_fd, (uint64_t)mem_yuv_phy_addr | 0x100000000); + assert(mem_yuv_logic_addr != MAP_FAILED); + fprintf(stderr, "map share mem phy addr: 0x%08X, size: %u\n", mem_yuv_phy_addr, mem_yuv_map_size); // open encoder EncSettings encoder_settings = { .channel = 0, - .width = PIC_YUV_WIDTH, - .height = PIC_YUV_HEIGHT, + .width = active_yuv_width, + .height = pic_yuv_height, .FrameRate = 30, .BitRate = 4000000, .MaxBitRate = 4000000, @@ -700,8 +770,8 @@ int main(int argc, char *argv[]) { henc = VideoEncoder_Create(&encoder_settings); EncSettings encoder_settings_h264 = { .channel = 1, - .width = PIC_YUV_WIDTH, - .height = PIC_YUV_HEIGHT, + .width = active_yuv_width, + .height = pic_yuv_height, .FrameRate = 30, .BitRate = 4000000, .MaxBitRate = 4000000, @@ -736,16 +806,17 @@ int main(int argc, char *argv[]) { assert(setsockopt(server.io_watcher.fd, SOL_SOCKET, SO_REUSEADDR, &(int){1}, sizeof(int)) == 0); assert(uv_listen((uv_stream_t*)&server, 128, on_new_connection) == 0); - uv_tty_t input; - uv_handle_type t = uv_guess_handle(STDIN_FILENO); - if (t == UV_TTY) { - - } else if (t == UV_FILE) { - // TODO: read from file - printf("stdin is not stdin\n"); + if (pic_yuv_size > 0) { + uv_tty_t input; + uv_handle_type t = uv_guess_handle(STDIN_FILENO); + if (t == UV_TTY) { + } else if (t == UV_FILE) { + // TODO: read from file + printf("stdin is not stdin\n"); + } + uv_tty_init(loop, &input, STDIN_FILENO, 1); + uv_read_start((uv_stream_t*)&input, alloc_buffer, stdin_read); } - uv_tty_init(loop, &input, STDIN_FILENO, 1); - uv_read_start((uv_stream_t*)&input, alloc_buffer, stdin_read); #if DEBUG_STDIN uv_idle_t idle_task; uv_idle_init(loop, &idle_task); diff --git a/package/live555_canaan/0009-buildroot-live555.patch b/package/live555_canaan/0009-buildroot-live555.patch index f4001d8..03fd475 100644 --- a/package/live555_canaan/0009-buildroot-live555.patch +++ b/package/live555_canaan/0009-buildroot-live555.patch @@ -19,7 +19,7 @@ Index: b/testProgs/DataBufCtrlEX.cpp pthread_mutex_lock(&m_FrameMutex); //if (m_nBufferLen + nSize > HI_MAX_DATA_SIZE) - if (m_nPushIndex - m_nPopIndex > 100) -+ if (m_nPushIndex - m_nPopIndex > 15) ++ if (m_nPushIndex - m_nPopIndex > 100) { m_nBufferLen = 0; char sInfo[1000] = { 0 }; diff --git a/package/live555_canaan/0010-buildroot-live555.patch b/package/live555_canaan/0010-buildroot-live555.patch new file mode 100755 index 0000000..c100854 --- /dev/null +++ b/package/live555_canaan/0010-buildroot-live555.patch @@ -0,0 +1,79 @@ +Index: b/testProgs/IRtspServer.h +=================================================================== +--- a/testProgs/IRtspServer.h ++++ b/testProgs/IRtspServer.h +@@ -7,6 +7,7 @@ + */ + + #pragma once ++#include + + enum RTSP_AUDIO_TYPE + { +@@ -33,6 +34,7 @@ public: + virtual int CreateStreamUrl(char const* streamName) = 0;//ַ + virtual bool PushVideoData(unsigned char *pBuf, int nlen, unsigned long long dTime) = 0; //Ƶ(I֡SPSPPSڲԶʶƵ) + virtual bool PushAudioData(unsigned char *pBuf, int nlen, unsigned long long dTime) = 0; ++ virtual void GetThreadId(pthread_t *tid) = 0; + }; + + +Index: b/testProgs/RtspServerEX.cpp +=================================================================== +--- a/testProgs/RtspServerEX.cpp ++++ b/testProgs/RtspServerEX.cpp +@@ -141,9 +141,13 @@ int CRtspServerEX::Init(short sPort,bool + + OutPacketBuffer::maxSize = 10000000;//max framesize + //CreateThread(NULL, 0, StartRtspEventLoop, (LPVOID)NULL, 0, NULL); +- pthread_t tid1; +- pthread_create(&tid1, NULL, StartRtspEventLoop, this); ++ ++ pthread_create(&m_tid, NULL, StartRtspEventLoop, this); + ++ char name[12]; ++ sprintf(name, "rtsp%d", sPort); ++ pthread_setname_np(m_tid, name); ++ + return 0; + } + +@@ -152,3 +156,9 @@ void CRtspServerEX::SetAudioInfo(cons + m_audioInfo = audioInfo; + } + ++void CRtspServerEX::GetThreadId(pthread_t *tid) ++{ ++ *tid = m_tid; ++} ++ ++ +Index: b/testProgs/RtspServerEX.h +=================================================================== +--- a/testProgs/RtspServerEX.h ++++ b/testProgs/RtspServerEX.h +@@ -11,7 +11,7 @@ class CRtspSourceDataObj; + class UsageEnvironment; + class RTSPServer; + #include"IRtspServer.h" +- ++#include + + class CRtspServerEX:public IRtspServerEX + { +@@ -24,6 +24,7 @@ public: + int CreateStreamUrl(char const* streamName); + bool PushVideoData(unsigned char *pBuf, int nlen, unsigned long long dTime); + bool PushAudioData(unsigned char *pBuf, int nlen, unsigned long long dTime); ++ void GetThreadId(pthread_t *tid); + + protected: + static void* StartRtspEventLoop(void* pUser); +@@ -43,6 +44,6 @@ private: + int m_nCurUrlIndex; + RTSP_AUDIO_INFO m_audioInfo; + bool m_bTransferAudio; +- ++ pthread_t m_tid; + }; + diff --git a/package/mediactl_lib/mediactl_lib.mk b/package/mediactl_lib/mediactl_lib.mk index a223ceb..cfc73e3 100644 --- a/package/mediactl_lib/mediactl_lib.mk +++ b/package/mediactl_lib/mediactl_lib.mk @@ -14,17 +14,20 @@ define MEDIACTL_LIB_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/v4l2_demo/ all $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/v4l2_drm/ all $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/v4l2_test/ all - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/v4l2_drm_isptool/ all endef define MEDIACTL_LIB_INSTALL_STAGING_CMDS cp -rf $(@D)/libmediactl.so $(STAGING_DIR)/lib64/lp64d/libmediactl.so + cp -rf $(@D)/lib3actl.so $(STAGING_DIR)/lib64/lp64d/lib3actl.so + cp -rf $(@D)/libadaptive.so $(STAGING_DIR)/lib64/lp64d/libadaptive.so cp -rf $(@D)/media_ctl.h $(STAGING_DIR)/usr/include cp -rf $(@D)/isp/cJSON.h $(STAGING_DIR)/usr/include endef define MEDIACTL_LIB_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0755 $(@D)/libmediactl.so $(TARGET_DIR)/lib64/lp64d/libmediactl.so + $(INSTALL) -D -m 0755 $(@D)/lib3actl.so $(TARGET_DIR)/lib64/lp64d/lib3actl.so + $(INSTALL) -D -m 0755 $(@D)/libadaptive.so $(TARGET_DIR)/lib64/lp64d/libadaptive.so mkdir $(TARGET_DIR)/app/mediactl_lib/ -p #$(INSTALL) -D -m 0755 $(@D)/v4l2_demo/v4l2-demo $(TARGET_DIR)/app/mediactl_lib/ #$(INSTALL) -D -m 0755 $(@D)/v4l2_demo/*.conf $(TARGET_DIR)/app/mediactl_lib/ @@ -33,7 +36,6 @@ define MEDIACTL_LIB_INSTALL_TARGET_CMDS #$(INSTALL) -D -m 0755 $(@D)/v4l2_drm/imx219_1080x1920_0.conf $(TARGET_DIR)/app/mediactl_lib/ #$(INSTALL) -D -m 0755 $(@D)/v4l2_test/v4l2_test.out $(TARGET_DIR)/app/mediactl_lib/ #$(INSTALL) -D -m 0755 $(@D)/v4l2_test/video_test.conf $(TARGET_DIR)/app/mediactl_lib/ - $(INSTALL) -D -m 0755 $(@D)/v4l2_drm_isptool/v4l2_drm_isptool.out $(TARGET_DIR)/app/mediactl_lib/ $(INSTALL) -D -m 0755 $(@D)/config/*.conf $(TARGET_DIR)/app/mediactl_lib/ endef diff --git a/package/mediactl_lib/src/3a_ctl/ae_cfg_param.h b/package/mediactl_lib/src/3a_ctl/ae_cfg_param.h new file mode 100644 index 0000000..618764a --- /dev/null +++ b/package/mediactl_lib/src/3a_ctl/ae_cfg_param.h @@ -0,0 +1,123 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __3A_AE_CTL_CFG_H__ +#define __3A_AE_CTL_CFG_H__ + +static AE_CTL_INIT_CFG_T ae_ctl_init_cfg_param_dual_imx219 = +{ + /* can modify */ + .bDualCameraSync = 0, + .nSingleSensorETDelayFrame = {1, 1}, // [0]: f2k, [1]: r2k + .nSingleSensorSetMode = {1, 1}, // [0]: f2k, [1]: r2k + .nDualSensorETDelayFrame = {1, 1}, // [0]: f2k, [1]: r2k + .nDualSensorSetMode = {1, 1}, // [0]: f2k, [1]: r2k + .nFrameRate = {30, 30}, // [0]: sensor0, [1]: sensor1 + /* do not change */ + .nAeSmoothSteps = 9, +}; + +static AE_CTL_INIT_CFG_T ae_ctl_init_cfg_param_dual_imx385 = +{ + /* can modify */ + .bDualCameraSync = 0, + .nSingleSensorETDelayFrame = {1, 1}, // [0]: f2k, [1]: r2k + .nSingleSensorSetMode = {0, 0}, // [0]: f2k, [1]: r2k + .nDualSensorETDelayFrame = {0, 0}, // [0]: f2k, [1]: r2k + .nDualSensorSetMode = {0, 0}, // [0]: f2k, [1]: r2k + .nFrameRate = {30, 30}, // [0]: sensor0, [1]: sensor1 + + /* do not change */ + .nAeSmoothSteps = 9, +}; + +static AE_CTL_INIT_CFG_T ae_ctl_init_cfg_param_gc2093_gc2053 = +{ + /* can modify */ + .bDualCameraSync = 0, + .nSingleSensorETDelayFrame = {0, 0}, // [0]: f2k, [1]: r2k + .nSingleSensorSetMode = {0, 0}, // [0]: f2k, [1]: r2k + .nDualSensorETDelayFrame = {0, 0}, // [0]: f2k, [1]: r2k + .nDualSensorSetMode = {0, 0}, // [0]: f2k, [1]: r2k + .nFrameRate = {30, 30}, // [0]: sensor0, [1]: sensor1 + + /* do not change */ + .nAeSmoothSteps = 9, +}; + +/* different sensor type between sensor0 and sensor1 */ +// static AE_CTL_INIT_CFG_T ae_ctl_init_cfg_param_imx385_imx219 = +// { +// /* can modify */ +// .bDualCameraSync = 1, +// .nSingleSensorETDelayFrame = {1, 1}, // [0]: f2k, [1]: r2k +// .nSingleSensorSetMode = {0, 0}, // [0]: f2k, [1]: r2k +// .nDualSensorETDelayFrame = {0, 0}, // [0]: f2k, [1]: r2k +// .nDualSensorSetMode = {0, 0}, // [0]: f2k, [1]: r2k +// .nFrameRate = {30, 30}, // [0]: sensor0, [1]: sensor1 + +// /* do not change */ +// .nAeSmoothSteps = 9, +// }; + +AE_CTL_SENSOR_NAME_T ae_ctl_sensor_name[] = +{ + // dual imx219(default) + { + .cSensor0Name = "m00_f_imx219_0 0-0010", + .cSensor1Name = "m01_f_imx219_1 3-0010", + .tAeCtlInitCfg = &ae_ctl_init_cfg_param_dual_imx219, + }, + + // dual imx385 + { + .cSensor0Name = "m00_f_IMX385 0-001a", + .cSensor1Name = "m00_f_imx385 3-001a", + .tAeCtlInitCfg = &ae_ctl_init_cfg_param_dual_imx385, + }, + + // sensor0: gc2093, sensor1: gc2053 + { + .cSensor0Name = "m00_f_gc2093 0-007e", + .cSensor1Name = "m01_f_gc2053 0-0037", + .tAeCtlInitCfg = &ae_ctl_init_cfg_param_gc2093_gc2053, + }, + + + // // sensor0: imx385, sensor1: imx219 + // { + // .cSensor0Name = "m00_f_imx385_0 0-0010", + // .cSensor1Name = "m00_f_imx219_0 3-0010", + // .tAeCtlInitCfg = &ae_ctl_init_cfg_param_imx385_imx219, + // }, +}; + +AE_CTL_SENSOR_NAME_S_T ae_ctl_sensor_name_s = +{ + .nSize = sizeof(ae_ctl_sensor_name) / sizeof(AE_CTL_SENSOR_NAME_T), + .tAeCtlSensorName = ae_ctl_sensor_name, +}; + +#endif \ No newline at end of file diff --git a/package/mediactl_lib/src/3a_ctl/ae_ctl.h b/package/mediactl_lib/src/3a_ctl/ae_ctl.h new file mode 100644 index 0000000..4d352aa --- /dev/null +++ b/package/mediactl_lib/src/3a_ctl/ae_ctl.h @@ -0,0 +1,176 @@ +#ifndef __3A_AE_CTL_H__ +#define __3A_AE_CTL_H__ + +#define AE_CTL_MANUAL_SET_EXP_MODE 0 +#define AE_CTL_MANUAL_SET_GAIN_MODE 1 +#define AE_CTL_MANUAL_SET_TARGET_MODE 2 +#define AE_CTL_MANUAL_SET_TARGET_RANGE_MODE 3 +#define AE_CTL_MANUAL_SET_FROM_USER 4 +enum ae_ctl_isp_pipeline_e +{ + AE_CTL_ISP_F2K_PIPELINE, + AE_CTL_ISP_R2K_PIPELINE, + AE_CTL_ISP_TOF_PIPELINE +}; + +enum ISP_AE_Mode +{ + AE_Auto, + AE_Manual, +}; + +enum ISP_AE_Anti_Flicker_Mode +{ + Anti_flicker_50Hz_auto, + Anti_flicker_60Hz_auto, + Anti_flicker_50Hz_force, + Anti_flicker_60Hz_force, + Anti_flicker_None, +}; + +enum ISP_Backlight_Mode +{ + Normal, + Backlight_Compensation, + Stronglight_Suppression, +}; + +enum anti_flicker_scl_e +{ + ANTI_FLICKER_ALL_DSIABLE, + ANTI_FLICKER_F2K_ENABLE, + ANTI_FLICKER_R2K_ENABLE, + ANTI_FLICKER_ALL2K_ENABLE, +}; + +enum ae_attr_page_stat_e +{ + AE_ATTR_PAGE_WAIT, + AE_ATTR_PAGE_ON, + AE_ATTR_PAGE_OFF, + AE_ATTR_PAGE_ON_TO_OFF, +}; + +struct ISP_AE_Parameters { + enum ISP_AE_Mode AE_Mode; + enum ISP_AE_Anti_Flicker_Mode AE_AntiFlicker; //Anti-flicker mode + enum ISP_Backlight_Mode AE_Backlight; //Backlight mode + int target; //get from AE_YOBJ + int LockRange; //get from AE_AV_RG + int maxET; //get from AE_EXP_MAX + int maxGain; //get from AE_AGC_MAX + int minET; //get from AE_EXP_MIN + int minGain; //get from AE_AGC_MIN + int Lock_IntNum; //get from AE_LKIN_SL, AE_LKIN_SL = 0: F2K_Lock_IntNum = 32; AE_LKIN_SL = 1: F2K_Lock_IntNum = 64; + int Lock_OutNum; //get from AE_LKOT_SL, AE_LKOT_SL = 0: F2K_Lock_OutNum = 32; AE_LKOT_SL = 1: F2K_Lock_OutNum = 64; + + int ET_Current; //initial setting: get from AE_EXP_L + int Gain_Current; //initial setting: get from AE_AGC + int ET_New; + int Gain_New; + int Def_Gain; + unsigned long Max_Exposure_Value; // F2K_maxET*F2K_maxGain + unsigned long Min_Exposure_Value; //F2K_minET * F2K_minGain + unsigned long Old_Exposure_Value; // ET_Curren* Gain_Current + unsigned long New_Exposure_Value; //New_ET* New_Gain + unsigned int ET_Set; + unsigned int Gain_Set; + + int LockStatus; + int Process; //0:not in set AE process;1~ AESmoothSteps:in set AE process + int Change; //0: in the process of decrease the exposure value;1: in the process of increasing the exposure value + int FrameRate; //Frame rate + int FrameLines; //ET lines per frame + int AntiF_Lines; //Based ET lines for Anti_Flicker 50Hz/60Hz + int Anti_50Hz_Lines; // 1/100s ET lines + int Anti_60Hz_Lines; //1/120s ET lines + int ready_to_write_et; // need write exp time current frame + int ready_to_write_gain; // need write gain current frame + int user_re_init; // re init when param is changed +}; + +typedef struct { + int nExpTimeLines; + int nGain; +} AE_CTL_AE_STAT_T; + +typedef struct { + /* modify param */ + bool bDualCameraSync; + int nSingleSensorETDelayFrame[2]; + int nSingleSensorSetMode[2]; + int nDualSensorETDelayFrame[2]; + int nDualSensorSetMode[2]; + int nFrameRate[2]; + /* fix param */ + int nAeSmoothSteps; //将AE收敛分为9步完成,可设置, >=7 // internal + +} AE_CTL_INIT_CFG_T; + +typedef struct { + char * cSensor0Name; + char * cSensor1Name; + AE_CTL_INIT_CFG_T * tAeCtlInitCfg; +} AE_CTL_SENSOR_NAME_T; + +typedef struct { + int nSize; + AE_CTL_SENSOR_NAME_T * tAeCtlSensorName; +} AE_CTL_SENSOR_NAME_S_T; + +typedef struct { + int nAttePageEn; + int nAeModeSwitch; +} AE_CTL_ATTR_PARAM; + +typedef struct { + int nAeTarBright; + int nAeTarBrightRange; + int nAeExValueMax; + int nAeGainValueMax; + int nAeExValueMin; + int nAeGainValueMin; + int nAeEnterLsSel; + int nAeLExTime; + int nAeAgc; + int nTotalHeight; +} AE_CTL_ISP_INIT_PARAM; + +extern bool Sensor1_Sync; +extern int AESmoothSteps; //将AE收敛分为9步完成,可设置, >=7 +extern int ETDelayFrameNumber[2]; //Sensor ET设置生效所需帧数 +extern struct ISP_AE_Parameters AE_Para_Inf[2]; + +/* callback */ +typedef int (* manual_set_callback)(enum ae_ctl_isp_pipeline_e pipeline, int value); + +/* main functions */ +int Anti_Flicker_ETL(enum ae_ctl_isp_pipeline_e pipeline); +int Set_AE_Value(enum ae_ctl_isp_pipeline_e pipeline, struct media_entity * pipe, AE_CTL_AE_STAT_T * ae_stat_callback); + +/* user enable*/ +int anti_flicker_scl(int scl); + +/* user init */ +int ae_ctl_cfg_init(int pipeline_en_f2k, int pipeline_en_r2k, AE_CTL_SENSOR_NAME_S_T ae_ctl_sensor_name_s, char * sensor0_name, char * sensor1_name); +int ae_ctl_init(enum ae_ctl_isp_pipeline_e pipeline, struct isp_core_cfg_info * isp_core_cfg); +// re init when param change online +int ae_ctl_reinit(enum ae_ctl_isp_pipeline_e pipeline); +// n: number of devices, ... &(struct media_entity) f2k r2k sensor0 sensor1 +int ae_ctl_device_init(int n, ...); + +/* user functions */ +int ae_ctl_calc(enum ae_ctl_isp_pipeline_e pipeline, struct k510isp_ae_stats ae_stats, struct media_entity * pipe, AE_CTL_AE_STAT_T * ae_stat_callback); +int ae_ctl_limit_range(enum ae_ctl_isp_pipeline_e pipeline, int min_et, int max_et, int max_gain); +int ae_ctl_manual_set(int set_mode, manual_set_callback userfunc, enum ae_ctl_isp_pipeline_e pipeline, int value, AE_CTL_AE_STAT_T * ae_stat_callback); +int et_line_time_convert(enum ae_ctl_isp_pipeline_e pipeline, int exp_time); +int line_time_et_convert(enum ae_ctl_isp_pipeline_e pipeline, int et); +int anti_flicker_switch(enum ae_ctl_isp_pipeline_e pipeline, int scl); +int ae_ctl_sync_setting(enum ae_ctl_isp_pipeline_e pipeline, int ae_sync); +int ae_ctl_attr_page_stat_set_v2(enum ae_ctl_isp_pipeline_e pipeline, int stat); +int ae_ctl_attr_page_param_set(enum ae_ctl_isp_pipeline_e pipeline, AE_CTL_ATTR_PARAM page_attr); + +/* user get version */ +char * ae_ctl_get_version(); + +#endif \ No newline at end of file diff --git a/package/mediactl_lib/src/Makefile b/package/mediactl_lib/src/Makefile index 46bef81..37426be 100644 --- a/package/mediactl_lib/src/Makefile +++ b/package/mediactl_lib/src/Makefile @@ -16,10 +16,10 @@ CROSS_COMPILE = riscv64-linux- CC=$(CROSS_COMPILE)gcc LD=$(CROSS_COMPILE)ld -CCFLAGS=-g -Wall -lm -L ./ -O2 +CCFLAGS=-g -Wall -lm -L./ -Iadaptive -ladaptive -I3actl -l3actl -O2 ${TARGET}: ${OBJ} - ${LD} ${OBJ} -shared -o $@ + ${LD} ${OBJ} -L./ -ladaptive -l3actl -shared -o $@ @echo "Compile done." $(OBJ):%.o:%.c @@ -36,4 +36,4 @@ clean: @rm -f ${TARGET} @echo "Clean target files done." - @echo "Clean done." \ No newline at end of file + @echo "Clean done." diff --git a/package/mediactl_lib/src/adaptive/adaptive_isp_reg.h b/package/mediactl_lib/src/adaptive/adaptive_isp_reg.h new file mode 100644 index 0000000..1643d54 --- /dev/null +++ b/package/mediactl_lib/src/adaptive/adaptive_isp_reg.h @@ -0,0 +1,211 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ +#ifndef _ADAPTIVE_ISP_CORE_REG_H_ +#define _ADAPTIVE_ISP_CORE_REG_H_ + +//itc +#define ISP_CORE_ITC_CTL (0x0000) +#define ISP_CORE_ITC_TTL_V (0x0004) // * +#define ISP_CORE_ITC_TTL_H (0x0008) +#define ISP_CORE_IMAGE_V_START (0x000C) +#define ISP_CORE_IMAGE_H_START (0x0010) +#define ISP_CORE_IMAGE_ACTIVE_WIDTH (0x0014) +#define ISP_CORE_IMAGE_ACTIVE_HEIGHT (0x0018) +//tpg +#define ISP_CORE_TEST_CTL (0x001C) +//blc +#define ISP_CORE_BLC_CTL (0x0020) +#define ISP_CORE_BLC_OFFSET (0x0024) +#define ISP_CORE_BLC_RATIO (0x0028) +//lsc +#define ISP_CORE_LSC_CTL (0x002C) +#define ISP_CORE_LSC_H_CENTER (0x0030) +#define ISP_CORE_LSC_V_CENTER (0x0034) +#define ISP_CORE_LSC_R_RATIO (0x0038) +#define ISP_CORE_LSC_G_RATIO (0x003C) +#define ISP_CORE_LSC_B_RATIO (0x0040) +#define ISP_CORE_LSC_IR_RATIO (0x0044) +//ae +#define ISP_CORE_AE_CTL (0x0050) +#define ISP_CORE_AE_WIN_H_START (0x0054) +#define ISP_CORE_AE_WIN_V_START (0x0058) +#define ISP_CORE_AE_WIN_H_END (0x005C) +#define ISP_CORE_AE_WIN_V_END (0x0060) +#define ISP_CORE_AE_TAR_BR (0x0064) +#define ISP_CORE_AE_TAR_BR_RANGE (0x0068) +#define ISP_CORE_AE_L_EX_TIME (0x006C) +#define ISP_CORE_AE_M_EX_TIME (0x0070) +#define ISP_CORE_AE_S_EX_TIME (0x0074) +#define ISP_CORE_AE_AGC (0x0078) +#define ISP_CORE_AE_ADJUST_CTL (0x007C) +#define ISP_CORE_AE_ADJUST_STEP_MAX (0x0080) +#define ISP_CORE_AE_EX_VALUE_MAX (0x0084) +#define ISP_CORE_AE_EX_VALUE_MID (0x0088) +#define ISP_CORE_AE_EX_VALUE_MIN (0x008C) +#define ISP_CORE_AE_GAIN_MAX (0x0090) +#define ISP_CORE_AE_GAIN_MID (0x0094) +#define ISP_CORE_AE_GAIN_MIN (0x0098) +#define ISP_CORE_AE_DN_SWITCH_ADJUST_STEP_MAX (0x009C) +#define ISP_CORE_AE_DN_SWITCH_WAIT_TIME (0x00A0) + +#define ISP_CORE_APE_DIFF_MAX (0x00AC) +#define ISP_CORE_APE_DRV_SIGNAL_MAX (0x00B0) +#define ISP_CORE_APE_COEFF_DIS (0x00B4) +#define ISP_CORE_APE_COEFF_SPEED (0x00B8) +#define ISP_CORE_APE_COEFF_ACCE (0x00BC) +#define ISP_CORE_APE_DRV_MANUAL_VALUE (0x00C0) +#define ISP_CORE_APE_DAMP_MANUAL_VALUE (0x00C4) + +#define ISP_CORE_AE_VALUE_READY (0x00D4) +#define ISP_CORE_AE_LONG_CUR_EX (0x00D8) +#define ISP_CORE_AE_MID_CUR_EX (0x00DC) +#define ISP_CORE_AE_SHORT_CUR_EX (0x00E0) +#define ISP_CORE_AE_CUR_DIGITAL_GAIN (0x00E4) +#define ISP_CORE_AE_CUR_AVE_BRIGHTNESS (0x00E8) +#define ISP_CORE_AE_CUR_DN_STATUS (0x00EC) +#define ISP_CORE_AE_EX_STATUS (0x00F0) +#define ISP_CORE_AE_SUM (0x00F4) +#define ISP_CORE_AE_PIXEL_SUM (0x00F8) +//awb +#define ISP_CORE_AWB_CTL (0x0104) +#define ISP_CORE_AWB_D65_RED_GAIN (0x0108) +#define ISP_CORE_AWB_D65_BLUE_GAIN (0x010C) +#define ISP_CORE_CCM_RR_COFF (0x0110) +#define ISP_CORE_CCM_RG_COFF (0x0114) +#define ISP_CORE_CCM_RB_COFF (0x0118) +#define ISP_CORE_CCM_GR_COFF (0x011C) +#define ISP_CORE_CCM_GG_COFF (0x0120) +#define ISP_CORE_CCM_GB_COFF (0x0124) +#define ISP_CORE_CCM_BR_COFF (0x0128) +#define ISP_CORE_CCM_BG_COFF (0x012C) +#define ISP_CORE_CCM_BB_COFF (0x0130) +#define ISP_CORE_CCM_CORRECT_COFF (0x0134) +#define ISP_CORE_AWB_WIN_H_START (0x0138) +#define ISP_CORE_AWB_WIN_V_START (0x013C) +#define ISP_CORE_AWB_WIN_H_END (0x0140) +#define ISP_CORE_AWB_WIN_V_END (0x0144) +#define ISP_CORE_AWB_CORRECT_DIFF_TH (0x0148) +#define ISP_CORE_AWB_RES_TIME (0x014C) +#define ISP_CORE_AWB_HIST_TH (0x0150) +#define ISP_CORE_AWB_RED_GAIN_ADJUST (0x0154) +#define ISP_CORE_AWB_GREEN_GAIN_ADJUST (0x0158) +#define ISP_CORE_AWB_BLUE_GAIN_ADJUST (0x015C) +#define ISP_CORE_AWB_RED_MAX_VALUE (0x0160) +#define ISP_CORE_AWB_BLUE_MAX_VALUE (0x0164) +#define ISP_CORE_AWB_RED_MIN_VALUE (0x0168) +#define ISP_CORE_AWB_BLUE_MIN_VALUE (0x016C) +#define ISP_CORE_AWB_RED_OBJ_VALUE (0x0170) +#define ISP_CORE_AWB_BLUE_OBJ_VALUE (0x0174) +#define ISP_CORE_AWB_BLUE_HIST_VALUE (0x017C) +#define ISP_CORE_AWB_BLUE_HIST_PIXEL (0x0180) +#define ISP_CORE_AWB_RED_HIST_VALUE (0x0184) +#define ISP_CORE_AWB_RED_HIST_PIXEL (0x0188) +#define ISP_CORE_AWB_BYPASS_BLUE_HIST_VALUE (0x018C) +#define ISP_CORE_AWB_BYPASS_BLUE_HIST_PIXEL (0x0190) +#define ISP_CORE_AWB_BYPASS_RED_HIST_VALUE (0x0194) +#define ISP_CORE_AWB_BYPASS_RED_HIST_PIXEL (0x0198) +#define ISP_CORE_AWB_RED_VALUE (0x019C) +#define ISP_CORE_AWB_GREEN_VALUE (0x01A0) +#define ISP_CORE_AWB_BLUE_VALUE (0x01A4) +#define ISP_CORE_AWB_ORG_RED_VALUE (0x01A8) +#define ISP_CORE_AWB_ORG_GREEN_VALUE (0x01AC) +#define ISP_CORE_AWB_ORG_BLUE_VALUE (0x01B0) +//wdr +#define ISP_CORE_WDR_CTL (0x01B8) +#define ISP_CORE_WDR_OVER_EX_RATIO_TH1 (0x01BC) +#define ISP_CORE_WDR_OVER_EX_RATIO_TH2 (0x01C0) +#define ISP_CORE_WDR_FUSION_RATIO_TH (0x01C4) +#define ISP_CORE_WDR_FUSION_VALUE1 (0x01C8) +#define ISP_CORE_WDR_FUSION_VALUE2 (0x01CC) +//csc +#define ISP_CORE_CSC_R2Y_00 (0x01D8) +#define ISP_CORE_CSC_R2Y_01 (0x01DC) +#define ISP_CORE_CSC_R2Y_02 (0x01E0) +#define ISP_CORE_CSC_R2Y_10 (0x01E4) +#define ISP_CORE_CSC_R2Y_11 (0x01E8) +#define ISP_CORE_CSC_R2Y_12 (0x01EC) +#define ISP_CORE_CSC_R2Y_20 (0x01F0) +#define ISP_CORE_CSC_R2Y_21 (0x01F4) +#define ISP_CORE_CSC_R2Y_22 (0x01F8) +//ada +#define ISP_CORE_ADA_CTL (0x0204) +#define ISP_CORE_ADA_STAT_MAX_VALUE (0x0208) +#define ISP_CORE_ADA_AD_STREN_MAX_VALUE (0x020C) +#define ISP_CORE_ADA_WIN_H_START (0x0210) +#define ISP_CORE_ADA_WIN_V_START (0x0214) +#define ISP_CORE_ADA_WIN_H_END (0x0218) +#define ISP_CORE_ADA_WIN_V_END (0x021C) +//rgbir +#define ISP_CORE_RGBIR_CTL (0x0230) +#define ISP_CORE_RGBIR_RPC_MAX_VALUE (0x0234) +#define ISP_CORE_RGBIR_RPC_COLOR_COFF (0x0238) +#define ISP_CORE_RGBIR_RPC_LUMA_COFF (0x023C) +#define ISP_CORE_RGBIR_RPC_TH (0x0240) +#define ISP_CORE_RGBIR_RPC_TH1 (0x0244) +//2dnr +#define ISP_CORE_2DNR_CTL (0x0258) +#define ISP_CORE_2DNR_RAW_INTENSITY (0x025C) +#define ISP_CORE_2DNR_BAP_INTENSITY (0x0260) +#define ISP_CORE_2DNR_EDGE_INTENSITY (0x0264) +#define ISP_CORE_2DNR_LUMA_INTENSITY (0x0268) +#define ISP_CORE_2DNR_CHROMA_INTENSITY (0x026C) +//3dnr +#define ISP_CORE_3DNR_CTL (0x0278) +#define ISP_CORE_3DNR_PRE_LUMA_TH (0x027C) +#define ISP_CORE_3DNR_PRE_LUMA_INTENSITY (0x0280) +#define ISP_CORE_3DNR_PRE_CHROMA_INTENSITY (0x0284) +#define ISP_CORE_3DNR_MID_FILTER_TH (0x0288) +#define ISP_CORE_3DNR_PRE_MID_FILTER_TH (0x028C) +#define ISP_CORE_3DNR_CUR_FILTER_TH (0x0290) +#define ISP_CORE_3DNR_LOW_PASS_FILTER_TH (0x0294) +#define ISP_CORE_3DNR_LUMA_TH (0x0298) +#define ISP_CORE_3DNR_MIN_VALUE (0x029C) +#define ISP_CORE_3DNR_LUMA_INTENSITY (0x02A0) +#define ISP_CORE_3DNR_CHROMA_INTENSITY (0x02A4) +#define ISP_CORE_3DNR_POST_EDGE_TH (0x02A8) +#define ISP_CORE_3DNR_POST_LUMA_INTENSITY (0x02AC) +#define ISP_CORE_3DNR_POST_CHROMA_INTENSITY (0x02B0) +//enh +#define ISP_CORE_ENH_CTL (0x02BC) +#define ISP_CORE_LTM_GAIN (0x02C0) +#define ISP_CORE_LTM_TH (0x02C4) +#define ISP_CORE_ENH_NR_TH (0x02C8) +#define ISP_CORE_ENH_TH1 (0x02CC) +#define ISP_CORE_ENH_TH2 (0x02D0) +#define ISP_CORE_SHARP_GAIN (0x02D4) +//post +#define ISP_CORE_POST_CTL (0x02E4) +#define ISP_CORE_CONT_GAIN (0x02E8) +#define ISP_CORE_LUMA_GAIN (0x02EC) +#define ISP_CORE_SATU_GAIN (0x02F0) +//otc +#define ISP_CORE_OTC_STT_VR (0x02F4) +#define ISP_CORE_OTC_STT_HR (0x02F8) +#define ISP_CORE_OTC_HEIGHT (0x02FC) +#define ISP_CORE_OTC_WIDTH (0x0300) +//ldc +#define ISP_CORE_LDC_CTL (0x0304) +#define ISP_CORE_LDC_REQ_FREQ (0x0308) +#define ISP_CORE_LDC_H_CENTER_POS (0x030C) +#define ISP_CORE_LDC_V_CENTER_POS (0x0310) +#define ISP_CORE_LDC_RECTIFY_CR (0x0314) +#define ISP_CORE_LDC_RECTIFY_CZ (0x0318) +//ram table +#define ISP_CORE_RAM_WR_STATUS (0x0320) +#define ISP_CORE_RAM_RD_STATUS (0x0324) +#define ISP_CORE_RAM_READ_LOCK (0x0328) +//af +#define ISP_CORE_AF_CTL (0x0340) +#define ISP_CORE_AF_STAT_WIN_H_START (0x0344) +#define ISP_CORE_AF_STAT_WIN_V_START (0x0348) +#define ISP_CORE_AF_STAT_WIN_H_END (0x034C) +#define ISP_CORE_AF_STAT_WIN_V_END (0x0350) +#define ISP_CORE_AF_MID_FRQ_DATA (0x035C) +#define ISP_CORE_AF_HIGH_FRQ_DATA (0x0360) +#define ISP_CORE_AF_STAT_PIXEL_NUM (0x0364) +#define ISP_CORE_RGB_GAMMA_HEAD_ADDR (0x0400) +#endif /*_ISP_CORE_REG_H_*/ \ No newline at end of file diff --git a/package/mediactl_lib/src/adaptive/adaptive_params.h b/package/mediactl_lib/src/adaptive/adaptive_params.h new file mode 100644 index 0000000..ddad8e1 --- /dev/null +++ b/package/mediactl_lib/src/adaptive/adaptive_params.h @@ -0,0 +1,74 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ADAPTIVE_PARAMS_SETTING_ +#define _ADAPTIVE_PARAMS_SETTING_ + +/* f2k adaptive param include */ +#include "sensor_params/imx219/adaptive_imx219_f2k.h" +#include "sensor_params/imx385/adaptive_imx385_f2k.h" +#include "sensor_params/gc2093_gc2053/adaptive_gc2093_f2k.h" + +/* r2k adaptive param include */ +#include "sensor_params/imx219/adaptive_imx219_r2k.h" +#include "sensor_params/imx385/adaptive_imx385_r2k.h" +#include "sensor_params/gc2093_gc2053/adaptive_gc2053_r2k.h" + + + +#include "adaptive_setting.h" + +/* user use different sensor will use corresponding param */ +ADAPTIVE_SENSOR_NAME_T adaptive_sensor_name[] = +{ + // imx219(default) + { + .cSensor0Name = "m00_f_imx219_0 0-0010", + .cSensor1Name = "m01_f_imx219_1 3-0010", + .tAdapIspParamF2k = &adap_imx219_f2k, + .tAdapIspParamR2k = &adap_imx219_r2k, + }, + // imx385 + { + .cSensor0Name = "m00_f_IMX385 0-001a", + .cSensor1Name = "m00_f_imx385 3-001a", + .tAdapIspParamF2k = &adap_imx385_f2k, + .tAdapIspParamR2k = &adap_imx385_r2k, + }, + // gc2093_gc2053 + { + .cSensor0Name = "m00_f_gc2093 0-007e", + .cSensor1Name = "m01_f_gc2053 0-0037", + .tAdapIspParamF2k = &adap_gc2093_f2k, + .tAdapIspParamR2k = &adap_gc2053_r2k, + }, +}; + +ADAPTIVE_SENSOR_NAME_S_T adaptive_sensor_name_s = +{ + .size = sizeof(adaptive_sensor_name) / sizeof(ADAPTIVE_SENSOR_NAME_T), + .tAdaptiveSensorName = adaptive_sensor_name, +}; +#endif \ No newline at end of file diff --git a/package/mediactl_lib/src/adaptive/adaptive_setting.h b/package/mediactl_lib/src/adaptive/adaptive_setting.h new file mode 100644 index 0000000..8d4903f --- /dev/null +++ b/package/mediactl_lib/src/adaptive/adaptive_setting.h @@ -0,0 +1,460 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __ADAPTIVE_SETTING_H__ +#define __ADAPTIVE_SETTING_H__ + +#define ADAPTIVE_WEIGHT_THRESHOLD 0 // 0 - 255 +#define ADAPTIVE_GAMMA_DAY 0 +#define ADAPTIVE_GAMMA_NIGHT 1 +#define ADAPTIVE_COLOR_TO_GREY 0 +#define ADAPTIVE_GREY_TO_COLOR 1 +#define ADAPTIVE_COLOR_GREY_USE_CSM 1 +#define ADAPTIVE_COLOR_GREY_USE_CCM 2 +#define ADAPTIVE_IR_CUT_DAY_TO_NIGHT 0 +#define ADAPTIVE_IR_CUT_NIGHT_TO_DAY 1 +#define ADAPTIVE_EXPOSURE_LINE_V 1979 +#define ADAPTIVE_ANTI_FLICKER_MODE_50Hz 1 +#define ADAPTIVE_ANTI_FLICKER_MODE_60Hz 2 +#define ADAPTIVE_ANTI_FLICKER_CORRECT_PRECENT 150 +#define ADAPTIVE_ANTI_FLICKER_50Hz_PERIOD (1000000/(50 * 2)) +#define ADAPTIVE_ANTI_FLICKER_60Hz_PERIOD (1000000/(60 * 2)) +#define ADAPTIVE_ANTI_FLICKER_FPS 30 +#define ADAPTIVE_UNIT_CONVERT 1000 +#define ADAPTIVE_ET_LINE_OFFSET_RATE 0.50 +#define ADAPTIVE_CORRECT_GAIN_OFFSET 384 +#define ADAPTIVE_GAIN_MAX_CORRECT_OFFSET 8 // 256 * 0.03 +#define ADAPTIVE_3A_SYNC_FOLLOW_SELECT 1 // need f2k & r2k sync stat is 1, 0: nothing 1 : follow f2k, 2 : follow r2k(can not work normaly, need fix ae_wren = 1) +#define ADAPTIVE_AE_EHN_MODE_NORMAL 0 +#define ADAPTIVE_AE_EHN_MODE_BACKLIGHT 1 +#define ADAPTIVE_AE_EHN_MODE_STRONG_LIGHT_SUPPRESSION 2 +#define ADAPTIVE_IR_CUT_MAX_LEVEL 20 +#define ADAPTIVE_IR_CUT_MIN_LEVEL 0 + +/* struct define */ +typedef struct _ADAPTIVE_USER_ATTR_ISP_CTL_T { + int nLscEnable; // 0: disable, 1: enable + int nLdcEnable; // 0: disable, 1: enable + int nAeEnable; // 0: manual ae, 1: auto ae + int nAeEnhMode; // 0: normal, 1: ae back light compensation, 2: strong light suppression + int nWdrEnable; // 0: normal, 1: linner-wdr enable + int nAwbEnable; // 0: all disbale, 1: d65 gain enable, 2: ccm enable, ... 527: + int nFlip; // 0: normal, 1: hflip, 2: vflip, 3: hvflip + int nAntiflickerScl; // 0: disable, 1: 50Hz auto, 2: 50Hz force 3: 60Hz auto, 4: 60Hz force + int nDefogEn; // 0: disable, 1: enable, will use isp ada and disable adaptive-ADA + int nIrCutEnable; // 0: disable, 1: enable + int nIrCutFilterType; // 0: day2night pcs, 1: night2day pcs +} ADAPTIVE_USER_ATTR_ISP_CTL_T; + +typedef struct _ADAPTIVE_USER_ATTR_LIMIT_T { + int nGainRange[2]; // gain range [0]: min, [1]: max + int nEtRange[2]; // et range [0]: min, [1]: max + int nCtScl; // color temperature + int nIrCutSwMode; // 0: auto(default), 1: manual mode +} ADAPTIVE_USER_ATTR_LIMIT_T; + +typedef struct _ADAPTIVE_USER_ATTR_WEIGHT_T { + int nSaturationCoeff; // saturation user coeff step1: 0 - 50, step2: 50 - 100 + int nBrightnessCoeff; // luma gain user coeff step: 0 - 100, default 50 + int nContrastCoeff; // contrast gain user coeff step: 0 - 100, default 50 + int nSharpnessCoeff; // sharpness gain user coeff step: 0 - 100, default 50, final val = 50 * adap_sharp + int n2dnrLevelCoeff; // 2dnr user coeff: step: 0 - 10, default 5 + /* ae param */ + int nAeBacklightCoeff; + int nAeStronglightCoeff; + int nWdrCoeff; +} ADAPTIVE_USER_ATTR_WEIGHT_T; + +typedef struct _ADAPTIVE_USER_MENU_3A_T { + int nCurGain; // current gain: 1~15.9906x, default 2x, over range will use min or max value + int nCurExpTime; // current exposure time(us) + int nCurWbRGain; // + int nCurWbGGain; // + int nCurWbBGain; // +} ADAPTIVE_USER_MENU_3A_T; + +typedef struct _ADAP_USER_ATTR_PAGE_T +{ + int nWritten; + int nAdaptiveUserAttrEnable; + int nAdaptiveUserAeMode; // only use to ae auto/handle switch 0: sw, 1: hw + int nAeSync; // only use for ae sync in dual camera & sw ae + ADAPTIVE_USER_ATTR_ISP_CTL_T tUserAttrIspCtl; + ADAPTIVE_USER_ATTR_LIMIT_T tUserAttrLimit; + ADAPTIVE_USER_ATTR_WEIGHT_T tUserAttrWeight; + ADAPTIVE_USER_MENU_3A_T tUserMenu3A; +} ADAPTIVE_ATTRIBUTE_PAGE_T; // Root Permission for whole adaptive function + +typedef struct { + // attr page ctl + int nAttrPageEnFlag; + // isp ctl + int nAeEnhModeFlag; + int nWdrEnableFlag; + int nAeEnFlag; + int nAwbEnableFlag; + int nLdcEnableFlag; + int nLscEnableFlag; + int nFlipFlag; + int nAntiflickerFlag; + int nDefogFlag; + // isp limit + int nCtSclFlag; + int nEtFlag; + int nGainFlag; + // isp weight + int n2dnrFlag; + int nBrightnessFlag; + int nContrastFlag; + int nSaturationFlag; + int nSharpnessFlag; + int nBackLightFlag; + int nStrongLightFlag; + int nWdrLevelFlag; + // 3a manual + int nCurExpFlag; + int nCurGainFlag; + int nRGainFlag; + int nGGainFlag; + int nBGainFlag; + + // sum + int nSum; +} ADAPTIVE_ATTR_FLAG_T; + +/* enum define */ + +enum weight_mode_e +{ + AE_GAIN_WEIGHT, + AE_EV_WEIGHT, +}; + +enum ev_type_e +{ + EV_TYPE_GAMMA, + EV_TYPE_COLOR_GREY_SWITCH, + EV_TYPE_IR_CUT, +}; + +typedef struct +{ + // dynamic params + ADAPTIVE_ISP_CALC_PARAM_T isp_adap_param; + ADAPTIVE_ISP_3A_STAT_T isp_3a_stat; // will destory in the future + // fix params + ADAPTIVE_IMG_TIMING_CFG_T image_timing_cfg; + // correct result + ADAPTIVE_ISP_3A_STAT_T isp_3a_stat_correct; + // ex model value + ADAPTIVE_ISP_EX_MODEL_VAL_T isp_ex_val; + +} ADAPTIVE_INIT_PARAM_T; + +enum adaptive_isp_pipeline_e +{ + ADAP_ISP_F2K_PIPELINE, + ADAP_ISP_R2K_PIPELINE, + ADAP_ISP_TOF_PIPELINE +}; + +enum adap_callback_id +{ + ADAP_CALLBACK_ID_START = -1, // -1 + ADAP_CALLBACK_ID_BLC, // 0 + ADAP_CALLBACK_ID_LSC, // 1 + ADAP_CALLBACK_ID_SHARPNESS, // 2 + ADAP_CALLBACK_ID_LTM, // 3 + ADAP_CALLBACK_ID_2DNR, // 4 + ADAP_CALLBACK_ID_3DNR, // 5 + ADAP_CALLBACK_ID_WDR, // 6 + ADAP_CALLBACK_ID_CCM, // 7 + ADAP_CALLBACK_ID_AWB, // 8 + ADAP_CALLBACK_ID_GAMMA, // 9 + ADAP_CALLBACK_ID_IRCUT, // 10 + ADAP_CALLBACK_ID_SATURATION, // 11 + ADAP_CALLBACK_ID_COLOR2BW, // 12 + ADAP_CALLBACK_ID_ADA, // 13 + ADAP_CALLBACK_ID_END, // 14 +}; + +enum ir_cut_mode_user_e { + ADAPTIVE_USER_IR_CUT_NIGHT, + ADAPTIVE_USER_IR_CUT_DAY, +}; + +// static struct k510isp_reg_val adaptive_apply_rgb_gamma_table = {0x0400, 0x0}; + +typedef struct { + char * cSensor0Name; + char * cSensor1Name; + ADAPTIVE_ISP_PIPELINE_PARAM_T * tAdapIspParamF2k; + ADAPTIVE_ISP_PIPELINE_PARAM_T * tAdapIspParamR2k; +} ADAPTIVE_SENSOR_NAME_T; + +typedef struct { + int size; + ADAPTIVE_SENSOR_NAME_T *tAdaptiveSensorName; +} ADAPTIVE_SENSOR_NAME_S_T; + +typedef union +{ + struct + { + unsigned int : 5 ; /* [0 ..4 ] */ + unsigned int mirror_ctl : 1 ; /* [5 ] */ + unsigned int : 26 ; /* [32..7 ] */ + } bits; + unsigned int u32; +} ADAPTIVE_ISP_ITC_CTL_U; + +typedef union +{ + struct + { + unsigned int : 3 ; /* [0 1 2] */ + unsigned int awb_handle : 1 ; /* [3 ] */ + unsigned int : 28 ; /* [4 .. 32] */ + } bits; + unsigned int u32; +} ADAPTIVE_ISP_AWB_CTL_U; + +typedef union +{ + struct + { + unsigned int : 5 ; /* [0 1 2 3 4] */ + unsigned int chroma_en : 1 ; /* [5 ] */ + unsigned int : 26 ; /* [6 .. 31] */ + } bits; + unsigned int u32; +} ADAPTIVE_ISP_2DNR_CTL_U; + +typedef union +{ + struct + { + unsigned int auto_exp_en : 1 ; /* [0] */ + unsigned int auto_gain_en : 1 ; /* [1] */ + unsigned int : 6 ; /* [2 .. 7] */ + unsigned int ae_win_sl : 2 ; /* [8 9] */ + unsigned int ae_md_sl : 2 ; /* [10 11] */ + unsigned int : 20 ; /* [12 31 ] */ + } bits; + unsigned int u32; +} ADAPTIVE_ISP_AE_CTL_U; + +typedef union +{ + struct + { + unsigned int : 5 ; /* [0 ... 4] */ + unsigned int ada_adp_en : 1 ; /* [5] */ + unsigned int : 3 ; /* [6 7 8] */ + unsigned int ada_md_sl : 2 ; /* [9 10] */ + unsigned int : 21 ; /* [11 31] */ + } bits; + unsigned int u32; +} ADAPTIVE_ISP_DEFOG_CTL_U; + +typedef union +{ + struct + { + unsigned int hflip : 1; + unsigned int vflip : 1; + unsigned int :30; + } bits; + unsigned int u32; +} FLIP_VAL_U; + +typedef union +{ + struct + { + unsigned int attr_en_flag : 1 ; /* [ 0 ] */ + unsigned int ae_sync_flag : 1 ; /* [ 1 ] */ + unsigned int ehn_mode_flag : 1 ; /* [ 2 ] */ + unsigned int ae_en_flag : 1 ; /* [ 3 ] */ + unsigned int awb_en_flag : 1 ; /* [ 4 ] */ + unsigned int lsc_en_flag : 1 ; /* [ 5 ] */ + unsigned int ldc_en_flag : 1 ; /* [ 6 ] */ + unsigned int flip_flag : 1 ; /* [ 7 ] */ + unsigned int anti_flicker_flag : 1 ; /* [ 8 ] */ + unsigned int defog_en_flag : 1 ; /* [ 9 ] */ + unsigned int wdr_en_flag : 1 ; /* [ 10 ] */ + unsigned int ct_flag : 1 ; /* [ 11 ] */ + unsigned int et_min_flag : 1 ; /* [ 12 ] */ + unsigned int et_max_flag : 1 ; /* [ 13 ] */ + unsigned int gain_min : 1 ; /* [ 14 ] */ + unsigned int gain_max : 1 ; /* [ 15 ] */ + unsigned int nr2d_flag : 1 ; /* [ 16 ] */ + unsigned int bright_flag : 1 ; /* [ 17 ] */ + unsigned int contrast_flag : 1 ; /* [ 18 ] */ + unsigned int saturation_flag : 1 ; /* [ 19 ] */ + unsigned int sharpness_flag : 1 ; /* [ 20 ] */ + unsigned int backlight_flag : 1 ; /* [ 21 ] */ + unsigned int stronglight_flag : 1 ; /* [ 22 ] */ + unsigned int wdr_level_flag : 1 ; /* [ 23 ] */ + unsigned int cur_exp_flag : 1 ; /* [ 24 ] */ + unsigned int cur_gain_flag : 1 ; /* [ 25 ] */ + unsigned int cur_r_gain_flag : 1 ; /* [ 26 ] */ + unsigned int cur_g_gain_flag : 1 ; /* [ 27 ] */ + unsigned int cur_b_gain_flag : 1 ; /* [ 28 ] */ + unsigned int ir_cut_en_flag : 1 ; /* [ 29 ] */ + unsigned int ir_cut_ctl_flag : 1 ; /* [ 30 ] */ + unsigned int ir_cut_ft_type : 1 ; /* [ 31 ] */ + } bits; + unsigned int u32; +} ADAPTIVE_ATTR_STAT_FLAG_U; + +typedef union +{ + struct + { + unsigned int gain_weight_0_flag : 1 ; /* [ 0 ] */ + unsigned int gain_weight_1_flag : 1 ; /* [ 1 ] */ + unsigned int ae_ev_weight_0_flag : 1 ; /* [ 2 ] */ + unsigned int ae_ev_weight_1_flag : 1 ; /* [ 3 ] */ + unsigned int saturation_weight_flag : 1 ; /* [ 4 ] */ + unsigned int gain_range_0_flag : 1 ; /* [ 5 ] */ + unsigned int gain_range_1_flag : 1 ; /* [ 6 ] */ + unsigned int gamma_curve_flag : 1 ; /* [ 7 ] */ + unsigned int color_grey_flag : 1 ; /* [ 8 ] */ + unsigned int ct_flag : 1 ; /* [ 9 ] */ + unsigned int ae_ev_range_0_flag : 1 ; /* [ 10 ] */ + unsigned int ae_ev_range_1_flag : 1 ; /* [ 11 ] */ + unsigned int ir_cut_flag : 1 ; /* [ 12 ] */ + unsigned int ada_flag : 1 ; /* [ 13 ] */ + unsigned int reserved : 18 ; /* [14 .. 31] */ + } bits; + unsigned int u32; +} ADAPTIVE_ISP_WEIGHT_FLAG_U; + +/* user callback function */ +typedef int (* __AdapCallBack)(void *); + +/* callback struct */ +typedef struct __ADAP_CB_T +{ + __AdapCallBack pAcbfunc; // callback function + int nSize; // such as sizeof(CB_IR_CUT_T), depth copy need + enum adap_callback_id nAcbId; // callback moudel id, adap need know which use it +} ADAP_CB_T; + +typedef struct __CB_IR_CUT_T +{ + int nIrCutCtl; // 0:day2night, 1: night2day + int nSensor; // 0: sensor0, 1: sensor1 +} CB_IR_CUT_T; + +/* param check Range */ +#define ADAPTIVE_PARAM_CHECK_AE_Y_TARGET 255 +#define ADAPTIVE_PARAM_CHECK_BLC 4095 +#define ADAPTIVE_PARAM_CHECK_LSC 511 +#define ADAPTIVE_PARAM_CHECK_SHARPNESS_CORE_GAIN 255 +#define ADAPTIVE_PARAM_CHECK_SHARPNESS_TH 4095 +#define ADAPTIVE_PARAM_CHECK_LTM 255 +#define ADAPTIVE_PARAM_CHECK_2DNR_RAWKL 255 +#define ADAPTIVE_PARAM_CHECK_2DNR_JLTH 511 +#define ADAPTIVE_PARAM_CHECK_2DNR_EGK 1023 +#define ADAPTIVE_PARAM_CHECK_2DNR_YK 255 +#define ADAPTIVE_PARAM_CHECK_2DNR_CK 255 +#define ADAPTIVE_PARAM_CHECK_2DNR_CK_ENABLE_GAIN 768 // 3 * 256 +#define ADAPTIVE_PARAM_CHECK_3DNR_DP_THY 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_DP_THYP 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_DP_THCP 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_MID_TH 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_MTP_TH 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_MTC_TH 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_DM_YMK 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_DM_THY 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_DM_MIN 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_DM_THW0 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_CHROMA_INTENSITY 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_EG_TH 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_DB_THYP 255 +#define ADAPTIVE_PARAM_CHECK_3DNR_DB_THCP 255 +#define ADAPTIVE_PARAM_CHECK_WDR_LGHT_TH 4095 +#define ADAPTIVE_PARAM_CHECK_WDR_FS_TH 255 +#define ADAPTIVE_PARAM_CHECK_WDR_FS_KN 255 +#define ADAPTIVE_PARAM_CHECK_CCM_WB_GAIN 1023 +#define ADAPTIVE_PARAM_CHECK_CCM_RR_GG_BB 511 +#define ADAPTIVE_PARAM_CHECK_CCM_RG_RB_GR_GB_BR_BG 256 +#define ADAPTIVE_PARAM_CHECK_AWB 1023 +#define ADAPTIVE_PARAM_CHECK_IMX219_EXP_TIME 33333 +#define ADAPTIVE_PARAM_CHECK_IMX219_GAIN 4095 + +/* param check error code */ +#define ADAPTIVE_CALLBACK_REG_SUCCESS (0) +#define ADAPTIVE_CALLBACK_REG_FAIL (-1) +#define ADAPTIVE_CALLBACK_FUNC_NULL (-2) +#define ADAPTIVE_CALLBACK_ID_OVER_RANGE (-3) +#define ADAPTIVE_CALLBACK_ID_NOT_MATCH (-4) + +/* ir cut level error code */ +#define ADAPTIVE_IR_CUT_SET_EV_SUCCESS (0) +#define ADAPTIVE_IR_CUT_SET_VAL_SUCCESS (0) +#define ADAPTIVE_IR_CUT_EV_LV_OVER_RANGE (-1) +#define ADAPTIVE_IR_CUT_EV_LV_DIFF_LESS_THAN_TWO (-2) +#define ADAPTIVE_IR_CUT_GET_EV_LV_FAILED (-3) +#define ADAPTIVE_IR_CUT_SET_EV_LV_FAILED (-4) +/* callback reg function */ +int adaptive_cb_assign(ADAP_CB_T * acb); + +/* lots of init functions */ +int adaptive_setting_param_check(enum adaptive_isp_pipeline_e pipeline); +int adaptiet_convert_init(enum adaptive_isp_pipeline_e isp_pipeline, ADAPTIVE_IMG_TIMING_CFG_T image_timing_cfg); +int adaptive_calc_feture_init_from_reg(enum adaptive_isp_pipeline_e pipeline, struct media_entity * pipe); +int adaptive_param_flag_init(enum adaptive_isp_pipeline_e pipeline); +int adaptive_param_format_init(enum adaptive_isp_pipeline_e pipeline); + +/* n: number of devices, ... &(struct media_entity) f2k r2k sensor0 sensor1 */ +int adaptive_device_init(int n, ...); + +/* main functions */ +int adaptive_user_attr_page_init(enum adaptive_isp_pipeline_e pipeline); +// int adaptive_user_attr_page_init(enum adaptive_isp_pipeline_e pipeline, struct isp_core_cfg_info * isp_core_cfg); +int adaptive_et_line_time_convert(enum adaptive_isp_pipeline_e isp_pipeline, int itc_ttl_v, int adap_exp_time); +int adaptive_select_moudel_apply(enum adaptive_isp_pipeline_e pipeline, struct media_entity * pipe, int adap_en, int size, struct k510isp_reg_val adap_param[]); +int adaptive_select_moudel_get(enum adaptive_isp_pipeline_e pipeline, struct media_entity * pipe, int adap_en, int size, struct k510isp_reg_val adap_param[]); +int adaptive_select_gamma_apply(enum adaptive_isp_pipeline_e pipeline, struct media_entity * pipe, int adap_en); +int adaptive_ex_param_apply(enum adaptive_isp_pipeline_e pipeline, struct media_entity * pipe); +int adaptive_attr_page_isp_moudel_apply(enum adaptive_isp_pipeline_e pipeline); +// int adaptive_mirror_flip_apply(enum adaptive_isp_pipeline_e pipeline, int adap_en, struct media_entity * pipe); +int adaptive_param_campare(enum adaptive_isp_pipeline_e pipeline, ADAPTIVE_ISP_WEIGHT_PARAM_T * cur_isp_weight); +/* callback */ +int adaptive_callback_register(ADAP_CB_T * acb); + +/* flip_level 0:normal, 1:hflip, 2:vflip, 3: hvflip */ +int adaptive_mirror_flip_apply(enum adaptive_isp_pipeline_e pipeline, int flip_level); + +/* ir cut */ +int adap_ir_cut_ev_get(enum adaptive_isp_pipeline_e pipeline, enum ir_cut_mode_user_e ir_cut_mode); +int adap_ir_cut_ev_set(enum adaptive_isp_pipeline_e pipeline, enum ir_cut_mode_user_e ir_cut_mode, int level); +float adap_ir_cut_hold_time_get(enum adaptive_isp_pipeline_e pipeline, enum ir_cut_mode_user_e ir_cut_mode); +int adap_ir_cut_hold_time_set(enum adaptive_isp_pipeline_e pipeline, enum ir_cut_mode_user_e ir_cut_mode, float hold_time); +unsigned short adap_ir_cut_lv_calc(enum adaptive_isp_pipeline_e pipeline, int ev); +#endif \ No newline at end of file diff --git a/package/mediactl_lib/src/adaptive/adaptive_user_func.h b/package/mediactl_lib/src/adaptive/adaptive_user_func.h new file mode 100644 index 0000000..f47965a --- /dev/null +++ b/package/mediactl_lib/src/adaptive/adaptive_user_func.h @@ -0,0 +1,60 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __ADAPTIVE_USER_FUNC_H__ +#define __ADAPTIVE_USER_FUNC_H__ + +#include "sensor_params/canaan_isp_struct.h" +#include "adaptive_isp_reg.h" +#include "adaptive_setting.h" + +/* user init */ +int adaptive_calc_feture_init(enum adaptive_isp_pipeline_e pipeline, ADAPTIVE_IMG_TIMING_CFG_T image_timing_cfg); +int adaptive_param_init(enum adaptive_isp_pipeline_e pipeline, ADAPTIVE_SENSOR_NAME_S_T * adaptive_sensor_name_s, char * sensor_name); +int adaptive_user_attr_page_init(enum adaptive_isp_pipeline_e pipeline); +/* user functions */ +int adaptive_get_3a_stat(enum adaptive_isp_pipeline_e pipeline, struct media_entity * pipe); +int adaptive_setting_ctl(enum adaptive_isp_pipeline_e pipeline); +int adaptive_param_apply(enum adaptive_isp_pipeline_e pipeline, struct media_entity * pipe); +int adaptive_callback_ctl_stat(enum adaptive_isp_pipeline_e pipeline, enum adap_callback_id cbid); + +/* can setting gamma, if gamma_table = NULL, will use linner-wdr-gamma */ +int adaptive_gamma_setting(enum adaptive_isp_pipeline_e pipeline, unsigned short * gamma_table); + +/* user ex opeartion */ +int adaptive_ex_gt_update_flag(enum adaptive_isp_pipeline_e pipeline); +int adaptive_ex_gt_awb_apply_flag(enum adaptive_isp_pipeline_e pipeline); +int adaptive_ex_gt_target_stat(enum adaptive_isp_pipeline_e pipeline); +int adaptive_ex_gt_target_range_stat(enum adaptive_isp_pipeline_e pipeline); +int adaptive_ex_st_ev_apply_flag(enum adaptive_isp_pipeline_e pipeline, int flag); +int adaptive_ex_st_ae_apply(enum adaptive_isp_pipeline_e pipeline, int yeverage, int expl, int agco); +int adaptive_ex_st_update_flag(enum adaptive_isp_pipeline_e pipeline); +int adaptive_user_attr_page_parse(enum adaptive_isp_pipeline_e pipeline, ADAPTIVE_ATTRIBUTE_PAGE_T * adap_attr_page); +int adaptive_user_attr_page_compare(enum adaptive_isp_pipeline_e pipeline, ADAPTIVE_ATTRIBUTE_PAGE_T * adap_attr_page); + +/* user get version */ +char * adaptive_get_version(); + +#endif \ No newline at end of file diff --git a/package/mediactl_lib/src/adaptive/sensor_params/adaptive_linner_wdr_gamma.h b/package/mediactl_lib/src/adaptive/sensor_params/adaptive_linner_wdr_gamma.h new file mode 100644 index 0000000..65758b4 --- /dev/null +++ b/package/mediactl_lib/src/adaptive/sensor_params/adaptive_linner_wdr_gamma.h @@ -0,0 +1,195 @@ +#ifndef __ADAP_ATTR_LINNER_WDR_GAMMA_TABLE_H__ +#define __ADAP_ATTR_LINNER_WDR_GAMMA_TABLE_H__ + +static unsigned short adap_attr_linner_wdr_gamma[][256] = +{ + { + 0x000, 0x519, 0xD21, 0x128, 0x22D, 0x931, 0x735, 0x039, 0x43C, 0x53F, 0x242, 0xD44, 0x647, 0xD49, 0x24C, 0x54E, + 0x750, 0x852, 0x854, 0x756, 0x558, 0x25A, 0xE5B, 0x95D, 0x45F, 0xE60, 0x862, 0x164, 0x965, 0x167, 0x968, 0x06A, + 0x66B, 0xC6C, 0x26E, 0x86F, 0xD70, 0x172, 0x673, 0xA74, 0xE75, 0x177, 0x478, 0x779, 0xA7A, 0xC7B, 0xF7C, 0x17E, + 0x27F, 0x480, 0x581, 0x782, 0x783, 0x884, 0x985, 0x986, 0x987, 0x988, 0x989, 0x98A, 0x98B, 0x88C, 0x78D, 0x78E, + 0x68F, 0x490, 0x391, 0x292, 0x093, 0xF93, 0xD94, 0xB95, 0x996, 0x797, 0x598, 0x299, 0x09A, 0xD9A, 0xB9B, 0x89C, + 0x59D, 0x29E, 0xF9E, 0xC9F, 0x9A0, 0x5A1, 0x2A2, 0xFA2, 0xBA3, 0x7A4, 0x4A5, 0x0A6, 0xCA6, 0x8A7, 0x4A8, 0x0A9, + 0xCA9, 0x7AA, 0x3AB, 0xFAB, 0xAAC, 0x6AD, 0x1AE, 0xDAE, 0x8AF, 0x3B0, 0xEB0, 0x9B1, 0x4B2, 0xFB2, 0xAB3, 0x5B4, + 0x0B5, 0xBB5, 0x5B6, 0x0B7, 0xBB7, 0x5B8, 0x0B9, 0xAB9, 0x4BA, 0xFBA, 0x9BB, 0x3BC, 0xDBC, 0x7BD, 0x2BE, 0xCBE, + 0x6BF, 0xFBF, 0x9C0, 0x3C1, 0xDC1, 0x7C2, 0x1C3, 0xAC3, 0x4C4, 0xDC4, 0x7C5, 0x1C6, 0xAC6, 0x3C7, 0xDC7, 0x6C8, + 0x0C9, 0x9C9, 0x2CA, 0xBCA, 0x4CB, 0xECB, 0x7CC, 0x0CD, 0x9CD, 0x2CE, 0xBCE, 0x4CF, 0xDCF, 0x5D0, 0xED0, 0x7D1, + 0x0D2, 0x9D2, 0x1D3, 0xAD3, 0x3D4, 0xBD4, 0x4D5, 0xCD5, 0x5D6, 0xDD6, 0x6D7, 0xED7, 0x7D8, 0xFD8, 0x7D9, 0x0DA, + 0x8DA, 0x0DB, 0x8DB, 0x1DC, 0x9DC, 0x1DD, 0x9DD, 0x1DE, 0x9DE, 0x1DF, 0x9DF, 0x1E0, 0x9E0, 0x1E1, 0x9E1, 0x1E2, + 0x9E2, 0x1E3, 0x9E3, 0x1E4, 0x8E4, 0x0E5, 0x8E5, 0x0E6, 0x7E6, 0xFE6, 0x7E7, 0xEE7, 0x6E8, 0xDE8, 0x5E9, 0xCE9, + 0x4EA, 0xBEA, 0x3EB, 0xAEB, 0x2EC, 0x9EC, 0x1ED, 0x8ED, 0xFED, 0x7EE, 0xEEE, 0x5EF, 0xDEF, 0x4F0, 0xBF0, 0x2F1, + 0x9F1, 0x1F2, 0x8F2, 0xFF2, 0x6F3, 0xDF3, 0x4F4, 0xBF4, 0x2F5, 0x9F5, 0x0F6, 0x7F6, 0xEF6, 0x5F7, 0xCF7, 0x3F8, + 0xAF8, 0x1F9, 0x8F9, 0xFF9, 0x6FA, 0xDFA, 0x3FB, 0xAFB, 0x1FC, 0x8FC, 0xEFC, 0x5FD, 0xCFD, 0x3FE, 0x9FE, 0x0FF, + }, + { + 0x000, 0x41E, 0x827, 0x32E, 0x933, 0x338, 0x53C, 0x040, 0x543, 0x746, 0x649, 0x24C, 0xB4E, 0x351, 0x853, 0xC55, + 0xF57, 0x05A, 0x05C, 0xF5D, 0xD5F, 0xA61, 0x663, 0x165, 0xC66, 0x668, 0xF69, 0x86B, 0x06D, 0x86E, 0xF6F, 0x671, + 0xC72, 0x274, 0x875, 0xD76, 0x278, 0x679, 0xA7A, 0xE7B, 0x17D, 0x47E, 0x77F, 0x980, 0xC81, 0xE82, 0xF83, 0x185, + 0x286, 0x387, 0x488, 0x589, 0x58A, 0x68B, 0x68C, 0x68D, 0x58E, 0x58F, 0x490, 0x491, 0x392, 0x293, 0x094, 0xF94, + 0xD95, 0xC96, 0xA97, 0x898, 0x699, 0x49A, 0x29B, 0xF9B, 0xD9C, 0xA9D, 0x79E, 0x49F, 0x1A0, 0xEA0, 0xBA1, 0x8A2, + 0x4A3, 0x1A4, 0xDA4, 0xAA5, 0x6A6, 0x2A7, 0xEA7, 0xAA8, 0x6A9, 0x2AA, 0xDAA, 0x9AB, 0x5AC, 0x0AD, 0xBAD, 0x7AE, + 0x2AF, 0xDAF, 0x8B0, 0x3B1, 0xEB1, 0x9B2, 0x4B3, 0xFB3, 0xAB4, 0x4B5, 0xFB5, 0x9B6, 0x4B7, 0xEB7, 0x9B8, 0x3B9, + 0xDB9, 0x7BA, 0x2BB, 0xCBB, 0x6BC, 0x0BD, 0xABD, 0x3BE, 0xDBE, 0x7BF, 0x1C0, 0xAC0, 0x4C1, 0xDC1, 0x7C2, 0x0C3, + 0xAC3, 0x3C4, 0xDC4, 0x6C5, 0xFC5, 0x8C6, 0x2C7, 0xBC7, 0x4C8, 0xDC8, 0x6C9, 0xFC9, 0x8CA, 0x1CB, 0x9CB, 0x2CC, + 0xBCC, 0x4CD, 0xCCD, 0x5CE, 0xECE, 0x6CF, 0xFCF, 0x7D0, 0x0D1, 0x8D1, 0x1D2, 0x9D2, 0x1D3, 0xAD3, 0x2D4, 0xAD4, + 0x2D5, 0xBD5, 0x3D6, 0xBD6, 0x3D7, 0xBD7, 0x3D8, 0xBD8, 0x3D9, 0xBD9, 0x3DA, 0xBDA, 0x3DB, 0xADB, 0x2DC, 0xADC, + 0x2DD, 0x9DD, 0x1DE, 0x9DE, 0x0DF, 0x8DF, 0x0E0, 0x7E0, 0xFE0, 0x6E1, 0xEE1, 0x5E2, 0xDE2, 0x4E3, 0xBE3, 0x3E4, + 0xAE4, 0x1E5, 0x9E5, 0x0E6, 0x7E6, 0xEE6, 0x6E7, 0xDE7, 0x4E8, 0xBE8, 0x2E9, 0x9E9, 0x0EA, 0x7EA, 0xFEA, 0x6EB, + 0xDEB, 0x3EC, 0xAEC, 0x1ED, 0x8ED, 0xFED, 0x6EE, 0xDEE, 0x4EF, 0xAEF, 0x1F0, 0x8F0, 0xFF0, 0x6F1, 0xCF1, 0x3F2, + 0xAF2, 0x0F3, 0x7F3, 0xDF3, 0x4F4, 0xBF4, 0x1F5, 0x8F5, 0xEF5, 0x5F6, 0xBF6, 0x2F7, 0x8F7, 0xFF7, 0x5F8, 0xCF8, + 0x2F9, 0x8F9, 0xFF9, 0x5FA, 0xBFA, 0x2FB, 0x8FB, 0xEFB, 0x5FC, 0xBFC, 0x1FD, 0x7FD, 0xDFD, 0x4FE, 0xAFE, 0x0FF, + }, + + { + 0x000, 0x423, 0x22D, 0x334, 0xD39, 0xA3E, 0xD42, 0xA46, 0x14A, 0x44D, 0x350, 0x053, 0xA55, 0x158, 0x75A, 0xB5C, + 0xE5E, 0xF60, 0xF62, 0xE64, 0xC66, 0x968, 0x56A, 0x06C, 0xA6D, 0x46F, 0xD70, 0x672, 0xE73, 0x575, 0xC76, 0x278, + 0x879, 0xE7A, 0x37C, 0x77D, 0xC7E, 0x080, 0x381, 0x782, 0x983, 0xC84, 0xE85, 0x187, 0x288, 0x489, 0x58A, 0x68B, + 0x78C, 0x88D, 0x88E, 0x88F, 0x890, 0x891, 0x892, 0x793, 0x694, 0x595, 0x496, 0x397, 0x298, 0x099, 0xE99, 0xC9A, + 0xA9B, 0x89C, 0x69D, 0x39E, 0x19F, 0xE9F, 0xBA0, 0x8A1, 0x5A2, 0x2A3, 0xFA3, 0xBA4, 0x8A5, 0x4A6, 0x1A7, 0xDA7, + 0x9A8, 0x5A9, 0x1AA, 0xDAA, 0x8AB, 0x4AC, 0xFAC, 0xBAD, 0x6AE, 0x2AF, 0xDAF, 0x8B0, 0x3B1, 0xEB1, 0x9B2, 0x4B3, + 0xEB3, 0x9B4, 0x4B5, 0xEB5, 0x9B6, 0x3B7, 0xDB7, 0x8B8, 0x2B9, 0xCB9, 0x6BA, 0x0BB, 0xABB, 0x4BC, 0xEBC, 0x7BD, + 0x1BE, 0xBBE, 0x4BF, 0xEBF, 0x8C0, 0x1C1, 0xAC1, 0x4C2, 0xDC2, 0x6C3, 0x0C4, 0x9C4, 0x2C5, 0xBC5, 0x4C6, 0xDC6, + 0x6C7, 0xFC7, 0x7C8, 0x0C9, 0x9C9, 0x2CA, 0xACA, 0x3CB, 0xCCB, 0x4CC, 0xDCC, 0x5CD, 0xDCD, 0x6CE, 0xECE, 0x7CF, + 0xFCF, 0x7D0, 0xFD0, 0x7D1, 0x0D2, 0x8D2, 0x0D3, 0x8D3, 0x0D4, 0x8D4, 0x0D5, 0x7D5, 0xFD5, 0x7D6, 0xFD6, 0x7D7, + 0xED7, 0x6D8, 0xED8, 0x5D9, 0xDD9, 0x5DA, 0xCDA, 0x4DB, 0xBDB, 0x3DC, 0xADC, 0x1DD, 0x9DD, 0x0DE, 0x7DE, 0xFDE, + 0x6DF, 0xDDF, 0x4E0, 0xCE0, 0x3E1, 0xAE1, 0x1E2, 0x8E2, 0xFE2, 0x6E3, 0xDE3, 0x4E4, 0xBE4, 0x2E5, 0x9E5, 0x0E6, + 0x7E6, 0xEE6, 0x4E7, 0xBE7, 0x2E8, 0x9E8, 0x0E9, 0x6E9, 0xDE9, 0x4EA, 0xAEA, 0x1EB, 0x7EB, 0xEEB, 0x5EC, 0xBEC, + 0x2ED, 0x8ED, 0xFED, 0x5EE, 0xCEE, 0x2EF, 0x8EF, 0xFEF, 0x5F0, 0xCF0, 0x2F1, 0x8F1, 0xEF1, 0x5F2, 0xBF2, 0x1F3, + 0x7F3, 0xEF3, 0x4F4, 0xAF4, 0x0F5, 0x6F5, 0xCF5, 0x2F6, 0x9F6, 0xFF6, 0x5F7, 0xBF7, 0x1F8, 0x7F8, 0xDF8, 0x3F9, + 0x9F9, 0xFF9, 0x4FA, 0xAFA, 0x0FB, 0x6FB, 0xCFB, 0x2FC, 0x8FC, 0xDFC, 0x3FD, 0x9FD, 0xFFD, 0x5FE, 0xAFE, 0x0FF, + }, + + { + 0x000, 0x328, 0xB32, 0x03A, 0xD3F, 0xC44, 0x149, 0xF4C, 0x750, 0xA53, 0xA56, 0x759, 0x15C, 0x95E, 0xF60, 0x363, + 0x565, 0x667, 0x669, 0x56B, 0x26D, 0xF6E, 0xB70, 0x672, 0x074, 0x975, 0x277, 0xA78, 0x27A, 0x97B, 0xF7C, 0x57E, + 0xB7F, 0x081, 0x482, 0x983, 0xC84, 0x086, 0x387, 0x688, 0x889, 0xB8A, 0xC8B, 0xE8C, 0xF8D, 0x18F, 0x190, 0x291, + 0x292, 0x293, 0x294, 0x295, 0x196, 0x197, 0x098, 0xF98, 0xE99, 0xC9A, 0xB9B, 0x99C, 0x79D, 0x59E, 0x39F, 0x0A0, + 0xEA0, 0xBA1, 0x8A2, 0x5A3, 0x2A4, 0xFA4, 0xCA5, 0x8A6, 0x5A7, 0x1A8, 0xDA8, 0x9A9, 0x5AA, 0x1AB, 0xDAB, 0x9AC, + 0x4AD, 0x0AE, 0xBAE, 0x7AF, 0x2B0, 0xDB0, 0x8B1, 0x3B2, 0xEB2, 0x9B3, 0x3B4, 0xEB4, 0x9B5, 0x3B6, 0xDB6, 0x8B7, + 0x2B8, 0xCB8, 0x6B9, 0x0BA, 0xABA, 0x4BB, 0xEBB, 0x8BC, 0x2BD, 0xBBD, 0x5BE, 0xFBE, 0x8BF, 0x1C0, 0xBC0, 0x4C1, + 0xDC1, 0x7C2, 0x0C3, 0x9C3, 0x2C4, 0xBC4, 0x4C5, 0xDC5, 0x6C6, 0xEC6, 0x7C7, 0x0C8, 0x8C8, 0x1C9, 0xAC9, 0x2CA, + 0xBCA, 0x3CB, 0xBCB, 0x4CC, 0xCCC, 0x4CD, 0xCCD, 0x5CE, 0xDCE, 0x5CF, 0xDCF, 0x5D0, 0xDD0, 0x5D1, 0xDD1, 0x5D2, + 0xCD2, 0x4D3, 0xCD3, 0x4D4, 0xBD4, 0x3D5, 0xBD5, 0x2D6, 0xAD6, 0x1D7, 0x9D7, 0x0D8, 0x8D8, 0xFD8, 0x6D9, 0xED9, + 0x5DA, 0xCDA, 0x3DB, 0xBDB, 0x2DC, 0x9DC, 0x0DD, 0x7DD, 0xEDD, 0x5DE, 0xCDE, 0x3DF, 0xADF, 0x1E0, 0x8E0, 0xFE0, + 0x6E1, 0xCE1, 0x3E2, 0xAE2, 0x1E3, 0x7E3, 0xEE3, 0x5E4, 0xBE4, 0x2E5, 0x9E5, 0xFE5, 0x6E6, 0xCE6, 0x3E7, 0x9E7, + 0x0E8, 0x6E8, 0xDE8, 0x3E9, 0x9E9, 0x0EA, 0x6EA, 0xCEA, 0x3EB, 0x9EB, 0xFEB, 0x5EC, 0xCEC, 0x2ED, 0x8ED, 0xEED, + 0x4EE, 0xAEE, 0x0EF, 0x6EF, 0xCEF, 0x2F0, 0x8F0, 0xEF0, 0x4F1, 0xAF1, 0x0F2, 0x6F2, 0xCF2, 0x2F3, 0x8F3, 0xEF3, + 0x3F4, 0x9F4, 0xFF4, 0x5F5, 0xBF5, 0x0F6, 0x6F6, 0xCF6, 0x1F7, 0x7F7, 0xDF7, 0x2F8, 0x8F8, 0xEF8, 0x3F9, 0x9F9, + 0xEF9, 0x4FA, 0x9FA, 0xFFA, 0x4FB, 0xAFB, 0xFFB, 0x5FC, 0xAFC, 0x0FD, 0x5FD, 0xBFD, 0x0FE, 0x5FE, 0xBFE, 0x0FF, + }, + { + 0x000, 0x22D, 0x138, 0xA3F, 0xA45, 0xA4A, 0x04F, 0xF52, 0x756, 0xB59, 0xB5C, 0x85F, 0x262, 0xA64, 0xF66, 0x369, + 0x66B, 0x66D, 0x66F, 0x471, 0x273, 0xE74, 0x976, 0x478, 0xE79, 0x77B, 0xF7C, 0x77E, 0xE7F, 0x481, 0xA82, 0x084, + 0x585, 0xA86, 0xE87, 0x189, 0x58A, 0x88B, 0xB8C, 0xD8D, 0xF8E, 0x190, 0x291, 0x392, 0x493, 0x594, 0x595, 0x596, + 0x597, 0x598, 0x499, 0x39A, 0x29B, 0x19C, 0x09D, 0xE9D, 0xD9E, 0xB9F, 0x9A0, 0x6A1, 0x4A2, 0x1A3, 0xFA3, 0xCA4, + 0x9A5, 0x6A6, 0x2A7, 0xFA7, 0xBA8, 0x8A9, 0x4AA, 0x0AB, 0xCAB, 0x8AC, 0x4AD, 0xFAD, 0xBAE, 0x6AF, 0x2B0, 0xDB0, + 0x8B1, 0x3B2, 0xEB2, 0x9B3, 0x4B4, 0xEB4, 0x9B5, 0x4B6, 0xEB6, 0x8B7, 0x3B8, 0xDB8, 0x7B9, 0x1BA, 0xBBA, 0x5BB, + 0xFBB, 0x8BC, 0x2BD, 0xCBD, 0x5BE, 0xFBE, 0x8BF, 0x1C0, 0xBC0, 0x4C1, 0xDC1, 0x6C2, 0xFC2, 0x8C3, 0x1C4, 0xAC4, + 0x3C5, 0xCC5, 0x4C6, 0xDC6, 0x6C7, 0xEC7, 0x7C8, 0xFC8, 0x8C9, 0x0CA, 0x8CA, 0x1CB, 0x9CB, 0x1CC, 0x9CC, 0x1CD, + 0x9CD, 0x1CE, 0x9CE, 0x1CF, 0x9CF, 0x1D0, 0x9D0, 0x1D1, 0x8D1, 0x0D2, 0x8D2, 0xFD2, 0x7D3, 0xED3, 0x6D4, 0xDD4, + 0x5D5, 0xCD5, 0x3D6, 0xBD6, 0x2D7, 0x9D7, 0x1D8, 0x8D8, 0xFD8, 0x6D9, 0xDD9, 0x4DA, 0xBDA, 0x2DB, 0x9DB, 0x0DC, + 0x7DC, 0xEDC, 0x5DD, 0xCDD, 0x2DE, 0x9DE, 0x0DF, 0x6DF, 0xDDF, 0x4E0, 0xAE0, 0x1E1, 0x8E1, 0xEE1, 0x5E2, 0xBE2, + 0x2E3, 0x8E3, 0xEE3, 0x5E4, 0xBE4, 0x2E5, 0x8E5, 0xEE5, 0x4E6, 0xBE6, 0x1E7, 0x7E7, 0xDE7, 0x3E8, 0xAE8, 0x0E9, + 0x6E9, 0xCE9, 0x2EA, 0x8EA, 0xEEA, 0x4EB, 0xAEB, 0x0EC, 0x6EC, 0xCEC, 0x1ED, 0x7ED, 0xDED, 0x3EE, 0x9EE, 0xFEE, + 0x4EF, 0xAEF, 0x0F0, 0x6F0, 0xBF0, 0x1F1, 0x7F1, 0xCF1, 0x2F2, 0x7F2, 0xDF2, 0x2F3, 0x8F3, 0xEF3, 0x3F4, 0x9F4, + 0xEF4, 0x3F5, 0x9F5, 0xEF5, 0x4F6, 0x9F6, 0xFF6, 0x4F7, 0x9F7, 0xFF7, 0x4F8, 0x9F8, 0xEF8, 0x4F9, 0x9F9, 0xEF9, + 0x3FA, 0x9FA, 0xEFA, 0x3FB, 0x8FB, 0xDFB, 0x2FC, 0x8FC, 0xDFC, 0x2FD, 0x7FD, 0xCFD, 0x1FE, 0x6FE, 0xBFE, 0x0FF, + }, + + { + 0x000, 0x032, 0x43D, 0x145, 0x24B, 0x450, 0xA54, 0x958, 0x25C, 0x65F, 0x662, 0x365, 0xD67, 0x46A, 0xA6C, 0xD6E, + 0xF70, 0x073, 0xF74, 0xD76, 0xA78, 0x67A, 0x17C, 0xB7D, 0x47F, 0xD80, 0x582, 0xC83, 0x385, 0x986, 0xE87, 0x389, + 0x88A, 0xC8B, 0x08D, 0x38E, 0x68F, 0x990, 0xB91, 0xD92, 0xE93, 0xF94, 0x096, 0x197, 0x198, 0x299, 0x19A, 0x19B, + 0x19C, 0x09D, 0xF9D, 0xD9E, 0xC9F, 0xAA0, 0x9A1, 0x7A2, 0x4A3, 0x2A4, 0xFA4, 0xDA5, 0xAA6, 0x7A7, 0x4A8, 0x0A9, + 0xDA9, 0x9AA, 0x6AB, 0x2AC, 0xEAC, 0xAAD, 0x6AE, 0x1AF, 0xDAF, 0x8B0, 0x3B1, 0xFB1, 0xAB2, 0x5B3, 0x0B4, 0xBB4, + 0x5B5, 0x0B6, 0xAB6, 0x5B7, 0xFB7, 0x9B8, 0x4B9, 0xEB9, 0x8BA, 0x2BB, 0xCBB, 0x5BC, 0xFBC, 0x9BD, 0x2BE, 0xCBE, + 0x5BF, 0xEBF, 0x8C0, 0x1C1, 0xAC1, 0x3C2, 0xCC2, 0x5C3, 0xEC3, 0x7C4, 0x0C5, 0x8C5, 0x1C6, 0xAC6, 0x2C7, 0xBC7, + 0x3C8, 0xBC8, 0x4C9, 0xCC9, 0x4CA, 0xCCA, 0x5CB, 0xDCB, 0x5CC, 0xDCC, 0x5CD, 0xDCD, 0x4CE, 0xCCE, 0x4CF, 0xCCF, + 0x3D0, 0xBD0, 0x3D1, 0xAD1, 0x2D2, 0x9D2, 0x1D3, 0x8D3, 0xFD3, 0x7D4, 0xED4, 0x5D5, 0xCD5, 0x4D6, 0xBD6, 0x2D7, + 0x9D7, 0x0D8, 0x7D8, 0xED8, 0x5D9, 0xCD9, 0x2DA, 0x9DA, 0x0DB, 0x7DB, 0xEDB, 0x4DC, 0xBDC, 0x2DD, 0x8DD, 0xFDD, + 0x5DE, 0xCDE, 0x2DF, 0x9DF, 0xFDF, 0x6E0, 0xCE0, 0x2E1, 0x9E1, 0xFE1, 0x5E2, 0xCE2, 0x2E3, 0x8E3, 0xEE3, 0x4E4, + 0xAE4, 0x1E5, 0x7E5, 0xDE5, 0x3E6, 0x9E6, 0xFE6, 0x5E7, 0xBE7, 0x1E8, 0x6E8, 0xCE8, 0x2E9, 0x8E9, 0xEE9, 0x4EA, + 0x9EA, 0xFEA, 0x5EB, 0xAEB, 0x0EC, 0x6EC, 0xBEC, 0x1ED, 0x7ED, 0xCED, 0x2EE, 0x7EE, 0xDEE, 0x2EF, 0x8EF, 0xDEF, + 0x3F0, 0x8F0, 0xEF0, 0x3F1, 0x8F1, 0xEF1, 0x3F2, 0x8F2, 0xEF2, 0x3F3, 0x8F3, 0xDF3, 0x3F4, 0x8F4, 0xDF4, 0x2F5, + 0x7F5, 0xDF5, 0x2F6, 0x7F6, 0xCF6, 0x1F7, 0x6F7, 0xBF7, 0x0F8, 0x5F8, 0xAF8, 0xFF8, 0x4F9, 0x9F9, 0xEF9, 0x3FA, + 0x8FA, 0xDFA, 0x2FB, 0x7FB, 0xBFB, 0x0FC, 0x5FC, 0xAFC, 0xFFC, 0x4FD, 0x8FD, 0xDFD, 0x2FE, 0x7FE, 0xBFE, 0x0FF, + }, + + { + 0x000, 0xB36, 0x542, 0x44A, 0x750, 0x955, 0x05A, 0xF5D, 0x861, 0xC64, 0xB67, 0x86A, 0x26D, 0x96F, 0xE71, 0x174, + 0x376, 0x378, 0x27A, 0xF7B, 0xC7D, 0x77F, 0x281, 0xB82, 0x484, 0xC85, 0x487, 0xB88, 0x18A, 0x68B, 0xC8C, 0x08E, + 0x48F, 0x890, 0xB91, 0xE92, 0x194, 0x395, 0x496, 0x697, 0x798, 0x899, 0x89A, 0x89B, 0x89C, 0x89D, 0x79E, 0x79F, + 0x6A0, 0x4A1, 0x3A2, 0x1A3, 0xFA3, 0xDA4, 0xBA5, 0x8A6, 0x6A7, 0x3A8, 0x0A9, 0xDA9, 0xAAA, 0x6AB, 0x3AC, 0xFAC, + 0xBAD, 0x7AE, 0x3AF, 0xFAF, 0xAB0, 0x6B1, 0x1B2, 0xCB2, 0x7B3, 0x2B4, 0xDB4, 0x8B5, 0x3B6, 0xEB6, 0x8B7, 0x2B8, + 0xDB8, 0x7B9, 0x1BA, 0xBBA, 0x5BB, 0xFBB, 0x9BC, 0x2BD, 0xCBD, 0x6BE, 0xFBE, 0x8BF, 0x2C0, 0xBC0, 0x4C1, 0xDC1, + 0x6C2, 0xFC2, 0x8C3, 0x1C4, 0xAC4, 0x3C5, 0xBC5, 0x4C6, 0xCC6, 0x5C7, 0xDC7, 0x5C8, 0xEC8, 0x6C9, 0xEC9, 0x6CA, + 0xECA, 0x6CB, 0xECB, 0x6CC, 0xECC, 0x6CD, 0xECD, 0x6CE, 0xDCE, 0x5CF, 0xCCF, 0x4D0, 0xCD0, 0x3D1, 0xAD1, 0x2D2, + 0x9D2, 0x0D3, 0x8D3, 0xFD3, 0x6D4, 0xDD4, 0x4D5, 0xBD5, 0x2D6, 0x9D6, 0x0D7, 0x7D7, 0xED7, 0x5D8, 0xCD8, 0x2D9, + 0x9D9, 0x0DA, 0x7DA, 0xDDA, 0x4DB, 0xADB, 0x1DC, 0x7DC, 0xEDC, 0x4DD, 0xBDD, 0x1DE, 0x7DE, 0xEDE, 0x4DF, 0xADF, + 0x1E0, 0x7E0, 0xDE0, 0x3E1, 0x9E1, 0xFE1, 0x5E2, 0xBE2, 0x1E3, 0x7E3, 0xDE3, 0x3E4, 0x9E4, 0xFE4, 0x5E5, 0xBE5, + 0x1E6, 0x6E6, 0xCE6, 0x2E7, 0x8E7, 0xDE7, 0x3E8, 0x9E8, 0xEE8, 0x4E9, 0xAE9, 0xFE9, 0x5EA, 0xAEA, 0x0EB, 0x5EB, + 0xBEB, 0x0EC, 0x6EC, 0xBEC, 0x0ED, 0x6ED, 0xBED, 0x0EE, 0x6EE, 0xBEE, 0x0EF, 0x6EF, 0xBEF, 0x0F0, 0x5F0, 0xAF0, + 0x0F1, 0x5F1, 0xAF1, 0xFF1, 0x4F2, 0x9F2, 0xEF2, 0x3F3, 0x8F3, 0xDF3, 0x2F4, 0x7F4, 0xCF4, 0x1F5, 0x6F5, 0xBF5, + 0x0F6, 0x5F6, 0x9F6, 0xEF6, 0x3F7, 0x8F7, 0xDF7, 0x1F8, 0x6F8, 0xBF8, 0x0F9, 0x4F9, 0x9F9, 0xEF9, 0x3FA, 0x7FA, + 0xCFA, 0x1FB, 0x5FB, 0xAFB, 0xEFB, 0x3FC, 0x7FC, 0xCFC, 0x1FD, 0x5FD, 0xAFD, 0xEFD, 0x3FE, 0x7FE, 0xCFE, 0x0FF, + }, + + { + 0x000, 0x53B, 0x347, 0x34F, 0x755, 0xA5A, 0x15F, 0x063, 0x966, 0xC69, 0xC6C, 0x86F, 0x172, 0x874, 0xD76, 0x079, + 0x17B, 0x17D, 0xF7E, 0xC80, 0x882, 0x384, 0xD85, 0x687, 0xF88, 0x68A, 0xD8B, 0x48D, 0x98E, 0xF8F, 0x391, 0x792, + 0xB93, 0xE94, 0x196, 0x397, 0x598, 0x799, 0x89A, 0x99B, 0xA9C, 0xA9D, 0xA9E, 0xA9F, 0x9A0, 0x9A1, 0x8A2, 0x6A3, + 0x5A4, 0x3A5, 0x1A6, 0xFA6, 0xDA7, 0xAA8, 0x8A9, 0x5AA, 0x2AB, 0xFAB, 0xBAC, 0x8AD, 0x4AE, 0x0AF, 0xCAF, 0x8B0, + 0x4B1, 0xFB1, 0xBB2, 0x6B3, 0x1B4, 0xCB4, 0x7B5, 0x2B6, 0xDB6, 0x8B7, 0x2B8, 0xDB8, 0x7B9, 0x1BA, 0xBBA, 0x5BB, + 0xFBB, 0x9BC, 0x3BD, 0xDBD, 0x6BE, 0x0BF, 0x9BF, 0x2C0, 0xCC0, 0x5C1, 0xEC1, 0x7C2, 0x0C3, 0x9C3, 0x2C4, 0xAC4, + 0x3C5, 0xCC5, 0x4C6, 0xDC6, 0x5C7, 0xEC7, 0x6C8, 0xEC8, 0x6C9, 0xEC9, 0x6CA, 0xECA, 0x6CB, 0xECB, 0x6CC, 0xECC, + 0x6CD, 0xDCD, 0x5CE, 0xDCE, 0x4CF, 0xCCF, 0x3D0, 0xBD0, 0x2D1, 0x9D1, 0x0D2, 0x8D2, 0xFD2, 0x6D3, 0xDD3, 0x4D4, + 0xBD4, 0x2D5, 0x9D5, 0x0D6, 0x7D6, 0xED6, 0x4D7, 0xBD7, 0x2D8, 0x9D8, 0xFD8, 0x6D9, 0xCD9, 0x3DA, 0x9DA, 0x0DB, + 0x6DB, 0xDDB, 0x3DC, 0x9DC, 0x0DD, 0x6DD, 0xCDD, 0x2DE, 0x9DE, 0xFDE, 0x5DF, 0xBDF, 0x1E0, 0x7E0, 0xDE0, 0x3E1, + 0x9E1, 0xFE1, 0x5E2, 0xBE2, 0x1E3, 0x6E3, 0xCE3, 0x2E4, 0x8E4, 0xDE4, 0x3E5, 0x9E5, 0xEE5, 0x4E6, 0xAE6, 0xFE6, + 0x5E7, 0xAE7, 0x0E8, 0x5E8, 0xBE8, 0x0E9, 0x5E9, 0xBE9, 0x0EA, 0x6EA, 0xBEA, 0x0EB, 0x6EB, 0xBEB, 0x0EC, 0x5EC, + 0xAEC, 0x0ED, 0x5ED, 0xAED, 0xFED, 0x4EE, 0x9EE, 0xEEE, 0x3EF, 0x8EF, 0xDEF, 0x2F0, 0x7F0, 0xCF0, 0x1F1, 0x6F1, + 0xBF1, 0x0F2, 0x5F2, 0xAF2, 0xEF2, 0x3F3, 0x8F3, 0xDF3, 0x2F4, 0x6F4, 0xBF4, 0x0F5, 0x5F5, 0x9F5, 0xEF5, 0x3F6, + 0x7F6, 0xCF6, 0x0F7, 0x5F7, 0xAF7, 0xEF7, 0x3F8, 0x7F8, 0xCF8, 0x0F9, 0x5F9, 0x9F9, 0xEF9, 0x2FA, 0x7FA, 0xBFA, + 0xFFA, 0x4FB, 0x8FB, 0xDFB, 0x1FC, 0x5FC, 0xAFC, 0xEFC, 0x2FD, 0x7FD, 0xBFD, 0xFFD, 0x3FE, 0x8FE, 0xCFE, 0x0FF, + }, + + { + 0x000, 0xD3F, 0xE4B, 0x054, 0x45A, 0x75F, 0xE63, 0xD67, 0x56B, 0x86E, 0x871, 0x374, 0xC76, 0x379, 0x77B, 0x97D, + 0xA7F, 0x981, 0x783, 0x485, 0xF86, 0xA88, 0x38A, 0xC8B, 0x48D, 0xB8E, 0x290, 0x791, 0xD92, 0x194, 0x595, 0x996, + 0xC97, 0xF98, 0x19A, 0x39B, 0x59C, 0x69D, 0x79E, 0x79F, 0x8A0, 0x8A1, 0x7A2, 0x7A3, 0x6A4, 0x4A5, 0x3A6, 0x1A7, + 0xFA7, 0xDA8, 0xBA9, 0x8AA, 0x6AB, 0x3AC, 0x0AD, 0xCAD, 0x9AE, 0x5AF, 0x2B0, 0xEB0, 0xAB1, 0x5B2, 0x1B3, 0xCB3, + 0x8B4, 0x3B5, 0xEB5, 0x9B6, 0x4B7, 0xFB7, 0x9B8, 0x4B9, 0xEB9, 0x8BA, 0x3BB, 0xDBB, 0x7BC, 0x0BD, 0xABD, 0x4BE, + 0xDBE, 0x7BF, 0x0C0, 0xAC0, 0x3C1, 0xCC1, 0x5C2, 0xEC2, 0x7C3, 0x0C4, 0x9C4, 0x1C5, 0xAC5, 0x3C6, 0xBC6, 0x4C7, + 0xCC7, 0x4C8, 0xCC8, 0x5C9, 0xDC9, 0x5CA, 0xDCA, 0x5CB, 0xCCB, 0x4CC, 0xCCC, 0x4CD, 0xBCD, 0x3CE, 0xBCE, 0x2CF, + 0x9CF, 0x1D0, 0x8D0, 0xFD0, 0x7D1, 0xED1, 0x5D2, 0xCD2, 0x3D3, 0xAD3, 0x1D4, 0x8D4, 0xFD4, 0x6D5, 0xDD5, 0x3D6, + 0xAD6, 0x1D7, 0x8D7, 0xED7, 0x5D8, 0xBD8, 0x2D9, 0x8D9, 0xFD9, 0x5DA, 0xBDA, 0x2DB, 0x8DB, 0xEDB, 0x4DC, 0xBDC, + 0x1DD, 0x7DD, 0xDDD, 0x3DE, 0x9DE, 0xFDE, 0x5DF, 0xBDF, 0x1E0, 0x7E0, 0xDE0, 0x3E1, 0x8E1, 0xEE1, 0x4E2, 0xAE2, + 0xFE2, 0x5E3, 0xBE3, 0x0E4, 0x6E4, 0xBE4, 0x1E5, 0x6E5, 0xCE5, 0x1E6, 0x7E6, 0xCE6, 0x1E7, 0x7E7, 0xCE7, 0x2E8, + 0x7E8, 0xCE8, 0x1E9, 0x7E9, 0xCE9, 0x1EA, 0x6EA, 0xBEA, 0x0EB, 0x5EB, 0xBEB, 0x0EC, 0x5EC, 0xAEC, 0xFEC, 0x4ED, + 0x9ED, 0xEED, 0x2EE, 0x7EE, 0xCEE, 0x1EF, 0x6EF, 0xBEF, 0x0F0, 0x4F0, 0x9F0, 0xEF0, 0x3F1, 0x7F1, 0xCF1, 0x1F2, + 0x5F2, 0xAF2, 0xFF2, 0x3F3, 0x8F3, 0xCF3, 0x1F4, 0x6F4, 0xAF4, 0xFF4, 0x3F5, 0x8F5, 0xCF5, 0x1F6, 0x5F6, 0x9F6, + 0xEF6, 0x2F7, 0x7F7, 0xBF7, 0xFF7, 0x4F8, 0x8F8, 0xCF8, 0x1F9, 0x5F9, 0x9F9, 0xEF9, 0x2FA, 0x6FA, 0xAFA, 0xEFA, + 0x3FB, 0x7FB, 0xBFB, 0xFFB, 0x3FC, 0x7FC, 0xCFC, 0x0FD, 0x4FD, 0x8FD, 0xCFD, 0x0FE, 0x4FE, 0x8FE, 0xCFE, 0x0FF, + }, + + { + 0x000, 0x344, 0x650, 0x958, 0xD5E, 0x064, 0x768, 0x56C, 0xD6F, 0x073, 0xF75, 0xA78, 0x37B, 0x97D, 0xC7F, 0xE81, + 0xE83, 0xD85, 0xA87, 0x789, 0x28B, 0xC8C, 0x58E, 0xD8F, 0x491, 0xB92, 0x194, 0x695, 0xB96, 0xF97, 0x399, 0x69A, + 0x99B, 0xB9C, 0xD9D, 0xF9E, 0x0A0, 0x1A1, 0x1A2, 0x1A3, 0x1A4, 0x0A5, 0x0A6, 0xFA6, 0xDA7, 0xCA8, 0xAA9, 0x8AA, + 0x5AB, 0x3AC, 0x0AD, 0xDAD, 0xAAE, 0x7AF, 0x3B0, 0x0B1, 0xCB1, 0x8B2, 0x4B3, 0xFB3, 0xBB4, 0x6B5, 0x2B6, 0xDB6, + 0x8B7, 0x3B8, 0xDB8, 0x8B9, 0x2BA, 0xDBA, 0x7BB, 0x1BC, 0xBBC, 0x5BD, 0xFBD, 0x9BE, 0x2BF, 0xCBF, 0x5C0, 0xFC0, + 0x8C1, 0x1C2, 0xAC2, 0x3C3, 0xCC3, 0x5C4, 0xEC4, 0x6C5, 0xFC5, 0x8C6, 0x0C7, 0x8C7, 0x1C8, 0x9C8, 0x1C9, 0x9C9, + 0x1CA, 0x9CA, 0x1CB, 0x9CB, 0x1CC, 0x9CC, 0x0CD, 0x8CD, 0xFCD, 0x7CE, 0xECE, 0x6CF, 0xDCF, 0x5D0, 0xCD0, 0x3D1, + 0xAD1, 0x1D2, 0x8D2, 0xFD2, 0x6D3, 0xDD3, 0x4D4, 0xBD4, 0x2D5, 0x8D5, 0xFD5, 0x6D6, 0xCD6, 0x3D7, 0xAD7, 0x0D8, + 0x7D8, 0xDD8, 0x3D9, 0xAD9, 0x0DA, 0x6DA, 0xCDA, 0x3DB, 0x9DB, 0xFDB, 0x5DC, 0xBDC, 0x1DD, 0x7DD, 0xDDD, 0x3DE, + 0x9DE, 0xFDE, 0x5DF, 0xBDF, 0x0E0, 0x6E0, 0xCE0, 0x1E1, 0x7E1, 0xDE1, 0x2E2, 0x8E2, 0xEE2, 0x3E3, 0x9E3, 0xEE3, + 0x3E4, 0x9E4, 0xEE4, 0x4E5, 0x9E5, 0xEE5, 0x4E6, 0x9E6, 0xEE6, 0x3E7, 0x9E7, 0xEE7, 0x3E8, 0x8E8, 0xDE8, 0x2E9, + 0x7E9, 0xCE9, 0x1EA, 0x6EA, 0xBEA, 0x0EB, 0x5EB, 0xAEB, 0xFEB, 0x4EC, 0x9EC, 0xEEC, 0x2ED, 0x7ED, 0xCED, 0x1EE, + 0x5EE, 0xAEE, 0xFEE, 0x4EF, 0x8EF, 0xDEF, 0x1F0, 0x6F0, 0xBF0, 0xFF0, 0x4F1, 0x8F1, 0xDF1, 0x1F2, 0x6F2, 0xAF2, + 0xFF2, 0x3F3, 0x8F3, 0xCF3, 0x0F4, 0x5F4, 0x9F4, 0xEF4, 0x2F5, 0x6F5, 0xBF5, 0xFF5, 0x3F6, 0x7F6, 0xCF6, 0x0F7, + 0x4F7, 0x8F7, 0xCF7, 0x1F8, 0x5F8, 0x9F8, 0xDF8, 0x1F9, 0x5F9, 0x9F9, 0xDF9, 0x1FA, 0x5FA, 0xAFA, 0xEFA, 0x2FB, + 0x6FB, 0xAFB, 0xDFB, 0x1FC, 0x5FC, 0x9FC, 0xDFC, 0x1FD, 0x5FD, 0x9FD, 0xDFD, 0x1FE, 0x5FE, 0x8FE, 0xCFE, 0x0FF, + } +}; + +#endif \ No newline at end of file diff --git a/package/mediactl_lib/src/adaptive/sensor_params/canaan_isp_struct.h b/package/mediactl_lib/src/adaptive/sensor_params/canaan_isp_struct.h new file mode 100644 index 0000000..880961f --- /dev/null +++ b/package/mediactl_lib/src/adaptive/sensor_params/canaan_isp_struct.h @@ -0,0 +1,438 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __CANAAN_ISP_STRUCT_H__ +#define __CANAAN_ISP_STRUCT_H__ + +#define ADAPTIVE_AE_ROUTE_STEPS 5 // real 5 +#define ADAPTIVE_GAIN_ROUTE_STEPS 5 // real 7 +#define ADAPTIVE_GAMMA_ROUTE_STEPS 2 +#define ADAPTIVE_CCM_TEMPERATURE_NUM 6 // real 6 +#define ADAPTIVE_IR_CUT_MODE_NUM 2 +#define ADAPTIVE_COLOR_GREY_SWITCH_MODE_NUM 2 +#define ADAPTIVE_GAMMA_CURVE_INDEX_NUM 256 +#define ADAPTIVE_ADA_ROUTE_STEPS 5 +#define ADAPTIVE_3A_SYNC_FOLLOW_DISABLE 0 +#define ADAPTIVE_3A_SYNC_FOLLOW_F2K 1 +#define ADAPTIVE_3A_SYNC_FOLLOW_R2K 2 +#define ADAPTIVE_AWB_RANGE_NUM 2 // real 2 +#define ADAPTIVE_CCM_COEFF_SATURATION_WEIGHT 512 +#define ADAPTIVE_CCM_COEFF_SATURATION_WEIGHT_HALF 256 + +/* AE */ + +typedef struct { + int nAeYTarget; + int nAeYTargetRange; +} _AE_CTL_PARAM_T; + +typedef struct { + int nExposureTime; /* 0 - 40000 us */ + int nExposureGain; /* 256 - 8192; 1x is 256 */ + _AE_CTL_PARAM_T tAeCtlParam; +} ISP_AE_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + int nAntiFlickerSelect; /* 0: Anti_Flicker_None; 1: Anti_Flicker_50Hz; 2: Anti_Flicker_60Hz */ + ISP_AE_PARAM_T tAeParam[ADAPTIVE_AE_ROUTE_STEPS]; +} ADAPTIVE_ISP_AE_PARAM_T; + +/* Gain Range */ + +typedef struct { + int nGain[ADAPTIVE_GAIN_ROUTE_STEPS]; +} ADAPTIVE_ISP_AE_GAIN_PARAM_T; + +/* +* BLC +* follow ae gain +*/ + +typedef struct { + unsigned short nOffset; /* default 220 */ +} _BLC_CTL_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + _BLC_CTL_PARAM_T tBlcCtlParam[ADAPTIVE_GAIN_ROUTE_STEPS]; +} ADAPTIVE_ISP_BLC_PARAM_T; + +/* +* LSC +* follow ae gain +*/ + +typedef struct { + unsigned short nLscRedRatio; + unsigned short nLscGreenRatio; + unsigned short nLscBlueRatio; +} _LSC_CTL_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + _LSC_CTL_PARAM_T tLscCtlParam[ADAPTIVE_GAIN_ROUTE_STEPS]; +} ADAPTIVE_ISP_LSC_PARAM_T; + +/* +* SHARPNESS +* follow ae gain +*/ + +typedef struct { + unsigned short nSharpnessCore; + unsigned short nSharpnessThres[2]; /* [0]: threshold0 [1]: threshold1 */ + unsigned short nSharpnessGain; /* TBD */ +} _SHARPNESS_CTL_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + _SHARPNESS_CTL_PARAM_T tSharpnessCtlParam[ADAPTIVE_GAIN_ROUTE_STEPS]; +} ADAPTIVE_ISP_SHARPNESS_PARAM_T; + +/* +* LTM +* follow ae gain +*/ + +typedef struct { + unsigned short nLtmGain; + unsigned short nLtmThres; +} _LTM_CTL_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + _LTM_CTL_PARAM_T tLtmCtlParam[ADAPTIVE_GAIN_ROUTE_STEPS]; +} ADAPTIVE_ISP_LTM_PARAM_T; + +/* +* 2D NR +* follow ae gain +*/ + +typedef struct { + unsigned short nRawDomainIntensity; + unsigned short n2dAdjacentPixIntensity; + unsigned short n2dEdgeIntensity; + unsigned short n2dLumaIntensit; + unsigned short n2dChromaIntensity; +} _2D_DENOISE_CTL_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + _2D_DENOISE_CTL_PARAM_T t2dNoiseCtlParam[ADAPTIVE_GAIN_ROUTE_STEPS]; +} ADAPTIVE_ISP_2D_DENOISE_PARAM_T; + +/* +* 3D NR +* follow ae gain +*/ + +typedef struct { + unsigned short nPre3dLumaThres; /* dp thy */ + unsigned short nPre3dLumaIntensity; /* dp thyp */ + unsigned short nPre3dChromaIntensity; /* dp thcp */ + unsigned short nMain3dMiddleFilterThres; /* */ + unsigned short nMain3dPrevFrameMidFilter; + unsigned short nMain3dCurFrameMidFilterThres; + unsigned short nMain3dLowPassFilterVal; + unsigned short nMain3dLumaThres; + unsigned short nMain3dMinimumVal; + unsigned short nMain3dLumaIntensity; /* dm thyp */ + unsigned short nMain3dChromaIntensity; /* dm thcp */ + unsigned short nPost3dEdgeThreshold; /* db theg */ + unsigned short nPost3dLumaIntensity; /* db thyp */ + unsigned short nPost3dChromaIntensity; /* db thcp */ +} _3D_DENOISE_CTL_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + _3D_DENOISE_CTL_PARAM_T t3dNoiseCtlParam[ADAPTIVE_GAIN_ROUTE_STEPS]; +} ADAPTIVE_ISP_3D_DENOISE_PARAM_T; + +/* +* WDR +* follow ae gain +*/ + +typedef struct { + unsigned short nLghtTh[2]; /* Threshold of overexposure ratio [0] used for 3 frames mode; [1] used for 2 frames mode */ + unsigned short nFsTh; /* threshold of WDR fusion */ + unsigned short nFsK[2]; /* WDR image fusion handle value; [0] used for 3 frames mode; [1] used for 2 frames mode */ +} _WDR_CTL_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + _WDR_CTL_PARAM_T tWdrCtlParam[ADAPTIVE_GAIN_ROUTE_STEPS]; +} ADAPTIVE_ISP_WDR_PARAM_T; + +/* +* CCM +* follow awb gain +*/ + +typedef struct { + int nCtCcm[3][3]; /* [0][0]: Rr [0][1]: Rg [0][2]: Rb; [1][0]: Gr [1][1]: Gg [1][2]: Gb; [2][0]: Br [2][0]: Bg [2][0]: Bb*/ +} _CCM_CTL_PARAM_T; + +typedef struct { + unsigned short nRGain; + unsigned short nBGain; + _CCM_CTL_PARAM_T tCcmCtlParam; +} ISP_CCM_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + ISP_CCM_PARAM_T tCcmParam[ADAPTIVE_CCM_TEMPERATURE_NUM]; +} ADAPTIVE_ISP_CCM_PARAM_T; + +/* +* AWB +* follow ae +*/ + +typedef struct { + unsigned short nRGain[2]; /* [0]: Min; [1]: Max */ + unsigned short nBGain[2]; /* [0]: Min; [1]: Max */ +} _AWB_CTL_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + _AWB_CTL_PARAM_T tAwbCtlParam[ADAPTIVE_AE_ROUTE_STEPS]; +} ADAPTIVE_ISP_AWB_PARAM_T; + +/* +* GAMMA +* follow ae gain & exposure +*/ + +typedef struct { + unsigned short nGammaCurve[ADAPTIVE_GAMMA_CURVE_INDEX_NUM]; +} _GAMMA_CTL_PARAM_T; + +typedef struct { + int nEtGamma; + int nGainGamma; + _GAMMA_CTL_PARAM_T tGammaCtlParam; +} ISP_GAMMA_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + ISP_GAMMA_PARAM_T tGammaParam[ADAPTIVE_GAMMA_ROUTE_STEPS]; +} ADAPTIVE_ISP_GAMMA_PARAM_T; + +/* +* IR CUT +* follow ae gain & exposure +* callback from user +*/ + +typedef struct { + unsigned short nHoldTime; + unsigned short nIrCutMode; +} _IR_CUT_CTL_PARAM; + +typedef struct { + unsigned short nExposureTime; + unsigned short nGain; + _IR_CUT_CTL_PARAM tIrCutCtlParam; + int nIrCutCtlMode; // ir cut auto/manual ctl mode 0 / 1 +} ISP_IR_CUT_PARAM_T; + +typedef struct { + unsigned short nAutoSwitchEnable; /* 0: disable 1: enable */ + ISP_IR_CUT_PARAM_T tIrCutParam[ADAPTIVE_IR_CUT_MODE_NUM]; +} ADAPTIVE_ISP_IR_CUT_PARAM_T; + +/* +* POST SATURATION +* follow ae gain +* need calc real saturation +*/ + +typedef struct { + unsigned short nSaturationCoeff; +} _POST_SATURATION_CTL_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; /* 0: disable 1: enable */ + _POST_SATURATION_CTL_PARAM_T tPostSaturationCtlParam[ADAPTIVE_GAIN_ROUTE_STEPS]; +} ADAPTIVE_ISP_POST_SATURATION_PARAM_T; + +/* +* COLOR BLACK WHITE MODE +* follow ae gain +*/ + +typedef struct { + unsigned short nSaturation; +} _COLOR_GREY_CTL_PARAM; + +typedef struct { + int nExposureTime; + int nGain; + _COLOR_GREY_CTL_PARAM tColorGreyCsmCtlParam; +} ISP_COLOR_GREY_SWITCH_PARAM_T; + +typedef struct { + unsigned short nAutoSwitchEnable; /* 0: disable 1: saturation convert mode */ + ISP_COLOR_GREY_SWITCH_PARAM_T tColorGreySwitchParam[ADAPTIVE_COLOR_GREY_SWITCH_MODE_NUM]; +} ADAPTIVE_ISP_COLOR_GREY_SWITCH_PARAM_T; + +/* +* ADA +* follow ae TO_CPU_Y_AV(gain & et max ae lock) +*/ + +typedef struct { + unsigned short nAdaHistMax; + unsigned short nAdaTtlMax; +} _ADA_CTL_PARAM; + +typedef struct { + unsigned short nAeYEverage; + _ADA_CTL_PARAM tAdaCtlParam; +} ISP_ADA_PARAM_T; + +typedef struct { + unsigned short nAdaptiveEnable; + ISP_ADA_PARAM_T tAdaParam[ADAPTIVE_ADA_ROUTE_STEPS]; +} ADAPTIVE_ISP_ADA_PARAM_T; + +typedef struct { + float nFps; + ADAPTIVE_ISP_AE_PARAM_T tAeParam; + ADAPTIVE_ISP_AE_GAIN_PARAM_T tAeGainParam; + ADAPTIVE_ISP_BLC_PARAM_T tBlcParam; + ADAPTIVE_ISP_LSC_PARAM_T tLscParam; + ADAPTIVE_ISP_SHARPNESS_PARAM_T tSharpnessParam; + ADAPTIVE_ISP_LTM_PARAM_T tLtm_param; + ADAPTIVE_ISP_2D_DENOISE_PARAM_T tNr2dParam; + ADAPTIVE_ISP_3D_DENOISE_PARAM_T tNr3dParam; + ADAPTIVE_ISP_WDR_PARAM_T tWdrParam; + ADAPTIVE_ISP_CCM_PARAM_T tCcmParam; + ADAPTIVE_ISP_AWB_PARAM_T tAwbParam; + ADAPTIVE_ISP_GAMMA_PARAM_T tGammaParam; + ADAPTIVE_ISP_IR_CUT_PARAM_T tIrCutParam; // TBD + ADAPTIVE_ISP_POST_SATURATION_PARAM_T tSaturationParam; + ADAPTIVE_ISP_COLOR_GREY_SWITCH_PARAM_T tColorGreySwitchParam; + ADAPTIVE_ISP_ADA_PARAM_T tAdaParam; +} ADAPTIVE_ISP_PIPELINE_PARAM_T; + +typedef struct { + int nAeEvApplyFlag; // will ctl follow ae model + int nAwbStatApplyFlag; // will ctl follow awb model + int nUpdateFlag; // will ctl all model +} _PARAM_APPLY_FLAG_T; + +typedef struct { + int nAeGainWeight0; // weight of left interval(need 256 == 1.0) + int nAeGainWeight1; // weight of right interval + int nAeEvWeight0; // exposure time * gain weight + int nAeEvWeight1; // exposure time * gain weight + int nAeGainRange0; // range of left interval + int nAeGainRange1; // range of right interval + int nAeEvRange0; + int nAeEvRange1; + unsigned short nSaturationWeight; + unsigned short nGammaCurveSel; // gamma curve select + unsigned short nColorGreySel; // color2grey or grey2color + unsigned short nCtSel; // color temperature select + unsigned short nIrCutSwitchSel; // ir cut mode + unsigned short nAdaSel; // ada param select +} ADAPTIVE_ISP_WEIGHT_PARAM_T; + +typedef struct { + _BLC_CTL_PARAM_T tBlcCtlParam; + _LSC_CTL_PARAM_T tLscCtlParam; + _SHARPNESS_CTL_PARAM_T tSharpnessCtlParam; + _LTM_CTL_PARAM_T tLtmCtlParam; + _2D_DENOISE_CTL_PARAM_T t2dNrCtlParam; + _3D_DENOISE_CTL_PARAM_T t3dNrCtlParam; + _WDR_CTL_PARAM_T tWdrCtlParam; + _GAMMA_CTL_PARAM_T tGammaCtlParam; + _CCM_CTL_PARAM_T tCcmCtlParam; + _AE_CTL_PARAM_T tAeCtlParam; + _AWB_CTL_PARAM_T tAwbCtlParam; + _COLOR_GREY_CTL_PARAM tColorGreyCtlParam; + _IR_CUT_CTL_PARAM tIrCutCtlParam; + _ADA_CTL_PARAM tAdaCtlParam; + _POST_SATURATION_CTL_PARAM_T tPostSatuartionCtlParam; + ADAPTIVE_ISP_WEIGHT_PARAM_T isp_weight; + _PARAM_APPLY_FLAG_T param_flag; +} ADAPTIVE_ISP_CALC_PARAM_T; + +typedef struct { + /* ae stat */ + int nAeExposureTime; + int nAeGain; + /* awb stat */ + unsigned short nAwbRgain; + unsigned short nAwbBgain; + + /* reserved */ + int nAeReadyWr; + int nAeYEverage; + int nReserved[2]; +} ADAPTIVE_ISP_3A_STAT_T; + +typedef struct { + // post + unsigned short nBrightnessVal; // luma gain step: 0 - 255, default 128 + unsigned short nContrastVal; // contrast gain coeff step: 0 - 255, default 128 + // 2dnr + unsigned short n2dnrWeightStep_f_rawk; // 0 - 5, max_adap_2dnr / (5 - 0) + unsigned short n2dnrWeightStep_f_ek; // 0 - 5, max_adap_2dnr / (5 - 0) + unsigned short n2dnrWeightStep_f_yk; // 0 - 5, max_adap_2dnr / (5 - 0) + unsigned short n2dnrWeightStep_p_rawk; // 6 - 10, (255 - max_adap_2dnr + 1) / (10 - 6 + 1) + unsigned short n2dnrWeightStep_p_ek; // 6 - 10, (255 - max_adap_2dnr + 1) / (10 - 6 + 1) + unsigned short n2dnrWeightStep_p_yk; // 6 - 10, (255 - max_adap_2dnr + 1) / (10 - 6 + 1) + // ir cut + unsigned short nIrCutLevelDay2Night; // 2 - 20 + unsigned short nIrCutLevelNight2Day; // 0 - 18 +} ADAPTIVE_ISP_EX_MODEL_VAL_T; + +typedef struct { + /* itc ttl v */ + int nItcTtlV; + + /* ae range */ + int nMaxExpLine; + int nMinExpLine; + int nMaxGain; + int nMinGain; + /* saturation */ + unsigned short nDefaultSaturation; + /* ccm coeff */ + unsigned short nRwgt; + unsigned short nGwgt; + unsigned short nBwgt; + /* ccm normalization */ + unsigned short nSaturationRatio; // Ratio = 100% * (n + 521) / 512, need calib for different sensor + unsigned short nCcmNl[2][3]; + unsigned short reserved[1]; +} ADAPTIVE_IMG_TIMING_CFG_T; + +#endif \ No newline at end of file diff --git a/package/mediactl_lib/src/adaptive/sensor_params/gc2093_gc2053/adaptive_gc2053_r2k.h b/package/mediactl_lib/src/adaptive/sensor_params/gc2093_gc2053/adaptive_gc2053_r2k.h new file mode 100644 index 0000000..1358d66 --- /dev/null +++ b/package/mediactl_lib/src/adaptive/sensor_params/gc2093_gc2053/adaptive_gc2053_r2k.h @@ -0,0 +1,1000 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __ADAPTIVE_PARAMS_SETTING_GC2053_R2K_H__ +#define __ADAPTIVE_PARAMS_SETTING_GC2053_R2K_H__ + +#include "../canaan_isp_struct.h" + +static ADAPTIVE_ISP_PIPELINE_PARAM_T adap_gc2053_r2k = + +{ + /* fps */ + 30, + { + /* AE Parameters */ + + // static ADAPTIVE_ISP_AE_PARAM_T ae_param = { + /* nAdaptiveEnable */ + 1, + /* nAntiFlickerSelect */ + 0, //0: disable 1: 50Hz 2: 60Hz + /* tAeParam */ + { + /* 0 */ + { + /* nExposureTime */ + 88, // 10000lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 80, + /* nAeYTargetRange */ + 11, + }, + }, + /* 1 */ + { + /* nExposureTime */ + 1375, // 2500lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 80, + /* nAeYTargetRange */ + 11, + }, + }, + /* 2 */ + { + /* nExposureTime */ + 6332, // 400lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 72, + /* AE_YTarget_Range */ + 10, + }, + }, + /* 3 */ + { + /* nExposureTime */ + 17433, // 100lux + /* nExposureGain */ + 1024, + { + /* nAeYTarget */ + 65, + /* AE_YTarget_Range */ + 9, + }, + }, + /* 4 */ + { + /* nExposureTime */ + 17433, + /* nExposureGain */ + 4095, + { + /* nAeYTarget */ + 59, + /* AE_YTarget_Range */ + 8, + }, + }, + }, + // }; + }, + + /* AE gain */ + + { + {256, 768, 1024, 2048, 4095}, + }, + + { + /* BLC Parameters */ + + // static ADAPTIVE_ISP_BLC_PARAM_T blc_param = { + /* nAdaptiveEnable */ + 1, + /* blc param */ + { + /* 0 */ + {240}, + /* 1 */ + {240}, + /* 2 */ + {240}, + /* 3 */ + {240}, + /* 4 */ + {240}, + }, + // }; + }, + + { + /* LSC Parameters */ + + // static ADAPTIVE_ISP_LSC_PARAM_T lsc_param = { + /* nAdaptiveEnable */ + 1, + /* lsc param */ + { + /* 0 */ + { + /* nLscRedRatio */ + 6, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 4, + }, + /* 1 */ + { + /* nLscRedRatio */ + 6, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 4, + }, + /* 2 */ + { + /* nLscRedRatio */ + 6, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 4, + }, + /* 3 */ + { + /* nLscRedRatio */ + 6, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 4, + }, + /* 4 */ + { + /* nLscRedRatio */ + 6, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 4, + }, + }, + // }; + }, + + { + /* SHARPNESS Parameters */ + + // static ADAPTIVE_ISP_SHARPNESS_PARAM_T sharpness_param = { + /* nAdaptiveEnable */ + 1, + /* sharpness param */ + { + /* 0 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 1 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 2 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 56, + }, + /* 3 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 48, + }, + /* 4 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 40, + }, + }, + // }; + }, + + { + /* LTM Parameters */ + + // static ADAPTIVE_ISP_LTM_PARAM_T ltm_param = { + /* nAdaptiveEnable */ + 1, + { + /* 0 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 1 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 2 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 3 */ + { + /* nLtmGain */ + 100, + /* nLtmThres */ + 128, + }, + /* 4 */ + { + /* nLtmGain */ + 80, + /* nLtmThres */ + 128, + }, + }, + // }; + }, + + { + /* 2D NR Parameters */ + + // static ADAPTIVE_ISP_2D_DENOISE_PARAM_T nr2d_param = { + /* nAdaptiveEnable */ + 1, + /* 2dnr */ + { + /* 0 */ + { + /* nRawDomainIntensity */ + 12, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 24, + /* n2dLumaIntensity */ + 16, + /* n2dChromaIntensity */ + 1, + }, + /* 1 */ + { + /* nRawDomainIntensity */ + 12, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 24, + /* n2dLumaIntensity */ + 16, + /* n2dChromaIntensity */ + 1, + }, + /* 2 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 24, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 1, + }, + /* 3 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 24, + /* n2dLumaIntensit */ + 255, + /* n2dChromaIntensity */ + 1, + }, + /* 4 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 255, + /* n2dChromaIntensity */ + 1, + }, + }, + // }; + }, + + { + /* 3D NR Parameters */ + + // static ADAPTIVE_ISP_3D_DENOISE_PARAM_T nr3d_param = { + /* nAdaptiveEnable */ + 1, + /* 3dnr */ + { + /* 0 */ + { + /* nPre3dLumaThres */ + 255, + /* nPre3dLumaIntensity */ + 255, + /* nPre3dChromaIntensity */ + 32, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 30, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 1 */ + { + /* nPre3dLumaThres */ + 255, + /* nPre3dLumaIntensity */ + 255, + /* nPre3dChromaIntensity */ + 32, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 30, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 2 */ + { + /* nPre3dLumaThres */ + 255, + /* nPre3dLumaIntensity */ + 255, + /* nPre3dChromaIntensity */ + 32, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 30, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 3 */ + { + /* nPre3dLumaThres */ + 255, + /* nPre3dLumaIntensity */ + 255, + /* nPre3dChromaIntensity */ + 32, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 90, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 4 */ + { + /* nPre3dLumaThres */ + 255, + /* nPre3dLumaIntensity */ + 255, + /* nPre3dChromaIntensity */ + 32, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 90, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + }, + // }; + }, + + { + /* WDR Parameters */ + + // static ADAPTIVE_ISP_WDR_PARAM_T wdr_param = { + /* nAdaptiveEnable */ + 0, + /* wdr param */ + { + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 2 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 3 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 4 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + }, + // }; + }, + + { + /* CCM Parameters */ + + // static ADAPTIVE_ISP_CCM_PARAM_T ccm_param = { + /* nAdaptiveEnable */ + 0, + /* tCcmParam */ + { + /* A */ + { + /* nRGain */ + 166, + /* nBGain */ + 434, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {267, 8, 3}, + {75, 344, 13}, + {47, 108, 411}, + }, + }, + }, + /* U30 */ + { + /* nRGain */ + 176, + /* nBGain */ + 431, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {276, 0, 20}, + {71, 327, 0}, + {15, 129, 400}, + }, + }, + }, + /* U35 */ + { + /* nRGain */ + 199, + /* nBGain */ + 386, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {276, 0, 20}, + {73, 330, 1}, + {11, 102, 369}, + }, + }, + }, + /* TL84 */ + { + /* nRGain */ + 218, + /* nBGain */ + 349, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {261, 5, 0}, + {47, 308, 5}, + {6, 69, 331}, + }, + }, + }, + /* D50 */ + { + /* nRGain */ + 232, + /* nBGain */ + 306, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {267, 10, 1}, + {50, 312, 6}, + {3, 107, 366}, + }, + }, + }, + /* D65 */ + { + /* nRGain */ + 254, + /* nBGain */ + 274, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {267, 10, 1}, + {52, 314, 6}, + {7, 66, 329}, + }, + }, + }, + }, + // }; + }, + + { + /* AWB */ + + // static ADAPTIVE_ISP_AWB_PARAM_T awb_param = { + /* nAdaptiveEnable */ + 0, + /* awb param */ + { + /* 0 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {218, 254}, + /* nBGain[2]; [0]: Min [1]: Max */ + {274, 349}, + }, + /* 1 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {164, 254}, + /* nBGain[2]; [0]: Min [1]: Max */ + {274, 449}, + }, + /* 2 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {164, 254}, + /* nBGain[2]; [0]: Min [1]: Max */ + {274, 449}, + }, + /* 3 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {218, 254}, + /* nBGain[2]; [0]: Min [1]: Max */ + {274, 349}, + }, + /* 4 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {218, 254}, + /* nBGain[2]; [0]: Min [1]: Max */ + {274, 349}, + }, + }, + // }; + }, + + { + + /* GAMMA Parameters */ + + // static ADAPTIVE_ISP_GAMMA_PARAM_T gamma_param = { + /* nAdaptiveEnable */ + 1, // if 1 affect ae stablization + /* tGammaParam */ + { + /* Day */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 512, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x000, 0xC05, 0x80B, 0x411, 0xC16, 0x01C, 0x421, 0x426, 0x02B, 0x82F, 0xC33, 0xC37, 0x83B, 0x03F, 0x442, 0x445, + 0x048, 0xC4A, 0x44D, 0xC4F, 0x052, 0x454, 0x856, 0x858, 0x85A, 0x85C, 0x85E, 0x860, 0x862, 0x864, 0x466, 0x068, + 0xC69, 0x86B, 0x46D, 0x06F, 0xC70, 0x872, 0x074, 0x875, 0x077, 0x878, 0x07A, 0x87B, 0x07D, 0x87E, 0xC7F, 0x081, + 0x482, 0x883, 0xC84, 0x086, 0x487, 0x888, 0xC89, 0x08B, 0x48C, 0x88D, 0x88E, 0x88F, 0x890, 0x891, 0x892, 0x893, + 0x894, 0x895, 0x896, 0x897, 0x898, 0x899, 0x89A, 0x89B, 0x89C, 0x89D, 0x89E, 0x49F, 0x0A0, 0xCA0, 0x8A1, 0x4A2, + 0x0A3, 0xCA3, 0x8A4, 0x4A5, 0x0A6, 0xCA6, 0x8A7, 0x4A8, 0x0A9, 0xCA9, 0x8AA, 0x4AB, 0x0AC, 0xCAC, 0x8AD, 0x4AE, + 0x0AF, 0xCAF, 0x8B0, 0x4B1, 0x0B2, 0xCB2, 0x8B3, 0x4B4, 0x0B5, 0xCB5, 0x4B6, 0xCB6, 0x4B7, 0xCB7, 0x4B8, 0xCB8, + 0x4B9, 0xCB9, 0x4BA, 0xCBA, 0x4BB, 0xCBB, 0x4BC, 0xCBC, 0x4BD, 0xCBD, 0x4BE, 0xCBE, 0x4BF, 0xCBF, 0x4C0, 0xCC0, + 0x4C1, 0xCC1, 0x4C2, 0xCC2, 0x4C3, 0xCC3, 0x4C4, 0xCC4, 0x4C5, 0xCC5, 0x4C6, 0xCC6, 0x4C7, 0xCC7, 0x4C8, 0xCC8, + 0x4C9, 0xCC9, 0x4CA, 0xCCA, 0x4CB, 0xCCB, 0x4CC, 0xCCC, 0x4CD, 0xCCD, 0x4CE, 0xCCE, 0x4CF, 0xCCF, 0x4D0, 0xCD0, + 0x4D1, 0xCD1, 0x4D2, 0xCD2, 0x4D3, 0xCD3, 0x4D4, 0xCD4, 0x4D5, 0xCD5, 0x4D6, 0xCD6, 0x4D7, 0xCD7, 0x4D8, 0xCD8, + 0x4D9, 0xCD9, 0x4DA, 0xCDA, 0x4DB, 0xCDB, 0x4DC, 0xCDC, 0x4DD, 0xCDD, 0x4DE, 0xCDE, 0x4DF, 0xCDF, 0x4E0, 0xCE0, + 0x4E1, 0xCE1, 0x4E2, 0xCE2, 0x4E3, 0xCE3, 0x4E4, 0xCE4, 0x4E5, 0xCE5, 0x4E6, 0xCE6, 0x4E7, 0xCE7, 0x4E8, 0xCE8, + 0x4E9, 0xCE9, 0x4EA, 0xCEA, 0x4EB, 0xCEB, 0x4EC, 0xCEC, 0x4ED, 0xCED, 0x4EE, 0xCEE, 0x4EF, 0xCEF, 0x4F0, 0xCF0, + 0x4F1, 0xCF1, 0x4F2, 0xCF2, 0x4F3, 0xCF3, 0x4F4, 0xCF4, 0x4F5, 0xCF5, 0x4F6, 0xCF6, 0x4F7, 0xCF7, 0x4F8, 0xCF8, + 0x4F9, 0xCF9, 0x4FA, 0xCFA, 0x4FB, 0xCFB, 0x4FC, 0xCFC, 0x4FD, 0xCFD, 0x4FE, 0xCFE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + /* Night */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 3072, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x001, 0x814, 0x41C, 0x022, 0xC26, 0xC2A, 0x82E, 0xC31, 0x035, 0xC37, 0x83A, 0x43D, 0xC3F, 0x042, 0x444, 0x846, + 0x848, 0x84A, 0x84C, 0x84E, 0x450, 0x052, 0xC53, 0x855, 0x457, 0x059, 0x85A, 0x05C, 0x85D, 0x05F, 0x860, 0x062, + 0x863, 0x065, 0x866, 0xC67, 0x069, 0x46A, 0x86B, 0xC6C, 0x06E, 0x46F, 0x870, 0xC71, 0x073, 0x474, 0x875, 0xC76, + 0x078, 0x479, 0x47A, 0x47B, 0x47C, 0x47D, 0x47E, 0x47F, 0x480, 0x481, 0x482, 0x483, 0x484, 0x485, 0x486, 0x487, + 0x488, 0x489, 0x48A, 0x48B, 0x48C, 0x48D, 0x48E, 0x48F, 0x490, 0x491, 0x492, 0x493, 0x494, 0x495, 0x496, 0x497, + 0x098, 0xC98, 0x899, 0x49A, 0x09B, 0xC9B, 0x89C, 0x49D, 0x09E, 0xC9E, 0x89F, 0x4A0, 0x0A1, 0xCA1, 0x8A2, 0x4A3, + 0x0A4, 0xCA4, 0x8A5, 0x4A6, 0x0A7, 0xCA7, 0x8A8, 0x4A9, 0x0AA, 0xCAA, 0x8AB, 0x4AC, 0x0AD, 0xCAD, 0x8AE, 0x4AF, + 0x0B0, 0xCB0, 0x8B1, 0x4B2, 0x0B3, 0xCB3, 0x8B4, 0x4B5, 0x0B6, 0xCB6, 0x8B7, 0x4B8, 0x0B9, 0xCB9, 0x8BA, 0x4BB, + 0x0BC, 0xCBC, 0x8BD, 0x4BE, 0x0BF, 0xCBF, 0x8C0, 0x4C1, 0x0C2, 0xCC2, 0x8C3, 0x4C4, 0x0C5, 0xCC5, 0x8C6, 0x4C7, + 0x0C8, 0xCC8, 0x8C9, 0x4CA, 0x0CB, 0x8CB, 0x0CC, 0x8CC, 0x0CD, 0x8CD, 0x0CE, 0x8CE, 0x0CF, 0x8CF, 0x0D0, 0x8D0, + 0x0D1, 0x8D1, 0x0D2, 0x8D2, 0x0D3, 0x8D3, 0x0D4, 0x8D4, 0x0D5, 0x8D5, 0x0D6, 0x8D6, 0x0D7, 0x8D7, 0x0D8, 0x8D8, + 0x0D9, 0x8D9, 0x0DA, 0x8DA, 0x0DB, 0x8DB, 0x0DC, 0x8DC, 0x0DD, 0x8DD, 0x0DE, 0x8DE, 0x0DF, 0x8DF, 0x0E0, 0x8E0, + 0x0E1, 0x8E1, 0x0E2, 0x8E2, 0x0E3, 0x8E3, 0x0E4, 0x8E4, 0x0E5, 0x8E5, 0x0E6, 0x8E6, 0x0E7, 0x8E7, 0x0E8, 0x8E8, + 0x0E9, 0x8E9, 0x0EA, 0x8EA, 0x0EB, 0x8EB, 0x0EC, 0x8EC, 0x0ED, 0x8ED, 0x0EE, 0x8EE, 0x0EF, 0x8EF, 0x0F0, 0x8F0, + 0x0F1, 0x8F1, 0x0F2, 0x8F2, 0x0F3, 0x8F3, 0x0F4, 0x8F4, 0x0F5, 0x8F5, 0x0F6, 0x8F6, 0x0F7, 0x8F7, 0x0F8, 0x8F8, + 0x0F9, 0x8F9, 0x0FA, 0x8FA, 0x0FB, 0x8FB, 0x0FC, 0x8FC, 0x0FD, 0x8FD, 0x0FE, 0x8FE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + }, + // }; + }, + + { + // static ADAPTIVE_ISP_IR_CUT_PARAM_T ir_cut_param = { + /* nAutoSwitchEnable */ + 1, + /* tIrCutParam */ + { + /* Day2Night */ + { + /* nExposureTime */ + 30000, + /* nGain */ + 512, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 2, + /* nIrCutMode TBD? */ + 1, + }, + }, + /* Night2Day */ + { + /* nExposureTime */ + 20000, + /* nGain */ + 256, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 6, + /* nIrCutMode TBD? */ + 0, + }, + }, + }, + // }; + }, + + { + /* POST SATURATION Parameters */ + + // static ADAPTIVE_ISP_POST_SATURATION_PARAM_T saturation_param = { + /* nAdaptiveEnable */ + 1, + /* post saturation param */ + { + /* 0 */ + {100}, + /* 1 */ + {100}, + /* 2 */ + {100}, + /* 3 */ + {100}, + /* 4 */ + {90}, + }, + // }; + }, + + { + /* Color Black White Mode Parameters */ + + // static ADAPTIVE_ISP_COLOR_GREY_SWI2CH_PARAM_T color_grey_switch_param = { + /* nAutoSwitchEnable */ + 1, // use csm mode + /* tColorGreySwitchParam */ + { + /* Color2BW */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 4095, + /* tColorGreyCsmCtlParam*/ + {0}, + }, + /* BW2Color */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 1536, + /* tColorGreyCsmCtlParam*/ + {255}, + }, + }, + // }; + }, + + { + /* ADA Parameters */ + + // static ADAPTIVE_ISP_ADA_PARAM_T ada_param = { + /* nAdaptiveEnable */ + 1, // 1: enable, 0: disable + /* tAdaParam */ + { + /* 0 */ + { + /* nAeYEverage */ + 60, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 255, + }, + }, + /* 1 */ + { + /* nAeYEverage */ + 50, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 200, + }, + }, + /* 2 */ + { + /* nAeYEverage */ + 40, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 128, + }, + }, + /* 3 */ + { + /* nAeYEverage */ + 30, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 100, + }, + }, + /* 4 */ + { + /* nAeYEverage */ + 20, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 90, + }, + }, + }, + // }; + }, +}; + +#endif diff --git a/package/mediactl_lib/src/adaptive/sensor_params/gc2093_gc2053/adaptive_gc2093_f2k.h b/package/mediactl_lib/src/adaptive/sensor_params/gc2093_gc2053/adaptive_gc2093_f2k.h new file mode 100644 index 0000000..7c1c3dc --- /dev/null +++ b/package/mediactl_lib/src/adaptive/sensor_params/gc2093_gc2053/adaptive_gc2093_f2k.h @@ -0,0 +1,1000 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __ADAPTIVE_PARAMS_SETTING_GC2093_F2K_H__ +#define __ADAPTIVE_PARAMS_SETTING_GC2093_F2K_H__ + +#include "../canaan_isp_struct.h" + +static ADAPTIVE_ISP_PIPELINE_PARAM_T adap_gc2093_f2k = + +{ + /* fps */ + 30, + { + /* AE Parameters */ + + // static ADAPTIVE_ISP_AE_PARAM_T ae_param = { + /* nAdaptiveEnable */ + 1, + /* nAntiFlickerSelect */ + 0, //0: disable 1: 50Hz 2: 60Hz + /* tAeParam */ + { + /* 0 */ + { + /* nExposureTime */ + 88, // 10000lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 100, + /* nAeYTargetRange */ + 14, + }, + }, + /* 1 */ + { + /* nExposureTime */ + 1375, // 2500lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 100, + /* nAeYTargetRange */ + 14, + }, + }, + /* 2 */ + { + /* nExposureTime */ + 6332, // 400lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 90, + /* AE_YTarget_Range */ + 13, + }, + }, + /* 3 */ + { + /* nExposureTime */ + 17433, // 100lux + /* nExposureGain */ + 1024, + { + /* nAeYTarget */ + 80, + /* AE_YTarget_Range */ + 11, + }, + }, + /* 4 */ + { + /* nExposureTime */ + 17433, + /* nExposureGain */ + 4095, + { + /* nAeYTarget */ + 72, + /* AE_YTarget_Range */ + 10, + }, + }, + }, + // }; + }, + + /* AE gain */ + + { + {256, 768, 1024, 2048, 4095}, + }, + + { + /* BLC Parameters */ + + // static ADAPTIVE_ISP_BLC_PARAM_T blc_param = { + /* nAdaptiveEnable */ + 1, + /* blc param */ + { + /* 0 */ + {240}, + /* 1 */ + {240}, + /* 2 */ + {240}, + /* 3 */ + {240}, + /* 4 */ + {240}, + }, + // }; + }, + + { + /* LSC Parameters */ + + // static ADAPTIVE_ISP_LSC_PARAM_T lsc_param = { + /* nAdaptiveEnable */ + 1, + /* lsc param */ + { + /* 0 */ + { + /* nLscRedRatio */ + 6, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 4, + }, + /* 1 */ + { + /* nLscRedRatio */ + 6, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 4, + }, + /* 2 */ + { + /* nLscRedRatio */ + 6, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 4, + }, + /* 3 */ + { + /* nLscRedRatio */ + 6, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 4, + }, + /* 4 */ + { + /* nLscRedRatio */ + 6, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 4, + }, + }, + // }; + }, + + { + /* SHARPNESS Parameters */ + + // static ADAPTIVE_ISP_SHARPNESS_PARAM_T sharpness_param = { + /* nAdaptiveEnable */ + 1, + /* sharpness param */ + { + /* 0 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 1 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 2 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 56, + }, + /* 3 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 48, + }, + /* 4 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 40, + }, + }, + // }; + }, + + { + /* LTM Parameters */ + + // static ADAPTIVE_ISP_LTM_PARAM_T ltm_param = { + /* nAdaptiveEnable */ + 1, + { + /* 0 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 1 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 2 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 3 */ + { + /* nLtmGain */ + 100, + /* nLtmThres */ + 128, + }, + /* 4 */ + { + /* nLtmGain */ + 80, + /* nLtmThres */ + 128, + }, + }, + // }; + }, + + { + /* 2D NR Parameters */ + + // static ADAPTIVE_ISP_2D_DENOISE_PARAM_T nr2d_param = { + /* nAdaptiveEnable */ + 1, + /* 2dnr */ + { + /* 0 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 24, + /* n2dLumaIntensity */ + 32, + /* n2dChromaIntensity */ + 1, + }, + /* 1 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 24, + /* n2dLumaIntensit */ + 32, + /* n2dChromaIntensity */ + 1, + }, + /* 2 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 24, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 160, + }, + /* 3 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 24, + /* n2dLumaIntensit */ + 255, + /* n2dChromaIntensity */ + 255, + }, + /* 4 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 255, + /* n2dChromaIntensity */ + 255, + }, + }, + // }; + }, + + { + /* 3D NR Parameters */ + + // static ADAPTIVE_ISP_3D_DENOISE_PARAM_T nr3d_param = { + /* nAdaptiveEnable */ + 1, + /* 3dnr */ + { + /* 0 */ + { + /* nPre3dLumaThres */ + 255, + /* nPre3dLumaIntensity */ + 255, + /* nPre3dChromaIntensity */ + 32, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 30, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 1 */ + { + /* nPre3dLumaThres */ + 255, + /* nPre3dLumaIntensity */ + 255, + /* nPre3dChromaIntensity */ + 32, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 30, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 2 */ + { + /* nPre3dLumaThres */ + 255, + /* nPre3dLumaIntensity */ + 255, + /* nPre3dChromaIntensity */ + 32, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 30, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 3 */ + { + /* nPre3dLumaThres */ + 255, + /* nPre3dLumaIntensity */ + 255, + /* nPre3dChromaIntensity */ + 32, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 90, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 4 */ + { + /* nPre3dLumaThres */ + 255, + /* nPre3dLumaIntensity */ + 255, + /* nPre3dChromaIntensity */ + 32, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 90, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + }, + // }; + }, + + { + /* WDR Parameters */ + + // static ADAPTIVE_ISP_WDR_PARAM_T wdr_param = { + /* nAdaptiveEnable */ + 0, + /* wdr param */ + { + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 2 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 3 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 4 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + }, + // }; + }, + + { + /* CCM Parameters */ + + // static ADAPTIVE_ISP_CCM_PARAM_T ccm_param = { + /* nAdaptiveEnable */ + 1, + /* tCcmParam */ + { + /* A */ + { + /* nRGain */ + 166, + /* nBGain */ + 434, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {267, 8, 3}, + {75, 344, 13}, + {47, 108, 411}, + }, + }, + }, + /* U30 */ + { + /* nRGain */ + 176, + /* nBGain */ + 431, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {276, 0, 20}, + {71, 327, 0}, + {15, 129, 400}, + }, + }, + }, + /* U35 */ + { + /* nRGain */ + 199, + /* nBGain */ + 386, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {276, 0, 20}, + {73, 330, 1}, + {11, 102, 369}, + }, + }, + }, + /* TL84 */ + { + /* nRGain */ + 218, + /* nBGain */ + 349, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {261, 5, 0}, + {47, 308, 5}, + {6, 69, 331}, + }, + }, + }, + /* D50 */ + { + /* nRGain */ + 232, + /* nBGain */ + 306, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {267, 10, 1}, + {50, 312, 6}, + {3, 107, 366}, + }, + }, + }, + /* D65 */ + { + /* nRGain */ + 254, + /* nBGain */ + 274, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {267, 10, 1}, + {52, 314, 6}, + {7, 66, 329}, + }, + }, + }, + }, + // }; + }, + + { + /* AWB */ + + // static ADAPTIVE_ISP_AWB_PARAM_T awb_param = { + /* nAdaptiveEnable */ + 1, + /* awb param */ + { + /* 0 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {218, 254}, + /* nBGain[2]; [0]: Min [1]: Max */ + {274, 349}, + }, + /* 1 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {164, 254}, + /* nBGain[2]; [0]: Min [1]: Max */ + {274, 449}, + }, + /* 2 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {164, 254}, + /* nBGain[2]; [0]: Min [1]: Max */ + {274, 449}, + }, + /* 3 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {218, 254}, + /* nBGain[2]; [0]: Min [1]: Max */ + {274, 349}, + }, + /* 4 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {218, 254}, + /* nBGain[2]; [0]: Min [1]: Max */ + {274, 349}, + }, + }, + // }; + }, + + { + + /* GAMMA Parameters */ + + // static ADAPTIVE_ISP_GAMMA_PARAM_T gamma_param = { + /* nAdaptiveEnable */ + 1, // if 1 affect ae stablization + /* tGammaParam */ + { + /* Day */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 512, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x000, 0xC05, 0x80B, 0x411, 0xC16, 0x01C, 0x421, 0x426, 0x02B, 0x82F, 0xC33, 0xC37, 0x83B, 0x03F, 0x442, 0x445, + 0x048, 0xC4A, 0x44D, 0xC4F, 0x052, 0x454, 0x856, 0x858, 0x85A, 0x85C, 0x85E, 0x860, 0x862, 0x864, 0x466, 0x068, + 0xC69, 0x86B, 0x46D, 0x06F, 0xC70, 0x872, 0x074, 0x875, 0x077, 0x878, 0x07A, 0x87B, 0x07D, 0x87E, 0xC7F, 0x081, + 0x482, 0x883, 0xC84, 0x086, 0x487, 0x888, 0xC89, 0x08B, 0x48C, 0x88D, 0x88E, 0x88F, 0x890, 0x891, 0x892, 0x893, + 0x894, 0x895, 0x896, 0x897, 0x898, 0x899, 0x89A, 0x89B, 0x89C, 0x89D, 0x89E, 0x49F, 0x0A0, 0xCA0, 0x8A1, 0x4A2, + 0x0A3, 0xCA3, 0x8A4, 0x4A5, 0x0A6, 0xCA6, 0x8A7, 0x4A8, 0x0A9, 0xCA9, 0x8AA, 0x4AB, 0x0AC, 0xCAC, 0x8AD, 0x4AE, + 0x0AF, 0xCAF, 0x8B0, 0x4B1, 0x0B2, 0xCB2, 0x8B3, 0x4B4, 0x0B5, 0xCB5, 0x4B6, 0xCB6, 0x4B7, 0xCB7, 0x4B8, 0xCB8, + 0x4B9, 0xCB9, 0x4BA, 0xCBA, 0x4BB, 0xCBB, 0x4BC, 0xCBC, 0x4BD, 0xCBD, 0x4BE, 0xCBE, 0x4BF, 0xCBF, 0x4C0, 0xCC0, + 0x4C1, 0xCC1, 0x4C2, 0xCC2, 0x4C3, 0xCC3, 0x4C4, 0xCC4, 0x4C5, 0xCC5, 0x4C6, 0xCC6, 0x4C7, 0xCC7, 0x4C8, 0xCC8, + 0x4C9, 0xCC9, 0x4CA, 0xCCA, 0x4CB, 0xCCB, 0x4CC, 0xCCC, 0x4CD, 0xCCD, 0x4CE, 0xCCE, 0x4CF, 0xCCF, 0x4D0, 0xCD0, + 0x4D1, 0xCD1, 0x4D2, 0xCD2, 0x4D3, 0xCD3, 0x4D4, 0xCD4, 0x4D5, 0xCD5, 0x4D6, 0xCD6, 0x4D7, 0xCD7, 0x4D8, 0xCD8, + 0x4D9, 0xCD9, 0x4DA, 0xCDA, 0x4DB, 0xCDB, 0x4DC, 0xCDC, 0x4DD, 0xCDD, 0x4DE, 0xCDE, 0x4DF, 0xCDF, 0x4E0, 0xCE0, + 0x4E1, 0xCE1, 0x4E2, 0xCE2, 0x4E3, 0xCE3, 0x4E4, 0xCE4, 0x4E5, 0xCE5, 0x4E6, 0xCE6, 0x4E7, 0xCE7, 0x4E8, 0xCE8, + 0x4E9, 0xCE9, 0x4EA, 0xCEA, 0x4EB, 0xCEB, 0x4EC, 0xCEC, 0x4ED, 0xCED, 0x4EE, 0xCEE, 0x4EF, 0xCEF, 0x4F0, 0xCF0, + 0x4F1, 0xCF1, 0x4F2, 0xCF2, 0x4F3, 0xCF3, 0x4F4, 0xCF4, 0x4F5, 0xCF5, 0x4F6, 0xCF6, 0x4F7, 0xCF7, 0x4F8, 0xCF8, + 0x4F9, 0xCF9, 0x4FA, 0xCFA, 0x4FB, 0xCFB, 0x4FC, 0xCFC, 0x4FD, 0xCFD, 0x4FE, 0xCFE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + /* Night */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 3072, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x001, 0x814, 0x41C, 0x022, 0xC26, 0xC2A, 0x82E, 0xC31, 0x035, 0xC37, 0x83A, 0x43D, 0xC3F, 0x042, 0x444, 0x846, + 0x848, 0x84A, 0x84C, 0x84E, 0x450, 0x052, 0xC53, 0x855, 0x457, 0x059, 0x85A, 0x05C, 0x85D, 0x05F, 0x860, 0x062, + 0x863, 0x065, 0x866, 0xC67, 0x069, 0x46A, 0x86B, 0xC6C, 0x06E, 0x46F, 0x870, 0xC71, 0x073, 0x474, 0x875, 0xC76, + 0x078, 0x479, 0x47A, 0x47B, 0x47C, 0x47D, 0x47E, 0x47F, 0x480, 0x481, 0x482, 0x483, 0x484, 0x485, 0x486, 0x487, + 0x488, 0x489, 0x48A, 0x48B, 0x48C, 0x48D, 0x48E, 0x48F, 0x490, 0x491, 0x492, 0x493, 0x494, 0x495, 0x496, 0x497, + 0x098, 0xC98, 0x899, 0x49A, 0x09B, 0xC9B, 0x89C, 0x49D, 0x09E, 0xC9E, 0x89F, 0x4A0, 0x0A1, 0xCA1, 0x8A2, 0x4A3, + 0x0A4, 0xCA4, 0x8A5, 0x4A6, 0x0A7, 0xCA7, 0x8A8, 0x4A9, 0x0AA, 0xCAA, 0x8AB, 0x4AC, 0x0AD, 0xCAD, 0x8AE, 0x4AF, + 0x0B0, 0xCB0, 0x8B1, 0x4B2, 0x0B3, 0xCB3, 0x8B4, 0x4B5, 0x0B6, 0xCB6, 0x8B7, 0x4B8, 0x0B9, 0xCB9, 0x8BA, 0x4BB, + 0x0BC, 0xCBC, 0x8BD, 0x4BE, 0x0BF, 0xCBF, 0x8C0, 0x4C1, 0x0C2, 0xCC2, 0x8C3, 0x4C4, 0x0C5, 0xCC5, 0x8C6, 0x4C7, + 0x0C8, 0xCC8, 0x8C9, 0x4CA, 0x0CB, 0x8CB, 0x0CC, 0x8CC, 0x0CD, 0x8CD, 0x0CE, 0x8CE, 0x0CF, 0x8CF, 0x0D0, 0x8D0, + 0x0D1, 0x8D1, 0x0D2, 0x8D2, 0x0D3, 0x8D3, 0x0D4, 0x8D4, 0x0D5, 0x8D5, 0x0D6, 0x8D6, 0x0D7, 0x8D7, 0x0D8, 0x8D8, + 0x0D9, 0x8D9, 0x0DA, 0x8DA, 0x0DB, 0x8DB, 0x0DC, 0x8DC, 0x0DD, 0x8DD, 0x0DE, 0x8DE, 0x0DF, 0x8DF, 0x0E0, 0x8E0, + 0x0E1, 0x8E1, 0x0E2, 0x8E2, 0x0E3, 0x8E3, 0x0E4, 0x8E4, 0x0E5, 0x8E5, 0x0E6, 0x8E6, 0x0E7, 0x8E7, 0x0E8, 0x8E8, + 0x0E9, 0x8E9, 0x0EA, 0x8EA, 0x0EB, 0x8EB, 0x0EC, 0x8EC, 0x0ED, 0x8ED, 0x0EE, 0x8EE, 0x0EF, 0x8EF, 0x0F0, 0x8F0, + 0x0F1, 0x8F1, 0x0F2, 0x8F2, 0x0F3, 0x8F3, 0x0F4, 0x8F4, 0x0F5, 0x8F5, 0x0F6, 0x8F6, 0x0F7, 0x8F7, 0x0F8, 0x8F8, + 0x0F9, 0x8F9, 0x0FA, 0x8FA, 0x0FB, 0x8FB, 0x0FC, 0x8FC, 0x0FD, 0x8FD, 0x0FE, 0x8FE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + }, + // }; + }, + + { + // static ADAPTIVE_ISP_IR_CUT_PARAM_T ir_cut_param = { + /* nAutoSwitchEnable */ + 1, + /* tIrCutParam */ + { + /* Day2Night */ + { + /* nExposureTime */ + 30000, + /* nGain */ + 512, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 2, + /* nIrCutMode TBD? */ + 1, + }, + }, + /* Night2Day */ + { + /* nExposureTime */ + 20000, + /* nGain */ + 256, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 6, + /* nIrCutMode TBD? */ + 0, + }, + }, + }, + // }; + }, + + { + /* POST SATURATION Parameters */ + + // static ADAPTIVE_ISP_POST_SATURATION_PARAM_T saturation_param = { + /* nAdaptiveEnable */ + 1, + /* post saturation param */ + { + /* 0 */ + {100}, + /* 1 */ + {100}, + /* 2 */ + {100}, + /* 3 */ + {100}, + /* 4 */ + {90}, + }, + // }; + }, + + { + /* Color Black White Mode Parameters */ + + // static ADAPTIVE_ISP_COLOR_GREY_SWI2CH_PARAM_T color_grey_switch_param = { + /* nAutoSwitchEnable */ + 0, + /* tColorGreySwitchParam */ + { + /* Color2BW */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 4095, + /* tColorGreyCsmCtlParam*/ + {0}, + }, + /* BW2Color */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 1536, + /* tColorGreyCsmCtlParam*/ + {255}, + }, + }, + // }; + }, + + { + /* ADA Parameters */ + + // static ADAPTIVE_ISP_ADA_PARAM_T ada_param = { + /* nAdaptiveEnable */ + 1, // 1: enable, 0: disable + /* tAdaParam */ + { + /* 0 */ + { + /* nAeYEverage */ + 60, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 255, + }, + }, + /* 1 */ + { + /* nAeYEverage */ + 50, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 200, + }, + }, + /* 2 */ + { + /* nAeYEverage */ + 40, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 128, + }, + }, + /* 3 */ + { + /* nAeYEverage */ + 30, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 100, + }, + }, + /* 4 */ + { + /* nAeYEverage */ + 20, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 90, + }, + }, + }, + // }; + }, +}; + +#endif diff --git a/package/mediactl_lib/src/adaptive/sensor_params/imx219/adaptive_imx219_f2k.h b/package/mediactl_lib/src/adaptive/sensor_params/imx219/adaptive_imx219_f2k.h new file mode 100644 index 0000000..7f0fcef --- /dev/null +++ b/package/mediactl_lib/src/adaptive/sensor_params/imx219/adaptive_imx219_f2k.h @@ -0,0 +1,1000 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __ADAPTIVE_PARAMS_SETTING_IMX219_F2K_H__ +#define __ADAPTIVE_PARAMS_SETTING_IMX219_F2K_H__ + +#include "../canaan_isp_struct.h" + +static ADAPTIVE_ISP_PIPELINE_PARAM_T adap_imx219_f2k = + +{ + /* fps */ + 30, + { + /* AE Parameters */ + + // static ADAPTIVE_ISP_AE_PARAM_T ae_param = { + /* nAdaptiveEnable */ + 1, + /* nAntiFlickerSelect */ + 0, //0: disable 1: 50Hz 2: 60Hz + /* tAeParam */ + { + /* 0 */ + { + /* nExposureTime */ + 280, // 6000lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 100, + /* nAeYTargetRange */ + 14, + }, + }, + /* 1 */ + { + /* nExposureTime */ + 2630, // 2500lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 100, + /* nAeYTargetRange */ + 14, + }, + }, + /* 2 */ + { + /* nExposureTime */ + 12108, // 400lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 90, + /* AE_YTarget_Range */ + 13, + }, + }, + /* 3 */ + { + /* nExposureTime */ + 33333, // 100lux + /* nExposureGain */ + 1024, + { + /* nAeYTarget */ + 80, + /* AE_YTarget_Range */ + 11, + }, + }, + /* 4 */ + { + /* nExposureTime */ + 33333, + /* nExposureGain */ + 4095, + { + /* nAeYTarget */ + 72, + /* AE_YTarget_Range */ + 10, + }, + }, + }, + // }; + }, + + /* AE gain */ + + { + {256, 768, 1024, 2048, 4095}, + }, + + { + /* BLC Parameters */ + + // static ADAPTIVE_ISP_BLC_PARAM_T blc_param = { + /* nAdaptiveEnable */ + 1, + /* blc param */ + { + /* 0 */ + {240}, + /* 1 */ + {240}, + /* 2 */ + {224}, + /* 3 */ + {224}, + /* 4 */ + {224}, + }, + // }; + }, + + { + /* LSC Parameters */ + + // static ADAPTIVE_ISP_LSC_PARAM_T lsc_param = { + /* nAdaptiveEnable */ + 1, + /* lsc param */ + { + /* 0 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 1 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 2 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 3 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 4 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + }, + // }; + }, + + { + /* SHARPNESS Parameters */ + + // static ADAPTIVE_ISP_SHARPNESS_PARAM_T sharpness_param = { + /* nAdaptiveEnable */ + 1, + /* sharpness param */ + { + /* 0 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 1 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 2 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 56, + }, + /* 3 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 48, + }, + /* 4 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 40, + }, + }, + // }; + }, + + { + /* LTM Parameters */ + + // static ADAPTIVE_ISP_LTM_PARAM_T ltm_param = { + /* nAdaptiveEnable */ + 1, + { + /* 0 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 1 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 2 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 3 */ + { + /* nLtmGain */ + 100, + /* nLtmThres */ + 128, + }, + /* 4 */ + { + /* nLtmGain */ + 80, + /* nLtmThres */ + 128, + }, + }, + // }; + }, + + { + /* 2D NR Parameters */ + + // static ADAPTIVE_ISP_2D_DENOISE_PARAM_T nr2d_param = { + /* nAdaptiveEnable */ + 1, + /* 2dnr */ + { + /* 0 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 32, + /* n2dLumaIntensity */ + 32, + /* n2dChromaIntensity */ + 1, + }, + /* 1 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 32, + /* n2dLumaIntensit */ + 32, + /* n2dChromaIntensity */ + 1, + }, + /* 2 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 40, + /* n2dLumaIntensit */ + 48, + /* n2dChromaIntensity */ + 160, + }, + /* 3 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 255, + }, + /* 4 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 255, + }, + }, + // }; + }, + + { + /* 3D NR Parameters */ + + // static ADAPTIVE_ISP_3D_DENOISE_PARAM_T nr3d_param = { + /* nAdaptiveEnable */ + 1, + /* 3dnr */ + { + /* 0 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 1, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 1 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 2 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 3 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 4 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + }, + // }; + }, + + { + /* WDR Parameters */ + + // static ADAPTIVE_ISP_WDR_PARAM_T wdr_param = { + /* nAdaptiveEnable */ + 0, + /* wdr param */ + { + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 2 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 3 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 4 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + }, + // }; + }, + + { + /* CCM Parameters */ + + // static ADAPTIVE_ISP_CCM_PARAM_T ccm_param = { + /* nAdaptiveEnable */ + 1, + /* tCcmParam */ + { + /* A */ + { + /* nRGain */ + 162, + /* nBGain */ + 449, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {311, 49, 6}, + {62, 343, 26}, + {16, 142, 414}, + }, + }, + }, + /* U30 */ + { + /* nRGain */ + 156, + /* nBGain */ + 458, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {299, 39, 5}, + {56, 336, 24}, + {13, 126, 395}, + }, + }, + }, + /* U35 */ + { + /* nRGain */ + 176, + /* nBGain */ + 402, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {287, 28, 3}, + {50, 328, 22}, + {9, 111, 376}, + }, + }, + }, + /* TL84 */ + { + /* nRGain */ + 194, + /* nBGain */ + 360, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {259, 2, 1}, + {37, 310, 17}, + {1, 75, 332}, + }, + }, + }, + /* D50 */ + { + /* nRGain */ + 234, + /* nBGain */ + 299, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {277, 19, 3}, + {45, 322, 20}, + {6, 98, 360}, + }, + }, + }, + /* D65 */ + { + /* nRGain */ + 257, + /* nBGain */ + 269, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {259, 2, 1}, + {37, 310, 17}, + {1, 75, 332}, + }, + }, + }, + }, + // }; + }, + + { + /* AWB */ + + // static ADAPTIVE_ISP_AWB_PARAM_T awb_param = { + /* nAdaptiveEnable */ + 1, + /* awb param */ + { + /* 0 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 247}, + /* nBGain[2]; [0]: Min [1]: Max */ + {275, 360}, + }, + /* 1 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + /* 2 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {162, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 449}, + }, + /* 3 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + /* 4 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + }, + // }; + }, + + { + + /* GAMMA Parameters */ + + // static ADAPTIVE_ISP_GAMMA_PARAM_T gamma_param = { + /* nAdaptiveEnable */ + 1, // if 1 affect ae stablization + /* tGammaParam */ + { + /* Day */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 512, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x000, 0xC05, 0x80B, 0x411, 0xC16, 0x01C, 0x421, 0x426, 0x02B, 0x82F, 0xC33, 0xC37, 0x83B, 0x03F, 0x442, 0x445, + 0x048, 0xC4A, 0x44D, 0xC4F, 0x052, 0x454, 0x856, 0x858, 0x85A, 0x85C, 0x85E, 0x860, 0x862, 0x864, 0x466, 0x068, + 0xC69, 0x86B, 0x46D, 0x06F, 0xC70, 0x872, 0x074, 0x875, 0x077, 0x878, 0x07A, 0x87B, 0x07D, 0x87E, 0xC7F, 0x081, + 0x482, 0x883, 0xC84, 0x086, 0x487, 0x888, 0xC89, 0x08B, 0x48C, 0x88D, 0x88E, 0x88F, 0x890, 0x891, 0x892, 0x893, + 0x894, 0x895, 0x896, 0x897, 0x898, 0x899, 0x89A, 0x89B, 0x89C, 0x89D, 0x89E, 0x49F, 0x0A0, 0xCA0, 0x8A1, 0x4A2, + 0x0A3, 0xCA3, 0x8A4, 0x4A5, 0x0A6, 0xCA6, 0x8A7, 0x4A8, 0x0A9, 0xCA9, 0x8AA, 0x4AB, 0x0AC, 0xCAC, 0x8AD, 0x4AE, + 0x0AF, 0xCAF, 0x8B0, 0x4B1, 0x0B2, 0xCB2, 0x8B3, 0x4B4, 0x0B5, 0xCB5, 0x4B6, 0xCB6, 0x4B7, 0xCB7, 0x4B8, 0xCB8, + 0x4B9, 0xCB9, 0x4BA, 0xCBA, 0x4BB, 0xCBB, 0x4BC, 0xCBC, 0x4BD, 0xCBD, 0x4BE, 0xCBE, 0x4BF, 0xCBF, 0x4C0, 0xCC0, + 0x4C1, 0xCC1, 0x4C2, 0xCC2, 0x4C3, 0xCC3, 0x4C4, 0xCC4, 0x4C5, 0xCC5, 0x4C6, 0xCC6, 0x4C7, 0xCC7, 0x4C8, 0xCC8, + 0x4C9, 0xCC9, 0x4CA, 0xCCA, 0x4CB, 0xCCB, 0x4CC, 0xCCC, 0x4CD, 0xCCD, 0x4CE, 0xCCE, 0x4CF, 0xCCF, 0x4D0, 0xCD0, + 0x4D1, 0xCD1, 0x4D2, 0xCD2, 0x4D3, 0xCD3, 0x4D4, 0xCD4, 0x4D5, 0xCD5, 0x4D6, 0xCD6, 0x4D7, 0xCD7, 0x4D8, 0xCD8, + 0x4D9, 0xCD9, 0x4DA, 0xCDA, 0x4DB, 0xCDB, 0x4DC, 0xCDC, 0x4DD, 0xCDD, 0x4DE, 0xCDE, 0x4DF, 0xCDF, 0x4E0, 0xCE0, + 0x4E1, 0xCE1, 0x4E2, 0xCE2, 0x4E3, 0xCE3, 0x4E4, 0xCE4, 0x4E5, 0xCE5, 0x4E6, 0xCE6, 0x4E7, 0xCE7, 0x4E8, 0xCE8, + 0x4E9, 0xCE9, 0x4EA, 0xCEA, 0x4EB, 0xCEB, 0x4EC, 0xCEC, 0x4ED, 0xCED, 0x4EE, 0xCEE, 0x4EF, 0xCEF, 0x4F0, 0xCF0, + 0x4F1, 0xCF1, 0x4F2, 0xCF2, 0x4F3, 0xCF3, 0x4F4, 0xCF4, 0x4F5, 0xCF5, 0x4F6, 0xCF6, 0x4F7, 0xCF7, 0x4F8, 0xCF8, + 0x4F9, 0xCF9, 0x4FA, 0xCFA, 0x4FB, 0xCFB, 0x4FC, 0xCFC, 0x4FD, 0xCFD, 0x4FE, 0xCFE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + /* Night */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 3072, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x001, 0x814, 0x41C, 0x022, 0xC26, 0xC2A, 0x82E, 0xC31, 0x035, 0xC37, 0x83A, 0x43D, 0xC3F, 0x042, 0x444, 0x846, + 0x848, 0x84A, 0x84C, 0x84E, 0x450, 0x052, 0xC53, 0x855, 0x457, 0x059, 0x85A, 0x05C, 0x85D, 0x05F, 0x860, 0x062, + 0x863, 0x065, 0x866, 0xC67, 0x069, 0x46A, 0x86B, 0xC6C, 0x06E, 0x46F, 0x870, 0xC71, 0x073, 0x474, 0x875, 0xC76, + 0x078, 0x479, 0x47A, 0x47B, 0x47C, 0x47D, 0x47E, 0x47F, 0x480, 0x481, 0x482, 0x483, 0x484, 0x485, 0x486, 0x487, + 0x488, 0x489, 0x48A, 0x48B, 0x48C, 0x48D, 0x48E, 0x48F, 0x490, 0x491, 0x492, 0x493, 0x494, 0x495, 0x496, 0x497, + 0x098, 0xC98, 0x899, 0x49A, 0x09B, 0xC9B, 0x89C, 0x49D, 0x09E, 0xC9E, 0x89F, 0x4A0, 0x0A1, 0xCA1, 0x8A2, 0x4A3, + 0x0A4, 0xCA4, 0x8A5, 0x4A6, 0x0A7, 0xCA7, 0x8A8, 0x4A9, 0x0AA, 0xCAA, 0x8AB, 0x4AC, 0x0AD, 0xCAD, 0x8AE, 0x4AF, + 0x0B0, 0xCB0, 0x8B1, 0x4B2, 0x0B3, 0xCB3, 0x8B4, 0x4B5, 0x0B6, 0xCB6, 0x8B7, 0x4B8, 0x0B9, 0xCB9, 0x8BA, 0x4BB, + 0x0BC, 0xCBC, 0x8BD, 0x4BE, 0x0BF, 0xCBF, 0x8C0, 0x4C1, 0x0C2, 0xCC2, 0x8C3, 0x4C4, 0x0C5, 0xCC5, 0x8C6, 0x4C7, + 0x0C8, 0xCC8, 0x8C9, 0x4CA, 0x0CB, 0x8CB, 0x0CC, 0x8CC, 0x0CD, 0x8CD, 0x0CE, 0x8CE, 0x0CF, 0x8CF, 0x0D0, 0x8D0, + 0x0D1, 0x8D1, 0x0D2, 0x8D2, 0x0D3, 0x8D3, 0x0D4, 0x8D4, 0x0D5, 0x8D5, 0x0D6, 0x8D6, 0x0D7, 0x8D7, 0x0D8, 0x8D8, + 0x0D9, 0x8D9, 0x0DA, 0x8DA, 0x0DB, 0x8DB, 0x0DC, 0x8DC, 0x0DD, 0x8DD, 0x0DE, 0x8DE, 0x0DF, 0x8DF, 0x0E0, 0x8E0, + 0x0E1, 0x8E1, 0x0E2, 0x8E2, 0x0E3, 0x8E3, 0x0E4, 0x8E4, 0x0E5, 0x8E5, 0x0E6, 0x8E6, 0x0E7, 0x8E7, 0x0E8, 0x8E8, + 0x0E9, 0x8E9, 0x0EA, 0x8EA, 0x0EB, 0x8EB, 0x0EC, 0x8EC, 0x0ED, 0x8ED, 0x0EE, 0x8EE, 0x0EF, 0x8EF, 0x0F0, 0x8F0, + 0x0F1, 0x8F1, 0x0F2, 0x8F2, 0x0F3, 0x8F3, 0x0F4, 0x8F4, 0x0F5, 0x8F5, 0x0F6, 0x8F6, 0x0F7, 0x8F7, 0x0F8, 0x8F8, + 0x0F9, 0x8F9, 0x0FA, 0x8FA, 0x0FB, 0x8FB, 0x0FC, 0x8FC, 0x0FD, 0x8FD, 0x0FE, 0x8FE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + }, + // }; + }, + + { + // static ADAPTIVE_ISP_IR_CUT_PARAM_T ir_cut_param = { + /* nAutoSwitchEnable */ + 1, + /* tIrCutParam */ + { + /* Day2Night */ + { + /* nExposureTime */ + 30000, + /* nGain */ + 2048, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 120, + /* nIrCutMode */ + 1, + }, + }, + /* Night2Day */ + { + /* nExposureTime */ + 20000, + /* nGain */ + 512, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 120, + /* nIrCutMode */ + 0, + }, + }, + }, + // }; + }, + + { + /* POST SATURATION Parameters */ + + // static ADAPTIVE_ISP_POST_SATURATION_PARAM_T saturation_param = { + /* nAdaptiveEnable */ + 1, + /* post saturation param */ + { + /* 0 */ + {100}, + /* 1 */ + {100}, + /* 2 */ + {100}, + /* 3 */ + {100}, + /* 4 */ + {90}, + }, + // }; + }, + + { + /* Color Black White Mode Parameters */ + + // static ADAPTIVE_ISP_COLOR_GREY_SWI2CH_PARAM_T color_grey_switch_param = { + /* nAutoSwitchEnable */ + 0, // use csm mode + /* tColorGreySwitchParam */ + { + /* Color2BW */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 4095, + /* tColorGreyCsmCtlParam*/ + {0}, + }, + /* BW2Color */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 1536, + /* tColorGreyCsmCtlParam*/ + {255}, + }, + }, + // }; + }, + + { + /* ADA Parameters */ + + // static ADAPTIVE_ISP_ADA_PARAM_T ada_param = { + /* nAdaptiveEnable */ + 1, // 1: enable, 0: disable + /* tAdaParam */ + { + /* 0 */ + { + /* nAeYEverage */ + 60, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 255, + }, + }, + /* 1 */ + { + /* nAeYEverage */ + 50, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 200, + }, + }, + /* 2 */ + { + /* nAeYEverage */ + 40, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 128, + }, + }, + /* 3 */ + { + /* nAeYEverage */ + 30, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 100, + }, + }, + /* 4 */ + { + /* nAeYEverage */ + 20, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 90, + }, + }, + }, + // }; + }, +}; + +#endif diff --git a/package/mediactl_lib/src/adaptive/sensor_params/imx219/adaptive_imx219_r2k.h b/package/mediactl_lib/src/adaptive/sensor_params/imx219/adaptive_imx219_r2k.h new file mode 100644 index 0000000..d94ce46 --- /dev/null +++ b/package/mediactl_lib/src/adaptive/sensor_params/imx219/adaptive_imx219_r2k.h @@ -0,0 +1,1000 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __ADAPTIVE_PARAMS_SETTING_IMX219_R2K_H__ +#define __ADAPTIVE_PARAMS_SETTING_IMX219_R2K_H__ + +#include "../canaan_isp_struct.h" + +static ADAPTIVE_ISP_PIPELINE_PARAM_T adap_imx219_r2k = + +{ + /* fps */ + 30, + { + /* AE Parameters */ + + // static ADAPTIVE_ISP_AE_PARAM_T ae_param = { + /* nAdaptiveEnable */ + 1, + /* nAntiFlickerSelect */ + 0, //0: disable 1: 50Hz 2: 60Hz + /* tAeParam */ + { + /* 0 */ + { + /* nExposureTime */ + 280, // 6000lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 100, + /* nAeYTargetRange */ + 14, + }, + }, + /* 1 */ + { + /* nExposureTime */ + 2630, // 2500lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 100, + /* nAeYTargetRange */ + 14, + }, + }, + /* 2 */ + { + /* nExposureTime */ + 12108, // 400lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 90, + /* AE_YTarget_Range */ + 13, + }, + }, + /* 3 */ + { + /* nExposureTime */ + 33333, // 100lux + /* nExposureGain */ + 1024, + { + /* nAeYTarget */ + 80, + /* AE_YTarget_Range */ + 11, + }, + }, + /* 4 */ + { + /* nExposureTime */ + 33333, + /* nExposureGain */ + 4095, + { + /* nAeYTarget */ + 72, + /* AE_YTarget_Range */ + 10, + }, + }, + }, + // }; + }, + + /* AE gain */ + + { + {256, 768, 1024, 2048, 4095}, + }, + + { + /* BLC Parameters */ + + // static ADAPTIVE_ISP_BLC_PARAM_T blc_param = { + /* nAdaptiveEnable */ + 1, + /* blc param */ + { + /* 0 */ + {240}, + /* 1 */ + {240}, + /* 2 */ + {224}, + /* 3 */ + {224}, + /* 4 */ + {224}, + }, + // }; + }, + + { + /* LSC Parameters */ + + // static ADAPTIVE_ISP_LSC_PARAM_T lsc_param = { + /* nAdaptiveEnable */ + 1, + /* lsc param */ + { + /* 0 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 1 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 2 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 3 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 4 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + }, + // }; + }, + + { + /* SHARPNESS Parameters */ + + // static ADAPTIVE_ISP_SHARPNESS_PARAM_T sharpness_param = { + /* nAdaptiveEnable */ + 1, + /* sharpness param */ + { + /* 0 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 1 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 2 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 56, + }, + /* 3 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 48, + }, + /* 4 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 40, + }, + }, + // }; + }, + + { + /* LTM Parameters */ + + // static ADAPTIVE_ISP_LTM_PARAM_T ltm_param = { + /* nAdaptiveEnable */ + 1, + { + /* 0 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 1 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 2 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 3 */ + { + /* nLtmGain */ + 100, + /* nLtmThres */ + 128, + }, + /* 4 */ + { + /* nLtmGain */ + 80, + /* nLtmThres */ + 128, + }, + }, + // }; + }, + + { + /* 2D NR Parameters */ + + // static ADAPTIVE_ISP_2D_DENOISE_PARAM_T nr2d_param = { + /* nAdaptiveEnable */ + 1, + /* 2dnr */ + { + /* 0 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 32, + /* n2dLumaIntensity */ + 32, + /* n2dChromaIntensity */ + 1, + }, + /* 1 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 32, + /* n2dLumaIntensit */ + 32, + /* n2dChromaIntensity */ + 1, + }, + /* 2 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 128, + /* n2dEdgeIntensity */ + 40, + /* n2dLumaIntensit */ + 48, + /* n2dChromaIntensity */ + 160, + }, + /* 3 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 255, + }, + /* 4 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 255, + }, + }, + // }; + }, + + { + /* 3D NR Parameters */ + + // static ADAPTIVE_ISP_3D_DENOISE_PARAM_T nr3d_param = { + /* nAdaptiveEnable */ + 1, + /* 3dnr */ + { + /* 0 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 1, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 1 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 2 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 3 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 4 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + }, + // }; + }, + + { + /* WDR Parameters */ + + // static ADAPTIVE_ISP_WDR_PARAM_T wdr_param = { + /* nAdaptiveEnable */ + 0, + /* wdr param */ + { + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 2 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 3 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 4 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + }, + // }; + }, + + { + /* CCM Parameters */ + + // static ADAPTIVE_ISP_CCM_PARAM_T ccm_param = { + /* nAdaptiveEnable */ + 1, + /* tCcmParam */ + { + /* A */ + { + /* nRGain */ + 162, + /* nBGain */ + 449, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {311, 49, 6}, + {62, 343, 26}, + {16, 142, 414}, + }, + }, + }, + /* U30 */ + { + /* nRGain */ + 156, + /* nBGain */ + 458, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {299, 39, 5}, + {56, 336, 24}, + {13, 126, 395}, + }, + }, + }, + /* U35 */ + { + /* nRGain */ + 176, + /* nBGain */ + 402, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {287, 28, 3}, + {50, 328, 22}, + {9, 111, 376}, + }, + }, + }, + /* TL84 */ + { + /* nRGain */ + 194, + /* nBGain */ + 360, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {259, 2, 1}, + {37, 310, 17}, + {1, 75, 332}, + }, + }, + }, + /* D50 */ + { + /* nRGain */ + 234, + /* nBGain */ + 299, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {277, 19, 3}, + {45, 322, 20}, + {6, 98, 360}, + }, + }, + }, + /* D65 */ + { + /* nRGain */ + 257, + /* nBGain */ + 269, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {259, 2, 1}, + {37, 310, 17}, + {1, 75, 332}, + }, + }, + }, + }, + // }; + }, + + { + /* AWB */ + + // static ADAPTIVE_ISP_AWB_PARAM_T awb_param = { + /* nAdaptiveEnable */ + 1, + /* awb param */ + { + /* 0 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 247}, + /* nBGain[2]; [0]: Min [1]: Max */ + {275, 360}, + }, + /* 1 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + /* 2 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {162, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 449}, + }, + /* 3 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + /* 4 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + }, + // }; + }, + + { + + /* GAMMA Parameters */ + + // static ADAPTIVE_ISP_GAMMA_PARAM_T gamma_param = { + /* nAdaptiveEnable */ + 1, // if 1 affect ae stablization + /* tGammaParam */ + { + /* Day */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 512, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x000, 0xC05, 0x80B, 0x411, 0xC16, 0x01C, 0x421, 0x426, 0x02B, 0x82F, 0xC33, 0xC37, 0x83B, 0x03F, 0x442, 0x445, + 0x048, 0xC4A, 0x44D, 0xC4F, 0x052, 0x454, 0x856, 0x858, 0x85A, 0x85C, 0x85E, 0x860, 0x862, 0x864, 0x466, 0x068, + 0xC69, 0x86B, 0x46D, 0x06F, 0xC70, 0x872, 0x074, 0x875, 0x077, 0x878, 0x07A, 0x87B, 0x07D, 0x87E, 0xC7F, 0x081, + 0x482, 0x883, 0xC84, 0x086, 0x487, 0x888, 0xC89, 0x08B, 0x48C, 0x88D, 0x88E, 0x88F, 0x890, 0x891, 0x892, 0x893, + 0x894, 0x895, 0x896, 0x897, 0x898, 0x899, 0x89A, 0x89B, 0x89C, 0x89D, 0x89E, 0x49F, 0x0A0, 0xCA0, 0x8A1, 0x4A2, + 0x0A3, 0xCA3, 0x8A4, 0x4A5, 0x0A6, 0xCA6, 0x8A7, 0x4A8, 0x0A9, 0xCA9, 0x8AA, 0x4AB, 0x0AC, 0xCAC, 0x8AD, 0x4AE, + 0x0AF, 0xCAF, 0x8B0, 0x4B1, 0x0B2, 0xCB2, 0x8B3, 0x4B4, 0x0B5, 0xCB5, 0x4B6, 0xCB6, 0x4B7, 0xCB7, 0x4B8, 0xCB8, + 0x4B9, 0xCB9, 0x4BA, 0xCBA, 0x4BB, 0xCBB, 0x4BC, 0xCBC, 0x4BD, 0xCBD, 0x4BE, 0xCBE, 0x4BF, 0xCBF, 0x4C0, 0xCC0, + 0x4C1, 0xCC1, 0x4C2, 0xCC2, 0x4C3, 0xCC3, 0x4C4, 0xCC4, 0x4C5, 0xCC5, 0x4C6, 0xCC6, 0x4C7, 0xCC7, 0x4C8, 0xCC8, + 0x4C9, 0xCC9, 0x4CA, 0xCCA, 0x4CB, 0xCCB, 0x4CC, 0xCCC, 0x4CD, 0xCCD, 0x4CE, 0xCCE, 0x4CF, 0xCCF, 0x4D0, 0xCD0, + 0x4D1, 0xCD1, 0x4D2, 0xCD2, 0x4D3, 0xCD3, 0x4D4, 0xCD4, 0x4D5, 0xCD5, 0x4D6, 0xCD6, 0x4D7, 0xCD7, 0x4D8, 0xCD8, + 0x4D9, 0xCD9, 0x4DA, 0xCDA, 0x4DB, 0xCDB, 0x4DC, 0xCDC, 0x4DD, 0xCDD, 0x4DE, 0xCDE, 0x4DF, 0xCDF, 0x4E0, 0xCE0, + 0x4E1, 0xCE1, 0x4E2, 0xCE2, 0x4E3, 0xCE3, 0x4E4, 0xCE4, 0x4E5, 0xCE5, 0x4E6, 0xCE6, 0x4E7, 0xCE7, 0x4E8, 0xCE8, + 0x4E9, 0xCE9, 0x4EA, 0xCEA, 0x4EB, 0xCEB, 0x4EC, 0xCEC, 0x4ED, 0xCED, 0x4EE, 0xCEE, 0x4EF, 0xCEF, 0x4F0, 0xCF0, + 0x4F1, 0xCF1, 0x4F2, 0xCF2, 0x4F3, 0xCF3, 0x4F4, 0xCF4, 0x4F5, 0xCF5, 0x4F6, 0xCF6, 0x4F7, 0xCF7, 0x4F8, 0xCF8, + 0x4F9, 0xCF9, 0x4FA, 0xCFA, 0x4FB, 0xCFB, 0x4FC, 0xCFC, 0x4FD, 0xCFD, 0x4FE, 0xCFE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + /* Night */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 3072, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x001, 0x814, 0x41C, 0x022, 0xC26, 0xC2A, 0x82E, 0xC31, 0x035, 0xC37, 0x83A, 0x43D, 0xC3F, 0x042, 0x444, 0x846, + 0x848, 0x84A, 0x84C, 0x84E, 0x450, 0x052, 0xC53, 0x855, 0x457, 0x059, 0x85A, 0x05C, 0x85D, 0x05F, 0x860, 0x062, + 0x863, 0x065, 0x866, 0xC67, 0x069, 0x46A, 0x86B, 0xC6C, 0x06E, 0x46F, 0x870, 0xC71, 0x073, 0x474, 0x875, 0xC76, + 0x078, 0x479, 0x47A, 0x47B, 0x47C, 0x47D, 0x47E, 0x47F, 0x480, 0x481, 0x482, 0x483, 0x484, 0x485, 0x486, 0x487, + 0x488, 0x489, 0x48A, 0x48B, 0x48C, 0x48D, 0x48E, 0x48F, 0x490, 0x491, 0x492, 0x493, 0x494, 0x495, 0x496, 0x497, + 0x098, 0xC98, 0x899, 0x49A, 0x09B, 0xC9B, 0x89C, 0x49D, 0x09E, 0xC9E, 0x89F, 0x4A0, 0x0A1, 0xCA1, 0x8A2, 0x4A3, + 0x0A4, 0xCA4, 0x8A5, 0x4A6, 0x0A7, 0xCA7, 0x8A8, 0x4A9, 0x0AA, 0xCAA, 0x8AB, 0x4AC, 0x0AD, 0xCAD, 0x8AE, 0x4AF, + 0x0B0, 0xCB0, 0x8B1, 0x4B2, 0x0B3, 0xCB3, 0x8B4, 0x4B5, 0x0B6, 0xCB6, 0x8B7, 0x4B8, 0x0B9, 0xCB9, 0x8BA, 0x4BB, + 0x0BC, 0xCBC, 0x8BD, 0x4BE, 0x0BF, 0xCBF, 0x8C0, 0x4C1, 0x0C2, 0xCC2, 0x8C3, 0x4C4, 0x0C5, 0xCC5, 0x8C6, 0x4C7, + 0x0C8, 0xCC8, 0x8C9, 0x4CA, 0x0CB, 0x8CB, 0x0CC, 0x8CC, 0x0CD, 0x8CD, 0x0CE, 0x8CE, 0x0CF, 0x8CF, 0x0D0, 0x8D0, + 0x0D1, 0x8D1, 0x0D2, 0x8D2, 0x0D3, 0x8D3, 0x0D4, 0x8D4, 0x0D5, 0x8D5, 0x0D6, 0x8D6, 0x0D7, 0x8D7, 0x0D8, 0x8D8, + 0x0D9, 0x8D9, 0x0DA, 0x8DA, 0x0DB, 0x8DB, 0x0DC, 0x8DC, 0x0DD, 0x8DD, 0x0DE, 0x8DE, 0x0DF, 0x8DF, 0x0E0, 0x8E0, + 0x0E1, 0x8E1, 0x0E2, 0x8E2, 0x0E3, 0x8E3, 0x0E4, 0x8E4, 0x0E5, 0x8E5, 0x0E6, 0x8E6, 0x0E7, 0x8E7, 0x0E8, 0x8E8, + 0x0E9, 0x8E9, 0x0EA, 0x8EA, 0x0EB, 0x8EB, 0x0EC, 0x8EC, 0x0ED, 0x8ED, 0x0EE, 0x8EE, 0x0EF, 0x8EF, 0x0F0, 0x8F0, + 0x0F1, 0x8F1, 0x0F2, 0x8F2, 0x0F3, 0x8F3, 0x0F4, 0x8F4, 0x0F5, 0x8F5, 0x0F6, 0x8F6, 0x0F7, 0x8F7, 0x0F8, 0x8F8, + 0x0F9, 0x8F9, 0x0FA, 0x8FA, 0x0FB, 0x8FB, 0x0FC, 0x8FC, 0x0FD, 0x8FD, 0x0FE, 0x8FE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + }, + // }; + }, + + { + // static ADAPTIVE_ISP_IR_CUT_PARAM_T ir_cut_param = { + /* nAutoSwitchEnable */ + 1, + /* tIrCutParam */ + { + /* Day2Night */ + { + /* nExposureTime */ + 30000, + /* nGain */ + 2048, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 120, + /* nIrCutMode */ + 1, + }, + }, + /* Night2Day */ + { + /* nExposureTime */ + 20000, + /* nGain */ + 512, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 120, + /* nIrCutMode */ + 0, + }, + }, + }, + // }; + }, + + { + /* POST SATURATION Parameters */ + + // static ADAPTIVE_ISP_POST_SATURATION_PARAM_T saturation_param = { + /* nAdaptiveEnable */ + 1, + /* post saturation param */ + { + /* 0 */ + {100}, + /* 1 */ + {100}, + /* 2 */ + {100}, + /* 3 */ + {100}, + /* 4 */ + {90}, + }, + // }; + }, + + { + /* Color Black White Mode Parameters */ + + // static ADAPTIVE_ISP_COLOR_GREY_SWI2CH_PARAM_T color_grey_switch_param = { + /* nAutoSwitchEnable */ + 0, // use csm mode + /* tColorGreySwitchParam */ + { + /* Color2BW */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 4095, + /* tColorGreyCsmCtlParam*/ + {0}, + }, + /* BW2Color */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 1536, + /* tColorGreyCsmCtlParam*/ + {255}, + }, + }, + // }; + }, + + { + /* ADA Parameters */ + + // static ADAPTIVE_ISP_ADA_PARAM_T ada_param = { + /* nAdaptiveEnable */ + 1, // 1: enable, 0: disable + /* tAdaParam */ + { + /* 0 */ + { + /* nAeYEverage */ + 60, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 255, + }, + }, + /* 1 */ + { + /* nAeYEverage */ + 50, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 200, + }, + }, + /* 2 */ + { + /* nAeYEverage */ + 40, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 128, + }, + }, + /* 3 */ + { + /* nAeYEverage */ + 30, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 100, + }, + }, + /* 4 */ + { + /* nAeYEverage */ + 20, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 90, + }, + }, + }, + // }; + }, +}; + +#endif diff --git a/package/mediactl_lib/src/adaptive/sensor_params/imx385/adaptive_imx385_f2k.h b/package/mediactl_lib/src/adaptive/sensor_params/imx385/adaptive_imx385_f2k.h new file mode 100644 index 0000000..9146a77 --- /dev/null +++ b/package/mediactl_lib/src/adaptive/sensor_params/imx385/adaptive_imx385_f2k.h @@ -0,0 +1,1000 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __ADAPTIVE_PARAMS_SETTING_IMX385_F2K_H__ +#define __ADAPTIVE_PARAMS_SETTING_IMX385_F2K_H__ + +#include "../canaan_isp_struct.h" + +static ADAPTIVE_ISP_PIPELINE_PARAM_T adap_imx385_f2k = + +{ + /* fps */ + 29.97, + { + /* AE Parameters */ + + // static ADAPTIVE_ISP_AE_PARAM_T ae_param = { + /* nAdaptiveEnable */ + 1, + /* nAntiFlickerSelect */ + 0, //0: disable 1: 50Hz 2: 60Hz + /* tAeParam */ + { + /* 0 */ + { + /* nExposureTime */ + 168, // 10000lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 100, + /* nAeYTargetRange */ + 14, + }, + }, + /* 1 */ + { + /* nExposureTime */ + 2630, // 2500lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 100, + /* nAeYTargetRange */ + 14, + }, + }, + /* 2 */ + { + /* nExposureTime */ + 12108, // 400lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 90, + /* AE_YTarget_Range */ + 13, + }, + }, + /* 3 */ + { + /* nExposureTime */ + 33333, // 100lux + /* nExposureGain */ + 1024, + { + /* nAeYTarget */ + 80, + /* AE_YTarget_Range */ + 11, + }, + }, + /* 4 */ + { + /* nExposureTime */ + 33333, + /* nExposureGain */ + 4095, + { + /* nAeYTarget */ + 72, + /* AE_YTarget_Range */ + 10, + }, + }, + }, + // }; + }, + + /* AE gain */ + + { + {256, 768, 1024, 2048, 4095}, + }, + + { + /* BLC Parameters */ + + // static ADAPTIVE_ISP_BLC_PARAM_T blc_param = { + /* nAdaptiveEnable */ + 1, + /* blc param */ + { + /* 0 */ + {240}, + /* 1 */ + {240}, + /* 2 */ + {240}, + /* 3 */ + {240}, + /* 4 */ + {240}, + }, + // }; + }, + + { + /* LSC Parameters */ + + // static ADAPTIVE_ISP_LSC_PARAM_T lsc_param = { + /* nAdaptiveEnable */ + 1, + /* lsc param */ + { + /* 0 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 1 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 2 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 3 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 4 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + }, + // }; + }, + + { + /* SHARPNESS Parameters */ + + // static ADAPTIVE_ISP_SHARPNESS_PARAM_T sharpness_param = { + /* nAdaptiveEnable */ + 1, + /* sharpness param */ + { + /* 0 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 1 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 2 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 56, + }, + /* 3 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 48, + }, + /* 4 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 40, + }, + }, + // }; + }, + + { + /* LTM Parameters */ + + // static ADAPTIVE_ISP_LTM_PARAM_T ltm_param = { + /* nAdaptiveEnable */ + 1, + { + /* 0 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 1 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 2 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 3 */ + { + /* nLtmGain */ + 100, + /* nLtmThres */ + 128, + }, + /* 4 */ + { + /* nLtmGain */ + 80, + /* nLtmThres */ + 128, + }, + }, + // }; + }, + + { + /* 2D NR Parameters */ + + // static ADAPTIVE_ISP_2D_DENOISE_PARAM_T nr2d_param = { + /* nAdaptiveEnable */ + 1, + /* 2dnr */ + { + /* 0 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensity */ + 64, + /* n2dChromaIntensity */ + 1, + }, + /* 1 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 1, + }, + /* 2 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 160, + }, + /* 3 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 255, + }, + /* 4 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 255, + }, + }, + // }; + }, + + { + /* 3D NR Parameters */ + + // static ADAPTIVE_ISP_3D_DENOISE_PARAM_T nr3d_param = { + /* nAdaptiveEnable */ + 1, + /* 3dnr */ + { + /* 0 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 1, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 1 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 2 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 3 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 4 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + }, + // }; + }, + + { + /* WDR Parameters */ + + // static ADAPTIVE_ISP_WDR_PARAM_T wdr_param = { + /* nAdaptiveEnable */ + 0, + /* wdr param */ + { + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 2 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 3 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 4 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + }, + // }; + }, + + { + /* CCM Parameters */ + + // static ADAPTIVE_ISP_CCM_PARAM_T ccm_param = { + /* nAdaptiveEnable */ + 1, + /* tCcmParam */ + { + /* A */ + { + /* nRGain */ + 162, + /* nBGain */ + 449, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {311, 49, 6}, + {62, 343, 26}, + {16, 142, 414}, + }, + }, + }, + /* U30 */ + { + /* nRGain */ + 156, + /* nBGain */ + 458, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {299, 39, 5}, + {56, 336, 24}, + {13, 126, 395}, + }, + }, + }, + /* U35 */ + { + /* nRGain */ + 176, + /* nBGain */ + 402, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {287, 28, 3}, + {50, 328, 22}, + {9, 111, 376}, + }, + }, + }, + /* TL84 */ + { + /* nRGain */ + 194, + /* nBGain */ + 360, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {259, 2, 1}, + {37, 310, 17}, + {1, 75, 332}, + }, + }, + }, + /* D50 */ + { + /* nRGain */ + 234, + /* nBGain */ + 299, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {277, 19, 3}, + {45, 322, 20}, + {6, 98, 360}, + }, + }, + }, + /* D65 */ + { + /* nRGain */ + 257, + /* nBGain */ + 269, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {259, 2, 1}, + {37, 310, 17}, + {1, 75, 332}, + }, + }, + }, + }, + // }; + }, + + { + /* AWB */ + + // static ADAPTIVE_ISP_AWB_PARAM_T awb_param = { + /* nAdaptiveEnable */ + 1, + /* awb param */ + { + /* 0 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + /* 1 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {162, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 449}, + }, + /* 2 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {162, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 449}, + }, + /* 3 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + /* 4 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + }, + // }; + }, + + { + + /* GAMMA Parameters */ + + // static ADAPTIVE_ISP_GAMMA_PARAM_T gamma_param = { + /* nAdaptiveEnable */ + 1, // if 1 affect ae stablization + /* tGammaParam */ + { + /* Day */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 512, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x000, 0xC05, 0x80B, 0x411, 0xC16, 0x01C, 0x421, 0x426, 0x02B, 0x82F, 0xC33, 0xC37, 0x83B, 0x03F, 0x442, 0x445, + 0x048, 0xC4A, 0x44D, 0xC4F, 0x052, 0x454, 0x856, 0x858, 0x85A, 0x85C, 0x85E, 0x860, 0x862, 0x864, 0x466, 0x068, + 0xC69, 0x86B, 0x46D, 0x06F, 0xC70, 0x872, 0x074, 0x875, 0x077, 0x878, 0x07A, 0x87B, 0x07D, 0x87E, 0xC7F, 0x081, + 0x482, 0x883, 0xC84, 0x086, 0x487, 0x888, 0xC89, 0x08B, 0x48C, 0x88D, 0x88E, 0x88F, 0x890, 0x891, 0x892, 0x893, + 0x894, 0x895, 0x896, 0x897, 0x898, 0x899, 0x89A, 0x89B, 0x89C, 0x89D, 0x89E, 0x49F, 0x0A0, 0xCA0, 0x8A1, 0x4A2, + 0x0A3, 0xCA3, 0x8A4, 0x4A5, 0x0A6, 0xCA6, 0x8A7, 0x4A8, 0x0A9, 0xCA9, 0x8AA, 0x4AB, 0x0AC, 0xCAC, 0x8AD, 0x4AE, + 0x0AF, 0xCAF, 0x8B0, 0x4B1, 0x0B2, 0xCB2, 0x8B3, 0x4B4, 0x0B5, 0xCB5, 0x4B6, 0xCB6, 0x4B7, 0xCB7, 0x4B8, 0xCB8, + 0x4B9, 0xCB9, 0x4BA, 0xCBA, 0x4BB, 0xCBB, 0x4BC, 0xCBC, 0x4BD, 0xCBD, 0x4BE, 0xCBE, 0x4BF, 0xCBF, 0x4C0, 0xCC0, + 0x4C1, 0xCC1, 0x4C2, 0xCC2, 0x4C3, 0xCC3, 0x4C4, 0xCC4, 0x4C5, 0xCC5, 0x4C6, 0xCC6, 0x4C7, 0xCC7, 0x4C8, 0xCC8, + 0x4C9, 0xCC9, 0x4CA, 0xCCA, 0x4CB, 0xCCB, 0x4CC, 0xCCC, 0x4CD, 0xCCD, 0x4CE, 0xCCE, 0x4CF, 0xCCF, 0x4D0, 0xCD0, + 0x4D1, 0xCD1, 0x4D2, 0xCD2, 0x4D3, 0xCD3, 0x4D4, 0xCD4, 0x4D5, 0xCD5, 0x4D6, 0xCD6, 0x4D7, 0xCD7, 0x4D8, 0xCD8, + 0x4D9, 0xCD9, 0x4DA, 0xCDA, 0x4DB, 0xCDB, 0x4DC, 0xCDC, 0x4DD, 0xCDD, 0x4DE, 0xCDE, 0x4DF, 0xCDF, 0x4E0, 0xCE0, + 0x4E1, 0xCE1, 0x4E2, 0xCE2, 0x4E3, 0xCE3, 0x4E4, 0xCE4, 0x4E5, 0xCE5, 0x4E6, 0xCE6, 0x4E7, 0xCE7, 0x4E8, 0xCE8, + 0x4E9, 0xCE9, 0x4EA, 0xCEA, 0x4EB, 0xCEB, 0x4EC, 0xCEC, 0x4ED, 0xCED, 0x4EE, 0xCEE, 0x4EF, 0xCEF, 0x4F0, 0xCF0, + 0x4F1, 0xCF1, 0x4F2, 0xCF2, 0x4F3, 0xCF3, 0x4F4, 0xCF4, 0x4F5, 0xCF5, 0x4F6, 0xCF6, 0x4F7, 0xCF7, 0x4F8, 0xCF8, + 0x4F9, 0xCF9, 0x4FA, 0xCFA, 0x4FB, 0xCFB, 0x4FC, 0xCFC, 0x4FD, 0xCFD, 0x4FE, 0xCFE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + /* Night */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 3072, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x001, 0x814, 0x41C, 0x022, 0xC26, 0xC2A, 0x82E, 0xC31, 0x035, 0xC37, 0x83A, 0x43D, 0xC3F, 0x042, 0x444, 0x846, + 0x848, 0x84A, 0x84C, 0x84E, 0x450, 0x052, 0xC53, 0x855, 0x457, 0x059, 0x85A, 0x05C, 0x85D, 0x05F, 0x860, 0x062, + 0x863, 0x065, 0x866, 0xC67, 0x069, 0x46A, 0x86B, 0xC6C, 0x06E, 0x46F, 0x870, 0xC71, 0x073, 0x474, 0x875, 0xC76, + 0x078, 0x479, 0x47A, 0x47B, 0x47C, 0x47D, 0x47E, 0x47F, 0x480, 0x481, 0x482, 0x483, 0x484, 0x485, 0x486, 0x487, + 0x488, 0x489, 0x48A, 0x48B, 0x48C, 0x48D, 0x48E, 0x48F, 0x490, 0x491, 0x492, 0x493, 0x494, 0x495, 0x496, 0x497, + 0x098, 0xC98, 0x899, 0x49A, 0x09B, 0xC9B, 0x89C, 0x49D, 0x09E, 0xC9E, 0x89F, 0x4A0, 0x0A1, 0xCA1, 0x8A2, 0x4A3, + 0x0A4, 0xCA4, 0x8A5, 0x4A6, 0x0A7, 0xCA7, 0x8A8, 0x4A9, 0x0AA, 0xCAA, 0x8AB, 0x4AC, 0x0AD, 0xCAD, 0x8AE, 0x4AF, + 0x0B0, 0xCB0, 0x8B1, 0x4B2, 0x0B3, 0xCB3, 0x8B4, 0x4B5, 0x0B6, 0xCB6, 0x8B7, 0x4B8, 0x0B9, 0xCB9, 0x8BA, 0x4BB, + 0x0BC, 0xCBC, 0x8BD, 0x4BE, 0x0BF, 0xCBF, 0x8C0, 0x4C1, 0x0C2, 0xCC2, 0x8C3, 0x4C4, 0x0C5, 0xCC5, 0x8C6, 0x4C7, + 0x0C8, 0xCC8, 0x8C9, 0x4CA, 0x0CB, 0x8CB, 0x0CC, 0x8CC, 0x0CD, 0x8CD, 0x0CE, 0x8CE, 0x0CF, 0x8CF, 0x0D0, 0x8D0, + 0x0D1, 0x8D1, 0x0D2, 0x8D2, 0x0D3, 0x8D3, 0x0D4, 0x8D4, 0x0D5, 0x8D5, 0x0D6, 0x8D6, 0x0D7, 0x8D7, 0x0D8, 0x8D8, + 0x0D9, 0x8D9, 0x0DA, 0x8DA, 0x0DB, 0x8DB, 0x0DC, 0x8DC, 0x0DD, 0x8DD, 0x0DE, 0x8DE, 0x0DF, 0x8DF, 0x0E0, 0x8E0, + 0x0E1, 0x8E1, 0x0E2, 0x8E2, 0x0E3, 0x8E3, 0x0E4, 0x8E4, 0x0E5, 0x8E5, 0x0E6, 0x8E6, 0x0E7, 0x8E7, 0x0E8, 0x8E8, + 0x0E9, 0x8E9, 0x0EA, 0x8EA, 0x0EB, 0x8EB, 0x0EC, 0x8EC, 0x0ED, 0x8ED, 0x0EE, 0x8EE, 0x0EF, 0x8EF, 0x0F0, 0x8F0, + 0x0F1, 0x8F1, 0x0F2, 0x8F2, 0x0F3, 0x8F3, 0x0F4, 0x8F4, 0x0F5, 0x8F5, 0x0F6, 0x8F6, 0x0F7, 0x8F7, 0x0F8, 0x8F8, + 0x0F9, 0x8F9, 0x0FA, 0x8FA, 0x0FB, 0x8FB, 0x0FC, 0x8FC, 0x0FD, 0x8FD, 0x0FE, 0x8FE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + }, + // }; + }, + + { + // static ADAPTIVE_ISP_IR_CUT_PARAM_T ir_cut_param = { + /* nAutoSwitchEnable */ + 1, + /* tIrCutParam */ + { + /* Day2Night */ + { + /* nExposureTime */ + 30000, + /* nGain */ + 512, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 2, + /* nIrCutMode TBD? */ + 1, + }, + }, + /* Night2Day */ + { + /* nExposureTime */ + 20000, + /* nGain */ + 256, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 6, + /* nIrCutMode TBD? */ + 0, + }, + }, + }, + // }; + }, + + { + /* POST SATURATION Parameters */ + + // static ADAPTIVE_ISP_POST_SATURATION_PARAM_T saturation_param = { + /* nAdaptiveEnable */ + 1, + /* post saturation param */ + { + /* 0 */ + {100}, + /* 1 */ + {100}, + /* 2 */ + {100}, + /* 3 */ + {100}, + /* 4 */ + {100}, + }, + // }; + }, + + { + /* Color Black White Mode Parameters */ + + // static ADAPTIVE_ISP_COLOR_GREY_SWI2CH_PARAM_T color_grey_switch_param = { + /* nAutoSwitchEnable */ + 0, // use csm mode + /* tColorGreySwitchParam */ + { + /* Color2BW */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 3072, + /* tColorGreyCsmCtlParam*/ + {0}, + }, + /* BW2Color */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 1536, + /* tColorGreyCsmCtlParam*/ + {255}, + }, + }, + // }; + }, + + { + /* ADA Parameters */ + + // static ADAPTIVE_ISP_ADA_PARAM_T ada_param = { + /* nAdaptiveEnable */ + 1, // 1: enable, 0: disable + /* tAdaParam */ + { + /* 0 */ + { + /* nAeYEverage */ + 60, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 255, + }, + }, + /* 1 */ + { + /* nAeYEverage */ + 50, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 200, + }, + }, + /* 2 */ + { + /* nAeYEverage */ + 40, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 128, + }, + }, + /* 3 */ + { + /* nAeYEverage */ + 30, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 100, + }, + }, + /* 4 */ + { + /* nAeYEverage */ + 20, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 90, + }, + }, + }, + // }; + }, +}; + +#endif diff --git a/package/mediactl_lib/src/adaptive/sensor_params/imx385/adaptive_imx385_r2k.h b/package/mediactl_lib/src/adaptive/sensor_params/imx385/adaptive_imx385_r2k.h new file mode 100644 index 0000000..d3f1156 --- /dev/null +++ b/package/mediactl_lib/src/adaptive/sensor_params/imx385/adaptive_imx385_r2k.h @@ -0,0 +1,1000 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __ADAPTIVE_PARAMS_SETTING_IMX385_R2K_H__ +#define __ADAPTIVE_PARAMS_SETTING_IMX385_R2K_H__ + +#include "../canaan_isp_struct.h" + +static ADAPTIVE_ISP_PIPELINE_PARAM_T adap_imx385_r2k = + +{ + /* fps */ + 29.97, + { + /* AE Parameters */ + + // static ADAPTIVE_ISP_AE_PARAM_T ae_param = { + /* nAdaptiveEnable */ + 1, + /* nAntiFlickerSelect */ + 0, //0: disable 1: 50Hz 2: 60Hz + /* tAeParam */ + { + /* 0 */ + { + /* nExposureTime */ + 168, // 10000lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 100, + /* nAeYTargetRange */ + 14, + }, + }, + /* 1 */ + { + /* nExposureTime */ + 2630, // 2500lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 100, + /* nAeYTargetRange */ + 14, + }, + }, + /* 2 */ + { + /* nExposureTime */ + 12108, // 400lux + /* nExposureGain */ + 512, + /* ae ctl */ + { + /* nAeYTarget */ + 90, + /* AE_YTarget_Range */ + 13, + }, + }, + /* 3 */ + { + /* nExposureTime */ + 33333, // 100lux + /* nExposureGain */ + 1024, + { + /* nAeYTarget */ + 80, + /* AE_YTarget_Range */ + 11, + }, + }, + /* 4 */ + { + /* nExposureTime */ + 33333, + /* nExposureGain */ + 4095, + { + /* nAeYTarget */ + 72, + /* AE_YTarget_Range */ + 10, + }, + }, + }, + // }; + }, + + /* AE gain */ + + { + {256, 768, 1024, 2048, 2304}, + }, + + { + /* BLC Parameters */ + + // static ADAPTIVE_ISP_BLC_PARAM_T blc_param = { + /* nAdaptiveEnable */ + 1, + /* blc param */ + { + /* 0 */ + {240}, + /* 1 */ + {240}, + /* 2 */ + {240}, + /* 3 */ + {240}, + /* 4 */ + {240}, + }, + // }; + }, + + { + /* LSC Parameters */ + + // static ADAPTIVE_ISP_LSC_PARAM_T lsc_param = { + /* nAdaptiveEnable */ + 1, + /* lsc param */ + { + /* 0 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 1 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 2 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 3 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + /* 4 */ + { + /* nLscRedRatio */ + 10, + /* nLscGreenRatio */ + 6, + /* nLscBlueRatio */ + 6, + }, + }, + // }; + }, + + { + /* SHARPNESS Parameters */ + + // static ADAPTIVE_ISP_SHARPNESS_PARAM_T sharpness_param = { + /* nAdaptiveEnable */ + 1, + /* sharpness param */ + { + /* 0 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 1 */ + { + /* nSharpnessCore */ + 4, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 64, + }, + /* 2 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 56, + }, + /* 3 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 48, + }, + /* 4 */ + { + /* nSharpnessCore */ + 8, + /* nSharpnessThres[2]; [0]: thres1 [1]: thres2 */ + {3840, 4095}, + /* nSharpnessGain */ + 40, + }, + }, + // }; + }, + + { + /* LTM Parameters */ + + // static ADAPTIVE_ISP_LTM_PARAM_T ltm_param = { + /* nAdaptiveEnable */ + 1, + { + /* 0 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 1 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 2 */ + { + /* nLtmGain */ + 128, + /* nLtmThres */ + 128, + }, + /* 3 */ + { + /* nLtmGain */ + 100, + /* nLtmThres */ + 128, + }, + /* 4 */ + { + /* nLtmGain */ + 80, + /* nLtmThres */ + 128, + }, + }, + // }; + }, + + { + /* 2D NR Parameters */ + + // static ADAPTIVE_ISP_2D_DENOISE_PARAM_T nr2d_param = { + /* nAdaptiveEnable */ + 1, + /* 2dnr */ + { + /* 0 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensity */ + 64, + /* n2dChromaIntensity */ + 1, + }, + /* 1 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 1, + }, + /* 2 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 160, + }, + /* 3 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 255, + }, + /* 4 */ + { + /* nRawDomainIntensity */ + 16, + /* n2dAdjacentPixIntensity */ + 511, + /* n2dEdgeIntensity */ + 48, + /* n2dLumaIntensit */ + 64, + /* n2dChromaIntensity */ + 255, + }, + }, + // }; + }, + + { + /* 3D NR Parameters */ + + // static ADAPTIVE_ISP_3D_DENOISE_PARAM_T nr3d_param = { + /* nAdaptiveEnable */ + 1, + /* 3dnr */ + { + /* 0 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 1, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 1 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 2 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 3 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + + /* 4 */ + { + /* nPre3dLumaThres */ + 64, + /* nPre3dLumaIntensity */ + 64, + /* nPre3dChromaIntensity */ + 64, + /* nMain3dMiddleFilterThres */ + 128, + /* nMain3dPrevFrameMidFilter */ + 8, + /* nMain3dCurFrameMidFilterThres */ + 128, + /* nMain3dLowPassFilterVal */ + 60, + /* nMain3dLumaThres */ + 64, + /* nMain3dMinimumVal */ + 0, + /* nMain3dLumaIntensity */ + 128, + /* nMain3dChromaIntensity */ + 16, + /* nPost3dEdgeThreshold */ + 64, + /* nPost3dLumaIntensity */ + 64, + /* nPost3dChromaIntensity */ + 32, + }, + }, + // }; + }, + + { + /* WDR Parameters */ + + // static ADAPTIVE_ISP_WDR_PARAM_T wdr_param = { + /* nAdaptiveEnable */ + 0, + /* wdr param */ + { + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 0 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 2 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 3 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + /* 4 */ + { + /* nLghtTh[2] */ + {384, 32}, + /* nFsTh */ + 192, + /* nFsK */ + {0, 0}, + }, + }, + // }; + }, + + { + /* CCM Parameters */ + + // static ADAPTIVE_ISP_CCM_PARAM_T ccm_param = { + /* nAdaptiveEnable */ + 1, + /* tCcmParam */ + { + /* A */ + { + /* nRGain */ + 162, + /* nBGain */ + 449, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {311, 49, 6}, + {62, 343, 26}, + {16, 142, 414}, + }, + }, + }, + /* U30 */ + { + /* nRGain */ + 156, + /* nBGain */ + 458, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {299, 39, 5}, + {56, 336, 24}, + {13, 126, 395}, + }, + }, + }, + /* U35 */ + { + /* nRGain */ + 176, + /* nBGain */ + 402, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {287, 28, 3}, + {50, 328, 22}, + {9, 111, 376}, + }, + }, + }, + /* TL84 */ + { + /* nRGain */ + 194, + /* nBGain */ + 360, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {259, 2, 1}, + {37, 310, 17}, + {1, 75, 332}, + }, + }, + }, + /* D50 */ + { + /* nRGain */ + 234, + /* nBGain */ + 299, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {277, 19, 3}, + {45, 322, 20}, + {6, 98, 360}, + }, + }, + }, + /* D65 */ + { + /* nRGain */ + 257, + /* nBGain */ + 269, + /* tCcmCtlParam */ + { + /* nCtCcm[3][3] */ + { + {259, 2, 1}, + {37, 310, 17}, + {1, 75, 332}, + }, + }, + }, + }, + // }; + }, + + { + /* AWB */ + + // static ADAPTIVE_ISP_AWB_PARAM_T awb_param = { + /* nAdaptiveEnable */ + 1, + /* awb param */ + { + /* 0 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + /* 1 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {162, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 449}, + }, + /* 2 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {162, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 449}, + }, + /* 3 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + /* 4 */ + { + /* nRGain[2]; [0]: Min [1]: Max */ + {194, 257}, + /* nBGain[2]; [0]: Min [1]: Max */ + {269, 360}, + }, + }, + // }; + }, + + { + + /* GAMMA Parameters */ + + // static ADAPTIVE_ISP_GAMMA_PARAM_T gamma_param = { + /* nAdaptiveEnable */ + 1, // if 1 affect ae stablization + /* tGammaParam */ + { + /* Day */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 512, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x000, 0xC05, 0x80B, 0x411, 0xC16, 0x01C, 0x421, 0x426, 0x02B, 0x82F, 0xC33, 0xC37, 0x83B, 0x03F, 0x442, 0x445, + 0x048, 0xC4A, 0x44D, 0xC4F, 0x052, 0x454, 0x856, 0x858, 0x85A, 0x85C, 0x85E, 0x860, 0x862, 0x864, 0x466, 0x068, + 0xC69, 0x86B, 0x46D, 0x06F, 0xC70, 0x872, 0x074, 0x875, 0x077, 0x878, 0x07A, 0x87B, 0x07D, 0x87E, 0xC7F, 0x081, + 0x482, 0x883, 0xC84, 0x086, 0x487, 0x888, 0xC89, 0x08B, 0x48C, 0x88D, 0x88E, 0x88F, 0x890, 0x891, 0x892, 0x893, + 0x894, 0x895, 0x896, 0x897, 0x898, 0x899, 0x89A, 0x89B, 0x89C, 0x89D, 0x89E, 0x49F, 0x0A0, 0xCA0, 0x8A1, 0x4A2, + 0x0A3, 0xCA3, 0x8A4, 0x4A5, 0x0A6, 0xCA6, 0x8A7, 0x4A8, 0x0A9, 0xCA9, 0x8AA, 0x4AB, 0x0AC, 0xCAC, 0x8AD, 0x4AE, + 0x0AF, 0xCAF, 0x8B0, 0x4B1, 0x0B2, 0xCB2, 0x8B3, 0x4B4, 0x0B5, 0xCB5, 0x4B6, 0xCB6, 0x4B7, 0xCB7, 0x4B8, 0xCB8, + 0x4B9, 0xCB9, 0x4BA, 0xCBA, 0x4BB, 0xCBB, 0x4BC, 0xCBC, 0x4BD, 0xCBD, 0x4BE, 0xCBE, 0x4BF, 0xCBF, 0x4C0, 0xCC0, + 0x4C1, 0xCC1, 0x4C2, 0xCC2, 0x4C3, 0xCC3, 0x4C4, 0xCC4, 0x4C5, 0xCC5, 0x4C6, 0xCC6, 0x4C7, 0xCC7, 0x4C8, 0xCC8, + 0x4C9, 0xCC9, 0x4CA, 0xCCA, 0x4CB, 0xCCB, 0x4CC, 0xCCC, 0x4CD, 0xCCD, 0x4CE, 0xCCE, 0x4CF, 0xCCF, 0x4D0, 0xCD0, + 0x4D1, 0xCD1, 0x4D2, 0xCD2, 0x4D3, 0xCD3, 0x4D4, 0xCD4, 0x4D5, 0xCD5, 0x4D6, 0xCD6, 0x4D7, 0xCD7, 0x4D8, 0xCD8, + 0x4D9, 0xCD9, 0x4DA, 0xCDA, 0x4DB, 0xCDB, 0x4DC, 0xCDC, 0x4DD, 0xCDD, 0x4DE, 0xCDE, 0x4DF, 0xCDF, 0x4E0, 0xCE0, + 0x4E1, 0xCE1, 0x4E2, 0xCE2, 0x4E3, 0xCE3, 0x4E4, 0xCE4, 0x4E5, 0xCE5, 0x4E6, 0xCE6, 0x4E7, 0xCE7, 0x4E8, 0xCE8, + 0x4E9, 0xCE9, 0x4EA, 0xCEA, 0x4EB, 0xCEB, 0x4EC, 0xCEC, 0x4ED, 0xCED, 0x4EE, 0xCEE, 0x4EF, 0xCEF, 0x4F0, 0xCF0, + 0x4F1, 0xCF1, 0x4F2, 0xCF2, 0x4F3, 0xCF3, 0x4F4, 0xCF4, 0x4F5, 0xCF5, 0x4F6, 0xCF6, 0x4F7, 0xCF7, 0x4F8, 0xCF8, + 0x4F9, 0xCF9, 0x4FA, 0xCFA, 0x4FB, 0xCFB, 0x4FC, 0xCFC, 0x4FD, 0xCFD, 0x4FE, 0xCFE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + /* Night */ + { + /* nEtGamma */ + 33333, + /* nGainGamma */ + 3072, + /* tGammaCtlParam */ + { + /* nGammaCurve */ + { + 0x001, 0x814, 0x41C, 0x022, 0xC26, 0xC2A, 0x82E, 0xC31, 0x035, 0xC37, 0x83A, 0x43D, 0xC3F, 0x042, 0x444, 0x846, + 0x848, 0x84A, 0x84C, 0x84E, 0x450, 0x052, 0xC53, 0x855, 0x457, 0x059, 0x85A, 0x05C, 0x85D, 0x05F, 0x860, 0x062, + 0x863, 0x065, 0x866, 0xC67, 0x069, 0x46A, 0x86B, 0xC6C, 0x06E, 0x46F, 0x870, 0xC71, 0x073, 0x474, 0x875, 0xC76, + 0x078, 0x479, 0x47A, 0x47B, 0x47C, 0x47D, 0x47E, 0x47F, 0x480, 0x481, 0x482, 0x483, 0x484, 0x485, 0x486, 0x487, + 0x488, 0x489, 0x48A, 0x48B, 0x48C, 0x48D, 0x48E, 0x48F, 0x490, 0x491, 0x492, 0x493, 0x494, 0x495, 0x496, 0x497, + 0x098, 0xC98, 0x899, 0x49A, 0x09B, 0xC9B, 0x89C, 0x49D, 0x09E, 0xC9E, 0x89F, 0x4A0, 0x0A1, 0xCA1, 0x8A2, 0x4A3, + 0x0A4, 0xCA4, 0x8A5, 0x4A6, 0x0A7, 0xCA7, 0x8A8, 0x4A9, 0x0AA, 0xCAA, 0x8AB, 0x4AC, 0x0AD, 0xCAD, 0x8AE, 0x4AF, + 0x0B0, 0xCB0, 0x8B1, 0x4B2, 0x0B3, 0xCB3, 0x8B4, 0x4B5, 0x0B6, 0xCB6, 0x8B7, 0x4B8, 0x0B9, 0xCB9, 0x8BA, 0x4BB, + 0x0BC, 0xCBC, 0x8BD, 0x4BE, 0x0BF, 0xCBF, 0x8C0, 0x4C1, 0x0C2, 0xCC2, 0x8C3, 0x4C4, 0x0C5, 0xCC5, 0x8C6, 0x4C7, + 0x0C8, 0xCC8, 0x8C9, 0x4CA, 0x0CB, 0x8CB, 0x0CC, 0x8CC, 0x0CD, 0x8CD, 0x0CE, 0x8CE, 0x0CF, 0x8CF, 0x0D0, 0x8D0, + 0x0D1, 0x8D1, 0x0D2, 0x8D2, 0x0D3, 0x8D3, 0x0D4, 0x8D4, 0x0D5, 0x8D5, 0x0D6, 0x8D6, 0x0D7, 0x8D7, 0x0D8, 0x8D8, + 0x0D9, 0x8D9, 0x0DA, 0x8DA, 0x0DB, 0x8DB, 0x0DC, 0x8DC, 0x0DD, 0x8DD, 0x0DE, 0x8DE, 0x0DF, 0x8DF, 0x0E0, 0x8E0, + 0x0E1, 0x8E1, 0x0E2, 0x8E2, 0x0E3, 0x8E3, 0x0E4, 0x8E4, 0x0E5, 0x8E5, 0x0E6, 0x8E6, 0x0E7, 0x8E7, 0x0E8, 0x8E8, + 0x0E9, 0x8E9, 0x0EA, 0x8EA, 0x0EB, 0x8EB, 0x0EC, 0x8EC, 0x0ED, 0x8ED, 0x0EE, 0x8EE, 0x0EF, 0x8EF, 0x0F0, 0x8F0, + 0x0F1, 0x8F1, 0x0F2, 0x8F2, 0x0F3, 0x8F3, 0x0F4, 0x8F4, 0x0F5, 0x8F5, 0x0F6, 0x8F6, 0x0F7, 0x8F7, 0x0F8, 0x8F8, + 0x0F9, 0x8F9, 0x0FA, 0x8FA, 0x0FB, 0x8FB, 0x0FC, 0x8FC, 0x0FD, 0x8FD, 0x0FE, 0x8FE, 0x0FF, 0x4FF, 0x8FF, 0xCFF, + }, + }, + }, + }, + // }; + }, + + { + // static ADAPTIVE_ISP_IR_CUT_PARAM_T ir_cut_param = { + /* nAutoSwitchEnable */ + 1, + /* tIrCutParam */ + { + /* Day2Night */ + { + /* nExposureTime */ + 30000, + /* nGain */ + 512, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 2, + /* nIrCutMode TBD? */ + 1, + }, + }, + /* Night2Day */ + { + /* nExposureTime */ + 20000, + /* nGain */ + 256, + /* tIrCutCtlParam */ + { + /* nHoldTime */ + 6, + /* nIrCutMode TBD? */ + 0, + }, + }, + }, + // }; + }, + + { + /* POST SATURATION Parameters */ + + // static ADAPTIVE_ISP_POST_SATURATION_PARAM_T saturation_param = { + /* nAdaptiveEnable */ + 1, + /* post saturation param */ + { + /* 0 */ + {100}, + /* 1 */ + {100}, + /* 2 */ + {100}, + /* 3 */ + {100}, + /* 4 */ + {100}, + }, + // }; + }, + + { + /* Color Black White Mode Parameters */ + + // static ADAPTIVE_ISP_COLOR_GREY_SWI2CH_PARAM_T color_grey_switch_param = { + /* nAutoSwitchEnable */ + 0, // use csm mode + /* tColorGreySwitchParam */ + { + /* Color2BW */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 3072, + /* tColorGreyCsmCtlParam*/ + {0}, + }, + /* BW2Color */ + { + /* nExposureTime */ + 33333, + /* nGain */ + 1536, + /* tColorGreyCsmCtlParam*/ + {255}, + }, + }, + // }; + }, + + { + /* ADA Parameters */ + + // static ADAPTIVE_ISP_ADA_PARAM_T ada_param = { + /* nAdaptiveEnable */ + 1, // 1: enable, 0: disable + /* tAdaParam */ + { + /* 0 */ + { + /* nAeYEverage */ + 60, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 255, + }, + }, + /* 1 */ + { + /* nAeYEverage */ + 50, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 200, + }, + }, + /* 2 */ + { + /* nAeYEverage */ + 40, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 128, + }, + }, + /* 3 */ + { + /* nAeYEverage */ + 30, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 100, + }, + }, + /* 4 */ + { + /* nAeYEverage */ + 20, + /* tAdaCtlParam */ + { + /* nAdaHistMax */ + 128, + /* nAdaTtlMax */ + 90, + }, + }, + }, + // }; + }, +}; + +#endif diff --git a/package/mediactl_lib/src/config/gc2053.conf b/package/mediactl_lib/src/config/gc2053.conf new file mode 100644 index 0000000..ad24d59 --- /dev/null +++ b/package/mediactl_lib/src/config/gc2053.conf @@ -0,0 +1,531 @@ +{ + "isp_general":{ + "isp_out_sel":0, + "dvp_ch_mode":1, + "hist_3a_out_en":0, + "main_out":{ + "out_img_format":1, + "out_yuv_in_format":0, + "out_yuv422_pxl_order":0, + "out_pxl_width":0, + "out_frame_buf_size":2048 + }, + "out0":{ + "ds0_out_img_format":1, + "ds0_out_yuv_in_format":0, + "ds0_out_yuv422_pxl_order":0, + "ds0_out_pxl_width":0, + "ds0_frame_buf_size":2048 + }, + "out1":{ + "ds1_out_img_format":1, + "ds1_out_yuv_in_format":0, + "ds1_out_yuv422_pxl_order":0, + "ds1_out_pxl_width":0, + "ds1_frame_buf_size":2048 + }, + "out2":{ + "ds2_out_img_format":0, + "ds2_out_yuv_in_format":0, + "ds2_out_yuv422_pxl_order":0, + "ds2_out_pxl_width":0, + "ds2_frame_buf_size":2048 + }, + "wdr":{ + "wdr_mode":0, + "wdr_long_ch_mode":0, + "wdr_long_l2_buf_en":0, + "wdr_short_s1_buf_en":0, + "wdr_dynamic_switch_en":0, + "wdr_long_l2_buf_depth":0, + "wdr_long_img_format":0, + "wdr_long_yuv_in_format":0, + "wdr_long_img_out_format":0, + "wdr_long_yuv422_pxl_order":0, + "wdr_long_pixel_width":2, + "wdr_buf_base":0, + "wdr_line_stride":0, + "wdr_frame_buf_size":0 + }, + "nr3d":{ + "nr3d_en":0, + "nr3d_fbcd_en":0, + "nr3d_mv_out_en":0, + "nr3d_y_img_format":0, + "nr3d_y_yuv_in_format":0, + "nr3d_y_img_out_format":0, + "nr3d_y_yuv422_pxl_order":0, + "nr3d_y_pixel_width":2, + "nr3d_uv_img_format":0, + "nr3d_uv_yuv_in_format":0, + "nr3d_uv_mig_out_format":0, + "nr3d_uv_yuv422_pxl_order":0, + "nr3d_uv_pixel_width":2, + "nr3d_frame_buf_size":0 + }, + "ldc":{ + "ldc_line_stride":2048, + "ldc_frame_buf_size":2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol":0, + "vsync_pol":0, + "hsync_input_timing":2, + "vsync_input_timing":1, + "flip_ctl" :0, + "video_fmt_sl":0, + "itc_ttl_h" :2200, + "itc_ttl_v" :1125, + "itc_stt_hr" :0, + "itc_stt_vr" :1 + }, + "tpg": { + "tpg_en":0, + "bayer_mode_sel":3, + "motion_mode_sel":0, + "tpg_sel":9, + "wdr_l_mul_data":0, + "wdr_m_mul_data":0, + "wdr_s_mul_data":0 + }, + "blc":{ + "blc_en" :1, + "blc_offset" :240, + "blc_ratio" :272 + }, + "lsc":{ + "lsc_en" :1, + "lsc_h_center" :900, + "lsc_v_center" :580, + "lsc_r_ratio" :8, + "lsc_g_ratio":6, + "lsc_b_ratio" :6, + "lsc_ir_ratio" :6 + }, + "ae":{ + "ae_as_en" :0, + "ae_ag_en" :0, + "ae_airis_en" :0, + "ae_enter_ls_sel" :0, + "ae_exit_ls_sel" :0, + "ae_win_mode_sel" :0, + "ae_back_light_mode_sel" :2, + "ae_day_change_en" :0, + "ae_day_change_sel" :0, + "ae_win_stth" :0, + "ae_win_sttv" :0, + "ae_win_endh" :1919, + "ae_win_endv" :1079, + "ae_yobj" :80, + "ae_av_rg" :11, + "ae_l_ex_time" :1100, + "ae_m_ex_time" :32, + "ae_s_ex_time" :32, + "ae_agc" :256, + "ae_ad_shuttle_freq" :0, + "ae_ad_gain_freq" :0, + "ae_adjust_step_max":36, + "ae_ex_value_max" :1124, + "ae_ex_value_mid" :256, + "ae_ex_value_min" :1, + "ae_gain_value_max" :4095, + "ae_gain_value_mid" :512, + "ae_gain_value_min" :256, + "ae_dn_switch_ad_step_max" :512, + "ae_dn_switch_wait_time" :255, + "ape_max_diff" :12, + "ape_drv_signal_max" :3840, + "ape_coeff_distance" :0, + "ape_coeff_speed" :0, + "ape_coeff_acceleration" :0, + "ape_drv_manual_value" :4095, + "ape_damp_manual_value" :2048 + }, + "awb":{ + "awb_d65_en" :0, + "awb_ccm_en" :0, + "awb_en" :0, + "awb_mode_sel" :0, + "awb_hist_mode_sel" :0, + "awb_veri_en" :0, + "awb_fb_en" :0, + "awb_value_save_en" :0, + "awb_ccm_adp_adjust_en" :0, + "awb_stab_en" :1, + "awb_d65_red_gain" :256, + "awb_d65_blue_gain" :256, + "ccm_rr" :256, + "ccm_rg" :0, + "ccm_rb" :0, + "ccm_gr" :0, + "ccm_gg" :256, + "ccm_gb" :0, + "ccm_br" :0, + "ccm_bg" :0, + "ccm_bb" :256, + "ccm_correct_coff" :256, + "awb_win_stth" :0, + "awb_win_sttv" :0, + "awb_win_endh" :1919, + "awb_win_endv" :1079, + "awb_correct_diff_th" :8, + "awb_color_changeres_time" :8, + "awb_historgram_th" :4, + "awb_red_gain_adjust" :256, + "awb_green_gain_adjust" :256, + "awb_blue_gain_adjust" :256, + "awb_red_max_value" :240, + "awb_blue_max_value" :379, + "awb_red_min_value" :176, + "awb_blue_min_value" :281, + "awb_red_obj_value" :256, + "awb_blue_obj_value" :256 + }, + "wdr":{ + "wdr_fusion_en" :0, + "wdr_frame_sel" :0, + "wdr_adp_adjust_en" :0, + "wdr_stab_en" :0, + "wdr_en" :0, + "wdr_ghost_remove_en" :0, + "wdr_3frame_out_mode" :0, + "wdr_mode_sel" :0, + "wdr_2frame_ex_ratio" :1, + "wdr_3frame_ex_ratio" :1, + "wdr_stat_img_sel" :0, + "wdr_ltm_data_sel" :1, + "wdr_tz_data_sel" :1, + "wdr_remove_purple_en" :0, + "wdr_over_ex_ratio_th1" :384, + "wdr_over_ex_ratio_th2" :32, + "wdr_fusion_ratio_th" :192, + "wdr_fusion_value1" :64, + "wdr_fusion_value2" :16 + }, + "csc":{ + "rgb2yuv_00":153, + "rgb2yuv_01":256, + "rgb2yuv_02":86, + "rgb2yuv_10":301, + "rgb2yuv_11":214, + "rgb2yuv_12":170, + "rgb2yuv_20":58, + "rgb2yuv_21":42, + "rgb2yuv_22":256 + }, + "ada":{ + "gm_rgb_en" :1, + "gm_yuv_en" :0, + "ada_en" :1, + "ada_sbz_en" :0, + "ada_ccr_en" :0, + "ada_adp_en" :0, + "ada_adp_ccr_en" :0, + "ada_stat_mode_sel" :0, + "ada_enh_mode_sel" :0, + "ada_hist_max" :128, + "ada_ttl_max" :255, + "ada_win_stth" :0, + "ada_win_sttv" :0, + "ada_win_endh" :1919, + "ada_win_endv" :1079 + }, + "rgb-ir":{ + "raw_fmt" :0, + "rgbir_rct_en" :0, + "dfc_en" :0, + "rgbir_fs_en" :0, + "rgbir_ot_sl" :0, + "rgbir_fs_max" :256, + "dfc_krb" :0, + "dfc_ky" :0, + "dfc_th" :256, + "dfc_th_1" :256 + }, + "2dnr":{ + "dpeak_en" :1, + "nr2d_raw_en" :1, + "nr2d_eg_en" :1, + "nr2d_jl_en" :1, + "nr2d_av_en" :1, + "nr2d_c_en" :0, + "dpeak_adp_en" :0, + "nr2d_raw_adp_en":0, + "nr2d_y_adp_en" :0, + "nr2d_c_adp_en" :0, + "nr2d_raw_kl" :12, + "nr2d_jl_th" :128, + "nr2d_eg_k" :24, + "nr2d_y_k" :16, + "nr2d_c_k" :1 + }, + "3dnr":{ + "nr3d_en" :1, + "nr3dp_y_en" :1, + "nr3dp_c_en" :0, + "nr3dm_y_en" :1, + "nr3dm_c_en" :0, + "nr3db_y_en" :1, + "nr3db_c_en" :0, + "nr3dm_nr2d_y_en" :1, + "nr3dm_nr2d_c_en" :0, + "core_3dnr_wb_en" :1, + "core_3dnr_wb_sel" :1, + "core_3dnr_adp_luma_en" :0, + "core_3dnr_adp_chroma_en" :0, + "nr3dp_thy" :64, + "nr3dp_thyp" :64, + "nr3dp_thcp" :64, + "nr3dm_mid_th" :128, + "nr3dm_mtp_th" :8, + "nr3dm_mtc_th" :128, + "nr3dm_ym_k" :60, + "nr3dm_thy" :64, + "nr3dm_min" :0, + "nr3dm_thw0" :128, + "core_3dnr_chroma_intensity" :16, + "nr3db_nr2d_eg_th" :64, + "nr3db_thyp" :64, + "nr3db_thcp" :32 + }, + "enh":{ + "ltm":{ + "enh_ltm_en" :1, + "enh_adp_ltm_en" :0, + "ltm_gain" :128, + "ltm_mm_th" :128 + }, + "sharp":{ + "enh_sharp_en" :1, + "enh_adp_sharp_en" :0, + "shp_core" :8, + "shp_th1" :3840, + "shp_th2" :4095, + "shp_gain" :64 + }, + "cc":{ + "enh_cc_en" :0, + "enh_adp_cc_en" :0 + } + }, + "post_ctl":{ + "otc_ctl":{ + "otc_en" :0, + "otc_yc_sl" :0, + "otc_uv_sl" :1, + "otc_hs_plt_sl" :0, + "otc_vs_plt_sl" :0, + "otc_stt_vr" :0, + "otc_stt_hr" :0 + }, + "ctrst":{ + "ctrst_en" :1, + "ctrst_gain":128 + }, + "luma":{ + "luma_en" :1, + "luma_gain":128 + }, + "strt":{ + "strt_en" :1, + "strt_gain":0 + } + }, + "ldc":{ + "ldc_en" :0, + "ldc_rct_en" :0, + "ldc_rq_frq" :128, + "ldc_stt_ln" :540, + "ldc_ch" :960, + "ldc_cv" :540, + "ldc_cr" :684, + "ldc_cz" :684 + }, + "af":{ + "af_stat_en" :1, + "af_stat_mode_sel" :0, + "af_stat_win_h_start":0, + "af_stat_win_v_start":0, + "af_stat_win_h_end" :1919, + "af_stat_win_v_end" :1079 + } + }, + "isp_post":{ + "rgb2yuv":{ + "osd_rgb2yuv_coeff00":306, + "osd_rgb2yuv_coeff01":601, + "osd_rgb2yuv_coeff02":117, + "osd_rgb2yuv_coeff03":0, + "osd_rgb2yuv_coeff10":3920, + "osd_rgb2yuv_coeff11":3749, + "osd_rgb2yuv_coeff12":523, + "osd_rgb2yuv_coeff13":128, + "osd_rgb2yuv_coeff20":523, + "osd_rgb2yuv_coeff21":3658, + "osd_rgb2yuv_coeff22":4011, + "osd_rgb2yuv_coeff23":128 + }, + "yuv2rgb":{ + "out_yuv2rgb_coeff00":1024, + "out_yuv2rgb_coeff01":0, + "out_yuv2rgb_coeff02":1441, + "out_yuv2rgb_coeff03":3916, + "out_yuv2rgb_coeff10":1024, + "out_yuv2rgb_coeff11":3742, + "out_yuv2rgb_coeff12":3362, + "out_yuv2rgb_coeff13":136, + "out_yuv2rgb_coeff20":1024, + "out_yuv2rgb_coeff21":1822, + "out_yuv2rgb_coeff22":0, + "out_yuv2rgb_coeff23":3868 + }, + "ds0":{ + "ds0_out_rgb_mode":0, + "ds0_out_rgb_en":0, + "ds0_out_yuv_mode":0, + "ds0_out_uv_swap":0, + "ds0_osd0":{ + "ds0_osd0_enable":0, + "ds0_osd0_type":0, + "ds0_osd0_alpha_tpye":0, + "ds0_osd0_vst":0, + "ds0_osd0_hst":0, + "ds0_osd0_vend":0, + "ds0_osd0_hend":0, + "ds0_osd0_dma_request_length":0, + "ds0_osd0_dma_map":0, + "ds0_osd0_rgb_rev":0, + "ds0_osd0_global_alpha":0, + "ds0_osd0_swap_64":0, + "ds0_osd0_outstanding_num":0, + "ds0_osd0_bd_limit_en":0 + }, + "ds0_osd1":{ + "ds0_osd1_enable":0, + "ds0_osd1_type":0, + "ds0_osd1_alpha_tpye":0, + "ds0_osd1_vst":0, + "ds0_osd1_hst":0, + "ds0_osd1_vend":0, + "ds0_osd1_hend":0, + "ds0_osd1_dma_request_length":0, + "ds0_osd1_dma_map":0, + "ds0_osd1_rgb_rev":0, + "ds0_osd1_global_alpha":0, + "ds0_osd1_swap_64":0, + "ds0_osd1_outstanding_num":0, + "ds0_osd1_bd_limit_en":0 + }, + "ds0_osd2":{ + "ds0_osd2_enable":0, + "ds0_osd2_type":0, + "ds0_osd2_alpha_tpye":0, + "ds0_osd2_vst":0, + "ds0_osd2_hst":0, + "ds0_osd2_vend":0, + "ds0_osd2_hend":0, + "ds0_osd2_dma_request_length":0, + "ds0_osd2_dma_map":0, + "ds0_osd2_rgb_rev":0, + "ds0_osd2_global_alpha":0, + "ds0_osd2_swap_64":0, + "ds0_osd2_outstanding_num":0, + "ds0_osd2_bd_limit_en":0 + } + }, + "ds1":{ + "ds1_out_rgb_mode":0, + "ds1_out_rgb_en":0, + "ds1_out_yuv_mode":0, + "ds1_out_uv_swap":0, + "ds1_osd0":{ + "ds1_osd0_enable":0, + "ds1_osd0_type":0, + "ds1_osd0_alpha_tpye":0, + "ds1_osd0_vst":0, + "ds1_osd0_hst":0, + "ds1_osd0_vend":0, + "ds1_osd0_hend":0, + "ds1_osd0_dma_request_length":0, + "ds1_osd0_dma_map":0, + "ds1_osd0_rgb_rev":0, + "ds1_osd0_global_alpha":0, + "ds1_osd0_swap_64":0, + "ds1_osd0_outstanding_num":0, + "ds1_osd0_bd_limit_en":0 + }, + "ds1_osd1":{ + "ds1_osd1_enable":0, + "ds1_osd1_type":0, + "ds1_osd1_alpha_tpye":0, + "ds1_osd1_vst":0, + "ds1_osd1_hst":0, + "ds1_osd1_vend":0, + "ds1_osd1_hend":0, + "ds1_osd1_dma_request_length":0, + "ds1_osd1_dma_map":0, + "ds1_osd1_rgb_rev":0, + "ds1_osd1_global_alpha":0, + "ds1_osd1_swap_64":0, + "ds1_osd1_outstanding_num":0, + "ds1_osd1_bd_limit_en":0 + }, + "ds1_osd2":{ + "ds1_osd2_enable":0, + "ds1_osd2_type":0, + "ds1_osd2_alpha_tpye":0, + "ds1_osd2_vst":0, + "ds1_osd2_hst":0, + "ds1_osd2_vend":0, + "ds1_osd2_hend":0, + "ds1_osd2_dma_request_length":0, + "ds1_osd2_dma_map":0, + "ds1_osd2_rgb_rev":0, + "ds1_osd2_global_alpha":0, + "ds1_osd2_swap_64":0, + "ds1_osd2_outstanding_num":0, + "ds1_osd2_bd_limit_en":0 + } + }, + "ds2":{ + "ds2_out_rgb_mode":0, + "ds2_out_rgb_en":1, + "ds2_out_yuv_mode":0, + "ds2_out_uv_swap":0, + "ds2_osd0":{ + "ds2_osd0_enable":0, + "ds2_osd0_type":0, + "ds2_osd0_alpha_tpye":0, + "ds2_osd0_vst":0, + "ds2_osd0_hst":0, + "ds2_osd0_vend":0, + "ds2_osd0_hend":0, + "ds2_osd0_dma_request_length":0, + "ds2_osd0_dma_map":0, + "ds2_osd0_rgb_rev":0, + "ds2_osd0_global_alpha":0, + "ds2_osd0_swap_64":0, + "ds2_osd0_outstanding_num":0, + "ds2_osd0_bd_limit_en":0 + }, + "ds2_osd1":{ + "ds2_osd1_enable":0, + "ds2_osd1_type":0, + "ds2_osd1_alpha_tpye":0, + "ds2_osd1_vst":0, + "ds2_osd1_hst":0, + "ds2_osd1_vend":0, + "ds2_osd1_hend":0, + "ds2_osd1_dma_request_length":0, + "ds2_osd1_dma_map":0, + "ds2_osd1_rgb_rev":0, + "ds2_osd1_global_alpha":0, + "ds2_osd1_swap_64":0, + "ds2_osd1_outstanding_num":0, + "ds2_osd1_bd_limit_en":0 + } + } + } +} diff --git a/package/mediactl_lib/src/config/gc2093.conf b/package/mediactl_lib/src/config/gc2093.conf new file mode 100644 index 0000000..a08a526 --- /dev/null +++ b/package/mediactl_lib/src/config/gc2093.conf @@ -0,0 +1,531 @@ +{ + "isp_general":{ + "isp_out_sel":0, + "dvp_ch_mode":1, + "hist_3a_out_en":0, + "main_out":{ + "out_img_format":1, + "out_yuv_in_format":0, + "out_yuv422_pxl_order":0, + "out_pxl_width":0, + "out_frame_buf_size":2048 + }, + "out0":{ + "ds0_out_img_format":1, + "ds0_out_yuv_in_format":0, + "ds0_out_yuv422_pxl_order":0, + "ds0_out_pxl_width":0, + "ds0_frame_buf_size":2048 + }, + "out1":{ + "ds1_out_img_format":1, + "ds1_out_yuv_in_format":0, + "ds1_out_yuv422_pxl_order":0, + "ds1_out_pxl_width":0, + "ds1_frame_buf_size":2048 + }, + "out2":{ + "ds2_out_img_format":0, + "ds2_out_yuv_in_format":0, + "ds2_out_yuv422_pxl_order":0, + "ds2_out_pxl_width":0, + "ds2_frame_buf_size":2048 + }, + "wdr":{ + "wdr_mode":0, + "wdr_long_ch_mode":0, + "wdr_long_l2_buf_en":0, + "wdr_short_s1_buf_en":0, + "wdr_dynamic_switch_en":0, + "wdr_long_l2_buf_depth":0, + "wdr_long_img_format":0, + "wdr_long_yuv_in_format":0, + "wdr_long_img_out_format":0, + "wdr_long_yuv422_pxl_order":0, + "wdr_long_pixel_width":2, + "wdr_buf_base":0, + "wdr_line_stride":0, + "wdr_frame_buf_size":0 + }, + "nr3d":{ + "nr3d_en":0, + "nr3d_fbcd_en":0, + "nr3d_mv_out_en":0, + "nr3d_y_img_format":0, + "nr3d_y_yuv_in_format":0, + "nr3d_y_img_out_format":0, + "nr3d_y_yuv422_pxl_order":0, + "nr3d_y_pixel_width":2, + "nr3d_uv_img_format":0, + "nr3d_uv_yuv_in_format":0, + "nr3d_uv_mig_out_format":0, + "nr3d_uv_yuv422_pxl_order":0, + "nr3d_uv_pixel_width":2, + "nr3d_frame_buf_size":0 + }, + "ldc":{ + "ldc_line_stride":2048, + "ldc_frame_buf_size":2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol":0, + "vsync_pol":0, + "hsync_input_timing":2, + "vsync_input_timing":1, + "flip_ctl" :0, + "video_fmt_sl":0, + "itc_ttl_h" :2844, + "itc_ttl_v" :1125, + "itc_stt_hr" :0, + "itc_stt_vr" :1 + }, + "tpg": { + "tpg_en":0, + "bayer_mode_sel":3, + "motion_mode_sel":0, + "tpg_sel":9, + "wdr_l_mul_data":0, + "wdr_m_mul_data":0, + "wdr_s_mul_data":0 + }, + "blc":{ + "blc_en" :1, + "blc_offset" :240, + "blc_ratio" :272 + }, + "lsc":{ + "lsc_en" :1, + "lsc_h_center" :900, + "lsc_v_center" :580, + "lsc_r_ratio" :6, + "lsc_g_ratio":6, + "lsc_b_ratio" :4, + "lsc_ir_ratio" :6 + }, + "ae":{ + "ae_as_en" :1, + "ae_ag_en" :1, + "ae_airis_en" :0, + "ae_enter_ls_sel" :0, + "ae_exit_ls_sel" :0, + "ae_win_mode_sel" :0, + "ae_back_light_mode_sel" :2, + "ae_day_change_en" :0, + "ae_day_change_sel" :0, + "ae_win_stth" :0, + "ae_win_sttv" :0, + "ae_win_endh" :1919, + "ae_win_endv" :1079, + "ae_yobj" :100, + "ae_av_rg" :14, + "ae_l_ex_time" :1100, + "ae_m_ex_time" :32, + "ae_s_ex_time" :32, + "ae_agc" :256, + "ae_ad_shuttle_freq" :0, + "ae_ad_gain_freq" :0, + "ae_adjust_step_max":36, + "ae_ex_value_max" :1124, + "ae_ex_value_mid" :256, + "ae_ex_value_min" :1, + "ae_gain_value_max" :4095, + "ae_gain_value_mid" :512, + "ae_gain_value_min" :256, + "ae_dn_switch_ad_step_max" :512, + "ae_dn_switch_wait_time" :255, + "ape_max_diff" :12, + "ape_drv_signal_max" :3840, + "ape_coeff_distance" :0, + "ape_coeff_speed" :0, + "ape_coeff_acceleration" :0, + "ape_drv_manual_value" :4095, + "ape_damp_manual_value" :2048 + }, + "awb":{ + "awb_d65_en" :1, + "awb_ccm_en" :1, + "awb_en" :1, + "awb_mode_sel" :1, + "awb_hist_mode_sel" :0, + "awb_veri_en" :0, + "awb_fb_en" :0, + "awb_value_save_en" :0, + "awb_ccm_adp_adjust_en" :0, + "awb_stab_en" :1, + "awb_d65_red_gain" :487, + "awb_d65_blue_gain" :418, + "ccm_rr" :261, + "ccm_rg" :5, + "ccm_rb" :0, + "ccm_gr" :47, + "ccm_gg" :308, + "ccm_gb" :5, + "ccm_br" :6, + "ccm_bg" :69, + "ccm_bb" :331, + "ccm_correct_coff" :256, + "awb_win_stth" :0, + "awb_win_sttv" :0, + "awb_win_endh" :1919, + "awb_win_endv" :1079, + "awb_correct_diff_th" :8, + "awb_color_changeres_time" :8, + "awb_historgram_th" :4, + "awb_red_gain_adjust" :256, + "awb_green_gain_adjust" :256, + "awb_blue_gain_adjust" :256, + "awb_red_max_value" :258, + "awb_blue_max_value" :450, + "awb_red_min_value" :164, + "awb_blue_min_value" :256, + "awb_red_obj_value" :256, + "awb_blue_obj_value" :256 + }, + "wdr":{ + "wdr_fusion_en" :0, + "wdr_frame_sel" :0, + "wdr_adp_adjust_en" :0, + "wdr_stab_en" :0, + "wdr_en" :0, + "wdr_ghost_remove_en" :0, + "wdr_3frame_out_mode" :0, + "wdr_mode_sel" :0, + "wdr_2frame_ex_ratio" :1, + "wdr_3frame_ex_ratio" :1, + "wdr_stat_img_sel" :0, + "wdr_ltm_data_sel" :1, + "wdr_tz_data_sel" :1, + "wdr_remove_purple_en" :0, + "wdr_over_ex_ratio_th1" :384, + "wdr_over_ex_ratio_th2" :32, + "wdr_fusion_ratio_th" :192, + "wdr_fusion_value1" :64, + "wdr_fusion_value2" :16 + }, + "csc":{ + "rgb2yuv_00":153, + "rgb2yuv_01":256, + "rgb2yuv_02":86, + "rgb2yuv_10":301, + "rgb2yuv_11":214, + "rgb2yuv_12":170, + "rgb2yuv_20":58, + "rgb2yuv_21":42, + "rgb2yuv_22":256 + }, + "ada":{ + "gm_rgb_en" :1, + "gm_yuv_en" :0, + "ada_en" :1, + "ada_sbz_en" :0, + "ada_ccr_en" :0, + "ada_adp_en" :0, + "ada_adp_ccr_en" :0, + "ada_stat_mode_sel" :0, + "ada_enh_mode_sel" :0, + "ada_hist_max" :128, + "ada_ttl_max" :255, + "ada_win_stth" :0, + "ada_win_sttv" :0, + "ada_win_endh" :1919, + "ada_win_endv" :1079 + }, + "rgb-ir":{ + "raw_fmt" :0, + "rgbir_rct_en" :0, + "dfc_en" :0, + "rgbir_fs_en" :0, + "rgbir_ot_sl" :0, + "rgbir_fs_max" :256, + "dfc_krb" :0, + "dfc_ky" :0, + "dfc_th" :256, + "dfc_th_1" :256 + }, + "2dnr":{ + "dpeak_en" :1, + "nr2d_raw_en" :1, + "nr2d_eg_en" :1, + "nr2d_jl_en" :1, + "nr2d_av_en" :1, + "nr2d_c_en" :1, + "dpeak_adp_en" :0, + "nr2d_raw_adp_en":0, + "nr2d_y_adp_en" :0, + "nr2d_c_adp_en" :0, + "nr2d_raw_kl" :16, + "nr2d_jl_th" :128, + "nr2d_eg_k" :24, + "nr2d_y_k" :32, + "nr2d_c_k" :1 + }, + "3dnr":{ + "nr3d_en" :1, + "nr3dp_y_en" :1, + "nr3dp_c_en" :1, + "nr3dm_y_en" :1, + "nr3dm_c_en" :1, + "nr3db_y_en" :1, + "nr3db_c_en" :1, + "nr3dm_nr2d_y_en" :1, + "nr3dm_nr2d_c_en" :1, + "core_3dnr_wb_en" :1, + "core_3dnr_wb_sel" :1, + "core_3dnr_adp_luma_en" :0, + "core_3dnr_adp_chroma_en" :0, + "nr3dp_thy" :255, + "nr3dp_thyp" :255, + "nr3dp_thcp" :32, + "nr3dm_mid_th" :128, + "nr3dm_mtp_th" :8, + "nr3dm_mtc_th" :128, + "nr3dm_ym_k" :30, + "nr3dm_thy" :64, + "nr3dm_min" :0, + "nr3dm_thw0" :128, + "core_3dnr_chroma_intensity" :16, + "nr3db_nr2d_eg_th" :64, + "nr3db_thyp" :64, + "nr3db_thcp" :32 + }, + "enh":{ + "ltm":{ + "enh_ltm_en" :1, + "enh_adp_ltm_en" :0, + "ltm_gain" :128, + "ltm_mm_th" :128 + }, + "sharp":{ + "enh_sharp_en" :1, + "enh_adp_sharp_en" :0, + "shp_core" :8, + "shp_th1" :3840, + "shp_th2" :4095, + "shp_gain" :64 + }, + "cc":{ + "enh_cc_en" :0, + "enh_adp_cc_en" :0 + } + }, + "post_ctl":{ + "otc_ctl":{ + "otc_en" :0, + "otc_yc_sl" :0, + "otc_uv_sl" :1, + "otc_hs_plt_sl" :0, + "otc_vs_plt_sl" :0, + "otc_stt_vr" :0, + "otc_stt_hr" :0 + }, + "ctrst":{ + "ctrst_en" :1, + "ctrst_gain":128 + }, + "luma":{ + "luma_en" :1, + "luma_gain":128 + }, + "strt":{ + "strt_en" :1, + "strt_gain":222 + } + }, + "ldc":{ + "ldc_en" :0, + "ldc_rct_en" :0, + "ldc_rq_frq" :128, + "ldc_stt_ln" :540, + "ldc_ch" :960, + "ldc_cv" :540, + "ldc_cr" :684, + "ldc_cz" :684 + }, + "af":{ + "af_stat_en" :1, + "af_stat_mode_sel" :0, + "af_stat_win_h_start":0, + "af_stat_win_v_start":0, + "af_stat_win_h_end" :1919, + "af_stat_win_v_end" :1079 + } + }, + "isp_post":{ + "rgb2yuv":{ + "osd_rgb2yuv_coeff00":306, + "osd_rgb2yuv_coeff01":601, + "osd_rgb2yuv_coeff02":117, + "osd_rgb2yuv_coeff03":0, + "osd_rgb2yuv_coeff10":3920, + "osd_rgb2yuv_coeff11":3749, + "osd_rgb2yuv_coeff12":523, + "osd_rgb2yuv_coeff13":128, + "osd_rgb2yuv_coeff20":523, + "osd_rgb2yuv_coeff21":3658, + "osd_rgb2yuv_coeff22":4011, + "osd_rgb2yuv_coeff23":128 + }, + "yuv2rgb":{ + "out_yuv2rgb_coeff00":1024, + "out_yuv2rgb_coeff01":0, + "out_yuv2rgb_coeff02":1441, + "out_yuv2rgb_coeff03":3916, + "out_yuv2rgb_coeff10":1024, + "out_yuv2rgb_coeff11":3742, + "out_yuv2rgb_coeff12":3362, + "out_yuv2rgb_coeff13":136, + "out_yuv2rgb_coeff20":1024, + "out_yuv2rgb_coeff21":1822, + "out_yuv2rgb_coeff22":0, + "out_yuv2rgb_coeff23":3868 + }, + "ds0":{ + "ds0_out_rgb_mode":0, + "ds0_out_rgb_en":0, + "ds0_out_yuv_mode":0, + "ds0_out_uv_swap":0, + "ds0_osd0":{ + "ds0_osd0_enable":0, + "ds0_osd0_type":0, + "ds0_osd0_alpha_tpye":0, + "ds0_osd0_vst":0, + "ds0_osd0_hst":0, + "ds0_osd0_vend":0, + "ds0_osd0_hend":0, + "ds0_osd0_dma_request_length":0, + "ds0_osd0_dma_map":0, + "ds0_osd0_rgb_rev":0, + "ds0_osd0_global_alpha":0, + "ds0_osd0_swap_64":0, + "ds0_osd0_outstanding_num":0, + "ds0_osd0_bd_limit_en":0 + }, + "ds0_osd1":{ + "ds0_osd1_enable":0, + "ds0_osd1_type":0, + "ds0_osd1_alpha_tpye":0, + "ds0_osd1_vst":0, + "ds0_osd1_hst":0, + "ds0_osd1_vend":0, + "ds0_osd1_hend":0, + "ds0_osd1_dma_request_length":0, + "ds0_osd1_dma_map":0, + "ds0_osd1_rgb_rev":0, + "ds0_osd1_global_alpha":0, + "ds0_osd1_swap_64":0, + "ds0_osd1_outstanding_num":0, + "ds0_osd1_bd_limit_en":0 + }, + "ds0_osd2":{ + "ds0_osd2_enable":0, + "ds0_osd2_type":0, + "ds0_osd2_alpha_tpye":0, + "ds0_osd2_vst":0, + "ds0_osd2_hst":0, + "ds0_osd2_vend":0, + "ds0_osd2_hend":0, + "ds0_osd2_dma_request_length":0, + "ds0_osd2_dma_map":0, + "ds0_osd2_rgb_rev":0, + "ds0_osd2_global_alpha":0, + "ds0_osd2_swap_64":0, + "ds0_osd2_outstanding_num":0, + "ds0_osd2_bd_limit_en":0 + } + }, + "ds1":{ + "ds1_out_rgb_mode":0, + "ds1_out_rgb_en":0, + "ds1_out_yuv_mode":0, + "ds1_out_uv_swap":0, + "ds1_osd0":{ + "ds1_osd0_enable":0, + "ds1_osd0_type":0, + "ds1_osd0_alpha_tpye":0, + "ds1_osd0_vst":0, + "ds1_osd0_hst":0, + "ds1_osd0_vend":0, + "ds1_osd0_hend":0, + "ds1_osd0_dma_request_length":0, + "ds1_osd0_dma_map":0, + "ds1_osd0_rgb_rev":0, + "ds1_osd0_global_alpha":0, + "ds1_osd0_swap_64":0, + "ds1_osd0_outstanding_num":0, + "ds1_osd0_bd_limit_en":0 + }, + "ds1_osd1":{ + "ds1_osd1_enable":0, + "ds1_osd1_type":0, + "ds1_osd1_alpha_tpye":0, + "ds1_osd1_vst":0, + "ds1_osd1_hst":0, + "ds1_osd1_vend":0, + "ds1_osd1_hend":0, + "ds1_osd1_dma_request_length":0, + "ds1_osd1_dma_map":0, + "ds1_osd1_rgb_rev":0, + "ds1_osd1_global_alpha":0, + "ds1_osd1_swap_64":0, + "ds1_osd1_outstanding_num":0, + "ds1_osd1_bd_limit_en":0 + }, + "ds1_osd2":{ + "ds1_osd2_enable":0, + "ds1_osd2_type":0, + "ds1_osd2_alpha_tpye":0, + "ds1_osd2_vst":0, + "ds1_osd2_hst":0, + "ds1_osd2_vend":0, + "ds1_osd2_hend":0, + "ds1_osd2_dma_request_length":0, + "ds1_osd2_dma_map":0, + "ds1_osd2_rgb_rev":0, + "ds1_osd2_global_alpha":0, + "ds1_osd2_swap_64":0, + "ds1_osd2_outstanding_num":0, + "ds1_osd2_bd_limit_en":0 + } + }, + "ds2":{ + "ds2_out_rgb_mode":0, + "ds2_out_rgb_en":1, + "ds2_out_yuv_mode":0, + "ds2_out_uv_swap":0, + "ds2_osd0":{ + "ds2_osd0_enable":0, + "ds2_osd0_type":0, + "ds2_osd0_alpha_tpye":0, + "ds2_osd0_vst":0, + "ds2_osd0_hst":0, + "ds2_osd0_vend":0, + "ds2_osd0_hend":0, + "ds2_osd0_dma_request_length":0, + "ds2_osd0_dma_map":0, + "ds2_osd0_rgb_rev":0, + "ds2_osd0_global_alpha":0, + "ds2_osd0_swap_64":0, + "ds2_osd0_outstanding_num":0, + "ds2_osd0_bd_limit_en":0 + }, + "ds2_osd1":{ + "ds2_osd1_enable":0, + "ds2_osd1_type":0, + "ds2_osd1_alpha_tpye":0, + "ds2_osd1_vst":0, + "ds2_osd1_hst":0, + "ds2_osd1_vend":0, + "ds2_osd1_hend":0, + "ds2_osd1_dma_request_length":0, + "ds2_osd1_dma_map":0, + "ds2_osd1_rgb_rev":0, + "ds2_osd1_global_alpha":0, + "ds2_osd1_swap_64":0, + "ds2_osd1_outstanding_num":0, + "ds2_osd1_bd_limit_en":0 + } + } + } +} \ No newline at end of file diff --git a/package/mediactl_lib/src/config/gc2145.conf b/package/mediactl_lib/src/config/gc2145.conf new file mode 100644 index 0000000..eed49db --- /dev/null +++ b/package/mediactl_lib/src/config/gc2145.conf @@ -0,0 +1,531 @@ +{ + "isp_general":{ + "isp_out_sel":0, + "dvp_ch_mode":1, + "hist_3a_out_en":0, + "main_out":{ + "out_img_format":1, + "out_yuv_in_format":0, + "out_yuv422_pxl_order":0, + "out_pxl_width":0, + "out_frame_buf_size":2048 + }, + "out0":{ + "ds0_out_img_format":1, + "ds0_out_yuv_in_format":0, + "ds0_out_yuv422_pxl_order":0, + "ds0_out_pxl_width":0, + "ds0_frame_buf_size":2048 + }, + "out1":{ + "ds1_out_img_format":1, + "ds1_out_yuv_in_format":0, + "ds1_out_yuv422_pxl_order":0, + "ds1_out_pxl_width":0, + "ds1_frame_buf_size":2048 + }, + "out2":{ + "ds2_out_img_format":0, + "ds2_out_yuv_in_format":0, + "ds2_out_yuv422_pxl_order":0, + "ds2_out_pxl_width":0, + "ds2_frame_buf_size":2048 + }, + "wdr":{ + "wdr_mode":0, + "wdr_long_ch_mode":0, + "wdr_long_l2_buf_en":0, + "wdr_short_s1_buf_en":0, + "wdr_dynamic_switch_en":0, + "wdr_long_l2_buf_depth":0, + "wdr_long_img_format":0, + "wdr_long_yuv_in_format":0, + "wdr_long_img_out_format":0, + "wdr_long_yuv422_pxl_order":0, + "wdr_long_pixel_width":2, + "wdr_buf_base":0, + "wdr_line_stride":0, + "wdr_frame_buf_size":0 + }, + "nr3d":{ + "nr3d_en":0, + "nr3d_fbcd_en":0, + "nr3d_mv_out_en":0, + "nr3d_y_img_format":0, + "nr3d_y_yuv_in_format":0, + "nr3d_y_img_out_format":0, + "nr3d_y_yuv422_pxl_order":0, + "nr3d_y_pixel_width":2, + "nr3d_uv_img_format":0, + "nr3d_uv_yuv_in_format":0, + "nr3d_uv_mig_out_format":0, + "nr3d_uv_yuv422_pxl_order":0, + "nr3d_uv_pixel_width":2, + "nr3d_frame_buf_size":0 + }, + "ldc":{ + "ldc_line_stride":2048, + "ldc_frame_buf_size":2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol":0, + "vsync_pol":0, + "hsync_input_timing":2, + "vsync_input_timing":1, + "flip_ctl" :0, + "video_fmt_sl":0, + "itc_ttl_h" :1920, + "itc_ttl_v" :1250, + "itc_stt_hr" :0, + "itc_stt_vr" :1 + }, + "tpg": { + "tpg_en":0, + "bayer_mode_sel":3, + "motion_mode_sel":0, + "tpg_sel":9, + "wdr_l_mul_data":0, + "wdr_m_mul_data":0, + "wdr_s_mul_data":0 + }, + "blc":{ + "blc_en" :1, + "blc_offset" :240, + "blc_ratio" :272 + }, + "lsc":{ + "lsc_en" :1, + "lsc_h_center" :900, + "lsc_v_center" :580, + "lsc_r_ratio" :10, + "lsc_g_ratio":6, + "lsc_b_ratio" :6, + "lsc_ir_ratio" :6 + }, + "ae":{ + "ae_as_en" :1, + "ae_ag_en" :1, + "ae_airis_en" :0, + "ae_enter_ls_sel" :0, + "ae_exit_ls_sel" :0, + "ae_win_mode_sel" :0, + "ae_back_light_mode_sel" :0, + "ae_day_change_en" :0, + "ae_day_change_sel" :0, + "ae_win_stth" :0, + "ae_win_sttv" :0, + "ae_win_endh" :1280, + "ae_win_endv" :960, + "ae_yobj" :90, + "ae_av_rg" :13, + "ae_l_ex_time" :1100, + "ae_m_ex_time" :32, + "ae_s_ex_time" :32, + "ae_agc" :256, + "ae_ad_shuttle_freq" :1, + "ae_ad_gain_freq" :0, + "ae_adjust_step_max":36, + "ae_ex_value_max" :1162, + "ae_ex_value_mid" :256, + "ae_ex_value_min" :1, + "ae_gain_value_max" :2304, + "ae_gain_value_mid" :512, + "ae_gain_value_min" :256, + "ae_dn_switch_ad_step_max" :512, + "ae_dn_switch_wait_time" :255, + "ape_max_diff" :12, + "ape_drv_signal_max" :3840, + "ape_coeff_distance" :0, + "ape_coeff_speed" :0, + "ape_coeff_acceleration" :0, + "ape_drv_manual_value" :4095, + "ape_damp_manual_value" :2048 + }, + "awb":{ + "awb_d65_en" :1, + "awb_ccm_en" :1, + "awb_en" :1, + "awb_mode_sel" :1, + "awb_hist_mode_sel" :0, + "awb_veri_en" :0, + "awb_fb_en" :0, + "awb_value_save_en" :0, + "awb_ccm_adp_adjust_en" :0, + "awb_stab_en" :1, + "awb_d65_red_gain" :466, + "awb_d65_blue_gain" :382, + "ccm_rr" :322, + "ccm_rg" :54, + "ccm_rb" :12, + "ccm_gr" :37, + "ccm_gg" :310, + "ccm_gb" :17, + "ccm_br" :0, + "ccm_bg" :60, + "ccm_bb" :316, + "ccm_correct_coff" :256, + "awb_win_stth" :0, + "awb_win_sttv" :0, + "awb_win_endh" :1280, + "awb_win_endv" :960, + "awb_correct_diff_th" :8, + "awb_color_changeres_time" :8, + "awb_historgram_th" :4, + "awb_red_gain_adjust" :256, + "awb_green_gain_adjust" :256, + "awb_blue_gain_adjust" :256, + "awb_red_max_value" :240, + "awb_blue_max_value" :379, + "awb_red_min_value" :176, + "awb_blue_min_value" :281, + "awb_red_obj_value" :256, + "awb_blue_obj_value" :256 + }, + "wdr":{ + "wdr_fusion_en" :0, + "wdr_frame_sel" :0, + "wdr_adp_adjust_en" :0, + "wdr_stab_en" :0, + "wdr_en" :0, + "wdr_ghost_remove_en" :0, + "wdr_3frame_out_mode" :0, + "wdr_mode_sel" :0, + "wdr_2frame_ex_ratio" :1, + "wdr_3frame_ex_ratio" :1, + "wdr_stat_img_sel" :0, + "wdr_ltm_data_sel" :1, + "wdr_tz_data_sel" :1, + "wdr_remove_purple_en" :0, + "wdr_over_ex_ratio_th1" :384, + "wdr_over_ex_ratio_th2" :32, + "wdr_fusion_ratio_th" :192, + "wdr_fusion_value1" :64, + "wdr_fusion_value2" :16 + }, + "csc":{ + "rgb2yuv_00":153, + "rgb2yuv_01":256, + "rgb2yuv_02":86, + "rgb2yuv_10":301, + "rgb2yuv_11":214, + "rgb2yuv_12":170, + "rgb2yuv_20":58, + "rgb2yuv_21":42, + "rgb2yuv_22":256 + }, + "ada":{ + "gm_rgb_en" :1, + "gm_yuv_en" :0, + "ada_en" :0, + "ada_sbz_en" :0, + "ada_ccr_en" :0, + "ada_adp_en" :0, + "ada_adp_ccr_en" :0, + "ada_stat_mode_sel" :0, + "ada_enh_mode_sel" :0, + "ada_hist_max" :128, + "ada_ttl_max" :128, + "ada_win_stth" :0, + "ada_win_sttv" :0, + "ada_win_endh" :1599, + "ada_win_endv" :1199 + }, + "rgb-ir":{ + "raw_fmt" :0, + "rgbir_rct_en" :0, + "dfc_en" :0, + "rgbir_fs_en" :0, + "rgbir_ot_sl" :0, + "rgbir_fs_max" :256, + "dfc_krb" :0, + "dfc_ky" :0, + "dfc_th" :256, + "dfc_th_1" :256 + }, + "2dnr":{ + "dpeak_en" :1, + "nr2d_raw_en" :1, + "nr2d_eg_en" :1, + "nr2d_jl_en" :1, + "nr2d_av_en" :1, + "nr2d_c_en" :1, + "dpeak_adp_en" :1, + "nr2d_raw_adp_en":1, + "nr2d_y_adp_en" :1, + "nr2d_c_adp_en" :1, + "nr2d_raw_kl" :16, + "nr2d_jl_th" :511, + "nr2d_eg_k" :48, + "nr2d_y_k" :64, + "nr2d_c_k" :255 + }, + "3dnr":{ + "nr3d_en" :1, + "nr3dp_y_en" :1, + "nr3dp_c_en" :1, + "nr3dm_y_en" :1, + "nr3dm_c_en" :1, + "nr3db_y_en" :1, + "nr3db_c_en" :1, + "nr3dm_nr2d_y_en" :1, + "nr3dm_nr2d_c_en" :1, + "core_3dnr_wb_en" :1, + "core_3dnr_wb_sel" :1, + "core_3dnr_adp_luma_en" :0, + "core_3dnr_adp_chroma_en" :0, + "nr3dp_thy" :64, + "nr3dp_thyp" :64, + "nr3dp_thcp" :64, + "nr3dm_mid_th" :128, + "nr3dm_mtp_th" :8, + "nr3dm_mtc_th" :128, + "nr3dm_ym_k" :60, + "nr3dm_thy" :64, + "nr3dm_min" :0, + "nr3dm_thw0" :128, + "core_3dnr_chroma_intensity" :122, + "nr3db_nr2d_eg_th" :64, + "nr3db_thyp" :64, + "nr3db_thcp" :32 + }, + "enh":{ + "ltm":{ + "enh_ltm_en" :1, + "enh_adp_ltm_en" :0, + "ltm_gain" :128, + "ltm_mm_th" :128 + }, + "sharp":{ + "enh_sharp_en" :1, + "enh_adp_sharp_en" :1, + "shp_core" :8, + "shp_th1" :18, + "shp_th2" :256, + "shp_gain" :64 + }, + "cc":{ + "enh_cc_en" :1, + "enh_adp_cc_en" :0 + } + }, + "post_ctl":{ + "otc_ctl":{ + "otc_en" :0, + "otc_yc_sl" :0, + "otc_uv_sl" :1, + "otc_hs_plt_sl" :0, + "otc_vs_plt_sl" :0, + "otc_stt_vr" :0, + "otc_stt_hr" :0 + }, + "ctrst":{ + "ctrst_en" :1, + "ctrst_gain":128 + }, + "luma":{ + "luma_en" :1, + "luma_gain":128 + }, + "strt":{ + "strt_en" :1, + "strt_gain":255 + } + }, + "ldc":{ + "ldc_en" :0, + "ldc_rct_en" :0, + "ldc_rq_frq" :128, + "ldc_stt_ln" :540, + "ldc_ch" :960, + "ldc_cv" :540, + "ldc_cr" :684, + "ldc_cz" :684 + }, + "af":{ + "af_stat_en" :1, + "af_stat_mode_sel" :0, + "af_stat_win_h_start":0, + "af_stat_win_v_start":0, + "af_stat_win_h_end" :1919, + "af_stat_win_v_end" :1079 + } + }, + "isp_post":{ + "rgb2yuv":{ + "osd_rgb2yuv_coeff00":306, + "osd_rgb2yuv_coeff01":601, + "osd_rgb2yuv_coeff02":117, + "osd_rgb2yuv_coeff03":0, + "osd_rgb2yuv_coeff10":3920, + "osd_rgb2yuv_coeff11":3749, + "osd_rgb2yuv_coeff12":523, + "osd_rgb2yuv_coeff13":128, + "osd_rgb2yuv_coeff20":523, + "osd_rgb2yuv_coeff21":3658, + "osd_rgb2yuv_coeff22":4011, + "osd_rgb2yuv_coeff23":128 + }, + "yuv2rgb":{ + "out_yuv2rgb_coeff00":1024, + "out_yuv2rgb_coeff01":0, + "out_yuv2rgb_coeff02":1441, + "out_yuv2rgb_coeff03":3916, + "out_yuv2rgb_coeff10":1024, + "out_yuv2rgb_coeff11":3742, + "out_yuv2rgb_coeff12":3362, + "out_yuv2rgb_coeff13":136, + "out_yuv2rgb_coeff20":1024, + "out_yuv2rgb_coeff21":1822, + "out_yuv2rgb_coeff22":0, + "out_yuv2rgb_coeff23":3868 + }, + "ds0":{ + "ds0_out_rgb_mode":0, + "ds0_out_rgb_en":0, + "ds0_out_yuv_mode":0, + "ds0_out_uv_swap":0, + "ds0_osd0":{ + "ds0_osd0_enable":0, + "ds0_osd0_type":0, + "ds0_osd0_alpha_tpye":0, + "ds0_osd0_vst":0, + "ds0_osd0_hst":0, + "ds0_osd0_vend":0, + "ds0_osd0_hend":0, + "ds0_osd0_dma_request_length":0, + "ds0_osd0_dma_map":0, + "ds0_osd0_rgb_rev":0, + "ds0_osd0_global_alpha":0, + "ds0_osd0_swap_64":0, + "ds0_osd0_outstanding_num":0, + "ds0_osd0_bd_limit_en":0 + }, + "ds0_osd1":{ + "ds0_osd1_enable":0, + "ds0_osd1_type":0, + "ds0_osd1_alpha_tpye":0, + "ds0_osd1_vst":0, + "ds0_osd1_hst":0, + "ds0_osd1_vend":0, + "ds0_osd1_hend":0, + "ds0_osd1_dma_request_length":0, + "ds0_osd1_dma_map":0, + "ds0_osd1_rgb_rev":0, + "ds0_osd1_global_alpha":0, + "ds0_osd1_swap_64":0, + "ds0_osd1_outstanding_num":0, + "ds0_osd1_bd_limit_en":0 + }, + "ds0_osd2":{ + "ds0_osd2_enable":0, + "ds0_osd2_type":0, + "ds0_osd2_alpha_tpye":0, + "ds0_osd2_vst":0, + "ds0_osd2_hst":0, + "ds0_osd2_vend":0, + "ds0_osd2_hend":0, + "ds0_osd2_dma_request_length":0, + "ds0_osd2_dma_map":0, + "ds0_osd2_rgb_rev":0, + "ds0_osd2_global_alpha":0, + "ds0_osd2_swap_64":0, + "ds0_osd2_outstanding_num":0, + "ds0_osd2_bd_limit_en":0 + } + }, + "ds1":{ + "ds1_out_rgb_mode":0, + "ds1_out_rgb_en":0, + "ds1_out_yuv_mode":0, + "ds1_out_uv_swap":0, + "ds1_osd0":{ + "ds1_osd0_enable":0, + "ds1_osd0_type":0, + "ds1_osd0_alpha_tpye":0, + "ds1_osd0_vst":0, + "ds1_osd0_hst":0, + "ds1_osd0_vend":0, + "ds1_osd0_hend":0, + "ds1_osd0_dma_request_length":0, + "ds1_osd0_dma_map":0, + "ds1_osd0_rgb_rev":0, + "ds1_osd0_global_alpha":0, + "ds1_osd0_swap_64":0, + "ds1_osd0_outstanding_num":0, + "ds1_osd0_bd_limit_en":0 + }, + "ds1_osd1":{ + "ds1_osd1_enable":0, + "ds1_osd1_type":0, + "ds1_osd1_alpha_tpye":0, + "ds1_osd1_vst":0, + "ds1_osd1_hst":0, + "ds1_osd1_vend":0, + "ds1_osd1_hend":0, + "ds1_osd1_dma_request_length":0, + "ds1_osd1_dma_map":0, + "ds1_osd1_rgb_rev":0, + "ds1_osd1_global_alpha":0, + "ds1_osd1_swap_64":0, + "ds1_osd1_outstanding_num":0, + "ds1_osd1_bd_limit_en":0 + }, + "ds1_osd2":{ + "ds1_osd2_enable":0, + "ds1_osd2_type":0, + "ds1_osd2_alpha_tpye":0, + "ds1_osd2_vst":0, + "ds1_osd2_hst":0, + "ds1_osd2_vend":0, + "ds1_osd2_hend":0, + "ds1_osd2_dma_request_length":0, + "ds1_osd2_dma_map":0, + "ds1_osd2_rgb_rev":0, + "ds1_osd2_global_alpha":0, + "ds1_osd2_swap_64":0, + "ds1_osd2_outstanding_num":0, + "ds1_osd2_bd_limit_en":0 + } + }, + "ds2":{ + "ds2_out_rgb_mode":0, + "ds2_out_rgb_en":1, + "ds2_out_yuv_mode":0, + "ds2_out_uv_swap":0, + "ds2_osd0":{ + "ds2_osd0_enable":0, + "ds2_osd0_type":0, + "ds2_osd0_alpha_tpye":0, + "ds2_osd0_vst":0, + "ds2_osd0_hst":0, + "ds2_osd0_vend":0, + "ds2_osd0_hend":0, + "ds2_osd0_dma_request_length":0, + "ds2_osd0_dma_map":0, + "ds2_osd0_rgb_rev":0, + "ds2_osd0_global_alpha":0, + "ds2_osd0_swap_64":0, + "ds2_osd0_outstanding_num":0, + "ds2_osd0_bd_limit_en":0 + }, + "ds2_osd1":{ + "ds2_osd1_enable":0, + "ds2_osd1_type":0, + "ds2_osd1_alpha_tpye":0, + "ds2_osd1_vst":0, + "ds2_osd1_hst":0, + "ds2_osd1_vend":0, + "ds2_osd1_hend":0, + "ds2_osd1_dma_request_length":0, + "ds2_osd1_dma_map":0, + "ds2_osd1_rgb_rev":0, + "ds2_osd1_global_alpha":0, + "ds2_osd1_swap_64":0, + "ds2_osd1_outstanding_num":0, + "ds2_osd1_bd_limit_en":0 + } + } + } +} diff --git a/package/mediactl_lib/src/config/imx219_0.conf b/package/mediactl_lib/src/config/imx219_0.conf index 9d05d58..1ed1520 100644 --- a/package/mediactl_lib/src/config/imx219_0.conf +++ b/package/mediactl_lib/src/config/imx219_0.conf @@ -1,531 +1,531 @@ { - "isp_general":{ - "isp_out_sel":0, - "dvp_ch_mode":1, - "hist_3a_out_en":0, - "main_out":{ - "out_img_format":1, - "out_yuv_in_format":0, - "out_yuv422_pxl_order":0, - "out_pxl_width":0, - "out_frame_buf_size":2048 + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 }, - "out0":{ - "ds0_out_img_format":1, - "ds0_out_yuv_in_format":0, - "ds0_out_yuv422_pxl_order":0, - "ds0_out_pxl_width":0, - "ds0_frame_buf_size":2048 + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 }, - "out1":{ - "ds1_out_img_format":1, - "ds1_out_yuv_in_format":0, - "ds1_out_yuv422_pxl_order":0, - "ds1_out_pxl_width":0, - "ds1_frame_buf_size":2048 + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 }, - "out2":{ - "ds2_out_img_format":0, - "ds2_out_yuv_in_format":0, - "ds2_out_yuv422_pxl_order":0, - "ds2_out_pxl_width":0, - "ds2_frame_buf_size":2048 + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 }, - "wdr":{ - "wdr_mode":0, - "wdr_long_ch_mode":0, - "wdr_long_l2_buf_en":0, - "wdr_short_s1_buf_en":0, - "wdr_dynamic_switch_en":0, - "wdr_long_l2_buf_depth":0, - "wdr_long_img_format":0, - "wdr_long_yuv_in_format":0, - "wdr_long_img_out_format":0, - "wdr_long_yuv422_pxl_order":0, - "wdr_long_pixel_width":2, - "wdr_buf_base":0, - "wdr_line_stride":0, - "wdr_frame_buf_size":0 - }, - "nr3d":{ - "nr3d_en":0, - "nr3d_fbcd_en":0, - "nr3d_mv_out_en":0, - "nr3d_y_img_format":0, - "nr3d_y_yuv_in_format":0, - "nr3d_y_img_out_format":0, - "nr3d_y_yuv422_pxl_order":0, - "nr3d_y_pixel_width":2, - "nr3d_uv_img_format":0, - "nr3d_uv_yuv_in_format":0, - "nr3d_uv_mig_out_format":0, - "nr3d_uv_yuv422_pxl_order":0, - "nr3d_uv_pixel_width":2, - "nr3d_frame_buf_size":0 - }, - "ldc":{ - "ldc_line_stride":2048, - "ldc_frame_buf_size":2048 - } + "wdr": { + "wdr_mode": 0, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } }, - "isp_core": { + "isp_core": { "itc": { - "hsync_pol":0, - "vsync_pol":0, - "hsync_input_timing":2, - "vsync_input_timing":1, - "flip_ctl" :0, - "video_fmt_sl":0, - "itc_ttl_h" :3476, - "itc_ttl_v" :1166, - "itc_stt_hr" :0, - "itc_stt_vr" :1 + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 2, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 3476, + "itc_ttl_v": 1166, + "itc_stt_hr": 0, + "itc_stt_vr": 1 }, - "tpg": { - "tpg_en":0, - "bayer_mode_sel":3, - "motion_mode_sel":0, - "tpg_sel":9, - "wdr_l_mul_data":0, - "wdr_m_mul_data":0, - "wdr_s_mul_data":0 + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 }, - "blc":{ - "blc_en" :1, - "blc_offset" :240, - "blc_ratio" :272 + "blc": { + "blc_en": 1, + "blc_offset": 240, + "blc_ratio": 272 }, - "lsc":{ - "lsc_en" :1, - "lsc_h_center" :900, - "lsc_v_center" :580, - "lsc_r_ratio" :10, - "lsc_g_ratio":6, - "lsc_b_ratio" :6, - "lsc_ir_ratio" :6 + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 10, + "lsc_g_ratio": 6, + "lsc_b_ratio": 6, + "lsc_ir_ratio": 6 }, - "ae":{ - "ae_as_en" :1, - "ae_ag_en" :1, - "ae_airis_en" :0, - "ae_enter_ls_sel" :0, - "ae_exit_ls_sel" :0, - "ae_win_mode_sel" :0, - "ae_back_light_mode_sel" :0, - "ae_day_change_en" :0, - "ae_day_change_sel" :0, - "ae_win_stth" :0, - "ae_win_sttv" :0, - "ae_win_endh" :1919, - "ae_win_endv" :1079, - "ae_yobj" :90, - "ae_av_rg" :8, - "ae_l_ex_time" :1000, - "ae_m_ex_time" :32, - "ae_s_ex_time" :32, - "ae_agc" :256, - "ae_ad_shuttle_freq" :1, - "ae_ad_gain_freq" :0, - "ae_adjust_step_max":36, - "ae_ex_value_max" :1162, - "ae_ex_value_mid" :256, - "ae_ex_value_min" :1, - "ae_gain_value_max" :2304, - "ae_gain_value_mid" :512, - "ae_gain_value_min" :256, - "ae_dn_switch_ad_step_max" :512, - "ae_dn_switch_wait_time" :255, - "ape_max_diff" :12, - "ape_drv_signal_max" :3840, - "ape_coeff_distance" :0, - "ape_coeff_speed" :0, - "ape_coeff_acceleration" :0, - "ape_drv_manual_value" :4095, - "ape_damp_manual_value" :2048 + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 0, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 8, + "ae_win_sttv": 4, + "ae_win_endh": 1927, + "ae_win_endv": 1083, + "ae_yobj": 90, + "ae_av_rg": 8, + "ae_l_ex_time": 1000, + "ae_m_ex_time": 32, + "ae_s_ex_time": 32, + "ae_agc": 256, + "ae_ad_shuttle_freq": 0, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 1162, + "ae_ex_value_mid": 256, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 }, - "awb":{ - "awb_d65_en" :1, - "awb_ccm_en" :1, - "awb_en" :1, - "awb_mode_sel" :1, - "awb_hist_mode_sel" :0, - "awb_veri_en" :0, - "awb_fb_en" :0, - "awb_value_save_en" :0, - "awb_ccm_adp_adjust_en" :0, - "awb_stab_en" :1, - "awb_d65_red_gain" :466, - "awb_d65_blue_gain" :382, - "ccm_rr" :259, - "ccm_rg" :2, - "ccm_rb" :1, - "ccm_gr" :37, - "ccm_gg" :310, - "ccm_gb" :17, - "ccm_br" :1, - "ccm_bg" :75, - "ccm_bb" :332, - "ccm_correct_coff" :256, - "awb_win_stth" :0, - "awb_win_sttv" :0, - "awb_win_endh" :1919, - "awb_win_endv" :1079, - "awb_correct_diff_th" :8, - "awb_color_changeres_time" :8, - "awb_historgram_th" :4, - "awb_red_gain_adjust" :256, - "awb_green_gain_adjust" :256, - "awb_blue_gain_adjust" :256, - "awb_red_max_value" :259, - "awb_blue_max_value" :388, - "awb_red_min_value" :176, - "awb_blue_min_value" :262, - "awb_red_obj_value" :256, - "awb_blue_obj_value" :256 + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 466, + "awb_d65_blue_gain": 382, + "ccm_rr": 259, + "ccm_rg": 2, + "ccm_rb": 1, + "ccm_gr": 37, + "ccm_gg": 310, + "ccm_gb": 17, + "ccm_br": 1, + "ccm_bg": 75, + "ccm_bb": 332, + "ccm_correct_coff": 256, + "awb_win_stth": 8, + "awb_win_sttv": 4, + "awb_win_endh": 1927, + "awb_win_endv": 1083, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 259, + "awb_blue_max_value": 388, + "awb_red_min_value": 176, + "awb_blue_min_value": 262, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 }, - "wdr":{ - "wdr_fusion_en" :0, - "wdr_frame_sel" :0, - "wdr_adp_adjust_en" :0, - "wdr_stab_en" :0, - "wdr_en" :0, - "wdr_ghost_remove_en" :0, - "wdr_3frame_out_mode" :0, - "wdr_mode_sel" :0, - "wdr_2frame_ex_ratio" :1, - "wdr_3frame_ex_ratio" :1, - "wdr_stat_img_sel" :0, - "wdr_ltm_data_sel" :1, - "wdr_tz_data_sel" :1, - "wdr_remove_purple_en" :0, - "wdr_over_ex_ratio_th1" :384, - "wdr_over_ex_ratio_th2" :32, - "wdr_fusion_ratio_th" :192, - "wdr_fusion_value1" :64, - "wdr_fusion_value2" :16 + "wdr": { + "wdr_fusion_en": 0, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 0, + "wdr_stab_en": 0, + "wdr_en": 0, + "wdr_ghost_remove_en": 0, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 1, + "wdr_stat_img_sel": 0, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 0, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 }, - "csc":{ - "rgb2yuv_00":153, - "rgb2yuv_01":256, - "rgb2yuv_02":86, - "rgb2yuv_10":301, - "rgb2yuv_11":214, - "rgb2yuv_12":170, - "rgb2yuv_20":58, - "rgb2yuv_21":42, - "rgb2yuv_22":256 + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 }, - "ada":{ - "gm_rgb_en" :1, - "gm_yuv_en" :0, - "ada_en" :1, - "ada_sbz_en" :0, - "ada_ccr_en" :0, - "ada_adp_en" :0, - "ada_adp_ccr_en" :0, - "ada_stat_mode_sel" :0, - "ada_enh_mode_sel" :0, - "ada_hist_max" :128, - "ada_ttl_max" :255, - "ada_win_stth" :0, - "ada_win_sttv" :0, - "ada_win_endh" :1919, - "ada_win_endv" :1079 + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 }, - "rgb-ir":{ - "raw_fmt" :0, - "rgbir_rct_en" :0, - "dfc_en" :0, - "rgbir_fs_en" :0, - "rgbir_ot_sl" :0, - "rgbir_fs_max" :256, - "dfc_krb" :0, - "dfc_ky" :0, - "dfc_th" :256, - "dfc_th_1" :256 + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 }, - "2dnr":{ - "dpeak_en" :1, - "nr2d_raw_en" :1, - "nr2d_eg_en" :1, - "nr2d_jl_en" :1, - "nr2d_av_en" :1, - "nr2d_c_en" :1, - "dpeak_adp_en" :1, - "nr2d_raw_adp_en":1, - "nr2d_y_adp_en" :1, - "nr2d_c_adp_en" :1, - "nr2d_raw_kl" :16, - "nr2d_jl_th" :511, - "nr2d_eg_k" :48, - "nr2d_y_k" :64, - "nr2d_c_k" :1 + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 511, + "nr2d_eg_k": 48, + "nr2d_y_k": 64, + "nr2d_c_k": 1 }, - "3dnr":{ - "nr3d_en" :1, - "nr3dp_y_en" :1, - "nr3dp_c_en" :1, - "nr3dm_y_en" :1, - "nr3dm_c_en" :1, - "nr3db_y_en" :1, - "nr3db_c_en" :1, - "nr3dm_nr2d_y_en" :1, - "nr3dm_nr2d_c_en" :1, - "core_3dnr_wb_en" :0, - "core_3dnr_wb_sel" :0, - "core_3dnr_adp_luma_en" :0, - "core_3dnr_adp_chroma_en" :0, - "nr3dp_thy" :64, - "nr3dp_thyp" :64, - "nr3dp_thcp" :64, - "nr3dm_mid_th" :128, - "nr3dm_mtp_th" :8, - "nr3dm_mtc_th" :128, - "nr3dm_ym_k" :60, - "nr3dm_thy" :64, - "nr3dm_min" :0, - "nr3dm_thw0" :128, - "core_3dnr_chroma_intensity" :16, - "nr3db_nr2d_eg_th" :64, - "nr3db_thyp" :64, - "nr3db_thcp" :32 + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 64, + "nr3dp_thyp": 64, + "nr3dp_thcp": 64, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 60, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 }, - "enh":{ - "ltm":{ - "enh_ltm_en" :1, - "enh_adp_ltm_en" :0, - "ltm_gain" :128, - "ltm_mm_th" :128 + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 }, - "sharp":{ - "enh_sharp_en" :1, - "enh_adp_sharp_en" :1, - "shp_core" :8, - "shp_th1" :3840, - "shp_th2" :4095, - "shp_gain" :64 + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 8, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 64 }, - "cc":{ - "enh_cc_en" :0, - "enh_adp_cc_en" :0 - } + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } }, - "post_ctl":{ - "otc_ctl":{ - "otc_en" :0, - "otc_yc_sl" :0, - "otc_uv_sl" :1, - "otc_hs_plt_sl" :0, - "otc_vs_plt_sl" :0, - "otc_stt_vr" :0, - "otc_stt_hr" :0 + "post_ctl": { + "otc_ctl": { + "otc_en": 1, + "otc_yc_sl": 0, + "otc_uv_sl": 0, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 }, - "ctrst":{ - "ctrst_en" :1, - "ctrst_gain":128 + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 }, - "luma":{ - "luma_en" :1, - "luma_gain":128 + "luma": { + "luma_en": 1, + "luma_gain": 128 }, - "strt":{ - "strt_en" :1, - "strt_gain":250 + "strt": { + "strt_en": 1, + "strt_gain": 250 } }, - "ldc":{ - "ldc_en" :0, - "ldc_rct_en" :0, - "ldc_rq_frq" :128, - "ldc_stt_ln" :540, - "ldc_ch" :960, - "ldc_cv" :540, - "ldc_cr" :684, - "ldc_cz" :684 + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 960, + "ldc_cv": 540, + "ldc_cr": 684, + "ldc_cz": 684 }, - "af":{ - "af_stat_en" :1, - "af_stat_mode_sel" :0, - "af_stat_win_h_start":0, - "af_stat_win_v_start":0, - "af_stat_win_h_end" :1919, - "af_stat_win_v_end" :1079 + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 8, + "af_stat_win_v_start": 4, + "af_stat_win_h_end": 1927, + "af_stat_win_v_end": 1083 } }, - "isp_post":{ - "rgb2yuv":{ - "osd_rgb2yuv_coeff00":306, - "osd_rgb2yuv_coeff01":601, - "osd_rgb2yuv_coeff02":117, - "osd_rgb2yuv_coeff03":0, - "osd_rgb2yuv_coeff10":3920, - "osd_rgb2yuv_coeff11":3749, - "osd_rgb2yuv_coeff12":523, - "osd_rgb2yuv_coeff13":128, - "osd_rgb2yuv_coeff20":523, - "osd_rgb2yuv_coeff21":3658, - "osd_rgb2yuv_coeff22":4011, - "osd_rgb2yuv_coeff23":128 + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 }, - "yuv2rgb":{ - "out_yuv2rgb_coeff00":1024, - "out_yuv2rgb_coeff01":0, - "out_yuv2rgb_coeff02":1441, - "out_yuv2rgb_coeff03":3916, - "out_yuv2rgb_coeff10":1024, - "out_yuv2rgb_coeff11":3742, - "out_yuv2rgb_coeff12":3362, - "out_yuv2rgb_coeff13":136, - "out_yuv2rgb_coeff20":1024, - "out_yuv2rgb_coeff21":1822, - "out_yuv2rgb_coeff22":0, - "out_yuv2rgb_coeff23":3868 + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } }, - "ds0":{ - "ds0_out_rgb_mode":0, - "ds0_out_rgb_en":0, - "ds0_out_yuv_mode":0, - "ds0_out_uv_swap":0, - "ds0_osd0":{ - "ds0_osd0_enable":0, - "ds0_osd0_type":0, - "ds0_osd0_alpha_tpye":0, - "ds0_osd0_vst":0, - "ds0_osd0_hst":0, - "ds0_osd0_vend":0, - "ds0_osd0_hend":0, - "ds0_osd0_dma_request_length":0, - "ds0_osd0_dma_map":0, - "ds0_osd0_rgb_rev":0, - "ds0_osd0_global_alpha":0, - "ds0_osd0_swap_64":0, - "ds0_osd0_outstanding_num":0, - "ds0_osd0_bd_limit_en":0 - }, - "ds0_osd1":{ - "ds0_osd1_enable":0, - "ds0_osd1_type":0, - "ds0_osd1_alpha_tpye":0, - "ds0_osd1_vst":0, - "ds0_osd1_hst":0, - "ds0_osd1_vend":0, - "ds0_osd1_hend":0, - "ds0_osd1_dma_request_length":0, - "ds0_osd1_dma_map":0, - "ds0_osd1_rgb_rev":0, - "ds0_osd1_global_alpha":0, - "ds0_osd1_swap_64":0, - "ds0_osd1_outstanding_num":0, - "ds0_osd1_bd_limit_en":0 - }, - "ds0_osd2":{ - "ds0_osd2_enable":0, - "ds0_osd2_type":0, - "ds0_osd2_alpha_tpye":0, - "ds0_osd2_vst":0, - "ds0_osd2_hst":0, - "ds0_osd2_vend":0, - "ds0_osd2_hend":0, - "ds0_osd2_dma_request_length":0, - "ds0_osd2_dma_map":0, - "ds0_osd2_rgb_rev":0, - "ds0_osd2_global_alpha":0, - "ds0_osd2_swap_64":0, - "ds0_osd2_outstanding_num":0, - "ds0_osd2_bd_limit_en":0 - } - }, - "ds1":{ - "ds1_out_rgb_mode":0, - "ds1_out_rgb_en":0, - "ds1_out_yuv_mode":0, - "ds1_out_uv_swap":0, - "ds1_osd0":{ - "ds1_osd0_enable":0, - "ds1_osd0_type":0, - "ds1_osd0_alpha_tpye":0, - "ds1_osd0_vst":0, - "ds1_osd0_hst":0, - "ds1_osd0_vend":0, - "ds1_osd0_hend":0, - "ds1_osd0_dma_request_length":0, - "ds1_osd0_dma_map":0, - "ds1_osd0_rgb_rev":0, - "ds1_osd0_global_alpha":0, - "ds1_osd0_swap_64":0, - "ds1_osd0_outstanding_num":0, - "ds1_osd0_bd_limit_en":0 - }, - "ds1_osd1":{ - "ds1_osd1_enable":0, - "ds1_osd1_type":0, - "ds1_osd1_alpha_tpye":0, - "ds1_osd1_vst":0, - "ds1_osd1_hst":0, - "ds1_osd1_vend":0, - "ds1_osd1_hend":0, - "ds1_osd1_dma_request_length":0, - "ds1_osd1_dma_map":0, - "ds1_osd1_rgb_rev":0, - "ds1_osd1_global_alpha":0, - "ds1_osd1_swap_64":0, - "ds1_osd1_outstanding_num":0, - "ds1_osd1_bd_limit_en":0 - }, - "ds1_osd2":{ - "ds1_osd2_enable":0, - "ds1_osd2_type":0, - "ds1_osd2_alpha_tpye":0, - "ds1_osd2_vst":0, - "ds1_osd2_hst":0, - "ds1_osd2_vend":0, - "ds1_osd2_hend":0, - "ds1_osd2_dma_request_length":0, - "ds1_osd2_dma_map":0, - "ds1_osd2_rgb_rev":0, - "ds1_osd2_global_alpha":0, - "ds1_osd2_swap_64":0, - "ds1_osd2_outstanding_num":0, - "ds1_osd2_bd_limit_en":0 - } - }, - "ds2":{ - "ds2_out_rgb_mode":0, - "ds2_out_rgb_en":1, - "ds2_out_yuv_mode":0, - "ds2_out_uv_swap":0, - "ds2_osd0":{ - "ds2_osd0_enable":0, - "ds2_osd0_type":0, - "ds2_osd0_alpha_tpye":0, - "ds2_osd0_vst":0, - "ds2_osd0_hst":0, - "ds2_osd0_vend":0, - "ds2_osd0_hend":0, - "ds2_osd0_dma_request_length":0, - "ds2_osd0_dma_map":0, - "ds2_osd0_rgb_rev":0, - "ds2_osd0_global_alpha":0, - "ds2_osd0_swap_64":0, - "ds2_osd0_outstanding_num":0, - "ds2_osd0_bd_limit_en":0 - }, - "ds2_osd1":{ - "ds2_osd1_enable":0, - "ds2_osd1_type":0, - "ds2_osd1_alpha_tpye":0, - "ds2_osd1_vst":0, - "ds2_osd1_hst":0, - "ds2_osd1_vend":0, - "ds2_osd1_hend":0, - "ds2_osd1_dma_request_length":0, - "ds2_osd1_dma_map":0, - "ds2_osd1_rgb_rev":0, - "ds2_osd1_global_alpha":0, - "ds2_osd1_swap_64":0, - "ds2_osd1_outstanding_num":0, - "ds2_osd1_bd_limit_en":0 - } - } + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } } -} \ No newline at end of file +} diff --git a/package/mediactl_lib/src/config/imx219_1.conf b/package/mediactl_lib/src/config/imx219_1.conf index 9d05d58..1ed1520 100644 --- a/package/mediactl_lib/src/config/imx219_1.conf +++ b/package/mediactl_lib/src/config/imx219_1.conf @@ -1,531 +1,531 @@ { - "isp_general":{ - "isp_out_sel":0, - "dvp_ch_mode":1, - "hist_3a_out_en":0, - "main_out":{ - "out_img_format":1, - "out_yuv_in_format":0, - "out_yuv422_pxl_order":0, - "out_pxl_width":0, - "out_frame_buf_size":2048 + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 }, - "out0":{ - "ds0_out_img_format":1, - "ds0_out_yuv_in_format":0, - "ds0_out_yuv422_pxl_order":0, - "ds0_out_pxl_width":0, - "ds0_frame_buf_size":2048 + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 }, - "out1":{ - "ds1_out_img_format":1, - "ds1_out_yuv_in_format":0, - "ds1_out_yuv422_pxl_order":0, - "ds1_out_pxl_width":0, - "ds1_frame_buf_size":2048 + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 }, - "out2":{ - "ds2_out_img_format":0, - "ds2_out_yuv_in_format":0, - "ds2_out_yuv422_pxl_order":0, - "ds2_out_pxl_width":0, - "ds2_frame_buf_size":2048 + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 }, - "wdr":{ - "wdr_mode":0, - "wdr_long_ch_mode":0, - "wdr_long_l2_buf_en":0, - "wdr_short_s1_buf_en":0, - "wdr_dynamic_switch_en":0, - "wdr_long_l2_buf_depth":0, - "wdr_long_img_format":0, - "wdr_long_yuv_in_format":0, - "wdr_long_img_out_format":0, - "wdr_long_yuv422_pxl_order":0, - "wdr_long_pixel_width":2, - "wdr_buf_base":0, - "wdr_line_stride":0, - "wdr_frame_buf_size":0 - }, - "nr3d":{ - "nr3d_en":0, - "nr3d_fbcd_en":0, - "nr3d_mv_out_en":0, - "nr3d_y_img_format":0, - "nr3d_y_yuv_in_format":0, - "nr3d_y_img_out_format":0, - "nr3d_y_yuv422_pxl_order":0, - "nr3d_y_pixel_width":2, - "nr3d_uv_img_format":0, - "nr3d_uv_yuv_in_format":0, - "nr3d_uv_mig_out_format":0, - "nr3d_uv_yuv422_pxl_order":0, - "nr3d_uv_pixel_width":2, - "nr3d_frame_buf_size":0 - }, - "ldc":{ - "ldc_line_stride":2048, - "ldc_frame_buf_size":2048 - } + "wdr": { + "wdr_mode": 0, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } }, - "isp_core": { + "isp_core": { "itc": { - "hsync_pol":0, - "vsync_pol":0, - "hsync_input_timing":2, - "vsync_input_timing":1, - "flip_ctl" :0, - "video_fmt_sl":0, - "itc_ttl_h" :3476, - "itc_ttl_v" :1166, - "itc_stt_hr" :0, - "itc_stt_vr" :1 + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 2, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 3476, + "itc_ttl_v": 1166, + "itc_stt_hr": 0, + "itc_stt_vr": 1 }, - "tpg": { - "tpg_en":0, - "bayer_mode_sel":3, - "motion_mode_sel":0, - "tpg_sel":9, - "wdr_l_mul_data":0, - "wdr_m_mul_data":0, - "wdr_s_mul_data":0 + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 }, - "blc":{ - "blc_en" :1, - "blc_offset" :240, - "blc_ratio" :272 + "blc": { + "blc_en": 1, + "blc_offset": 240, + "blc_ratio": 272 }, - "lsc":{ - "lsc_en" :1, - "lsc_h_center" :900, - "lsc_v_center" :580, - "lsc_r_ratio" :10, - "lsc_g_ratio":6, - "lsc_b_ratio" :6, - "lsc_ir_ratio" :6 + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 10, + "lsc_g_ratio": 6, + "lsc_b_ratio": 6, + "lsc_ir_ratio": 6 }, - "ae":{ - "ae_as_en" :1, - "ae_ag_en" :1, - "ae_airis_en" :0, - "ae_enter_ls_sel" :0, - "ae_exit_ls_sel" :0, - "ae_win_mode_sel" :0, - "ae_back_light_mode_sel" :0, - "ae_day_change_en" :0, - "ae_day_change_sel" :0, - "ae_win_stth" :0, - "ae_win_sttv" :0, - "ae_win_endh" :1919, - "ae_win_endv" :1079, - "ae_yobj" :90, - "ae_av_rg" :8, - "ae_l_ex_time" :1000, - "ae_m_ex_time" :32, - "ae_s_ex_time" :32, - "ae_agc" :256, - "ae_ad_shuttle_freq" :1, - "ae_ad_gain_freq" :0, - "ae_adjust_step_max":36, - "ae_ex_value_max" :1162, - "ae_ex_value_mid" :256, - "ae_ex_value_min" :1, - "ae_gain_value_max" :2304, - "ae_gain_value_mid" :512, - "ae_gain_value_min" :256, - "ae_dn_switch_ad_step_max" :512, - "ae_dn_switch_wait_time" :255, - "ape_max_diff" :12, - "ape_drv_signal_max" :3840, - "ape_coeff_distance" :0, - "ape_coeff_speed" :0, - "ape_coeff_acceleration" :0, - "ape_drv_manual_value" :4095, - "ape_damp_manual_value" :2048 + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 0, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 8, + "ae_win_sttv": 4, + "ae_win_endh": 1927, + "ae_win_endv": 1083, + "ae_yobj": 90, + "ae_av_rg": 8, + "ae_l_ex_time": 1000, + "ae_m_ex_time": 32, + "ae_s_ex_time": 32, + "ae_agc": 256, + "ae_ad_shuttle_freq": 0, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 1162, + "ae_ex_value_mid": 256, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 }, - "awb":{ - "awb_d65_en" :1, - "awb_ccm_en" :1, - "awb_en" :1, - "awb_mode_sel" :1, - "awb_hist_mode_sel" :0, - "awb_veri_en" :0, - "awb_fb_en" :0, - "awb_value_save_en" :0, - "awb_ccm_adp_adjust_en" :0, - "awb_stab_en" :1, - "awb_d65_red_gain" :466, - "awb_d65_blue_gain" :382, - "ccm_rr" :259, - "ccm_rg" :2, - "ccm_rb" :1, - "ccm_gr" :37, - "ccm_gg" :310, - "ccm_gb" :17, - "ccm_br" :1, - "ccm_bg" :75, - "ccm_bb" :332, - "ccm_correct_coff" :256, - "awb_win_stth" :0, - "awb_win_sttv" :0, - "awb_win_endh" :1919, - "awb_win_endv" :1079, - "awb_correct_diff_th" :8, - "awb_color_changeres_time" :8, - "awb_historgram_th" :4, - "awb_red_gain_adjust" :256, - "awb_green_gain_adjust" :256, - "awb_blue_gain_adjust" :256, - "awb_red_max_value" :259, - "awb_blue_max_value" :388, - "awb_red_min_value" :176, - "awb_blue_min_value" :262, - "awb_red_obj_value" :256, - "awb_blue_obj_value" :256 + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 466, + "awb_d65_blue_gain": 382, + "ccm_rr": 259, + "ccm_rg": 2, + "ccm_rb": 1, + "ccm_gr": 37, + "ccm_gg": 310, + "ccm_gb": 17, + "ccm_br": 1, + "ccm_bg": 75, + "ccm_bb": 332, + "ccm_correct_coff": 256, + "awb_win_stth": 8, + "awb_win_sttv": 4, + "awb_win_endh": 1927, + "awb_win_endv": 1083, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 259, + "awb_blue_max_value": 388, + "awb_red_min_value": 176, + "awb_blue_min_value": 262, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 }, - "wdr":{ - "wdr_fusion_en" :0, - "wdr_frame_sel" :0, - "wdr_adp_adjust_en" :0, - "wdr_stab_en" :0, - "wdr_en" :0, - "wdr_ghost_remove_en" :0, - "wdr_3frame_out_mode" :0, - "wdr_mode_sel" :0, - "wdr_2frame_ex_ratio" :1, - "wdr_3frame_ex_ratio" :1, - "wdr_stat_img_sel" :0, - "wdr_ltm_data_sel" :1, - "wdr_tz_data_sel" :1, - "wdr_remove_purple_en" :0, - "wdr_over_ex_ratio_th1" :384, - "wdr_over_ex_ratio_th2" :32, - "wdr_fusion_ratio_th" :192, - "wdr_fusion_value1" :64, - "wdr_fusion_value2" :16 + "wdr": { + "wdr_fusion_en": 0, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 0, + "wdr_stab_en": 0, + "wdr_en": 0, + "wdr_ghost_remove_en": 0, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 1, + "wdr_stat_img_sel": 0, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 0, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 }, - "csc":{ - "rgb2yuv_00":153, - "rgb2yuv_01":256, - "rgb2yuv_02":86, - "rgb2yuv_10":301, - "rgb2yuv_11":214, - "rgb2yuv_12":170, - "rgb2yuv_20":58, - "rgb2yuv_21":42, - "rgb2yuv_22":256 + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 }, - "ada":{ - "gm_rgb_en" :1, - "gm_yuv_en" :0, - "ada_en" :1, - "ada_sbz_en" :0, - "ada_ccr_en" :0, - "ada_adp_en" :0, - "ada_adp_ccr_en" :0, - "ada_stat_mode_sel" :0, - "ada_enh_mode_sel" :0, - "ada_hist_max" :128, - "ada_ttl_max" :255, - "ada_win_stth" :0, - "ada_win_sttv" :0, - "ada_win_endh" :1919, - "ada_win_endv" :1079 + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 }, - "rgb-ir":{ - "raw_fmt" :0, - "rgbir_rct_en" :0, - "dfc_en" :0, - "rgbir_fs_en" :0, - "rgbir_ot_sl" :0, - "rgbir_fs_max" :256, - "dfc_krb" :0, - "dfc_ky" :0, - "dfc_th" :256, - "dfc_th_1" :256 + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 }, - "2dnr":{ - "dpeak_en" :1, - "nr2d_raw_en" :1, - "nr2d_eg_en" :1, - "nr2d_jl_en" :1, - "nr2d_av_en" :1, - "nr2d_c_en" :1, - "dpeak_adp_en" :1, - "nr2d_raw_adp_en":1, - "nr2d_y_adp_en" :1, - "nr2d_c_adp_en" :1, - "nr2d_raw_kl" :16, - "nr2d_jl_th" :511, - "nr2d_eg_k" :48, - "nr2d_y_k" :64, - "nr2d_c_k" :1 + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 511, + "nr2d_eg_k": 48, + "nr2d_y_k": 64, + "nr2d_c_k": 1 }, - "3dnr":{ - "nr3d_en" :1, - "nr3dp_y_en" :1, - "nr3dp_c_en" :1, - "nr3dm_y_en" :1, - "nr3dm_c_en" :1, - "nr3db_y_en" :1, - "nr3db_c_en" :1, - "nr3dm_nr2d_y_en" :1, - "nr3dm_nr2d_c_en" :1, - "core_3dnr_wb_en" :0, - "core_3dnr_wb_sel" :0, - "core_3dnr_adp_luma_en" :0, - "core_3dnr_adp_chroma_en" :0, - "nr3dp_thy" :64, - "nr3dp_thyp" :64, - "nr3dp_thcp" :64, - "nr3dm_mid_th" :128, - "nr3dm_mtp_th" :8, - "nr3dm_mtc_th" :128, - "nr3dm_ym_k" :60, - "nr3dm_thy" :64, - "nr3dm_min" :0, - "nr3dm_thw0" :128, - "core_3dnr_chroma_intensity" :16, - "nr3db_nr2d_eg_th" :64, - "nr3db_thyp" :64, - "nr3db_thcp" :32 + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 64, + "nr3dp_thyp": 64, + "nr3dp_thcp": 64, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 60, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 }, - "enh":{ - "ltm":{ - "enh_ltm_en" :1, - "enh_adp_ltm_en" :0, - "ltm_gain" :128, - "ltm_mm_th" :128 + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 }, - "sharp":{ - "enh_sharp_en" :1, - "enh_adp_sharp_en" :1, - "shp_core" :8, - "shp_th1" :3840, - "shp_th2" :4095, - "shp_gain" :64 + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 8, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 64 }, - "cc":{ - "enh_cc_en" :0, - "enh_adp_cc_en" :0 - } + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } }, - "post_ctl":{ - "otc_ctl":{ - "otc_en" :0, - "otc_yc_sl" :0, - "otc_uv_sl" :1, - "otc_hs_plt_sl" :0, - "otc_vs_plt_sl" :0, - "otc_stt_vr" :0, - "otc_stt_hr" :0 + "post_ctl": { + "otc_ctl": { + "otc_en": 1, + "otc_yc_sl": 0, + "otc_uv_sl": 0, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 }, - "ctrst":{ - "ctrst_en" :1, - "ctrst_gain":128 + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 }, - "luma":{ - "luma_en" :1, - "luma_gain":128 + "luma": { + "luma_en": 1, + "luma_gain": 128 }, - "strt":{ - "strt_en" :1, - "strt_gain":250 + "strt": { + "strt_en": 1, + "strt_gain": 250 } }, - "ldc":{ - "ldc_en" :0, - "ldc_rct_en" :0, - "ldc_rq_frq" :128, - "ldc_stt_ln" :540, - "ldc_ch" :960, - "ldc_cv" :540, - "ldc_cr" :684, - "ldc_cz" :684 + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 960, + "ldc_cv": 540, + "ldc_cr": 684, + "ldc_cz": 684 }, - "af":{ - "af_stat_en" :1, - "af_stat_mode_sel" :0, - "af_stat_win_h_start":0, - "af_stat_win_v_start":0, - "af_stat_win_h_end" :1919, - "af_stat_win_v_end" :1079 + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 8, + "af_stat_win_v_start": 4, + "af_stat_win_h_end": 1927, + "af_stat_win_v_end": 1083 } }, - "isp_post":{ - "rgb2yuv":{ - "osd_rgb2yuv_coeff00":306, - "osd_rgb2yuv_coeff01":601, - "osd_rgb2yuv_coeff02":117, - "osd_rgb2yuv_coeff03":0, - "osd_rgb2yuv_coeff10":3920, - "osd_rgb2yuv_coeff11":3749, - "osd_rgb2yuv_coeff12":523, - "osd_rgb2yuv_coeff13":128, - "osd_rgb2yuv_coeff20":523, - "osd_rgb2yuv_coeff21":3658, - "osd_rgb2yuv_coeff22":4011, - "osd_rgb2yuv_coeff23":128 + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 }, - "yuv2rgb":{ - "out_yuv2rgb_coeff00":1024, - "out_yuv2rgb_coeff01":0, - "out_yuv2rgb_coeff02":1441, - "out_yuv2rgb_coeff03":3916, - "out_yuv2rgb_coeff10":1024, - "out_yuv2rgb_coeff11":3742, - "out_yuv2rgb_coeff12":3362, - "out_yuv2rgb_coeff13":136, - "out_yuv2rgb_coeff20":1024, - "out_yuv2rgb_coeff21":1822, - "out_yuv2rgb_coeff22":0, - "out_yuv2rgb_coeff23":3868 + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } }, - "ds0":{ - "ds0_out_rgb_mode":0, - "ds0_out_rgb_en":0, - "ds0_out_yuv_mode":0, - "ds0_out_uv_swap":0, - "ds0_osd0":{ - "ds0_osd0_enable":0, - "ds0_osd0_type":0, - "ds0_osd0_alpha_tpye":0, - "ds0_osd0_vst":0, - "ds0_osd0_hst":0, - "ds0_osd0_vend":0, - "ds0_osd0_hend":0, - "ds0_osd0_dma_request_length":0, - "ds0_osd0_dma_map":0, - "ds0_osd0_rgb_rev":0, - "ds0_osd0_global_alpha":0, - "ds0_osd0_swap_64":0, - "ds0_osd0_outstanding_num":0, - "ds0_osd0_bd_limit_en":0 - }, - "ds0_osd1":{ - "ds0_osd1_enable":0, - "ds0_osd1_type":0, - "ds0_osd1_alpha_tpye":0, - "ds0_osd1_vst":0, - "ds0_osd1_hst":0, - "ds0_osd1_vend":0, - "ds0_osd1_hend":0, - "ds0_osd1_dma_request_length":0, - "ds0_osd1_dma_map":0, - "ds0_osd1_rgb_rev":0, - "ds0_osd1_global_alpha":0, - "ds0_osd1_swap_64":0, - "ds0_osd1_outstanding_num":0, - "ds0_osd1_bd_limit_en":0 - }, - "ds0_osd2":{ - "ds0_osd2_enable":0, - "ds0_osd2_type":0, - "ds0_osd2_alpha_tpye":0, - "ds0_osd2_vst":0, - "ds0_osd2_hst":0, - "ds0_osd2_vend":0, - "ds0_osd2_hend":0, - "ds0_osd2_dma_request_length":0, - "ds0_osd2_dma_map":0, - "ds0_osd2_rgb_rev":0, - "ds0_osd2_global_alpha":0, - "ds0_osd2_swap_64":0, - "ds0_osd2_outstanding_num":0, - "ds0_osd2_bd_limit_en":0 - } - }, - "ds1":{ - "ds1_out_rgb_mode":0, - "ds1_out_rgb_en":0, - "ds1_out_yuv_mode":0, - "ds1_out_uv_swap":0, - "ds1_osd0":{ - "ds1_osd0_enable":0, - "ds1_osd0_type":0, - "ds1_osd0_alpha_tpye":0, - "ds1_osd0_vst":0, - "ds1_osd0_hst":0, - "ds1_osd0_vend":0, - "ds1_osd0_hend":0, - "ds1_osd0_dma_request_length":0, - "ds1_osd0_dma_map":0, - "ds1_osd0_rgb_rev":0, - "ds1_osd0_global_alpha":0, - "ds1_osd0_swap_64":0, - "ds1_osd0_outstanding_num":0, - "ds1_osd0_bd_limit_en":0 - }, - "ds1_osd1":{ - "ds1_osd1_enable":0, - "ds1_osd1_type":0, - "ds1_osd1_alpha_tpye":0, - "ds1_osd1_vst":0, - "ds1_osd1_hst":0, - "ds1_osd1_vend":0, - "ds1_osd1_hend":0, - "ds1_osd1_dma_request_length":0, - "ds1_osd1_dma_map":0, - "ds1_osd1_rgb_rev":0, - "ds1_osd1_global_alpha":0, - "ds1_osd1_swap_64":0, - "ds1_osd1_outstanding_num":0, - "ds1_osd1_bd_limit_en":0 - }, - "ds1_osd2":{ - "ds1_osd2_enable":0, - "ds1_osd2_type":0, - "ds1_osd2_alpha_tpye":0, - "ds1_osd2_vst":0, - "ds1_osd2_hst":0, - "ds1_osd2_vend":0, - "ds1_osd2_hend":0, - "ds1_osd2_dma_request_length":0, - "ds1_osd2_dma_map":0, - "ds1_osd2_rgb_rev":0, - "ds1_osd2_global_alpha":0, - "ds1_osd2_swap_64":0, - "ds1_osd2_outstanding_num":0, - "ds1_osd2_bd_limit_en":0 - } - }, - "ds2":{ - "ds2_out_rgb_mode":0, - "ds2_out_rgb_en":1, - "ds2_out_yuv_mode":0, - "ds2_out_uv_swap":0, - "ds2_osd0":{ - "ds2_osd0_enable":0, - "ds2_osd0_type":0, - "ds2_osd0_alpha_tpye":0, - "ds2_osd0_vst":0, - "ds2_osd0_hst":0, - "ds2_osd0_vend":0, - "ds2_osd0_hend":0, - "ds2_osd0_dma_request_length":0, - "ds2_osd0_dma_map":0, - "ds2_osd0_rgb_rev":0, - "ds2_osd0_global_alpha":0, - "ds2_osd0_swap_64":0, - "ds2_osd0_outstanding_num":0, - "ds2_osd0_bd_limit_en":0 - }, - "ds2_osd1":{ - "ds2_osd1_enable":0, - "ds2_osd1_type":0, - "ds2_osd1_alpha_tpye":0, - "ds2_osd1_vst":0, - "ds2_osd1_hst":0, - "ds2_osd1_vend":0, - "ds2_osd1_hend":0, - "ds2_osd1_dma_request_length":0, - "ds2_osd1_dma_map":0, - "ds2_osd1_rgb_rev":0, - "ds2_osd1_global_alpha":0, - "ds2_osd1_swap_64":0, - "ds2_osd1_outstanding_num":0, - "ds2_osd1_bd_limit_en":0 - } - } + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } } -} \ No newline at end of file +} diff --git a/package/mediactl_lib/src/config/imx219_1080x1920_0.conf b/package/mediactl_lib/src/config/imx219_1080x1920_0.conf index 72a92ba..7a46fb2 100644 --- a/package/mediactl_lib/src/config/imx219_1080x1920_0.conf +++ b/package/mediactl_lib/src/config/imx219_1080x1920_0.conf @@ -1,531 +1,531 @@ -{ - "isp_general":{ - "isp_out_sel":0, - "dvp_ch_mode":1, - "hist_3a_out_en":0, - "main_out":{ - "out_img_format":1, - "out_yuv_in_format":0, - "out_yuv422_pxl_order":0, - "out_pxl_width":0, - "out_frame_buf_size":2048 - }, - "out0":{ - "ds0_out_img_format":1, - "ds0_out_yuv_in_format":0, - "ds0_out_yuv422_pxl_order":0, - "ds0_out_pxl_width":0, - "ds0_frame_buf_size":2048 - }, - "out1":{ - "ds1_out_img_format":1, - "ds1_out_yuv_in_format":0, - "ds1_out_yuv422_pxl_order":0, - "ds1_out_pxl_width":0, - "ds1_frame_buf_size":2048 - }, - "out2":{ - "ds2_out_img_format":0, - "ds2_out_yuv_in_format":0, - "ds2_out_yuv422_pxl_order":0, - "ds2_out_pxl_width":0, - "ds2_frame_buf_size":2048 - }, - "wdr":{ - "wdr_mode":0, - "wdr_long_ch_mode":0, - "wdr_long_l2_buf_en":0, - "wdr_short_s1_buf_en":0, - "wdr_dynamic_switch_en":0, - "wdr_long_l2_buf_depth":0, - "wdr_long_img_format":0, - "wdr_long_yuv_in_format":0, - "wdr_long_img_out_format":0, - "wdr_long_yuv422_pxl_order":0, - "wdr_long_pixel_width":2, - "wdr_buf_base":0, - "wdr_line_stride":0, - "wdr_frame_buf_size":0 - }, - "nr3d":{ - "nr3d_en":0, - "nr3d_fbcd_en":0, - "nr3d_mv_out_en":0, - "nr3d_y_img_format":0, - "nr3d_y_yuv_in_format":0, - "nr3d_y_img_out_format":0, - "nr3d_y_yuv422_pxl_order":0, - "nr3d_y_pixel_width":2, - "nr3d_uv_img_format":0, - "nr3d_uv_yuv_in_format":0, - "nr3d_uv_mig_out_format":0, - "nr3d_uv_yuv422_pxl_order":0, - "nr3d_uv_pixel_width":2, - "nr3d_frame_buf_size":0 - }, - "ldc":{ - "ldc_line_stride":2048, - "ldc_frame_buf_size":2048 - } - }, - "isp_core": { - "itc": { - "hsync_pol":0, - "vsync_pol":0, - "hsync_input_timing":2, - "vsync_input_timing":1, - "flip_ctl" :0, - "video_fmt_sl":0, - "itc_ttl_h" :3453, - "itc_ttl_v" :1979, - "itc_stt_hr" :0, - "itc_stt_vr" :1 - }, - "tpg": { - "tpg_en":0, - "bayer_mode_sel":3, - "motion_mode_sel":0, - "tpg_sel":9, - "wdr_l_mul_data":0, - "wdr_m_mul_data":0, - "wdr_s_mul_data":0 - }, - "blc":{ - "blc_en" :1, - "blc_offset" :240, - "blc_ratio" :272 - }, - "lsc":{ - "lsc_en" :1, - "lsc_h_center" :480, - "lsc_v_center" :1000, - "lsc_r_ratio" :10, - "lsc_g_ratio":6, - "lsc_b_ratio" :6, - "lsc_ir_ratio" :6 - }, - "ae":{ - "ae_as_en" :1, - "ae_ag_en" :1, - "ae_airis_en" :0, - "ae_enter_ls_sel" :0, - "ae_exit_ls_sel" :0, - "ae_win_mode_sel" :0, - "ae_back_light_mode_sel" :0, - "ae_day_change_en" :0, - "ae_day_change_sel" :0, - "ae_win_stth" :0, - "ae_win_sttv" :0, - "ae_win_endh" :1079, - "ae_win_endv" :1919, - "ae_yobj" :90, - "ae_av_rg" :8, - "ae_l_ex_time" :1000, - "ae_m_ex_time" :32, - "ae_s_ex_time" :32, - "ae_agc" :256, - "ae_ad_shuttle_freq" :1, - "ae_ad_gain_freq" :0, - "ae_adjust_step_max":36, - "ae_ex_value_max" :1975, - "ae_ex_value_mid" :256, - "ae_ex_value_min" :1, - "ae_gain_value_max" :2304, - "ae_gain_value_mid" :512, - "ae_gain_value_min" :256, - "ae_dn_switch_ad_step_max" :1000, - "ae_dn_switch_wait_time" :255, - "ape_max_diff" :12, - "ape_drv_signal_max" :3840, - "ape_coeff_distance" :0, - "ape_coeff_speed" :0, - "ape_coeff_acceleration" :0, - "ape_drv_manual_value" :4095, - "ape_damp_manual_value" :2048 - }, - "awb":{ - "awb_d65_en" :1, - "awb_ccm_en" :1, - "awb_en" :1, - "awb_mode_sel" :1, - "awb_hist_mode_sel" :0, - "awb_veri_en" :0, - "awb_fb_en" :0, - "awb_value_save_en" :0, - "awb_ccm_adp_adjust_en" :0, - "awb_stab_en" :1, - "awb_d65_red_gain" :466, - "awb_d65_blue_gain" :382, - "ccm_rr" :259, - "ccm_rg" :2, - "ccm_rb" :1, - "ccm_gr" :37, - "ccm_gg" :310, - "ccm_gb" :17, - "ccm_br" :1, - "ccm_bg" :75, - "ccm_bb" :332, - "ccm_correct_coff" :256, - "awb_win_stth" :0, - "awb_win_sttv" :0, - "awb_win_endh" :1079, - "awb_win_endv" :1919, - "awb_correct_diff_th" :8, - "awb_color_changeres_time" :8, - "awb_historgram_th" :4, - "awb_red_gain_adjust" :256, - "awb_green_gain_adjust" :256, - "awb_blue_gain_adjust" :256, - "awb_red_max_value" :259, - "awb_blue_max_value" :388, - "awb_red_min_value" :176, - "awb_blue_min_value" :262, - "awb_red_obj_value" :256, - "awb_blue_obj_value" :256 - }, - "wdr":{ - "wdr_fusion_en" :0, - "wdr_frame_sel" :0, - "wdr_adp_adjust_en" :0, - "wdr_stab_en" :0, - "wdr_en" :0, - "wdr_ghost_remove_en" :0, - "wdr_3frame_out_mode" :0, - "wdr_mode_sel" :0, - "wdr_2frame_ex_ratio" :1, - "wdr_3frame_ex_ratio" :1, - "wdr_stat_img_sel" :0, - "wdr_ltm_data_sel" :1, - "wdr_tz_data_sel" :1, - "wdr_remove_purple_en" :0, - "wdr_over_ex_ratio_th1" :384, - "wdr_over_ex_ratio_th2" :32, - "wdr_fusion_ratio_th" :192, - "wdr_fusion_value1" :64, - "wdr_fusion_value2" :16 - }, - "csc":{ - "rgb2yuv_00":153, - "rgb2yuv_01":256, - "rgb2yuv_02":86, - "rgb2yuv_10":301, - "rgb2yuv_11":214, - "rgb2yuv_12":170, - "rgb2yuv_20":58, - "rgb2yuv_21":42, - "rgb2yuv_22":256 - }, - "ada":{ - "gm_rgb_en" :1, - "gm_yuv_en" :0, - "ada_en" :1, - "ada_sbz_en" :0, - "ada_ccr_en" :0, - "ada_adp_en" :0, - "ada_adp_ccr_en" :0, - "ada_stat_mode_sel" :0, - "ada_enh_mode_sel" :0, - "ada_hist_max" :128, - "ada_ttl_max" :255, - "ada_win_stth" :0, - "ada_win_sttv" :0, - "ada_win_endh" :1079, - "ada_win_endv" :1919 - }, - "rgb-ir":{ - "raw_fmt" :0, - "rgbir_rct_en" :0, - "dfc_en" :0, - "rgbir_fs_en" :0, - "rgbir_ot_sl" :0, - "rgbir_fs_max" :256, - "dfc_krb" :0, - "dfc_ky" :0, - "dfc_th" :256, - "dfc_th_1" :256 - }, - "2dnr":{ - "dpeak_en" :1, - "nr2d_raw_en" :1, - "nr2d_eg_en" :1, - "nr2d_jl_en" :1, - "nr2d_av_en" :1, - "nr2d_c_en" :1, - "dpeak_adp_en" :1, - "nr2d_raw_adp_en":1, - "nr2d_y_adp_en" :1, - "nr2d_c_adp_en" :1, - "nr2d_raw_kl" :16, - "nr2d_jl_th" :511, - "nr2d_eg_k" :48, - "nr2d_y_k" :64, - "nr2d_c_k" :1 - }, - "3dnr":{ - "nr3d_en" :1, - "nr3dp_y_en" :1, - "nr3dp_c_en" :1, - "nr3dm_y_en" :1, - "nr3dm_c_en" :1, - "nr3db_y_en" :1, - "nr3db_c_en" :1, - "nr3dm_nr2d_y_en" :1, - "nr3dm_nr2d_c_en" :1, - "core_3dnr_wb_en" :0, - "core_3dnr_wb_sel" :0, - "core_3dnr_adp_luma_en" :0, - "core_3dnr_adp_chroma_en" :0, - "nr3dp_thy" :64, - "nr3dp_thyp" :64, - "nr3dp_thcp" :64, - "nr3dm_mid_th" :128, - "nr3dm_mtp_th" :8, - "nr3dm_mtc_th" :128, - "nr3dm_ym_k" :60, - "nr3dm_thy" :64, - "nr3dm_min" :0, - "nr3dm_thw0" :128, - "core_3dnr_chroma_intensity" :16, - "nr3db_nr2d_eg_th" :64, - "nr3db_thyp" :64, - "nr3db_thcp" :32 - }, - "enh":{ - "ltm":{ - "enh_ltm_en" :1, - "enh_adp_ltm_en" :0, - "ltm_gain" :128, - "ltm_mm_th" :128 - }, - "sharp":{ - "enh_sharp_en" :1, - "enh_adp_sharp_en" :1, - "shp_core" :8, - "shp_th1" :3840, - "shp_th2" :4095, - "shp_gain" :64 - }, - "cc":{ - "enh_cc_en" :0, - "enh_adp_cc_en" :0 - } - }, - "post_ctl":{ - "otc_ctl":{ - "otc_en" :0, - "otc_yc_sl" :0, - "otc_uv_sl" :1, - "otc_hs_plt_sl" :0, - "otc_vs_plt_sl" :0, - "otc_stt_vr" :0, - "otc_stt_hr" :0 - }, - "ctrst":{ - "ctrst_en" :1, - "ctrst_gain":128 - }, - "luma":{ - "luma_en" :1, - "luma_gain":128 - }, - "strt":{ - "strt_en" :1, - "strt_gain":250 - } - }, - "ldc":{ - "ldc_en" :0, - "ldc_rct_en" :0, - "ldc_rq_frq" :128, - "ldc_stt_ln" :540, - "ldc_ch" :480, - "ldc_cv" :1000, - "ldc_cr" :684, - "ldc_cz" :684 - }, - "af":{ - "af_stat_en" :1, - "af_stat_mode_sel" :0, - "af_stat_win_h_start":0, - "af_stat_win_v_start":0, - "af_stat_win_h_end" :1079, - "af_stat_win_v_end" :1919 - } - }, - "isp_post":{ - "rgb2yuv":{ - "osd_rgb2yuv_coeff00":306, - "osd_rgb2yuv_coeff01":601, - "osd_rgb2yuv_coeff02":117, - "osd_rgb2yuv_coeff03":0, - "osd_rgb2yuv_coeff10":3920, - "osd_rgb2yuv_coeff11":3749, - "osd_rgb2yuv_coeff12":523, - "osd_rgb2yuv_coeff13":128, - "osd_rgb2yuv_coeff20":523, - "osd_rgb2yuv_coeff21":3658, - "osd_rgb2yuv_coeff22":4011, - "osd_rgb2yuv_coeff23":128 - }, - "yuv2rgb":{ - "out_yuv2rgb_coeff00":1024, - "out_yuv2rgb_coeff01":0, - "out_yuv2rgb_coeff02":1441, - "out_yuv2rgb_coeff03":3916, - "out_yuv2rgb_coeff10":1024, - "out_yuv2rgb_coeff11":3742, - "out_yuv2rgb_coeff12":3362, - "out_yuv2rgb_coeff13":136, - "out_yuv2rgb_coeff20":1024, - "out_yuv2rgb_coeff21":1822, - "out_yuv2rgb_coeff22":0, - "out_yuv2rgb_coeff23":3868 - }, - "ds0":{ - "ds0_out_rgb_mode":0, - "ds0_out_rgb_en":0, - "ds0_out_yuv_mode":0, - "ds0_out_uv_swap":0, - "ds0_osd0":{ - "ds0_osd0_enable":0, - "ds0_osd0_type":0, - "ds0_osd0_alpha_tpye":0, - "ds0_osd0_vst":0, - "ds0_osd0_hst":0, - "ds0_osd0_vend":0, - "ds0_osd0_hend":0, - "ds0_osd0_dma_request_length":0, - "ds0_osd0_dma_map":0, - "ds0_osd0_rgb_rev":0, - "ds0_osd0_global_alpha":0, - "ds0_osd0_swap_64":0, - "ds0_osd0_outstanding_num":0, - "ds0_osd0_bd_limit_en":0 - }, - "ds0_osd1":{ - "ds0_osd1_enable":0, - "ds0_osd1_type":0, - "ds0_osd1_alpha_tpye":0, - "ds0_osd1_vst":0, - "ds0_osd1_hst":0, - "ds0_osd1_vend":0, - "ds0_osd1_hend":0, - "ds0_osd1_dma_request_length":0, - "ds0_osd1_dma_map":0, - "ds0_osd1_rgb_rev":0, - "ds0_osd1_global_alpha":0, - "ds0_osd1_swap_64":0, - "ds0_osd1_outstanding_num":0, - "ds0_osd1_bd_limit_en":0 - }, - "ds0_osd2":{ - "ds0_osd2_enable":0, - "ds0_osd2_type":0, - "ds0_osd2_alpha_tpye":0, - "ds0_osd2_vst":0, - "ds0_osd2_hst":0, - "ds0_osd2_vend":0, - "ds0_osd2_hend":0, - "ds0_osd2_dma_request_length":0, - "ds0_osd2_dma_map":0, - "ds0_osd2_rgb_rev":0, - "ds0_osd2_global_alpha":0, - "ds0_osd2_swap_64":0, - "ds0_osd2_outstanding_num":0, - "ds0_osd2_bd_limit_en":0 - } - }, - "ds1":{ - "ds1_out_rgb_mode":0, - "ds1_out_rgb_en":0, - "ds1_out_yuv_mode":0, - "ds1_out_uv_swap":0, - "ds1_osd0":{ - "ds1_osd0_enable":0, - "ds1_osd0_type":0, - "ds1_osd0_alpha_tpye":0, - "ds1_osd0_vst":0, - "ds1_osd0_hst":0, - "ds1_osd0_vend":0, - "ds1_osd0_hend":0, - "ds1_osd0_dma_request_length":0, - "ds1_osd0_dma_map":0, - "ds1_osd0_rgb_rev":0, - "ds1_osd0_global_alpha":0, - "ds1_osd0_swap_64":0, - "ds1_osd0_outstanding_num":0, - "ds1_osd0_bd_limit_en":0 - }, - "ds1_osd1":{ - "ds1_osd1_enable":0, - "ds1_osd1_type":0, - "ds1_osd1_alpha_tpye":0, - "ds1_osd1_vst":0, - "ds1_osd1_hst":0, - "ds1_osd1_vend":0, - "ds1_osd1_hend":0, - "ds1_osd1_dma_request_length":0, - "ds1_osd1_dma_map":0, - "ds1_osd1_rgb_rev":0, - "ds1_osd1_global_alpha":0, - "ds1_osd1_swap_64":0, - "ds1_osd1_outstanding_num":0, - "ds1_osd1_bd_limit_en":0 - }, - "ds1_osd2":{ - "ds1_osd2_enable":0, - "ds1_osd2_type":0, - "ds1_osd2_alpha_tpye":0, - "ds1_osd2_vst":0, - "ds1_osd2_hst":0, - "ds1_osd2_vend":0, - "ds1_osd2_hend":0, - "ds1_osd2_dma_request_length":0, - "ds1_osd2_dma_map":0, - "ds1_osd2_rgb_rev":0, - "ds1_osd2_global_alpha":0, - "ds1_osd2_swap_64":0, - "ds1_osd2_outstanding_num":0, - "ds1_osd2_bd_limit_en":0 - } - }, - "ds2":{ - "ds2_out_rgb_mode":0, - "ds2_out_rgb_en":1, - "ds2_out_yuv_mode":0, - "ds2_out_uv_swap":0, - "ds2_osd0":{ - "ds2_osd0_enable":0, - "ds2_osd0_type":0, - "ds2_osd0_alpha_tpye":0, - "ds2_osd0_vst":0, - "ds2_osd0_hst":0, - "ds2_osd0_vend":0, - "ds2_osd0_hend":0, - "ds2_osd0_dma_request_length":0, - "ds2_osd0_dma_map":0, - "ds2_osd0_rgb_rev":0, - "ds2_osd0_global_alpha":0, - "ds2_osd0_swap_64":0, - "ds2_osd0_outstanding_num":0, - "ds2_osd0_bd_limit_en":0 - }, - "ds2_osd1":{ - "ds2_osd1_enable":0, - "ds2_osd1_type":0, - "ds2_osd1_alpha_tpye":0, - "ds2_osd1_vst":0, - "ds2_osd1_hst":0, - "ds2_osd1_vend":0, - "ds2_osd1_hend":0, - "ds2_osd1_dma_request_length":0, - "ds2_osd1_dma_map":0, - "ds2_osd1_rgb_rev":0, - "ds2_osd1_global_alpha":0, - "ds2_osd1_swap_64":0, - "ds2_osd1_outstanding_num":0, - "ds2_osd1_bd_limit_en":0 - } - } - } -} \ No newline at end of file +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 0, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 2, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 3453, + "itc_ttl_v": 1977, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 240, + "blc_ratio": 272 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 480, + "lsc_v_center": 1000, + "lsc_r_ratio": 10, + "lsc_g_ratio": 6, + "lsc_b_ratio": 6, + "lsc_ir_ratio": 6 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 0, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 4, + "ae_win_sttv": 4, + "ae_win_endh": 1083, + "ae_win_endv": 1923, + "ae_yobj": 90, + "ae_av_rg": 8, + "ae_l_ex_time": 1000, + "ae_m_ex_time": 32, + "ae_s_ex_time": 32, + "ae_agc": 256, + "ae_ad_shuttle_freq": 0, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 1973, + "ae_ex_value_mid": 256, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 1000, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 466, + "awb_d65_blue_gain": 382, + "ccm_rr": 259, + "ccm_rg": 2, + "ccm_rb": 1, + "ccm_gr": 37, + "ccm_gg": 310, + "ccm_gb": 17, + "ccm_br": 1, + "ccm_bg": 75, + "ccm_bb": 332, + "ccm_correct_coff": 256, + "awb_win_stth": 4, + "awb_win_sttv": 4, + "awb_win_endh": 1083, + "awb_win_endv": 1923, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 259, + "awb_blue_max_value": 388, + "awb_red_min_value": 176, + "awb_blue_min_value": 262, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 0, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 0, + "wdr_stab_en": 0, + "wdr_en": 0, + "wdr_ghost_remove_en": 0, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 1, + "wdr_stat_img_sel": 0, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 0, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1079, + "ada_win_endv": 1919 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 511, + "nr2d_eg_k": 48, + "nr2d_y_k": 64, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 64, + "nr3dp_thyp": 64, + "nr3dp_thcp": 64, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 60, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 8, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 64 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 1, + "otc_yc_sl": 0, + "otc_uv_sl": 0, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 250 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 480, + "ldc_cv": 1000, + "ldc_cr": 684, + "ldc_cz": 684 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 4, + "af_stat_win_v_start": 4, + "af_stat_win_h_end": 1083, + "af_stat_win_v_end": 1923 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/mediactl_lib/src/config/imx219_1080x1920_1.conf b/package/mediactl_lib/src/config/imx219_1080x1920_1.conf index 72a92ba..7a46fb2 100644 --- a/package/mediactl_lib/src/config/imx219_1080x1920_1.conf +++ b/package/mediactl_lib/src/config/imx219_1080x1920_1.conf @@ -1,531 +1,531 @@ -{ - "isp_general":{ - "isp_out_sel":0, - "dvp_ch_mode":1, - "hist_3a_out_en":0, - "main_out":{ - "out_img_format":1, - "out_yuv_in_format":0, - "out_yuv422_pxl_order":0, - "out_pxl_width":0, - "out_frame_buf_size":2048 - }, - "out0":{ - "ds0_out_img_format":1, - "ds0_out_yuv_in_format":0, - "ds0_out_yuv422_pxl_order":0, - "ds0_out_pxl_width":0, - "ds0_frame_buf_size":2048 - }, - "out1":{ - "ds1_out_img_format":1, - "ds1_out_yuv_in_format":0, - "ds1_out_yuv422_pxl_order":0, - "ds1_out_pxl_width":0, - "ds1_frame_buf_size":2048 - }, - "out2":{ - "ds2_out_img_format":0, - "ds2_out_yuv_in_format":0, - "ds2_out_yuv422_pxl_order":0, - "ds2_out_pxl_width":0, - "ds2_frame_buf_size":2048 - }, - "wdr":{ - "wdr_mode":0, - "wdr_long_ch_mode":0, - "wdr_long_l2_buf_en":0, - "wdr_short_s1_buf_en":0, - "wdr_dynamic_switch_en":0, - "wdr_long_l2_buf_depth":0, - "wdr_long_img_format":0, - "wdr_long_yuv_in_format":0, - "wdr_long_img_out_format":0, - "wdr_long_yuv422_pxl_order":0, - "wdr_long_pixel_width":2, - "wdr_buf_base":0, - "wdr_line_stride":0, - "wdr_frame_buf_size":0 - }, - "nr3d":{ - "nr3d_en":0, - "nr3d_fbcd_en":0, - "nr3d_mv_out_en":0, - "nr3d_y_img_format":0, - "nr3d_y_yuv_in_format":0, - "nr3d_y_img_out_format":0, - "nr3d_y_yuv422_pxl_order":0, - "nr3d_y_pixel_width":2, - "nr3d_uv_img_format":0, - "nr3d_uv_yuv_in_format":0, - "nr3d_uv_mig_out_format":0, - "nr3d_uv_yuv422_pxl_order":0, - "nr3d_uv_pixel_width":2, - "nr3d_frame_buf_size":0 - }, - "ldc":{ - "ldc_line_stride":2048, - "ldc_frame_buf_size":2048 - } - }, - "isp_core": { - "itc": { - "hsync_pol":0, - "vsync_pol":0, - "hsync_input_timing":2, - "vsync_input_timing":1, - "flip_ctl" :0, - "video_fmt_sl":0, - "itc_ttl_h" :3453, - "itc_ttl_v" :1979, - "itc_stt_hr" :0, - "itc_stt_vr" :1 - }, - "tpg": { - "tpg_en":0, - "bayer_mode_sel":3, - "motion_mode_sel":0, - "tpg_sel":9, - "wdr_l_mul_data":0, - "wdr_m_mul_data":0, - "wdr_s_mul_data":0 - }, - "blc":{ - "blc_en" :1, - "blc_offset" :240, - "blc_ratio" :272 - }, - "lsc":{ - "lsc_en" :1, - "lsc_h_center" :480, - "lsc_v_center" :1000, - "lsc_r_ratio" :10, - "lsc_g_ratio":6, - "lsc_b_ratio" :6, - "lsc_ir_ratio" :6 - }, - "ae":{ - "ae_as_en" :1, - "ae_ag_en" :1, - "ae_airis_en" :0, - "ae_enter_ls_sel" :0, - "ae_exit_ls_sel" :0, - "ae_win_mode_sel" :0, - "ae_back_light_mode_sel" :0, - "ae_day_change_en" :0, - "ae_day_change_sel" :0, - "ae_win_stth" :0, - "ae_win_sttv" :0, - "ae_win_endh" :1079, - "ae_win_endv" :1919, - "ae_yobj" :90, - "ae_av_rg" :8, - "ae_l_ex_time" :1000, - "ae_m_ex_time" :32, - "ae_s_ex_time" :32, - "ae_agc" :256, - "ae_ad_shuttle_freq" :1, - "ae_ad_gain_freq" :0, - "ae_adjust_step_max":36, - "ae_ex_value_max" :1975, - "ae_ex_value_mid" :256, - "ae_ex_value_min" :1, - "ae_gain_value_max" :2304, - "ae_gain_value_mid" :512, - "ae_gain_value_min" :256, - "ae_dn_switch_ad_step_max" :1000, - "ae_dn_switch_wait_time" :255, - "ape_max_diff" :12, - "ape_drv_signal_max" :3840, - "ape_coeff_distance" :0, - "ape_coeff_speed" :0, - "ape_coeff_acceleration" :0, - "ape_drv_manual_value" :4095, - "ape_damp_manual_value" :2048 - }, - "awb":{ - "awb_d65_en" :1, - "awb_ccm_en" :1, - "awb_en" :1, - "awb_mode_sel" :1, - "awb_hist_mode_sel" :0, - "awb_veri_en" :0, - "awb_fb_en" :0, - "awb_value_save_en" :0, - "awb_ccm_adp_adjust_en" :0, - "awb_stab_en" :1, - "awb_d65_red_gain" :466, - "awb_d65_blue_gain" :382, - "ccm_rr" :259, - "ccm_rg" :2, - "ccm_rb" :1, - "ccm_gr" :37, - "ccm_gg" :310, - "ccm_gb" :17, - "ccm_br" :1, - "ccm_bg" :75, - "ccm_bb" :332, - "ccm_correct_coff" :256, - "awb_win_stth" :0, - "awb_win_sttv" :0, - "awb_win_endh" :1079, - "awb_win_endv" :1919, - "awb_correct_diff_th" :8, - "awb_color_changeres_time" :8, - "awb_historgram_th" :4, - "awb_red_gain_adjust" :256, - "awb_green_gain_adjust" :256, - "awb_blue_gain_adjust" :256, - "awb_red_max_value" :259, - "awb_blue_max_value" :388, - "awb_red_min_value" :176, - "awb_blue_min_value" :262, - "awb_red_obj_value" :256, - "awb_blue_obj_value" :256 - }, - "wdr":{ - "wdr_fusion_en" :0, - "wdr_frame_sel" :0, - "wdr_adp_adjust_en" :0, - "wdr_stab_en" :0, - "wdr_en" :0, - "wdr_ghost_remove_en" :0, - "wdr_3frame_out_mode" :0, - "wdr_mode_sel" :0, - "wdr_2frame_ex_ratio" :1, - "wdr_3frame_ex_ratio" :1, - "wdr_stat_img_sel" :0, - "wdr_ltm_data_sel" :1, - "wdr_tz_data_sel" :1, - "wdr_remove_purple_en" :0, - "wdr_over_ex_ratio_th1" :384, - "wdr_over_ex_ratio_th2" :32, - "wdr_fusion_ratio_th" :192, - "wdr_fusion_value1" :64, - "wdr_fusion_value2" :16 - }, - "csc":{ - "rgb2yuv_00":153, - "rgb2yuv_01":256, - "rgb2yuv_02":86, - "rgb2yuv_10":301, - "rgb2yuv_11":214, - "rgb2yuv_12":170, - "rgb2yuv_20":58, - "rgb2yuv_21":42, - "rgb2yuv_22":256 - }, - "ada":{ - "gm_rgb_en" :1, - "gm_yuv_en" :0, - "ada_en" :1, - "ada_sbz_en" :0, - "ada_ccr_en" :0, - "ada_adp_en" :0, - "ada_adp_ccr_en" :0, - "ada_stat_mode_sel" :0, - "ada_enh_mode_sel" :0, - "ada_hist_max" :128, - "ada_ttl_max" :255, - "ada_win_stth" :0, - "ada_win_sttv" :0, - "ada_win_endh" :1079, - "ada_win_endv" :1919 - }, - "rgb-ir":{ - "raw_fmt" :0, - "rgbir_rct_en" :0, - "dfc_en" :0, - "rgbir_fs_en" :0, - "rgbir_ot_sl" :0, - "rgbir_fs_max" :256, - "dfc_krb" :0, - "dfc_ky" :0, - "dfc_th" :256, - "dfc_th_1" :256 - }, - "2dnr":{ - "dpeak_en" :1, - "nr2d_raw_en" :1, - "nr2d_eg_en" :1, - "nr2d_jl_en" :1, - "nr2d_av_en" :1, - "nr2d_c_en" :1, - "dpeak_adp_en" :1, - "nr2d_raw_adp_en":1, - "nr2d_y_adp_en" :1, - "nr2d_c_adp_en" :1, - "nr2d_raw_kl" :16, - "nr2d_jl_th" :511, - "nr2d_eg_k" :48, - "nr2d_y_k" :64, - "nr2d_c_k" :1 - }, - "3dnr":{ - "nr3d_en" :1, - "nr3dp_y_en" :1, - "nr3dp_c_en" :1, - "nr3dm_y_en" :1, - "nr3dm_c_en" :1, - "nr3db_y_en" :1, - "nr3db_c_en" :1, - "nr3dm_nr2d_y_en" :1, - "nr3dm_nr2d_c_en" :1, - "core_3dnr_wb_en" :0, - "core_3dnr_wb_sel" :0, - "core_3dnr_adp_luma_en" :0, - "core_3dnr_adp_chroma_en" :0, - "nr3dp_thy" :64, - "nr3dp_thyp" :64, - "nr3dp_thcp" :64, - "nr3dm_mid_th" :128, - "nr3dm_mtp_th" :8, - "nr3dm_mtc_th" :128, - "nr3dm_ym_k" :60, - "nr3dm_thy" :64, - "nr3dm_min" :0, - "nr3dm_thw0" :128, - "core_3dnr_chroma_intensity" :16, - "nr3db_nr2d_eg_th" :64, - "nr3db_thyp" :64, - "nr3db_thcp" :32 - }, - "enh":{ - "ltm":{ - "enh_ltm_en" :1, - "enh_adp_ltm_en" :0, - "ltm_gain" :128, - "ltm_mm_th" :128 - }, - "sharp":{ - "enh_sharp_en" :1, - "enh_adp_sharp_en" :1, - "shp_core" :8, - "shp_th1" :3840, - "shp_th2" :4095, - "shp_gain" :64 - }, - "cc":{ - "enh_cc_en" :0, - "enh_adp_cc_en" :0 - } - }, - "post_ctl":{ - "otc_ctl":{ - "otc_en" :0, - "otc_yc_sl" :0, - "otc_uv_sl" :1, - "otc_hs_plt_sl" :0, - "otc_vs_plt_sl" :0, - "otc_stt_vr" :0, - "otc_stt_hr" :0 - }, - "ctrst":{ - "ctrst_en" :1, - "ctrst_gain":128 - }, - "luma":{ - "luma_en" :1, - "luma_gain":128 - }, - "strt":{ - "strt_en" :1, - "strt_gain":250 - } - }, - "ldc":{ - "ldc_en" :0, - "ldc_rct_en" :0, - "ldc_rq_frq" :128, - "ldc_stt_ln" :540, - "ldc_ch" :480, - "ldc_cv" :1000, - "ldc_cr" :684, - "ldc_cz" :684 - }, - "af":{ - "af_stat_en" :1, - "af_stat_mode_sel" :0, - "af_stat_win_h_start":0, - "af_stat_win_v_start":0, - "af_stat_win_h_end" :1079, - "af_stat_win_v_end" :1919 - } - }, - "isp_post":{ - "rgb2yuv":{ - "osd_rgb2yuv_coeff00":306, - "osd_rgb2yuv_coeff01":601, - "osd_rgb2yuv_coeff02":117, - "osd_rgb2yuv_coeff03":0, - "osd_rgb2yuv_coeff10":3920, - "osd_rgb2yuv_coeff11":3749, - "osd_rgb2yuv_coeff12":523, - "osd_rgb2yuv_coeff13":128, - "osd_rgb2yuv_coeff20":523, - "osd_rgb2yuv_coeff21":3658, - "osd_rgb2yuv_coeff22":4011, - "osd_rgb2yuv_coeff23":128 - }, - "yuv2rgb":{ - "out_yuv2rgb_coeff00":1024, - "out_yuv2rgb_coeff01":0, - "out_yuv2rgb_coeff02":1441, - "out_yuv2rgb_coeff03":3916, - "out_yuv2rgb_coeff10":1024, - "out_yuv2rgb_coeff11":3742, - "out_yuv2rgb_coeff12":3362, - "out_yuv2rgb_coeff13":136, - "out_yuv2rgb_coeff20":1024, - "out_yuv2rgb_coeff21":1822, - "out_yuv2rgb_coeff22":0, - "out_yuv2rgb_coeff23":3868 - }, - "ds0":{ - "ds0_out_rgb_mode":0, - "ds0_out_rgb_en":0, - "ds0_out_yuv_mode":0, - "ds0_out_uv_swap":0, - "ds0_osd0":{ - "ds0_osd0_enable":0, - "ds0_osd0_type":0, - "ds0_osd0_alpha_tpye":0, - "ds0_osd0_vst":0, - "ds0_osd0_hst":0, - "ds0_osd0_vend":0, - "ds0_osd0_hend":0, - "ds0_osd0_dma_request_length":0, - "ds0_osd0_dma_map":0, - "ds0_osd0_rgb_rev":0, - "ds0_osd0_global_alpha":0, - "ds0_osd0_swap_64":0, - "ds0_osd0_outstanding_num":0, - "ds0_osd0_bd_limit_en":0 - }, - "ds0_osd1":{ - "ds0_osd1_enable":0, - "ds0_osd1_type":0, - "ds0_osd1_alpha_tpye":0, - "ds0_osd1_vst":0, - "ds0_osd1_hst":0, - "ds0_osd1_vend":0, - "ds0_osd1_hend":0, - "ds0_osd1_dma_request_length":0, - "ds0_osd1_dma_map":0, - "ds0_osd1_rgb_rev":0, - "ds0_osd1_global_alpha":0, - "ds0_osd1_swap_64":0, - "ds0_osd1_outstanding_num":0, - "ds0_osd1_bd_limit_en":0 - }, - "ds0_osd2":{ - "ds0_osd2_enable":0, - "ds0_osd2_type":0, - "ds0_osd2_alpha_tpye":0, - "ds0_osd2_vst":0, - "ds0_osd2_hst":0, - "ds0_osd2_vend":0, - "ds0_osd2_hend":0, - "ds0_osd2_dma_request_length":0, - "ds0_osd2_dma_map":0, - "ds0_osd2_rgb_rev":0, - "ds0_osd2_global_alpha":0, - "ds0_osd2_swap_64":0, - "ds0_osd2_outstanding_num":0, - "ds0_osd2_bd_limit_en":0 - } - }, - "ds1":{ - "ds1_out_rgb_mode":0, - "ds1_out_rgb_en":0, - "ds1_out_yuv_mode":0, - "ds1_out_uv_swap":0, - "ds1_osd0":{ - "ds1_osd0_enable":0, - "ds1_osd0_type":0, - "ds1_osd0_alpha_tpye":0, - "ds1_osd0_vst":0, - "ds1_osd0_hst":0, - "ds1_osd0_vend":0, - "ds1_osd0_hend":0, - "ds1_osd0_dma_request_length":0, - "ds1_osd0_dma_map":0, - "ds1_osd0_rgb_rev":0, - "ds1_osd0_global_alpha":0, - "ds1_osd0_swap_64":0, - "ds1_osd0_outstanding_num":0, - "ds1_osd0_bd_limit_en":0 - }, - "ds1_osd1":{ - "ds1_osd1_enable":0, - "ds1_osd1_type":0, - "ds1_osd1_alpha_tpye":0, - "ds1_osd1_vst":0, - "ds1_osd1_hst":0, - "ds1_osd1_vend":0, - "ds1_osd1_hend":0, - "ds1_osd1_dma_request_length":0, - "ds1_osd1_dma_map":0, - "ds1_osd1_rgb_rev":0, - "ds1_osd1_global_alpha":0, - "ds1_osd1_swap_64":0, - "ds1_osd1_outstanding_num":0, - "ds1_osd1_bd_limit_en":0 - }, - "ds1_osd2":{ - "ds1_osd2_enable":0, - "ds1_osd2_type":0, - "ds1_osd2_alpha_tpye":0, - "ds1_osd2_vst":0, - "ds1_osd2_hst":0, - "ds1_osd2_vend":0, - "ds1_osd2_hend":0, - "ds1_osd2_dma_request_length":0, - "ds1_osd2_dma_map":0, - "ds1_osd2_rgb_rev":0, - "ds1_osd2_global_alpha":0, - "ds1_osd2_swap_64":0, - "ds1_osd2_outstanding_num":0, - "ds1_osd2_bd_limit_en":0 - } - }, - "ds2":{ - "ds2_out_rgb_mode":0, - "ds2_out_rgb_en":1, - "ds2_out_yuv_mode":0, - "ds2_out_uv_swap":0, - "ds2_osd0":{ - "ds2_osd0_enable":0, - "ds2_osd0_type":0, - "ds2_osd0_alpha_tpye":0, - "ds2_osd0_vst":0, - "ds2_osd0_hst":0, - "ds2_osd0_vend":0, - "ds2_osd0_hend":0, - "ds2_osd0_dma_request_length":0, - "ds2_osd0_dma_map":0, - "ds2_osd0_rgb_rev":0, - "ds2_osd0_global_alpha":0, - "ds2_osd0_swap_64":0, - "ds2_osd0_outstanding_num":0, - "ds2_osd0_bd_limit_en":0 - }, - "ds2_osd1":{ - "ds2_osd1_enable":0, - "ds2_osd1_type":0, - "ds2_osd1_alpha_tpye":0, - "ds2_osd1_vst":0, - "ds2_osd1_hst":0, - "ds2_osd1_vend":0, - "ds2_osd1_hend":0, - "ds2_osd1_dma_request_length":0, - "ds2_osd1_dma_map":0, - "ds2_osd1_rgb_rev":0, - "ds2_osd1_global_alpha":0, - "ds2_osd1_swap_64":0, - "ds2_osd1_outstanding_num":0, - "ds2_osd1_bd_limit_en":0 - } - } - } -} \ No newline at end of file +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 0, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 2, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 3453, + "itc_ttl_v": 1977, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 240, + "blc_ratio": 272 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 480, + "lsc_v_center": 1000, + "lsc_r_ratio": 10, + "lsc_g_ratio": 6, + "lsc_b_ratio": 6, + "lsc_ir_ratio": 6 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 0, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 4, + "ae_win_sttv": 4, + "ae_win_endh": 1083, + "ae_win_endv": 1923, + "ae_yobj": 90, + "ae_av_rg": 8, + "ae_l_ex_time": 1000, + "ae_m_ex_time": 32, + "ae_s_ex_time": 32, + "ae_agc": 256, + "ae_ad_shuttle_freq": 0, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 1973, + "ae_ex_value_mid": 256, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 1000, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 466, + "awb_d65_blue_gain": 382, + "ccm_rr": 259, + "ccm_rg": 2, + "ccm_rb": 1, + "ccm_gr": 37, + "ccm_gg": 310, + "ccm_gb": 17, + "ccm_br": 1, + "ccm_bg": 75, + "ccm_bb": 332, + "ccm_correct_coff": 256, + "awb_win_stth": 4, + "awb_win_sttv": 4, + "awb_win_endh": 1083, + "awb_win_endv": 1923, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 259, + "awb_blue_max_value": 388, + "awb_red_min_value": 176, + "awb_blue_min_value": 262, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 0, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 0, + "wdr_stab_en": 0, + "wdr_en": 0, + "wdr_ghost_remove_en": 0, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 1, + "wdr_stat_img_sel": 0, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 0, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1079, + "ada_win_endv": 1919 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 511, + "nr2d_eg_k": 48, + "nr2d_y_k": 64, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 64, + "nr3dp_thyp": 64, + "nr3dp_thcp": 64, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 60, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 8, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 64 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 1, + "otc_yc_sl": 0, + "otc_uv_sl": 0, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 250 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 480, + "ldc_cv": 1000, + "ldc_cr": 684, + "ldc_cz": 684 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 4, + "af_stat_win_v_start": 4, + "af_stat_win_h_end": 1083, + "af_stat_win_v_end": 1923 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/mediactl_lib/src/config/imx385_0.conf b/package/mediactl_lib/src/config/imx385_0.conf index 348dd2a..3ed8a14 100644 --- a/package/mediactl_lib/src/config/imx385_0.conf +++ b/package/mediactl_lib/src/config/imx385_0.conf @@ -72,7 +72,7 @@ "itc": { "hsync_pol":0, "vsync_pol":0, - "hsync_input_timing":2, + "hsync_input_timing":1, "vsync_input_timing":1, "flip_ctl" :0, "video_fmt_sl":0, @@ -334,14 +334,14 @@ } }, "ldc":{ - "ldc_en" :0, - "ldc_rct_en" :0, - "ldc_rq_frq" :128, - "ldc_stt_ln" :540, - "ldc_ch" :960, - "ldc_cv" :540, - "ldc_cr" :684, - "ldc_cz" :684 + "ldc_en":0, + "ldc_rct_en":0, + "ldc_rq_frq":80, + "ldc_stt_ln":4, + "ldc_ch":960, + "ldc_cv":540, + "ldc_cr":400, + "ldc_cz":500 }, "af":{ "af_stat_en" :1, @@ -528,4 +528,4 @@ } } } -} \ No newline at end of file +} diff --git a/package/mediactl_lib/src/config/imx385_2frame.conf b/package/mediactl_lib/src/config/imx385_2frame.conf new file mode 100644 index 0000000..58a28ca --- /dev/null +++ b/package/mediactl_lib/src/config/imx385_2frame.conf @@ -0,0 +1,531 @@ +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 1, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 1, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 2200, + "itc_ttl_v": 2250, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 224, + "blc_ratio": 271 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 4, + "lsc_g_ratio": 4, + "lsc_b_ratio": 4, + "lsc_ir_ratio": 4 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 1, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 0, + "ae_win_sttv": 0, + "ae_win_endh": 1919, + "ae_win_endv": 1079, + "ae_yobj": 100, + "ae_av_rg": 14, + "ae_l_ex_time": 675, + "ae_m_ex_time": 34, + "ae_s_ex_time": 32, + "ae_agc": 256, + "ae_ad_shuttle_freq": 1, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 2209, + "ae_ex_value_mid": 34, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 508, + "awb_d65_blue_gain": 423, + "ccm_rr": 256, + "ccm_rg": 0, + "ccm_rb": 0, + "ccm_gr": 83, + "ccm_gg": 361, + "ccm_gb": 22, + "ccm_br": 0, + "ccm_bg": 44, + "ccm_bb": 300, + "ccm_correct_coff": 256, + "awb_win_stth": 0, + "awb_win_sttv": 0, + "awb_win_endh": 1919, + "awb_win_endv": 1079, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 252, + "awb_blue_max_value": 423, + "awb_red_min_value": 174, + "awb_blue_min_value": 265, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 1, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 1, + "wdr_stab_en": 1, + "wdr_en": 1, + "wdr_ghost_remove_en": 1, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 0, + "wdr_3frame_ex_ratio": 0, + "wdr_stat_img_sel": 2, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 1, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 128, + "nr2d_eg_k": 32, + "nr2d_y_k": 32, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 255, + "nr3dp_thyp": 255, + "nr3dp_thcp": 32, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 8, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 4, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 160 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 0, + "otc_yc_sl": 0, + "otc_uv_sl": 1, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 210 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 880, + "ldc_cv": 480, + "ldc_cr": 2000, + "ldc_cz": 2000 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 0, + "af_stat_win_v_start": 0, + "af_stat_win_h_end": 1919, + "af_stat_win_v_end": 1079 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/mediactl_lib/src/config/imx385_3frame.conf b/package/mediactl_lib/src/config/imx385_3frame.conf new file mode 100644 index 0000000..43087b4 --- /dev/null +++ b/package/mediactl_lib/src/config/imx385_3frame.conf @@ -0,0 +1,531 @@ +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 2, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 1, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 2200, + "itc_ttl_v": 4500, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 224, + "blc_ratio": 271 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 4, + "lsc_g_ratio": 4, + "lsc_b_ratio": 4, + "lsc_ir_ratio": 4 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 1, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 0, + "ae_win_sttv": 0, + "ae_win_endh": 1919, + "ae_win_endv": 1079, + "ae_yobj": 100, + "ae_av_rg": 14, + "ae_l_ex_time": 1350, + "ae_m_ex_time": 32, + "ae_s_ex_time": 4, + "ae_agc": 256, + "ae_ad_shuttle_freq": 1, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 4436, + "ae_ex_value_mid": 32, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 508, + "awb_d65_blue_gain": 423, + "ccm_rr": 256, + "ccm_rg": 0, + "ccm_rb": 0, + "ccm_gr": 83, + "ccm_gg": 361, + "ccm_gb": 22, + "ccm_br": 0, + "ccm_bg": 44, + "ccm_bb": 300, + "ccm_correct_coff": 256, + "awb_win_stth": 0, + "awb_win_sttv": 0, + "awb_win_endh": 1919, + "awb_win_endv": 1079, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 252, + "awb_blue_max_value": 423, + "awb_red_min_value": 174, + "awb_blue_min_value": 265, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 1, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 1, + "wdr_stab_en": 1, + "wdr_en": 1, + "wdr_ghost_remove_en": 1, + "wdr_3frame_out_mode": 1, + "wdr_mode_sel": 1, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 2, + "wdr_stat_img_sel": 2, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 1, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 128, + "nr2d_eg_k": 32, + "nr2d_y_k": 32, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 255, + "nr3dp_thyp": 255, + "nr3dp_thcp": 32, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 8, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 4, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 160 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 0, + "otc_yc_sl": 0, + "otc_uv_sl": 1, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 210 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 880, + "ldc_cv": 480, + "ldc_cr": 2000, + "ldc_cz": 2000 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 0, + "af_stat_win_v_start": 0, + "af_stat_win_h_end": 1919, + "af_stat_win_v_end": 1079 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/mediactl_lib/src/config/imx385_normal.conf b/package/mediactl_lib/src/config/imx385_normal.conf new file mode 100644 index 0000000..7448830 --- /dev/null +++ b/package/mediactl_lib/src/config/imx385_normal.conf @@ -0,0 +1,531 @@ +{ + "isp_general": { + "isp_out_sel": 0, + "dvp_ch_mode": 1, + "hist_3a_out_en": 0, + "main_out": { + "out_img_format": 1, + "out_yuv_in_format": 0, + "out_yuv422_pxl_order": 0, + "out_pxl_width": 0, + "out_frame_buf_size": 2048 + }, + "out0": { + "ds0_out_img_format": 1, + "ds0_out_yuv_in_format": 0, + "ds0_out_yuv422_pxl_order": 0, + "ds0_out_pxl_width": 0, + "ds0_frame_buf_size": 2048 + }, + "out1": { + "ds1_out_img_format": 1, + "ds1_out_yuv_in_format": 0, + "ds1_out_yuv422_pxl_order": 0, + "ds1_out_pxl_width": 0, + "ds1_frame_buf_size": 2048 + }, + "out2": { + "ds2_out_img_format": 0, + "ds2_out_yuv_in_format": 0, + "ds2_out_yuv422_pxl_order": 0, + "ds2_out_pxl_width": 0, + "ds2_frame_buf_size": 2048 + }, + "wdr": { + "wdr_mode": 0, + "wdr_long_ch_mode": 0, + "wdr_long_l2_buf_en": 0, + "wdr_short_s1_buf_en": 0, + "wdr_dynamic_switch_en": 0, + "wdr_long_l2_buf_depth": 0, + "wdr_long_img_format": 0, + "wdr_long_yuv_in_format": 0, + "wdr_long_img_out_format": 0, + "wdr_long_yuv422_pxl_order": 0, + "wdr_long_pixel_width": 2, + "wdr_buf_base": 0, + "wdr_line_stride": 0, + "wdr_frame_buf_size": 0 + }, + "nr3d": { + "nr3d_en": 0, + "nr3d_fbcd_en": 0, + "nr3d_mv_out_en": 0, + "nr3d_y_img_format": 0, + "nr3d_y_yuv_in_format": 0, + "nr3d_y_img_out_format": 0, + "nr3d_y_yuv422_pxl_order": 0, + "nr3d_y_pixel_width": 2, + "nr3d_uv_img_format": 0, + "nr3d_uv_yuv_in_format": 0, + "nr3d_uv_mig_out_format": 0, + "nr3d_uv_yuv422_pxl_order": 0, + "nr3d_uv_pixel_width": 2, + "nr3d_frame_buf_size": 0 + }, + "ldc": { + "ldc_line_stride": 2048, + "ldc_frame_buf_size": 2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol": 0, + "vsync_pol": 0, + "hsync_input_timing": 1, + "vsync_input_timing": 1, + "flip_ctl": 0, + "video_fmt_sl": 0, + "itc_ttl_h": 2200, + "itc_ttl_v": 1125, + "itc_stt_hr": 0, + "itc_stt_vr": 1 + }, + "tpg": { + "tpg_en": 0, + "bayer_mode_sel": 3, + "motion_mode_sel": 0, + "tpg_sel": 9, + "wdr_l_mul_data": 0, + "wdr_m_mul_data": 0, + "wdr_s_mul_data": 0 + }, + "blc": { + "blc_en": 1, + "blc_offset": 224, + "blc_ratio": 271 + }, + "lsc": { + "lsc_en": 1, + "lsc_h_center": 900, + "lsc_v_center": 580, + "lsc_r_ratio": 4, + "lsc_g_ratio": 4, + "lsc_b_ratio": 4, + "lsc_ir_ratio": 4 + }, + "ae": { + "ae_as_en": 0, + "ae_ag_en": 0, + "ae_airis_en": 0, + "ae_enter_ls_sel": 0, + "ae_exit_ls_sel": 1, + "ae_win_mode_sel": 0, + "ae_back_light_mode_sel": 0, + "ae_day_change_en": 0, + "ae_day_change_sel": 0, + "ae_win_stth": 0, + "ae_win_sttv": 0, + "ae_win_endh": 1919, + "ae_win_endv": 1079, + "ae_yobj": 100, + "ae_av_rg": 14, + "ae_l_ex_time": 338, + "ae_m_ex_time": 34, + "ae_s_ex_time": 4, + "ae_agc": 256, + "ae_ad_shuttle_freq": 1, + "ae_ad_gain_freq": 0, + "ae_adjust_step_max": 36, + "ae_ex_value_max": 1122, + "ae_ex_value_mid": 34, + "ae_ex_value_min": 1, + "ae_gain_value_max": 4095, + "ae_gain_value_mid": 512, + "ae_gain_value_min": 256, + "ae_dn_switch_ad_step_max": 512, + "ae_dn_switch_wait_time": 255, + "ape_max_diff": 12, + "ape_drv_signal_max": 3840, + "ape_coeff_distance": 0, + "ape_coeff_speed": 0, + "ape_coeff_acceleration": 0, + "ape_drv_manual_value": 4095, + "ape_damp_manual_value": 2048 + }, + "awb": { + "awb_d65_en": 1, + "awb_ccm_en": 1, + "awb_en": 1, + "awb_mode_sel": 1, + "awb_hist_mode_sel": 0, + "awb_veri_en": 0, + "awb_fb_en": 0, + "awb_value_save_en": 0, + "awb_ccm_adp_adjust_en": 0, + "awb_stab_en": 1, + "awb_d65_red_gain": 508, + "awb_d65_blue_gain": 423, + "ccm_rr": 256, + "ccm_rg": 0, + "ccm_rb": 0, + "ccm_gr": 83, + "ccm_gg": 361, + "ccm_gb": 22, + "ccm_br": 0, + "ccm_bg": 44, + "ccm_bb": 300, + "ccm_correct_coff": 256, + "awb_win_stth": 0, + "awb_win_sttv": 0, + "awb_win_endh": 1919, + "awb_win_endv": 1079, + "awb_correct_diff_th": 8, + "awb_color_changeres_time": 8, + "awb_historgram_th": 4, + "awb_red_gain_adjust": 256, + "awb_green_gain_adjust": 256, + "awb_blue_gain_adjust": 256, + "awb_red_max_value": 252, + "awb_blue_max_value": 423, + "awb_red_min_value": 174, + "awb_blue_min_value": 265, + "awb_red_obj_value": 256, + "awb_blue_obj_value": 256 + }, + "wdr": { + "wdr_fusion_en": 0, + "wdr_frame_sel": 0, + "wdr_adp_adjust_en": 0, + "wdr_stab_en": 0, + "wdr_en": 0, + "wdr_ghost_remove_en": 0, + "wdr_3frame_out_mode": 0, + "wdr_mode_sel": 0, + "wdr_2frame_ex_ratio": 1, + "wdr_3frame_ex_ratio": 1, + "wdr_stat_img_sel": 1, + "wdr_ltm_data_sel": 1, + "wdr_tz_data_sel": 1, + "wdr_remove_purple_en": 0, + "wdr_over_ex_ratio_th1": 384, + "wdr_over_ex_ratio_th2": 32, + "wdr_fusion_ratio_th": 192, + "wdr_fusion_value1": 64, + "wdr_fusion_value2": 16 + }, + "csc": { + "rgb2yuv_00": 153, + "rgb2yuv_01": 256, + "rgb2yuv_02": 86, + "rgb2yuv_10": 301, + "rgb2yuv_11": 214, + "rgb2yuv_12": 170, + "rgb2yuv_20": 58, + "rgb2yuv_21": 42, + "rgb2yuv_22": 256 + }, + "ada": { + "gm_rgb_en": 1, + "gm_yuv_en": 0, + "ada_en": 1, + "ada_sbz_en": 0, + "ada_ccr_en": 0, + "ada_adp_en": 0, + "ada_adp_ccr_en": 0, + "ada_stat_mode_sel": 0, + "ada_enh_mode_sel": 0, + "ada_hist_max": 128, + "ada_ttl_max": 255, + "ada_win_stth": 0, + "ada_win_sttv": 0, + "ada_win_endh": 1919, + "ada_win_endv": 1079 + }, + "rgb-ir": { + "raw_fmt": 0, + "rgbir_rct_en": 0, + "dfc_en": 0, + "rgbir_fs_en": 0, + "rgbir_ot_sl": 0, + "rgbir_fs_max": 256, + "dfc_krb": 0, + "dfc_ky": 0, + "dfc_th": 256, + "dfc_th_1": 256 + }, + "2dnr": { + "dpeak_en": 1, + "nr2d_raw_en": 1, + "nr2d_eg_en": 1, + "nr2d_jl_en": 1, + "nr2d_av_en": 1, + "nr2d_c_en": 1, + "dpeak_adp_en": 0, + "nr2d_raw_adp_en": 0, + "nr2d_y_adp_en": 0, + "nr2d_c_adp_en": 0, + "nr2d_raw_kl": 16, + "nr2d_jl_th": 128, + "nr2d_eg_k": 32, + "nr2d_y_k": 32, + "nr2d_c_k": 1 + }, + "3dnr": { + "nr3d_en": 1, + "nr3dp_y_en": 1, + "nr3dp_c_en": 1, + "nr3dm_y_en": 1, + "nr3dm_c_en": 1, + "nr3db_y_en": 1, + "nr3db_c_en": 1, + "nr3dm_nr2d_y_en": 1, + "nr3dm_nr2d_c_en": 1, + "core_3dnr_wb_en": 0, + "core_3dnr_wb_sel": 0, + "core_3dnr_adp_luma_en": 0, + "core_3dnr_adp_chroma_en": 0, + "nr3dp_thy": 255, + "nr3dp_thyp": 255, + "nr3dp_thcp": 32, + "nr3dm_mid_th": 128, + "nr3dm_mtp_th": 8, + "nr3dm_mtc_th": 128, + "nr3dm_ym_k": 8, + "nr3dm_thy": 64, + "nr3dm_min": 0, + "nr3dm_thw0": 128, + "core_3dnr_chroma_intensity": 16, + "nr3db_nr2d_eg_th": 64, + "nr3db_thyp": 64, + "nr3db_thcp": 32 + }, + "enh": { + "ltm": { + "enh_ltm_en": 1, + "enh_adp_ltm_en": 0, + "ltm_gain": 128, + "ltm_mm_th": 128 + }, + "sharp": { + "enh_sharp_en": 1, + "enh_adp_sharp_en": 0, + "shp_core": 4, + "shp_th1": 3840, + "shp_th2": 4095, + "shp_gain": 160 + }, + "cc": { + "enh_cc_en": 0, + "enh_adp_cc_en": 0 + } + }, + "post_ctl": { + "otc_ctl": { + "otc_en": 0, + "otc_yc_sl": 0, + "otc_uv_sl": 1, + "otc_hs_plt_sl": 0, + "otc_vs_plt_sl": 0, + "otc_stt_vr": 0, + "otc_stt_hr": 0 + }, + "ctrst": { + "ctrst_en": 1, + "ctrst_gain": 128 + }, + "luma": { + "luma_en": 1, + "luma_gain": 128 + }, + "strt": { + "strt_en": 1, + "strt_gain": 210 + } + }, + "ldc": { + "ldc_en": 0, + "ldc_rct_en": 0, + "ldc_rq_frq": 128, + "ldc_stt_ln": 540, + "ldc_ch": 880, + "ldc_cv": 480, + "ldc_cr": 2000, + "ldc_cz": 2000 + }, + "af": { + "af_stat_en": 1, + "af_stat_mode_sel": 0, + "af_stat_win_h_start": 0, + "af_stat_win_v_start": 0, + "af_stat_win_h_end": 1919, + "af_stat_win_v_end": 1079 + } + }, + "isp_post": { + "rgb2yuv": { + "osd_rgb2yuv_coeff00": 306, + "osd_rgb2yuv_coeff01": 601, + "osd_rgb2yuv_coeff02": 117, + "osd_rgb2yuv_coeff03": 0, + "osd_rgb2yuv_coeff10": 3920, + "osd_rgb2yuv_coeff11": 3749, + "osd_rgb2yuv_coeff12": 523, + "osd_rgb2yuv_coeff13": 128, + "osd_rgb2yuv_coeff20": 523, + "osd_rgb2yuv_coeff21": 3658, + "osd_rgb2yuv_coeff22": 4011, + "osd_rgb2yuv_coeff23": 128 + }, + "yuv2rgb": { + "out_yuv2rgb_coeff00": 1024, + "out_yuv2rgb_coeff01": 0, + "out_yuv2rgb_coeff02": 1441, + "out_yuv2rgb_coeff03": 3916, + "out_yuv2rgb_coeff10": 1024, + "out_yuv2rgb_coeff11": 3742, + "out_yuv2rgb_coeff12": 3362, + "out_yuv2rgb_coeff13": 136, + "out_yuv2rgb_coeff20": 1024, + "out_yuv2rgb_coeff21": 1822, + "out_yuv2rgb_coeff22": 0, + "out_yuv2rgb_coeff23": 3868 + }, + "ds0": { + "ds0_out_rgb_mode": 0, + "ds0_out_rgb_en": 0, + "ds0_out_yuv_mode": 0, + "ds0_out_uv_swap": 0, + "ds0_osd0": { + "ds0_osd0_enable": 0, + "ds0_osd0_type": 0, + "ds0_osd0_alpha_tpye": 0, + "ds0_osd0_vst": 0, + "ds0_osd0_hst": 0, + "ds0_osd0_vend": 0, + "ds0_osd0_hend": 0, + "ds0_osd0_dma_request_length": 0, + "ds0_osd0_dma_map": 0, + "ds0_osd0_rgb_rev": 0, + "ds0_osd0_global_alpha": 0, + "ds0_osd0_swap_64": 0, + "ds0_osd0_outstanding_num": 0, + "ds0_osd0_bd_limit_en": 0 + }, + "ds0_osd1": { + "ds0_osd1_enable": 0, + "ds0_osd1_type": 0, + "ds0_osd1_alpha_tpye": 0, + "ds0_osd1_vst": 0, + "ds0_osd1_hst": 0, + "ds0_osd1_vend": 0, + "ds0_osd1_hend": 0, + "ds0_osd1_dma_request_length": 0, + "ds0_osd1_dma_map": 0, + "ds0_osd1_rgb_rev": 0, + "ds0_osd1_global_alpha": 0, + "ds0_osd1_swap_64": 0, + "ds0_osd1_outstanding_num": 0, + "ds0_osd1_bd_limit_en": 0 + }, + "ds0_osd2": { + "ds0_osd2_enable": 0, + "ds0_osd2_type": 0, + "ds0_osd2_alpha_tpye": 0, + "ds0_osd2_vst": 0, + "ds0_osd2_hst": 0, + "ds0_osd2_vend": 0, + "ds0_osd2_hend": 0, + "ds0_osd2_dma_request_length": 0, + "ds0_osd2_dma_map": 0, + "ds0_osd2_rgb_rev": 0, + "ds0_osd2_global_alpha": 0, + "ds0_osd2_swap_64": 0, + "ds0_osd2_outstanding_num": 0, + "ds0_osd2_bd_limit_en": 0 + } + }, + "ds1": { + "ds1_out_rgb_mode": 0, + "ds1_out_rgb_en": 0, + "ds1_out_yuv_mode": 0, + "ds1_out_uv_swap": 0, + "ds1_osd0": { + "ds1_osd0_enable": 0, + "ds1_osd0_type": 0, + "ds1_osd0_alpha_tpye": 0, + "ds1_osd0_vst": 0, + "ds1_osd0_hst": 0, + "ds1_osd0_vend": 0, + "ds1_osd0_hend": 0, + "ds1_osd0_dma_request_length": 0, + "ds1_osd0_dma_map": 0, + "ds1_osd0_rgb_rev": 0, + "ds1_osd0_global_alpha": 0, + "ds1_osd0_swap_64": 0, + "ds1_osd0_outstanding_num": 0, + "ds1_osd0_bd_limit_en": 0 + }, + "ds1_osd1": { + "ds1_osd1_enable": 0, + "ds1_osd1_type": 0, + "ds1_osd1_alpha_tpye": 0, + "ds1_osd1_vst": 0, + "ds1_osd1_hst": 0, + "ds1_osd1_vend": 0, + "ds1_osd1_hend": 0, + "ds1_osd1_dma_request_length": 0, + "ds1_osd1_dma_map": 0, + "ds1_osd1_rgb_rev": 0, + "ds1_osd1_global_alpha": 0, + "ds1_osd1_swap_64": 0, + "ds1_osd1_outstanding_num": 0, + "ds1_osd1_bd_limit_en": 0 + }, + "ds1_osd2": { + "ds1_osd2_enable": 0, + "ds1_osd2_type": 0, + "ds1_osd2_alpha_tpye": 0, + "ds1_osd2_vst": 0, + "ds1_osd2_hst": 0, + "ds1_osd2_vend": 0, + "ds1_osd2_hend": 0, + "ds1_osd2_dma_request_length": 0, + "ds1_osd2_dma_map": 0, + "ds1_osd2_rgb_rev": 0, + "ds1_osd2_global_alpha": 0, + "ds1_osd2_swap_64": 0, + "ds1_osd2_outstanding_num": 0, + "ds1_osd2_bd_limit_en": 0 + } + }, + "ds2": { + "ds2_out_rgb_mode": 0, + "ds2_out_rgb_en": 1, + "ds2_out_yuv_mode": 0, + "ds2_out_uv_swap": 0, + "ds2_osd0": { + "ds2_osd0_enable": 0, + "ds2_osd0_type": 0, + "ds2_osd0_alpha_tpye": 0, + "ds2_osd0_vst": 0, + "ds2_osd0_hst": 0, + "ds2_osd0_vend": 0, + "ds2_osd0_hend": 0, + "ds2_osd0_dma_request_length": 0, + "ds2_osd0_dma_map": 0, + "ds2_osd0_rgb_rev": 0, + "ds2_osd0_global_alpha": 0, + "ds2_osd0_swap_64": 0, + "ds2_osd0_outstanding_num": 0, + "ds2_osd0_bd_limit_en": 0 + }, + "ds2_osd1": { + "ds2_osd1_enable": 0, + "ds2_osd1_type": 0, + "ds2_osd1_alpha_tpye": 0, + "ds2_osd1_vst": 0, + "ds2_osd1_hst": 0, + "ds2_osd1_vend": 0, + "ds2_osd1_hend": 0, + "ds2_osd1_dma_request_length": 0, + "ds2_osd1_dma_map": 0, + "ds2_osd1_rgb_rev": 0, + "ds2_osd1_global_alpha": 0, + "ds2_osd1_swap_64": 0, + "ds2_osd1_outstanding_num": 0, + "ds2_osd1_bd_limit_en": 0 + } + } + } +} diff --git a/package/mediactl_lib/src/config/imx385_video_1920x1080_2frame.conf b/package/mediactl_lib/src/config/imx385_video_1920x1080_2frame.conf new file mode 100644 index 0000000..e30a55d --- /dev/null +++ b/package/mediactl_lib/src/config/imx385_video_1920x1080_2frame.conf @@ -0,0 +1,322 @@ +{ + "sensor0": { + "sensor0_name": "m00_f_IMX385 0-001a", + "sensor0_cfg_file": "imx385_2frame.conf", + "sensor0_total_size": { + "sensor0_total_width": 2200, + "sensor0_total_height": 1125 + }, + "sensor0_active_size": { + "sensor0_active_width": 1920, + "sensor0_active_height": 1080 + }, + "/dev/video2": { + "video2_used": 0, + "video2_width": 1920, + "video2_height": 1080, + "video2_out_format": 1 + }, + "/dev/video3": { + "video3_used": 1, + "video3_width": 1080, + "video3_height": 608, + "video3_out_format": 1 + }, + "/dev/video4": { + "video4_used": 0, + "video4_width": 1080, + "video4_height": 608, + "video4_out_format": 1 + }, + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 + } + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3476, + "sensor1_total_height": 1166 + }, + "sensor1_active_size": { + "sensor1_active_width": 1920, + "sensor1_active_height": 1080 + }, + "/dev/video6": { + "video6_used": 0, + "video6_width": 1920, + "video6_height": 1080, + "video6_out_format": 1 + }, + "/dev/video7": { + "video7_used": 0, + "video7_width": 1080, + "video7_height": 720, + "video7_out_format": 1 + }, + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 + }, + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 + } + }, + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 1, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 44, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 44, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 44, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 1, + "csi1_dl1_map": 2, + "csi1_dl2_map": 3, + "csi1_dl3_map": 4, + "csi10_datatype_select0": 44, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 1, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 2, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 2, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 2200, + "p01_total_height": 1125, + "p01_in_width": 1920, + "p01_in_height": 1080, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 2, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 2200, + "p02_total_height": 1125, + "p02_in_width": 1920, + "p02_in_height": 1080, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 2, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 2200, + "p10_total_height": 1125, + "p10_in_width": 1920, + "p10_in_height": 1080, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 2, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 2200, + "dvp00_total_height": 1125, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} diff --git a/package/mediactl_lib/src/config/imx385_video_1920x1080_3frame.conf b/package/mediactl_lib/src/config/imx385_video_1920x1080_3frame.conf new file mode 100644 index 0000000..6d6ea76 --- /dev/null +++ b/package/mediactl_lib/src/config/imx385_video_1920x1080_3frame.conf @@ -0,0 +1,322 @@ +{ + "sensor0": { + "sensor0_name": "m00_f_IMX385 0-001a", + "sensor0_cfg_file": "imx385_3frame.conf", + "sensor0_total_size": { + "sensor0_total_width": 2200, + "sensor0_total_height": 1125 + }, + "sensor0_active_size": { + "sensor0_active_width": 1920, + "sensor0_active_height": 1080 + }, + "/dev/video2": { + "video2_used": 0, + "video2_width": 1920, + "video2_height": 1080, + "video2_out_format": 1 + }, + "/dev/video3": { + "video3_used": 1, + "video3_width": 1080, + "video3_height": 608, + "video3_out_format": 1 + }, + "/dev/video4": { + "video4_used": 0, + "video4_width": 1080, + "video4_height": 608, + "video4_out_format": 1 + }, + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 + } + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3476, + "sensor1_total_height": 1166 + }, + "sensor1_active_size": { + "sensor1_active_width": 1920, + "sensor1_active_height": 1080 + }, + "/dev/video6": { + "video6_used": 0, + "video6_width": 1920, + "video6_height": 1080, + "video6_out_format": 1 + }, + "/dev/video7": { + "video7_used": 0, + "video7_width": 1080, + "video7_height": 720, + "video7_out_format": 1 + }, + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 + }, + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 + } + }, + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 1, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 44, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 44, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 44, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 1, + "csi1_dl1_map": 2, + "csi1_dl2_map": 3, + "csi1_dl3_map": 4, + "csi10_datatype_select0": 44, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 1, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 2, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 2, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 2200, + "p01_total_height": 1125, + "p01_in_width": 1920, + "p01_in_height": 1080, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 2, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 2200, + "p02_total_height": 1125, + "p02_in_width": 1920, + "p02_in_height": 1080, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 2, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 2200, + "p10_total_height": 1125, + "p10_in_width": 1920, + "p10_in_height": 1080, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 2, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 2200, + "dvp00_total_height": 1125, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} diff --git a/package/mediactl_lib/src/config/imx385_video_1920x1080_normal.conf b/package/mediactl_lib/src/config/imx385_video_1920x1080_normal.conf new file mode 100644 index 0000000..96c4bc0 --- /dev/null +++ b/package/mediactl_lib/src/config/imx385_video_1920x1080_normal.conf @@ -0,0 +1,322 @@ +{ + "sensor0": { + "sensor0_name": "m00_f_IMX385 0-001a", + "sensor0_cfg_file": "imx385_normal.conf", + "sensor0_total_size": { + "sensor0_total_width": 2200, + "sensor0_total_height": 1125 + }, + "sensor0_active_size": { + "sensor0_active_width": 1920, + "sensor0_active_height": 1080 + }, + "/dev/video2": { + "video2_used": 0, + "video2_width": 1920, + "video2_height": 1080, + "video2_out_format": 1 + }, + "/dev/video3": { + "video3_used": 1, + "video3_width": 1080, + "video3_height": 608, + "video3_out_format": 1 + }, + "/dev/video4": { + "video4_used": 0, + "video4_width": 1080, + "video4_height": 608, + "video4_out_format": 1 + }, + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 + } + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3476, + "sensor1_total_height": 1166 + }, + "sensor1_active_size": { + "sensor1_active_width": 1920, + "sensor1_active_height": 1080 + }, + "/dev/video6": { + "video6_used": 0, + "video6_width": 1920, + "video6_height": 1080, + "video6_out_format": 1 + }, + "/dev/video7": { + "video7_used": 0, + "video7_width": 1080, + "video7_height": 720, + "video7_out_format": 1 + }, + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 + }, + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 + } + }, + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 0, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 44, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 44, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 44, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 1, + "csi1_dl1_map": 2, + "csi1_dl2_map": 3, + "csi1_dl3_map": 4, + "csi10_datatype_select0": 44, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 0, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 2, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 2, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 2200, + "p01_total_height": 1125, + "p01_in_width": 1920, + "p01_in_height": 1080, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 2, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 2200, + "p02_total_height": 1125, + "p02_in_width": 1920, + "p02_in_height": 1080, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 2, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 2200, + "p10_total_height": 1125, + "p10_in_width": 1920, + "p10_in_height": 1080, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 2, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 2200, + "dvp00_total_height": 1125, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} diff --git a/package/mediactl_lib/src/config/sc035hgs.conf b/package/mediactl_lib/src/config/sc035hgs.conf new file mode 100644 index 0000000..affbd46 --- /dev/null +++ b/package/mediactl_lib/src/config/sc035hgs.conf @@ -0,0 +1,533 @@ +{ + "isp_general":{ + "isp_out_sel":0, + "dvp_ch_mode":1, + "hist_3a_out_en":0, + "main_out":{ + "out_img_format":1, + "out_yuv_in_format":0, + "out_yuv422_pxl_order":0, + "out_pxl_width":0, + "out_frame_buf_size":2048 + }, + "out0":{ + "ds0_out_img_format":1, + "ds0_out_yuv_in_format":0, + "ds0_out_yuv422_pxl_order":0, + "ds0_out_pxl_width":0, + "ds0_frame_buf_size":2048 + }, + "out1":{ + "ds1_out_img_format":1, + "ds1_out_yuv_in_format":0, + "ds1_out_yuv422_pxl_order":0, + "ds1_out_pxl_width":0, + "ds1_frame_buf_size":2048 + }, + "out2":{ + "ds2_out_img_format":0, + "ds2_out_yuv_in_format":0, + "ds2_out_yuv422_pxl_order":0, + "ds2_out_pxl_width":0, + "ds2_frame_buf_size":2048 + }, + "wdr":{ + "wdr_mode":0, + "wdr_long_ch_mode":0, + "wdr_long_l2_buf_en":0, + "wdr_short_s1_buf_en":0, + "wdr_dynamic_switch_en":0, + "wdr_long_l2_buf_depth":0, + "wdr_long_img_format":0, + "wdr_long_yuv_in_format":0, + "wdr_long_img_out_format":0, + "wdr_long_yuv422_pxl_order":0, + "wdr_long_pixel_width":2, + "wdr_buf_base":0, + "wdr_line_stride":0, + "wdr_frame_buf_size":0 + }, + "nr3d":{ + "nr3d_en":0, + "nr3d_fbcd_en":0, + "nr3d_mv_out_en":0, + "nr3d_y_img_format":0, + "nr3d_y_yuv_in_format":0, + "nr3d_y_img_out_format":0, + "nr3d_y_yuv422_pxl_order":0, + "nr3d_y_pixel_width":2, + "nr3d_uv_img_format":0, + "nr3d_uv_yuv_in_format":0, + "nr3d_uv_mig_out_format":0, + "nr3d_uv_yuv422_pxl_order":0, + "nr3d_uv_pixel_width":2, + "nr3d_frame_buf_size":0 + }, + "ldc":{ + "ldc_line_stride":2048, + "ldc_frame_buf_size":2048 + } + }, + "isp_core": { + "itc": { + "hsync_pol":0, + "vsync_pol":0, + "hsync_input_timing":2, + "vsync_input_timing":1, + "flip_ctl" :0, + "video_fmt_sl":0, + "itc_ttl_h" :852, + "itc_ttl_v" :1056, + "itc_stt_hr" :0, + "itc_stt_vr" :1, + "itc_width_in":640, + "itc_height_in":480 + }, + "tpg": { + "tpg_en":0, + "bayer_mode_sel":3, + "motion_mode_sel":0, + "tpg_sel":9, + "wdr_l_mul_data":0, + "wdr_m_mul_data":0, + "wdr_s_mul_data":0 + }, + "blc":{ + "blc_en" :1, + "blc_offset" :240, + "blc_ratio" :272 + }, + "lsc":{ + "lsc_en" :0, + "lsc_h_center" :320, + "lsc_v_center" :240, + "lsc_r_ratio" :2, + "lsc_g_ratio":2, + "lsc_b_ratio" :2, + "lsc_ir_ratio" :2 + }, + "ae":{ + "ae_as_en" :1, + "ae_ag_en" :1, + "ae_airis_en" :0, + "ae_enter_ls_sel" :0, + "ae_exit_ls_sel" :0, + "ae_win_mode_sel" :0, + "ae_back_light_mode_sel" :2, + "ae_day_change_en" :0, + "ae_day_change_sel" :0, + "ae_win_stth" :0, + "ae_win_sttv" :0, + "ae_win_endh" :639, + "ae_win_endv" :479, + "ae_yobj" :50, + "ae_av_rg" :14, + "ae_l_ex_time" :1000, + "ae_m_ex_time" :32, + "ae_s_ex_time" :32, + "ae_agc" :256, + "ae_ad_shuttle_freq" :1, + "ae_ad_gain_freq" :1, + "ae_adjust_step_max":6, + "ae_ex_value_max" :1050, + "ae_ex_value_mid" :256, + "ae_ex_value_min" :1, + "ae_gain_value_max" :3968, + "ae_gain_value_mid" :512, + "ae_gain_value_min" :256, + "ae_dn_switch_ad_step_max" :512, + "ae_dn_switch_wait_time" :255, + "ape_max_diff" :12, + "ape_drv_signal_max" :3840, + "ape_coeff_distance" :0, + "ape_coeff_speed" :0, + "ape_coeff_acceleration" :0, + "ape_drv_manual_value" :4095, + "ape_damp_manual_value" :2048 + }, + "awb":{ + "awb_d65_en" :0, + "awb_ccm_en" :0, + "awb_en" :0, + "awb_mode_sel" :0, + "awb_hist_mode_sel" :0, + "awb_veri_en" :0, + "awb_fb_en" :0, + "awb_value_save_en" :0, + "awb_ccm_adp_adjust_en" :0, + "awb_stab_en" :1, + "awb_d65_red_gain" :256, + "awb_d65_blue_gain" :256, + "ccm_rr" :256, + "ccm_rg" :0, + "ccm_rb" :0, + "ccm_gr" :0, + "ccm_gg" :256, + "ccm_gb" :0, + "ccm_br" :0, + "ccm_bg" :0, + "ccm_bb" :256, + "ccm_correct_coff" :256, + "awb_win_stth" :0, + "awb_win_sttv" :0, + "awb_win_endh" :1919, + "awb_win_endv" :1079, + "awb_correct_diff_th" :8, + "awb_color_changeres_time" :8, + "awb_historgram_th" :4, + "awb_red_gain_adjust" :256, + "awb_green_gain_adjust" :256, + "awb_blue_gain_adjust" :256, + "awb_red_max_value" :240, + "awb_blue_max_value" :379, + "awb_red_min_value" :176, + "awb_blue_min_value" :281, + "awb_red_obj_value" :256, + "awb_blue_obj_value" :256 + }, + "wdr":{ + "wdr_fusion_en" :0, + "wdr_frame_sel" :0, + "wdr_adp_adjust_en" :0, + "wdr_stab_en" :0, + "wdr_en" :0, + "wdr_ghost_remove_en" :0, + "wdr_3frame_out_mode" :0, + "wdr_mode_sel" :0, + "wdr_2frame_ex_ratio" :1, + "wdr_3frame_ex_ratio" :1, + "wdr_stat_img_sel" :0, + "wdr_ltm_data_sel" :1, + "wdr_tz_data_sel" :1, + "wdr_remove_purple_en" :0, + "wdr_over_ex_ratio_th1" :384, + "wdr_over_ex_ratio_th2" :32, + "wdr_fusion_ratio_th" :192, + "wdr_fusion_value1" :64, + "wdr_fusion_value2" :16 + }, + "csc":{ + "rgb2yuv_00":153, + "rgb2yuv_01":256, + "rgb2yuv_02":86, + "rgb2yuv_10":301, + "rgb2yuv_11":214, + "rgb2yuv_12":170, + "rgb2yuv_20":58, + "rgb2yuv_21":42, + "rgb2yuv_22":256 + }, + "ada":{ + "gm_rgb_en" :1, + "gm_yuv_en" :0, + "ada_en" :1, + "ada_sbz_en" :0, + "ada_ccr_en" :0, + "ada_adp_en" :0, + "ada_adp_ccr_en" :0, + "ada_stat_mode_sel" :0, + "ada_enh_mode_sel" :0, + "ada_hist_max" :128, + "ada_ttl_max" :255, + "ada_win_stth" :0, + "ada_win_sttv" :0, + "ada_win_endh" :1919, + "ada_win_endv" :1079 + }, + "rgb-ir":{ + "raw_fmt" :0, + "rgbir_rct_en" :0, + "dfc_en" :0, + "rgbir_fs_en" :0, + "rgbir_ot_sl" :0, + "rgbir_fs_max" :256, + "dfc_krb" :0, + "dfc_ky" :0, + "dfc_th" :256, + "dfc_th_1" :256 + }, + "2dnr":{ + "dpeak_en" :1, + "nr2d_raw_en" :1, + "nr2d_eg_en" :1, + "nr2d_jl_en" :1, + "nr2d_av_en" :1, + "nr2d_c_en" :0, + "dpeak_adp_en" :0, + "nr2d_raw_adp_en":0, + "nr2d_y_adp_en" :0, + "nr2d_c_adp_en" :0, + "nr2d_raw_kl" :12, + "nr2d_jl_th" :128, + "nr2d_eg_k" :24, + "nr2d_y_k" :16, + "nr2d_c_k" :1 + }, + "3dnr":{ + "nr3d_en" :1, + "nr3dp_y_en" :1, + "nr3dp_c_en" :0, + "nr3dm_y_en" :1, + "nr3dm_c_en" :0, + "nr3db_y_en" :1, + "nr3db_c_en" :0, + "nr3dm_nr2d_y_en" :1, + "nr3dm_nr2d_c_en" :0, + "core_3dnr_wb_en" :1, + "core_3dnr_wb_sel" :1, + "core_3dnr_adp_luma_en" :0, + "core_3dnr_adp_chroma_en" :0, + "nr3dp_thy" :64, + "nr3dp_thyp" :64, + "nr3dp_thcp" :64, + "nr3dm_mid_th" :128, + "nr3dm_mtp_th" :8, + "nr3dm_mtc_th" :128, + "nr3dm_ym_k" :60, + "nr3dm_thy" :64, + "nr3dm_min" :0, + "nr3dm_thw0" :128, + "core_3dnr_chroma_intensity" :16, + "nr3db_nr2d_eg_th" :64, + "nr3db_thyp" :64, + "nr3db_thcp" :32 + }, + "enh":{ + "ltm":{ + "enh_ltm_en" :1, + "enh_adp_ltm_en" :0, + "ltm_gain" :128, + "ltm_mm_th" :128 + }, + "sharp":{ + "enh_sharp_en" :1, + "enh_adp_sharp_en" :0, + "shp_core" :8, + "shp_th1" :3840, + "shp_th2" :4095, + "shp_gain" :64 + }, + "cc":{ + "enh_cc_en" :0, + "enh_adp_cc_en" :0 + } + }, + "post_ctl":{ + "otc_ctl":{ + "otc_en" :0, + "otc_yc_sl" :0, + "otc_uv_sl" :1, + "otc_hs_plt_sl" :0, + "otc_vs_plt_sl" :0, + "otc_stt_vr" :0, + "otc_stt_hr" :0 + }, + "ctrst":{ + "ctrst_en" :1, + "ctrst_gain":128 + }, + "luma":{ + "luma_en" :1, + "luma_gain":150 + }, + "strt":{ + "strt_en" :1, + "strt_gain":0 + } + }, + "ldc":{ + "ldc_en" :0, + "ldc_rct_en" :0, + "ldc_rq_frq" :128, + "ldc_stt_ln" :540, + "ldc_ch" :960, + "ldc_cv" :540, + "ldc_cr" :684, + "ldc_cz" :684 + }, + "af":{ + "af_stat_en" :1, + "af_stat_mode_sel" :0, + "af_stat_win_h_start":0, + "af_stat_win_v_start":0, + "af_stat_win_h_end" :1919, + "af_stat_win_v_end" :1079 + } + }, + "isp_post":{ + "rgb2yuv":{ + "osd_rgb2yuv_coeff00":306, + "osd_rgb2yuv_coeff01":601, + "osd_rgb2yuv_coeff02":117, + "osd_rgb2yuv_coeff03":0, + "osd_rgb2yuv_coeff10":3920, + "osd_rgb2yuv_coeff11":3749, + "osd_rgb2yuv_coeff12":523, + "osd_rgb2yuv_coeff13":128, + "osd_rgb2yuv_coeff20":523, + "osd_rgb2yuv_coeff21":3658, + "osd_rgb2yuv_coeff22":4011, + "osd_rgb2yuv_coeff23":128 + }, + "yuv2rgb":{ + "out_yuv2rgb_coeff00":1024, + "out_yuv2rgb_coeff01":0, + "out_yuv2rgb_coeff02":1441, + "out_yuv2rgb_coeff03":3916, + "out_yuv2rgb_coeff10":1024, + "out_yuv2rgb_coeff11":3742, + "out_yuv2rgb_coeff12":3362, + "out_yuv2rgb_coeff13":136, + "out_yuv2rgb_coeff20":1024, + "out_yuv2rgb_coeff21":1822, + "out_yuv2rgb_coeff22":0, + "out_yuv2rgb_coeff23":3868 + }, + "ds0":{ + "ds0_out_rgb_mode":0, + "ds0_out_rgb_en":0, + "ds0_out_yuv_mode":0, + "ds0_out_uv_swap":0, + "ds0_osd0":{ + "ds0_osd0_enable":0, + "ds0_osd0_type":0, + "ds0_osd0_alpha_tpye":0, + "ds0_osd0_vst":0, + "ds0_osd0_hst":0, + "ds0_osd0_vend":0, + "ds0_osd0_hend":0, + "ds0_osd0_dma_request_length":0, + "ds0_osd0_dma_map":0, + "ds0_osd0_rgb_rev":0, + "ds0_osd0_global_alpha":0, + "ds0_osd0_swap_64":0, + "ds0_osd0_outstanding_num":0, + "ds0_osd0_bd_limit_en":0 + }, + "ds0_osd1":{ + "ds0_osd1_enable":0, + "ds0_osd1_type":0, + "ds0_osd1_alpha_tpye":0, + "ds0_osd1_vst":0, + "ds0_osd1_hst":0, + "ds0_osd1_vend":0, + "ds0_osd1_hend":0, + "ds0_osd1_dma_request_length":0, + "ds0_osd1_dma_map":0, + "ds0_osd1_rgb_rev":0, + "ds0_osd1_global_alpha":0, + "ds0_osd1_swap_64":0, + "ds0_osd1_outstanding_num":0, + "ds0_osd1_bd_limit_en":0 + }, + "ds0_osd2":{ + "ds0_osd2_enable":0, + "ds0_osd2_type":0, + "ds0_osd2_alpha_tpye":0, + "ds0_osd2_vst":0, + "ds0_osd2_hst":0, + "ds0_osd2_vend":0, + "ds0_osd2_hend":0, + "ds0_osd2_dma_request_length":0, + "ds0_osd2_dma_map":0, + "ds0_osd2_rgb_rev":0, + "ds0_osd2_global_alpha":0, + "ds0_osd2_swap_64":0, + "ds0_osd2_outstanding_num":0, + "ds0_osd2_bd_limit_en":0 + } + }, + "ds1":{ + "ds1_out_rgb_mode":0, + "ds1_out_rgb_en":0, + "ds1_out_yuv_mode":0, + "ds1_out_uv_swap":0, + "ds1_osd0":{ + "ds1_osd0_enable":0, + "ds1_osd0_type":0, + "ds1_osd0_alpha_tpye":0, + "ds1_osd0_vst":0, + "ds1_osd0_hst":0, + "ds1_osd0_vend":0, + "ds1_osd0_hend":0, + "ds1_osd0_dma_request_length":0, + "ds1_osd0_dma_map":0, + "ds1_osd0_rgb_rev":0, + "ds1_osd0_global_alpha":0, + "ds1_osd0_swap_64":0, + "ds1_osd0_outstanding_num":0, + "ds1_osd0_bd_limit_en":0 + }, + "ds1_osd1":{ + "ds1_osd1_enable":0, + "ds1_osd1_type":0, + "ds1_osd1_alpha_tpye":0, + "ds1_osd1_vst":0, + "ds1_osd1_hst":0, + "ds1_osd1_vend":0, + "ds1_osd1_hend":0, + "ds1_osd1_dma_request_length":0, + "ds1_osd1_dma_map":0, + "ds1_osd1_rgb_rev":0, + "ds1_osd1_global_alpha":0, + "ds1_osd1_swap_64":0, + "ds1_osd1_outstanding_num":0, + "ds1_osd1_bd_limit_en":0 + }, + "ds1_osd2":{ + "ds1_osd2_enable":0, + "ds1_osd2_type":0, + "ds1_osd2_alpha_tpye":0, + "ds1_osd2_vst":0, + "ds1_osd2_hst":0, + "ds1_osd2_vend":0, + "ds1_osd2_hend":0, + "ds1_osd2_dma_request_length":0, + "ds1_osd2_dma_map":0, + "ds1_osd2_rgb_rev":0, + "ds1_osd2_global_alpha":0, + "ds1_osd2_swap_64":0, + "ds1_osd2_outstanding_num":0, + "ds1_osd2_bd_limit_en":0 + } + }, + "ds2":{ + "ds2_out_rgb_mode":0, + "ds2_out_rgb_en":1, + "ds2_out_yuv_mode":0, + "ds2_out_uv_swap":0, + "ds2_osd0":{ + "ds2_osd0_enable":0, + "ds2_osd0_type":0, + "ds2_osd0_alpha_tpye":0, + "ds2_osd0_vst":0, + "ds2_osd0_hst":0, + "ds2_osd0_vend":0, + "ds2_osd0_hend":0, + "ds2_osd0_dma_request_length":0, + "ds2_osd0_dma_map":0, + "ds2_osd0_rgb_rev":0, + "ds2_osd0_global_alpha":0, + "ds2_osd0_swap_64":0, + "ds2_osd0_outstanding_num":0, + "ds2_osd0_bd_limit_en":0 + }, + "ds2_osd1":{ + "ds2_osd1_enable":0, + "ds2_osd1_type":0, + "ds2_osd1_alpha_tpye":0, + "ds2_osd1_vst":0, + "ds2_osd1_hst":0, + "ds2_osd1_vend":0, + "ds2_osd1_hend":0, + "ds2_osd1_dma_request_length":0, + "ds2_osd1_dma_map":0, + "ds2_osd1_rgb_rev":0, + "ds2_osd1_global_alpha":0, + "ds2_osd1_swap_64":0, + "ds2_osd1_outstanding_num":0, + "ds2_osd1_bd_limit_en":0 + } + } + } +} diff --git a/package/mediactl_lib/src/config/video_drm_1080x1920.conf b/package/mediactl_lib/src/config/video_drm_1080x1920.conf index f3b86d4..c91939e 100644 --- a/package/mediactl_lib/src/config/video_drm_1080x1920.conf +++ b/package/mediactl_lib/src/config/video_drm_1080x1920.conf @@ -1,322 +1,322 @@ -{ - "sensor0":{ - "sensor0_name":"m00_f_imx219_0 0-0010", - "sensor0_cfg_file":"imx219_1080x1920_0.conf", - "sensor0_total_size":{ - "sensor0_total_width":3453, - "sensor0_total_height":1979 - }, - "sensor0_active_size":{ - "sensor0_active_width":1080, - "sensor0_active_height":1920 - }, - "/dev/video2":{ - "video2_used":1, - "video2_width":1080, - "video2_height":1920, - "video2_out_format":1 - }, - "/dev/video3":{ - "video3_used":0, - "video3_width":1080, - "video3_height":1920, - "video3_out_format":1 - }, - "/dev/video4":{ - "video4_used":0, - "video4_width":640, - "video4_height":480, - "video4_out_format":1 - }, - "/dev/video5":{ - "video5_used":0, - "video5_width":320, - "video5_height":320, - "video5_height_r":240, - "video5_out_format":1, - "video5_pitch":320 - } - }, - "sensor1":{ - "sensor1_name":"m01_f_imx219_1 3-0010", - "sensor1_cfg_file":"imx219_1.conf", - "sensor1_total_size":{ - "sensor1_total_width":3459, - "sensor1_total_height":1173 - }, - "sensor1_active_size":{ - "sensor1_active_width":1920, - "sensor1_active_height":1080 - }, - "/dev/video6":{ - "video6_used":0, - "video6_width":1920, - "video6_height":1080, - "video6_out_format":1 - }, - "/dev/video7":{ - "video7_used":0, - "video7_width":1080, - "video7_height":720, - "video7_out_format":1 - }, - "/dev/video8":{ - "video8_used":0, - "video8_width":640, - "video8_height":480, - "video8_out_format":1 - }, - "/dev/video9":{ - "video9_used":0, - "video9_width":320, - "video9_height":240, - "video9_height_r":240, - "video9_out_format":1, - "video9_pitch":320 - } - }, - "mipi_csi2":{ - "csi0_used":1, - "csi0_sony_wdr":0, - "csi0_lane_nb":2, - "csi0_dl0_map":1, - "csi0_dl1_map":2, - "csi0_dl2_map":3, - "csi0_dl3_map":4, - "csi00_datatype_select0":43, - "csi00_datatype_select1":42, - "csi00_vc_select":1, - "csi01_datatype_select0":43, - "csi01_datatype_select1":42, - "csi01_vc_select":2, - "csi02_datatype_select0":43, - "csi02_datatype_select1":42, - "csi02_vc_select":4, - "csi1_used":1, - "csi1_sony_wdr":0, - "csi1_lane_nb":2, - "csi1_dl0_map":3, - "csi1_dl1_map":4, - "csi1_dl2_map":1, - "csi1_dl3_map":2, - "csi10_datatype_select0":43, - "csi10_datatype_select1":42, - "csi10_vc_select":1 - }, - "isp_vi":{ - "vi_wrap":{ - "dphy_mode":0, - "sony_mode":0, - "sensor0_interface_en":1, - "sensor0_tpg_w_en":0, - "sensor0_tpg_r_en":0, - "sensor0_wdr_sensor_vendor":0, - "sensor0_wdr_mode":0, - "sensor0_mipi_mode":0, - "sensor0_isp_pipeline":1, - "sensor1_interface_en":1, - "sensor1_tpg_w_en":0, - "sensor1_tpg_r_en":0, - "sensor1_wdr_sensor_vendor":0, - "sensor1_wdr_mode":0, - "sensor1_mipi_mode":0, - "sensor1_isp_pipeline":2, - "sensor2_interface_en":0, - "sensor2_tpg_w_en":0, - "sensor2_tpg_r_en":0, - "sensor2_wdr_sensor_vendor":0, - "sensor2_wdr_mode":0, - "sensor2_mipi_mode":0, - "sensor2_isp_pipeline":2 - }, - "vi_pipe00":{ - "p00_win_mode_en":1, - "p00_input_ch_sel":1, - "p00_ch_mode_sel":1, - "p00_pixel_type":0, - "p00_yuv_in_format":0, - "p00_yuv_out_format":0, - "p00_yuv422_order":0, - "p00_pixel_width":1, - "p00_data_out_timming_ctrl":3, - "p00_sync_pulse_mode":0, - "p00_sen_mipi_clk_pol":1, - "p00_sen_mipi_vsync_pol":0, - "p00_sen_mipi_hsync_pol":0, - "p00_sen_mipi_field_pol":1, - "p00_isp_clk_pol":1, - "p00_isp_vsync_pol":1, - "p00_isp_hsync_pol":1, - "p00_isp_field_pol":1, - "p00_tpg_w_en":0, - "p00_tpg_r_en":0, - "p00_w_st_width":0, - "p00_w_st_height":16383, - "p00_r_st_width":279, - "p00_r_st_height":44, - "p00_tof_mode_enable":0, - "p00_vi_pipe_tpg_tof_frm_num":3, - "p00_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe01":{ - "p01_win_mode_en":1, - "p01_input_ch_sel":1, - "p01_ch_mode_sel":1, - "p01_pixel_type":0, - "p01_yuv_in_format":0, - "p01_yuv_out_format":0, - "p01_yuv422_order":0, - "p01_pixel_width":1, - "p01_data_out_timming_ctrl":3, - "p01_sync_pulse_mode":0, - "p01_sen_mipi_clk_pol":1, - "p01_sen_mipi_vsync_pol":0, - "p01_sen_mipi_hsync_pol":0, - "p01_sen_mipi_field_pol":1, - "p01_isp_clk_pol":1, - "p01_isp_vsync_pol":1, - "p01_isp_hsync_pol":1, - "p01_isp_field_pol":1, - "p01_tpg_w_en":0, - "p01_tpg_r_en":0, - "p01_total_width":3453, - "p01_total_height":1979, - "p01_in_width":1920, - "p01_in_height":1080, - "p01_w_st_width":0, - "p01_w_st_height":16383, - "p01_r_st_width":279, - "p01_r_st_height":44, - "p01_vi_pipe_w_addr_y0 ":0, - "p01_vi_pipe_w_addr_y1 ":0, - "p01_vi_pipe_w_addr_uv0":0, - "p01_vi_pipe_w_addr_uv1":0, - "p01_vi_pipe_r_addr_y0 ":0, - "p01_vi_pipe_r_addr_y1 ":0, - "p01_vi_pipe_addr_stride":0, - "p01_tof_mode_enable":0, - "p01_vi_pipe_tpg_tof_frm_num":3, - "p01_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe02":{ - "p02_win_mode_en":1, - "p02_input_ch_sel":1, - "p02_ch_mode_sel":1, - "p02_pixel_type":0, - "p02_yuv_in_format":0, - "p02_yuv_out_format":0, - "p02_yuv422_order":0, - "p02_pixel_width":1, - "p02_data_out_timming_ctrl":3, - "p02_sync_pulse_mode":0, - "p02_sen_mipi_clk_pol":1, - "p02_sen_mipi_vsync_pol":0, - "p02_sen_mipi_hsync_pol":0, - "p02_sen_mipi_field_pol":1, - "p02_isp_clk_pol":1, - "p02_isp_vsync_pol":1, - "p02_isp_hsync_pol":1, - "p02_isp_field_pol":1, - "p02_tpg_w_en":0, - "p02_tpg_r_en":0, - "p02_total_width":3457, - "p02_total_height":1969, - "p02_in_width":1920, - "p02_in_height":1080, - "p02_w_st_width":0, - "p02_w_st_height":16383, - "p02_r_st_width":279, - "p02_r_st_height":44, - "p02_vi_pipe_w_addr_y0 ":0, - "p02_vi_pipe_w_addr_y1 ":0, - "p02_vi_pipe_w_addr_uv0":0, - "p02_vi_pipe_w_addr_uv1":0, - "p02_vi_pipe_r_addr_y0 ":0, - "p02_vi_pipe_r_addr_y1 ":0, - "p02_vi_pipe_addr_stride":0, - "p02_tof_mode_enable":0, - "p02_vi_pipe_tpg_tof_frm_num":3, - "p02_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe10":{ - "p10_win_mode_en":1, - "p10_input_ch_sel":1, - "p10_ch_mode_sel":1, - "p10_pixel_type":0, - "p10_yuv_in_format":0, - "p10_yuv_out_format":0, - "p10_yuv422_order":0, - "p10_pixel_width":1, - "p10_data_out_timming_ctrl":3, - "p10_sync_pulse_mode":0, - "p10_sen_mipi_clk_pol":1, - "p10_sen_mipi_vsync_pol":0, - "p10_sen_mipi_hsync_pol":0, - "p10_sen_mipi_field_pol":1, - "p10_isp_clk_pol":1, - "p10_isp_vsync_pol":1, - "p10_isp_hsync_pol":1, - "p10_isp_field_pol":1, - "p10_tpg_w_en":0, - "p10_tpg_r_en":0, - "p10_total_width":3457, - "p10_total_height":1969, - "p10_in_width":1920, - "p10_in_height":1080, - "p10_w_st_width":0, - "p10_w_st_height":16383, - "p10_r_st_width":279, - "p10_r_st_height":44, - "p10_vi_pipe_w_addr_y0 ":0, - "p10_vi_pipe_w_addr_y1 ":0, - "p10_vi_pipe_w_addr_uv0":0, - "p10_vi_pipe_w_addr_uv1":0, - "p10_vi_pipe_r_addr_y0 ":0, - "p10_vi_pipe_r_addr_y1 ":0, - "p10_vi_pipe_addr_stride":0, - "p10_tof_mode_enable":0, - "p10_vi_pipe_tpg_tof_frm_num":3, - "p10_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_dvp00":{ - "dvp00_win_mode_en":1, - "dvp00_input_ch_sel":1, - "dvp00_ch_mode_sel":1, - "dvp00_pixel_type":0, - "dvp00_yuv_in_format":0, - "dvp00_yuv_out_format":0, - "dvp00_yuv422_order":0, - "dvp00_pixel_width":1, - "dvp00_data_out_timming_ctrl":3, - "dvp00_sync_pulse_mode":0, - "dvp00_sen_mipi_clk_pol":1, - "dvp00_sen_mipi_vsync_pol":0, - "dvp00_sen_mipi_hsync_pol":0, - "dvp00_sen_mipi_field_pol":1, - "dvp00_isp_clk_pol":1, - "dvp00_isp_vsync_pol":1, - "dvp00_isp_hsync_pol":1, - "dvp00_isp_field_pol":1, - "dvp00_tpg_w_en":0, - "dvp00_tpg_r_en":0, - "dvp00_total_width":3457, - "dvp00_total_height":1969, - "dvp00_in_width":1920, - "dvp00_in_height":1080, - "dvp00_w_st_width":0, - "dvp00_w_st_height":16383, - "dvp00_r_st_width":279, - "dvp00_r_st_height":44, - "dvp00_vi_pipe_w_addr_y0 ":0, - "dvp00_vi_pipe_w_addr_y1 ":0, - "dvp00_vi_pipe_w_addr_uv0":0, - "dvp00_vi_pipe_w_addr_uv1":0, - "dvp00_vi_pipe_r_addr_y0 ":0, - "dvp00_vi_pipe_r_addr_y1 ":0, - "dvp00_vi_pipe_addr_stride":0, - "dvp00_tof_mode_enable":0, - "dvp00_vi_pipe_tpg_tof_frm_num":3, - "dvp00_vi_pipe_tpg_tof_frm_stride":66432 - } - } -} +{ + "sensor0": { + "sensor0_name": "m00_f_imx219_0 0-0010", + "sensor0_cfg_file": "imx219_1080x1920_0.conf", + "sensor0_total_size": { + "sensor0_total_width": 3453, + "sensor0_total_height": 1979 + }, + "sensor0_active_size": { + "sensor0_active_width": 1088, + "sensor0_active_height": 1928 + }, + "/dev/video2": { + "video2_used": 1, + "video2_width": 1080, + "video2_height": 1920, + "video2_out_format": 1 + }, + "/dev/video3": { + "video3_used": 0, + "video3_width": 1080, + "video3_height": 1920, + "video3_out_format": 1 + }, + "/dev/video4": { + "video4_used": 0, + "video4_width": 640, + "video4_height": 480, + "video4_out_format": 1 + }, + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 + } + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3459, + "sensor1_total_height": 1173 + }, + "sensor1_active_size": { + "sensor1_active_width": 1936, + "sensor1_active_height": 1088 + }, + "/dev/video6": { + "video6_used": 0, + "video6_width": 1920, + "video6_height": 1080, + "video6_out_format": 1 + }, + "/dev/video7": { + "video7_used": 0, + "video7_width": 1080, + "video7_height": 720, + "video7_out_format": 1 + }, + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 + }, + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 + } + }, + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 0, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 43, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 43, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 43, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 3, + "csi1_dl1_map": 4, + "csi1_dl2_map": 1, + "csi1_dl3_map": 2, + "csi10_datatype_select0": 43, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 0, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 1, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 1, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 3453, + "p01_total_height": 1977, + "p01_in_width": 1920, + "p01_in_height": 1080, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 1, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 3453, + "p02_total_height": 1977, + "p02_in_width": 1920, + "p02_in_height": 1080, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 1, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 3453, + "p10_total_height": 1977, + "p10_in_width": 1920, + "p10_in_height": 1080, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 1, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 3453, + "dvp00_total_height": 1977, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} diff --git a/package/mediactl_lib/src/config/video_drm_1080x1920_r2k.conf b/package/mediactl_lib/src/config/video_drm_1080x1920_r2k.conf index 7066146..f991135 100644 --- a/package/mediactl_lib/src/config/video_drm_1080x1920_r2k.conf +++ b/package/mediactl_lib/src/config/video_drm_1080x1920_r2k.conf @@ -1,322 +1,322 @@ { - "sensor0":{ - "sensor0_name":"m00_f_imx219_0 0-0010", - "sensor0_cfg_file":"imx219_0.conf", - "sensor0_total_size":{ - "sensor0_total_width":3459, - "sensor0_total_height":1173 + "sensor0": { + "sensor0_name": "m00_f_imx219_0 0-0010", + "sensor0_cfg_file": "imx219_0.conf", + "sensor0_total_size": { + "sensor0_total_width": 3459, + "sensor0_total_height": 1173 }, - "sensor0_active_size":{ - "sensor0_active_width":1920, - "sensor0_active_height":1080 + "sensor0_active_size": { + "sensor0_active_width": 1936, + "sensor0_active_height": 1088 }, - "/dev/video2":{ - "video2_used":0, - "video2_width":1920, - "video2_height":1080, - "video2_out_format":1 + "/dev/video2": { + "video2_used": 0, + "video2_width": 1920, + "video2_height": 1080, + "video2_out_format": 1 }, - "/dev/video3":{ - "video3_used":0, - "video3_width":1920, - "video3_height":1080, - "video3_out_format":1 + "/dev/video3": { + "video3_used": 0, + "video3_width": 1920, + "video3_height": 1080, + "video3_out_format": 1 }, - "/dev/video4":{ - "video4_used":0, - "video4_width":640, - "video4_height":480, - "video4_out_format":1 + "/dev/video4": { + "video4_used": 0, + "video4_width": 640, + "video4_height": 480, + "video4_out_format": 1 }, - "/dev/video5":{ - "video5_used":0, - "video5_width":320, - "video5_height":320, - "video5_height_r":240, - "video5_out_format":1, - "video5_pitch":320 + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 } - }, - "sensor1":{ - "sensor1_name":"m01_f_imx219_1 3-0010", - "sensor1_cfg_file":"imx219_1080x1920_1.conf", - "sensor1_total_size":{ - "sensor1_total_width":3453, - "sensor1_total_height":1979 + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1080x1920_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3453, + "sensor1_total_height": 1977 }, - "sensor1_active_size":{ - "sensor1_active_width":1080, - "sensor1_active_height":1920 + "sensor1_active_size": { + "sensor1_active_width": 1088, + "sensor1_active_height": 1928 }, - "/dev/video6":{ - "video6_used":0, - "video6_width":1080, - "video6_height":1920, - "video6_out_format":1 + "/dev/video6": { + "video6_used": 0, + "video6_width": 1080, + "video6_height": 1920, + "video6_out_format": 1 }, - "/dev/video7":{ - "video7_used":1, - "video7_width":1080, - "video7_height":1920, - "video7_out_format":1 + "/dev/video7": { + "video7_used": 1, + "video7_width": 1080, + "video7_height": 1920, + "video7_out_format": 1 }, - "/dev/video8":{ - "video8_used":0, - "video8_width":640, - "video8_height":480, - "video8_out_format":1 + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 }, - "/dev/video9":{ - "video9_used":0, - "video9_width":320, - "video9_height":240, - "video9_height_r":240, - "video9_out_format":1, - "video9_pitch":320 + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 } }, - "mipi_csi2":{ - "csi0_used":1, - "csi0_sony_wdr":0, - "csi0_lane_nb":2, - "csi0_dl0_map":1, - "csi0_dl1_map":2, - "csi0_dl2_map":3, - "csi0_dl3_map":4, - "csi00_datatype_select0":43, - "csi00_datatype_select1":42, - "csi00_vc_select":1, - "csi01_datatype_select0":43, - "csi01_datatype_select1":42, - "csi01_vc_select":2, - "csi02_datatype_select0":43, - "csi02_datatype_select1":42, - "csi02_vc_select":4, - "csi1_used":1, - "csi1_sony_wdr":0, - "csi1_lane_nb":2, - "csi1_dl0_map":3, - "csi1_dl1_map":4, - "csi1_dl2_map":1, - "csi1_dl3_map":2, - "csi10_datatype_select0":43, - "csi10_datatype_select1":42, - "csi10_vc_select":1 - }, - "isp_vi":{ - "vi_wrap":{ - "dphy_mode":0, - "sony_mode":0, - "sensor0_interface_en":1, - "sensor0_tpg_w_en":0, - "sensor0_tpg_r_en":0, - "sensor0_wdr_sensor_vendor":0, - "sensor0_wdr_mode":0, - "sensor0_mipi_mode":0, - "sensor0_isp_pipeline":1, - "sensor1_interface_en":1, - "sensor1_tpg_w_en":0, - "sensor1_tpg_r_en":0, - "sensor1_wdr_sensor_vendor":0, - "sensor1_wdr_mode":0, - "sensor1_mipi_mode":0, - "sensor1_isp_pipeline":2, - "sensor2_interface_en":0, - "sensor2_tpg_w_en":0, - "sensor2_tpg_r_en":0, - "sensor2_wdr_sensor_vendor":0, - "sensor2_wdr_mode":0, - "sensor2_mipi_mode":0, - "sensor2_isp_pipeline":2 - }, - "vi_pipe00":{ - "p00_win_mode_en":1, - "p00_input_ch_sel":1, - "p00_ch_mode_sel":1, - "p00_pixel_type":0, - "p00_yuv_in_format":0, - "p00_yuv_out_format":0, - "p00_yuv422_order":0, - "p00_pixel_width":1, - "p00_data_out_timming_ctrl":3, - "p00_sync_pulse_mode":0, - "p00_sen_mipi_clk_pol":1, - "p00_sen_mipi_vsync_pol":0, - "p00_sen_mipi_hsync_pol":0, - "p00_sen_mipi_field_pol":1, - "p00_isp_clk_pol":1, - "p00_isp_vsync_pol":1, - "p00_isp_hsync_pol":1, - "p00_isp_field_pol":1, - "p00_tpg_w_en":0, - "p00_tpg_r_en":0, - "p00_w_st_width":0, - "p00_w_st_height":16383, - "p00_r_st_width":279, - "p00_r_st_height":44, - "p00_tof_mode_enable":0, - "p00_vi_pipe_tpg_tof_frm_num":3, - "p00_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe01":{ - "p01_win_mode_en":1, - "p01_input_ch_sel":1, - "p01_ch_mode_sel":1, - "p01_pixel_type":0, - "p01_yuv_in_format":0, - "p01_yuv_out_format":0, - "p01_yuv422_order":0, - "p01_pixel_width":1, - "p01_data_out_timming_ctrl":3, - "p01_sync_pulse_mode":0, - "p01_sen_mipi_clk_pol":1, - "p01_sen_mipi_vsync_pol":0, - "p01_sen_mipi_hsync_pol":0, - "p01_sen_mipi_field_pol":1, - "p01_isp_clk_pol":1, - "p01_isp_vsync_pol":1, - "p01_isp_hsync_pol":1, - "p01_isp_field_pol":1, - "p01_tpg_w_en":0, - "p01_tpg_r_en":0, - "p01_total_width":3453, - "p01_total_height":1979, - "p01_in_width":1080, - "p01_in_height":1920, - "p01_w_st_width":0, - "p01_w_st_height":16383, - "p01_r_st_width":279, - "p01_r_st_height":44, - "p01_vi_pipe_w_addr_y0 ":0, - "p01_vi_pipe_w_addr_y1 ":0, - "p01_vi_pipe_w_addr_uv0":0, - "p01_vi_pipe_w_addr_uv1":0, - "p01_vi_pipe_r_addr_y0 ":0, - "p01_vi_pipe_r_addr_y1 ":0, - "p01_vi_pipe_addr_stride":0, - "p01_tof_mode_enable":0, - "p01_vi_pipe_tpg_tof_frm_num":3, - "p01_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe02":{ - "p02_win_mode_en":1, - "p02_input_ch_sel":1, - "p02_ch_mode_sel":1, - "p02_pixel_type":0, - "p02_yuv_in_format":0, - "p02_yuv_out_format":0, - "p02_yuv422_order":0, - "p02_pixel_width":1, - "p02_data_out_timming_ctrl":3, - "p02_sync_pulse_mode":0, - "p02_sen_mipi_clk_pol":1, - "p02_sen_mipi_vsync_pol":0, - "p02_sen_mipi_hsync_pol":0, - "p02_sen_mipi_field_pol":1, - "p02_isp_clk_pol":1, - "p02_isp_vsync_pol":1, - "p02_isp_hsync_pol":1, - "p02_isp_field_pol":1, - "p02_tpg_w_en":0, - "p02_tpg_r_en":0, - "p02_total_width":3453, - "p02_total_height":1979, - "p02_in_width":1080, - "p02_in_height":1920, - "p02_w_st_width":0, - "p02_w_st_height":16383, - "p02_r_st_width":279, - "p02_r_st_height":44, - "p02_vi_pipe_w_addr_y0 ":0, - "p02_vi_pipe_w_addr_y1 ":0, - "p02_vi_pipe_w_addr_uv0":0, - "p02_vi_pipe_w_addr_uv1":0, - "p02_vi_pipe_r_addr_y0 ":0, - "p02_vi_pipe_r_addr_y1 ":0, - "p02_vi_pipe_addr_stride":0, - "p02_tof_mode_enable":0, - "p02_vi_pipe_tpg_tof_frm_num":3, - "p02_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe10":{ - "p10_win_mode_en":1, - "p10_input_ch_sel":1, - "p10_ch_mode_sel":1, - "p10_pixel_type":0, - "p10_yuv_in_format":0, - "p10_yuv_out_format":0, - "p10_yuv422_order":0, - "p10_pixel_width":1, - "p10_data_out_timming_ctrl":3, - "p10_sync_pulse_mode":0, - "p10_sen_mipi_clk_pol":1, - "p10_sen_mipi_vsync_pol":0, - "p10_sen_mipi_hsync_pol":0, - "p10_sen_mipi_field_pol":1, - "p10_isp_clk_pol":1, - "p10_isp_vsync_pol":1, - "p10_isp_hsync_pol":1, - "p10_isp_field_pol":1, - "p10_tpg_w_en":0, - "p10_tpg_r_en":0, - "p10_total_width":3453, - "p10_total_height":1979, - "p10_in_width":1080, - "p10_in_height":1920, - "p10_w_st_width":0, - "p10_w_st_height":16383, - "p10_r_st_width":279, - "p10_r_st_height":44, - "p10_vi_pipe_w_addr_y0 ":0, - "p10_vi_pipe_w_addr_y1 ":0, - "p10_vi_pipe_w_addr_uv0":0, - "p10_vi_pipe_w_addr_uv1":0, - "p10_vi_pipe_r_addr_y0 ":0, - "p10_vi_pipe_r_addr_y1 ":0, - "p10_vi_pipe_addr_stride":0, - "p10_tof_mode_enable":0, - "p10_vi_pipe_tpg_tof_frm_num":3, - "p10_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_dvp00":{ - "dvp00_win_mode_en":1, - "dvp00_input_ch_sel":1, - "dvp00_ch_mode_sel":1, - "dvp00_pixel_type":0, - "dvp00_yuv_in_format":0, - "dvp00_yuv_out_format":0, - "dvp00_yuv422_order":0, - "dvp00_pixel_width":1, - "dvp00_data_out_timming_ctrl":3, - "dvp00_sync_pulse_mode":0, - "dvp00_sen_mipi_clk_pol":1, - "dvp00_sen_mipi_vsync_pol":0, - "dvp00_sen_mipi_hsync_pol":0, - "dvp00_sen_mipi_field_pol":1, - "dvp00_isp_clk_pol":1, - "dvp00_isp_vsync_pol":1, - "dvp00_isp_hsync_pol":1, - "dvp00_isp_field_pol":1, - "dvp00_tpg_w_en":0, - "dvp00_tpg_r_en":0, - "dvp00_total_width":3453, - "dvp00_total_height":1979, - "dvp00_in_width":1920, - "dvp00_in_height":1080, - "dvp00_w_st_width":0, - "dvp00_w_st_height":16383, - "dvp00_r_st_width":279, - "dvp00_r_st_height":44, - "dvp00_vi_pipe_w_addr_y0 ":0, - "dvp00_vi_pipe_w_addr_y1 ":0, - "dvp00_vi_pipe_w_addr_uv0":0, - "dvp00_vi_pipe_w_addr_uv1":0, - "dvp00_vi_pipe_r_addr_y0 ":0, - "dvp00_vi_pipe_r_addr_y1 ":0, - "dvp00_vi_pipe_addr_stride":0, - "dvp00_tof_mode_enable":0, - "dvp00_vi_pipe_tpg_tof_frm_num":3, - "dvp00_vi_pipe_tpg_tof_frm_stride":66432 - } - } -} + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 0, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 43, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 43, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 43, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 3, + "csi1_dl1_map": 4, + "csi1_dl2_map": 1, + "csi1_dl3_map": 2, + "csi10_datatype_select0": 43, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 0, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 1, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 1, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 3453, + "p01_total_height": 1977, + "p01_in_width": 1080, + "p01_in_height": 1920, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 1, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 3453, + "p02_total_height": 1977, + "p02_in_width": 1080, + "p02_in_height": 1920, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 1, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 3453, + "p10_total_height": 1977, + "p10_in_width": 1080, + "p10_in_height": 1920, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 1, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 3453, + "dvp00_total_height": 1977, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} diff --git a/package/mediactl_lib/src/config/video_drm_1920x1080.conf b/package/mediactl_lib/src/config/video_drm_1920x1080.conf index e399540..4ebb7d5 100644 --- a/package/mediactl_lib/src/config/video_drm_1920x1080.conf +++ b/package/mediactl_lib/src/config/video_drm_1920x1080.conf @@ -1,322 +1,322 @@ { - "sensor0":{ - "sensor0_name":"m00_f_imx219_0 0-0010", - "sensor0_cfg_file":"imx219_0.conf", - "sensor0_total_size":{ - "sensor0_total_width":3476, - "sensor0_total_height":1166 + "sensor0": { + "sensor0_name": "m00_f_imx219_0 0-0010", + "sensor0_cfg_file": "imx219_0.conf", + "sensor0_total_size": { + "sensor0_total_width": 3476, + "sensor0_total_height": 1166 }, - "sensor0_active_size":{ - "sensor0_active_width":1920, - "sensor0_active_height":1080 + "sensor0_active_size": { + "sensor0_active_width": 1936, + "sensor0_active_height": 1088 }, - "/dev/video2":{ - "video2_used":0, - "video2_width":1920, - "video2_height":1080, - "video2_out_format":1 + "/dev/video2": { + "video2_used": 0, + "video2_width": 1920, + "video2_height": 1080, + "video2_out_format": 1 }, - "/dev/video3":{ - "video3_used":1, - "video3_width":1080, - "video3_height":720, - "video3_out_format":1 + "/dev/video3": { + "video3_used": 1, + "video3_width": 1080, + "video3_height": 720, + "video3_out_format": 1 }, - "/dev/video4":{ - "video4_used":0, - "video4_width":640, - "video4_height":480, - "video4_out_format":1 + "/dev/video4": { + "video4_used": 0, + "video4_width": 640, + "video4_height": 480, + "video4_out_format": 1 }, - "/dev/video5":{ - "video5_used":0, - "video5_width":320, - "video5_height":320, - "video5_height_r":240, - "video5_out_format":1, - "video5_pitch":320 + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 } - }, - "sensor1":{ - "sensor1_name":"m01_f_imx219_1 3-0010", - "sensor1_cfg_file":"imx219_1.conf", - "sensor1_total_size":{ - "sensor1_total_width":3476, - "sensor1_total_height":1166 + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3476, + "sensor1_total_height": 1166 }, - "sensor1_active_size":{ - "sensor1_active_width":1920, - "sensor1_active_height":1080 + "sensor1_active_size": { + "sensor1_active_width": 1936, + "sensor1_active_height": 1088 }, - "/dev/video6":{ - "video6_used":0, - "video6_width":1920, - "video6_height":1080, - "video6_out_format":1 + "/dev/video6": { + "video6_used": 0, + "video6_width": 1920, + "video6_height": 1080, + "video6_out_format": 1 }, - "/dev/video7":{ - "video7_used":1, - "video7_width":1080, - "video7_height":720, - "video7_out_format":1 + "/dev/video7": { + "video7_used": 1, + "video7_width": 1080, + "video7_height": 720, + "video7_out_format": 1 }, - "/dev/video8":{ - "video8_used":0, - "video8_width":640, - "video8_height":480, - "video8_out_format":1 + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 }, - "/dev/video9":{ - "video9_used":0, - "video9_width":320, - "video9_height":240, - "video9_height_r":240, - "video9_out_format":1, - "video9_pitch":320 + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 } }, - "mipi_csi2":{ - "csi0_used":1, - "csi0_sony_wdr":0, - "csi0_lane_nb":2, - "csi0_dl0_map":1, - "csi0_dl1_map":2, - "csi0_dl2_map":3, - "csi0_dl3_map":4, - "csi00_datatype_select0":43, - "csi00_datatype_select1":42, - "csi00_vc_select":1, - "csi01_datatype_select0":43, - "csi01_datatype_select1":42, - "csi01_vc_select":2, - "csi02_datatype_select0":43, - "csi02_datatype_select1":42, - "csi02_vc_select":4, - "csi1_used":1, - "csi1_sony_wdr":0, - "csi1_lane_nb":2, - "csi1_dl0_map":3, - "csi1_dl1_map":4, - "csi1_dl2_map":1, - "csi1_dl3_map":2, - "csi10_datatype_select0":43, - "csi10_datatype_select1":42, - "csi10_vc_select":1 - }, - "isp_vi":{ - "vi_wrap":{ - "dphy_mode":0, - "sony_mode":0, - "sensor0_interface_en":1, - "sensor0_tpg_w_en":0, - "sensor0_tpg_r_en":0, - "sensor0_wdr_sensor_vendor":0, - "sensor0_wdr_mode":0, - "sensor0_mipi_mode":0, - "sensor0_isp_pipeline":1, - "sensor1_interface_en":1, - "sensor1_tpg_w_en":0, - "sensor1_tpg_r_en":0, - "sensor1_wdr_sensor_vendor":0, - "sensor1_wdr_mode":0, - "sensor1_mipi_mode":0, - "sensor1_isp_pipeline":2, - "sensor2_interface_en":0, - "sensor2_tpg_w_en":0, - "sensor2_tpg_r_en":0, - "sensor2_wdr_sensor_vendor":0, - "sensor2_wdr_mode":0, - "sensor2_mipi_mode":0, - "sensor2_isp_pipeline":2 - }, - "vi_pipe00":{ - "p00_win_mode_en":1, - "p00_input_ch_sel":1, - "p00_ch_mode_sel":1, - "p00_pixel_type":0, - "p00_yuv_in_format":0, - "p00_yuv_out_format":0, - "p00_yuv422_order":0, - "p00_pixel_width":1, - "p00_data_out_timming_ctrl":3, - "p00_sync_pulse_mode":0, - "p00_sen_mipi_clk_pol":1, - "p00_sen_mipi_vsync_pol":0, - "p00_sen_mipi_hsync_pol":0, - "p00_sen_mipi_field_pol":1, - "p00_isp_clk_pol":1, - "p00_isp_vsync_pol":1, - "p00_isp_hsync_pol":1, - "p00_isp_field_pol":1, - "p00_tpg_w_en":0, - "p00_tpg_r_en":0, - "p00_w_st_width":0, - "p00_w_st_height":16383, - "p00_r_st_width":279, - "p00_r_st_height":44, - "p00_tof_mode_enable":0, - "p00_vi_pipe_tpg_tof_frm_num":3, - "p00_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe01":{ - "p01_win_mode_en":1, - "p01_input_ch_sel":1, - "p01_ch_mode_sel":1, - "p01_pixel_type":0, - "p01_yuv_in_format":0, - "p01_yuv_out_format":0, - "p01_yuv422_order":0, - "p01_pixel_width":1, - "p01_data_out_timming_ctrl":3, - "p01_sync_pulse_mode":0, - "p01_sen_mipi_clk_pol":1, - "p01_sen_mipi_vsync_pol":0, - "p01_sen_mipi_hsync_pol":0, - "p01_sen_mipi_field_pol":1, - "p01_isp_clk_pol":1, - "p01_isp_vsync_pol":1, - "p01_isp_hsync_pol":1, - "p01_isp_field_pol":1, - "p01_tpg_w_en":0, - "p01_tpg_r_en":0, - "p01_total_width":3476, - "p01_total_height":1166, - "p01_in_width":1920, - "p01_in_height":1080, - "p01_w_st_width":0, - "p01_w_st_height":16383, - "p01_r_st_width":279, - "p01_r_st_height":44, - "p01_vi_pipe_w_addr_y0 ":0, - "p01_vi_pipe_w_addr_y1 ":0, - "p01_vi_pipe_w_addr_uv0":0, - "p01_vi_pipe_w_addr_uv1":0, - "p01_vi_pipe_r_addr_y0 ":0, - "p01_vi_pipe_r_addr_y1 ":0, - "p01_vi_pipe_addr_stride":0, - "p01_tof_mode_enable":0, - "p01_vi_pipe_tpg_tof_frm_num":3, - "p01_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe02":{ - "p02_win_mode_en":1, - "p02_input_ch_sel":1, - "p02_ch_mode_sel":1, - "p02_pixel_type":0, - "p02_yuv_in_format":0, - "p02_yuv_out_format":0, - "p02_yuv422_order":0, - "p02_pixel_width":1, - "p02_data_out_timming_ctrl":3, - "p02_sync_pulse_mode":0, - "p02_sen_mipi_clk_pol":1, - "p02_sen_mipi_vsync_pol":0, - "p02_sen_mipi_hsync_pol":0, - "p02_sen_mipi_field_pol":1, - "p02_isp_clk_pol":1, - "p02_isp_vsync_pol":1, - "p02_isp_hsync_pol":1, - "p02_isp_field_pol":1, - "p02_tpg_w_en":0, - "p02_tpg_r_en":0, - "p02_total_width":3476, - "p02_total_height":1166, - "p02_in_width":1920, - "p02_in_height":1080, - "p02_w_st_width":0, - "p02_w_st_height":16383, - "p02_r_st_width":279, - "p02_r_st_height":44, - "p02_vi_pipe_w_addr_y0 ":0, - "p02_vi_pipe_w_addr_y1 ":0, - "p02_vi_pipe_w_addr_uv0":0, - "p02_vi_pipe_w_addr_uv1":0, - "p02_vi_pipe_r_addr_y0 ":0, - "p02_vi_pipe_r_addr_y1 ":0, - "p02_vi_pipe_addr_stride":0, - "p02_tof_mode_enable":0, - "p02_vi_pipe_tpg_tof_frm_num":3, - "p02_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_pipe10":{ - "p10_win_mode_en":1, - "p10_input_ch_sel":1, - "p10_ch_mode_sel":1, - "p10_pixel_type":0, - "p10_yuv_in_format":0, - "p10_yuv_out_format":0, - "p10_yuv422_order":0, - "p10_pixel_width":1, - "p10_data_out_timming_ctrl":3, - "p10_sync_pulse_mode":0, - "p10_sen_mipi_clk_pol":1, - "p10_sen_mipi_vsync_pol":0, - "p10_sen_mipi_hsync_pol":0, - "p10_sen_mipi_field_pol":1, - "p10_isp_clk_pol":1, - "p10_isp_vsync_pol":1, - "p10_isp_hsync_pol":1, - "p10_isp_field_pol":1, - "p10_tpg_w_en":0, - "p10_tpg_r_en":0, - "p10_total_width":3476, - "p10_total_height":1166, - "p10_in_width":1920, - "p10_in_height":1080, - "p10_w_st_width":0, - "p10_w_st_height":16383, - "p10_r_st_width":279, - "p10_r_st_height":44, - "p10_vi_pipe_w_addr_y0 ":0, - "p10_vi_pipe_w_addr_y1 ":0, - "p10_vi_pipe_w_addr_uv0":0, - "p10_vi_pipe_w_addr_uv1":0, - "p10_vi_pipe_r_addr_y0 ":0, - "p10_vi_pipe_r_addr_y1 ":0, - "p10_vi_pipe_addr_stride":0, - "p10_tof_mode_enable":0, - "p10_vi_pipe_tpg_tof_frm_num":3, - "p10_vi_pipe_tpg_tof_frm_stride":66432 - }, - "vi_dvp00":{ - "dvp00_win_mode_en":1, - "dvp00_input_ch_sel":1, - "dvp00_ch_mode_sel":1, - "dvp00_pixel_type":0, - "dvp00_yuv_in_format":0, - "dvp00_yuv_out_format":0, - "dvp00_yuv422_order":0, - "dvp00_pixel_width":1, - "dvp00_data_out_timming_ctrl":3, - "dvp00_sync_pulse_mode":0, - "dvp00_sen_mipi_clk_pol":1, - "dvp00_sen_mipi_vsync_pol":0, - "dvp00_sen_mipi_hsync_pol":0, - "dvp00_sen_mipi_field_pol":1, - "dvp00_isp_clk_pol":1, - "dvp00_isp_vsync_pol":1, - "dvp00_isp_hsync_pol":1, - "dvp00_isp_field_pol":1, - "dvp00_tpg_w_en":0, - "dvp00_tpg_r_en":0, - "dvp00_total_width":3476, - "dvp00_total_height":1166, - "dvp00_in_width":1920, - "dvp00_in_height":1080, - "dvp00_w_st_width":0, - "dvp00_w_st_height":16383, - "dvp00_r_st_width":279, - "dvp00_r_st_height":44, - "dvp00_vi_pipe_w_addr_y0 ":0, - "dvp00_vi_pipe_w_addr_y1 ":0, - "dvp00_vi_pipe_w_addr_uv0":0, - "dvp00_vi_pipe_w_addr_uv1":0, - "dvp00_vi_pipe_r_addr_y0 ":0, - "dvp00_vi_pipe_r_addr_y1 ":0, - "dvp00_vi_pipe_addr_stride":0, - "dvp00_tof_mode_enable":0, - "dvp00_vi_pipe_tpg_tof_frm_num":3, - "dvp00_vi_pipe_tpg_tof_frm_stride":66432 - } - } -} \ No newline at end of file + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 0, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 43, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 43, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 43, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 3, + "csi1_dl1_map": 4, + "csi1_dl2_map": 1, + "csi1_dl3_map": 2, + "csi10_datatype_select0": 43, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 0, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 1, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 1, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 3476, + "p01_total_height": 1166, + "p01_in_width": 1920, + "p01_in_height": 1080, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 1, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 3476, + "p02_total_height": 1166, + "p02_in_width": 1920, + "p02_in_height": 1080, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 1, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 3476, + "p10_total_height": 1166, + "p10_in_width": 1920, + "p10_in_height": 1080, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 1, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 3476, + "dvp00_total_height": 1166, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} diff --git a/package/mediactl_lib/src/config/video_drm_gc2053_gc2093_1920x1080.conf b/package/mediactl_lib/src/config/video_drm_gc2053_gc2093_1920x1080.conf new file mode 100755 index 0000000..f20605b --- /dev/null +++ b/package/mediactl_lib/src/config/video_drm_gc2053_gc2093_1920x1080.conf @@ -0,0 +1,322 @@ +{ + "sensor0":{ + "sensor0_name":"m00_f_gc2053 3-0037", + "sensor0_cfg_file":"gc2053.conf", + "sensor0_total_size":{ + "sensor0_total_width":2200, + "sensor0_total_height":1125 + }, + "sensor0_active_size":{ + "sensor0_active_width":1920, + "sensor0_active_height":1080 + }, + "/dev/video2":{ + "video2_used":0, + "video2_width":1920, + "video2_height":1080, + "video2_out_format":1 + }, + "/dev/video3":{ + "video3_used":1, + "video3_width":1080, + "video3_height":720, + "video3_out_format":1 + }, + "/dev/video4":{ + "video4_used":0, + "video4_width":640, + "video4_height":480, + "video4_out_format":1 + }, + "/dev/video5":{ + "video5_used":0, + "video5_width":320, + "video5_height":320, + "video5_height_r":240, + "video5_out_format":1, + "video5_pitch":320 + } + }, + "sensor1":{ + "sensor1_name":"m01_f_gc2093 0-007e", + "sensor1_cfg_file":"gc2093.conf", + "sensor1_total_size":{ + "sensor1_total_width":2640, + "sensor1_total_height":2500 + }, + "sensor1_active_size":{ + "sensor1_active_width":1920, + "sensor1_active_height":1080 + }, + "/dev/video6":{ + "video6_used":0, + "video6_width":1920, + "video6_height":1080, + "video6_out_format":1 + }, + "/dev/video7":{ + "video7_used":1, + "video7_width":1080, + "video7_height":720, + "video7_out_format":1 + }, + "/dev/video8":{ + "video8_used":0, + "video8_width":640, + "video8_height":480, + "video8_out_format":1 + }, + "/dev/video9":{ + "video9_used":0, + "video9_width":320, + "video9_height":240, + "video9_height_r":240, + "video9_out_format":1, + "video9_pitch":320 + } + }, + "mipi_csi2":{ + "csi0_used":1, + "csi0_sony_wdr":0, + "csi0_lane_nb":2, + "csi0_dl0_map":1, + "csi0_dl1_map":2, + "csi0_dl2_map":3, + "csi0_dl3_map":4, + "csi00_datatype_select0":43, + "csi00_datatype_select1":42, + "csi00_vc_select":1, + "csi01_datatype_select0":43, + "csi01_datatype_select1":42, + "csi01_vc_select":2, + "csi02_datatype_select0":43, + "csi02_datatype_select1":42, + "csi02_vc_select":4, + "csi1_used":1, + "csi1_sony_wdr":0, + "csi1_lane_nb":2, + "csi1_dl0_map":3, + "csi1_dl1_map":4, + "csi1_dl2_map":1, + "csi1_dl3_map":2, + "csi10_datatype_select0":43, + "csi10_datatype_select1":42, + "csi10_vc_select":1 + }, + "isp_vi":{ + "vi_wrap":{ + "dphy_mode":0, + "sony_mode":0, + "sensor0_interface_en":1, + "sensor0_tpg_w_en":0, + "sensor0_tpg_r_en":0, + "sensor0_wdr_sensor_vendor":0, + "sensor0_wdr_mode":0, + "sensor0_mipi_mode":0, + "sensor0_isp_pipeline":1, + "sensor1_interface_en":1, + "sensor1_tpg_w_en":0, + "sensor1_tpg_r_en":0, + "sensor1_wdr_sensor_vendor":0, + "sensor1_wdr_mode":0, + "sensor1_mipi_mode":0, + "sensor1_isp_pipeline":2, + "sensor2_interface_en":0, + "sensor2_tpg_w_en":0, + "sensor2_tpg_r_en":0, + "sensor2_wdr_sensor_vendor":0, + "sensor2_wdr_mode":0, + "sensor2_mipi_mode":0, + "sensor2_isp_pipeline":2 + }, + "vi_pipe00":{ + "p00_win_mode_en":1, + "p00_input_ch_sel":1, + "p00_ch_mode_sel":1, + "p00_pixel_type":0, + "p00_yuv_in_format":0, + "p00_yuv_out_format":0, + "p00_yuv422_order":0, + "p00_pixel_width":1, + "p00_data_out_timming_ctrl":3, + "p00_sync_pulse_mode":0, + "p00_sen_mipi_clk_pol":1, + "p00_sen_mipi_vsync_pol":0, + "p00_sen_mipi_hsync_pol":0, + "p00_sen_mipi_field_pol":1, + "p00_isp_clk_pol":1, + "p00_isp_vsync_pol":1, + "p00_isp_hsync_pol":1, + "p00_isp_field_pol":1, + "p00_tpg_w_en":0, + "p00_tpg_r_en":0, + "p00_w_st_width":0, + "p00_w_st_height":16383, + "p00_r_st_width":279, + "p00_r_st_height":44, + "p00_tof_mode_enable":0, + "p00_vi_pipe_tpg_tof_frm_num":3, + "p00_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe01":{ + "p01_win_mode_en":1, + "p01_input_ch_sel":1, + "p01_ch_mode_sel":1, + "p01_pixel_type":0, + "p01_yuv_in_format":0, + "p01_yuv_out_format":0, + "p01_yuv422_order":0, + "p01_pixel_width":1, + "p01_data_out_timming_ctrl":3, + "p01_sync_pulse_mode":0, + "p01_sen_mipi_clk_pol":1, + "p01_sen_mipi_vsync_pol":0, + "p01_sen_mipi_hsync_pol":0, + "p01_sen_mipi_field_pol":1, + "p01_isp_clk_pol":1, + "p01_isp_vsync_pol":1, + "p01_isp_hsync_pol":1, + "p01_isp_field_pol":1, + "p01_tpg_w_en":0, + "p01_tpg_r_en":0, + "p01_total_width":2200, + "p01_total_height":1125, + "p01_in_width":1920, + "p01_in_height":1080, + "p01_w_st_width":0, + "p01_w_st_height":16383, + "p01_r_st_width":279, + "p01_r_st_height":44, + "p01_vi_pipe_w_addr_y0 ":0, + "p01_vi_pipe_w_addr_y1 ":0, + "p01_vi_pipe_w_addr_uv0":0, + "p01_vi_pipe_w_addr_uv1":0, + "p01_vi_pipe_r_addr_y0 ":0, + "p01_vi_pipe_r_addr_y1 ":0, + "p01_vi_pipe_addr_stride":0, + "p01_tof_mode_enable":0, + "p01_vi_pipe_tpg_tof_frm_num":3, + "p01_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe02":{ + "p02_win_mode_en":1, + "p02_input_ch_sel":1, + "p02_ch_mode_sel":1, + "p02_pixel_type":0, + "p02_yuv_in_format":0, + "p02_yuv_out_format":0, + "p02_yuv422_order":0, + "p02_pixel_width":1, + "p02_data_out_timming_ctrl":3, + "p02_sync_pulse_mode":0, + "p02_sen_mipi_clk_pol":1, + "p02_sen_mipi_vsync_pol":0, + "p02_sen_mipi_hsync_pol":0, + "p02_sen_mipi_field_pol":1, + "p02_isp_clk_pol":1, + "p02_isp_vsync_pol":1, + "p02_isp_hsync_pol":1, + "p02_isp_field_pol":1, + "p02_tpg_w_en":0, + "p02_tpg_r_en":0, + "p02_total_width":2200, + "p02_total_height":1125, + "p02_in_width":1920, + "p02_in_height":1080, + "p02_w_st_width":0, + "p02_w_st_height":16383, + "p02_r_st_width":279, + "p02_r_st_height":44, + "p02_vi_pipe_w_addr_y0 ":0, + "p02_vi_pipe_w_addr_y1 ":0, + "p02_vi_pipe_w_addr_uv0":0, + "p02_vi_pipe_w_addr_uv1":0, + "p02_vi_pipe_r_addr_y0 ":0, + "p02_vi_pipe_r_addr_y1 ":0, + "p02_vi_pipe_addr_stride":0, + "p02_tof_mode_enable":0, + "p02_vi_pipe_tpg_tof_frm_num":3, + "p02_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe10":{ + "p10_win_mode_en":1, + "p10_input_ch_sel":1, + "p10_ch_mode_sel":1, + "p10_pixel_type":0, + "p10_yuv_in_format":0, + "p10_yuv_out_format":0, + "p10_yuv422_order":0, + "p10_pixel_width":1, + "p10_data_out_timming_ctrl":3, + "p10_sync_pulse_mode":0, + "p10_sen_mipi_clk_pol":1, + "p10_sen_mipi_vsync_pol":0, + "p10_sen_mipi_hsync_pol":0, + "p10_sen_mipi_field_pol":1, + "p10_isp_clk_pol":1, + "p10_isp_vsync_pol":1, + "p10_isp_hsync_pol":1, + "p10_isp_field_pol":1, + "p10_tpg_w_en":0, + "p10_tpg_r_en":0, + "p10_total_width":2640, + "p10_total_height":2500, + "p10_in_width":1920, + "p10_in_height":1080, + "p10_w_st_width":0, + "p10_w_st_height":16383, + "p10_r_st_width":279, + "p10_r_st_height":44, + "p10_vi_pipe_w_addr_y0 ":0, + "p10_vi_pipe_w_addr_y1 ":0, + "p10_vi_pipe_w_addr_uv0":0, + "p10_vi_pipe_w_addr_uv1":0, + "p10_vi_pipe_r_addr_y0 ":0, + "p10_vi_pipe_r_addr_y1 ":0, + "p10_vi_pipe_addr_stride":0, + "p10_tof_mode_enable":0, + "p10_vi_pipe_tpg_tof_frm_num":3, + "p10_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_dvp00":{ + "dvp00_win_mode_en":1, + "dvp00_input_ch_sel":1, + "dvp00_ch_mode_sel":1, + "dvp00_pixel_type":0, + "dvp00_yuv_in_format":0, + "dvp00_yuv_out_format":0, + "dvp00_yuv422_order":0, + "dvp00_pixel_width":1, + "dvp00_data_out_timming_ctrl":3, + "dvp00_sync_pulse_mode":0, + "dvp00_sen_mipi_clk_pol":1, + "dvp00_sen_mipi_vsync_pol":0, + "dvp00_sen_mipi_hsync_pol":0, + "dvp00_sen_mipi_field_pol":1, + "dvp00_isp_clk_pol":1, + "dvp00_isp_vsync_pol":1, + "dvp00_isp_hsync_pol":1, + "dvp00_isp_field_pol":1, + "dvp00_tpg_w_en":0, + "dvp00_tpg_r_en":0, + "dvp00_total_width":2640, + "dvp00_total_height":2500, + "dvp00_in_width":1920, + "dvp00_in_height":1080, + "dvp00_w_st_width":0, + "dvp00_w_st_height":16383, + "dvp00_r_st_width":279, + "dvp00_r_st_height":44, + "dvp00_vi_pipe_w_addr_y0 ":0, + "dvp00_vi_pipe_w_addr_y1 ":0, + "dvp00_vi_pipe_w_addr_uv0":0, + "dvp00_vi_pipe_w_addr_uv1":0, + "dvp00_vi_pipe_r_addr_y0 ":0, + "dvp00_vi_pipe_r_addr_y1 ":0, + "dvp00_vi_pipe_addr_stride":0, + "dvp00_tof_mode_enable":0, + "dvp00_vi_pipe_tpg_tof_frm_num":3, + "dvp00_vi_pipe_tpg_tof_frm_stride":66432 + } + } +} diff --git a/package/mediactl_lib/src/config/video_drm_gc2093_1920x1080_gc2145_1280x960.conf b/package/mediactl_lib/src/config/video_drm_gc2093_1920x1080_gc2145_1280x960.conf new file mode 100644 index 0000000..700b89d --- /dev/null +++ b/package/mediactl_lib/src/config/video_drm_gc2093_1920x1080_gc2145_1280x960.conf @@ -0,0 +1,322 @@ +{ + "sensor0":{ + "sensor0_name":"m00_f_gc2093 0-0037", + "sensor0_cfg_file":"gc2093.conf", + "sensor0_total_size":{ + "sensor0_total_width":2640, + "sensor0_total_height":2500 + }, + "sensor0_active_size":{ + "sensor0_active_width":1920, + "sensor0_active_height":1080 + }, + "/dev/video2":{ + "video2_used":0, + "video2_width":1920, + "video2_height":1080, + "video2_out_format":1 + }, + "/dev/video3":{ + "video3_used":1, + "video3_width":1080, + "video3_height":720, + "video3_out_format":1 + }, + "/dev/video4":{ + "video4_used":0, + "video4_width":640, + "video4_height":480, + "video4_out_format":1 + }, + "/dev/video5":{ + "video5_used":0, + "video5_width":320, + "video5_height":320, + "video5_height_r":240, + "video5_out_format":1, + "video5_pitch":320 + } + }, + "sensor1":{ + "sensor1_name":"m01_f_gc2145 3-003c", + "sensor1_cfg_file":"gc2145.conf", + "sensor1_total_size":{ + "sensor1_total_width":1920, + "sensor1_total_height":1250 + }, + "sensor1_active_size":{ + "sensor1_active_width":1280, + "sensor1_active_height":960 + }, + "/dev/video6":{ + "video6_used":0, + "video6_width":1280, + "video6_height":960, + "video6_out_format":1 + }, + "/dev/video7":{ + "video7_used":1, + "video7_width":1080, + "video7_height":720, + "video7_out_format":1 + }, + "/dev/video8":{ + "video8_used":0, + "video8_width":640, + "video8_height":480, + "video8_out_format":1 + }, + "/dev/video9":{ + "video9_used":0, + "video9_width":320, + "video9_height":240, + "video9_height_r":240, + "video9_out_format":1, + "video9_pitch":320 + } + }, + "mipi_csi2":{ + "csi0_used":1, + "csi0_sony_wdr":0, + "csi0_lane_nb":2, + "csi0_dl0_map":1, + "csi0_dl1_map":2, + "csi0_dl2_map":3, + "csi0_dl3_map":4, + "csi00_datatype_select0":43, + "csi00_datatype_select1":42, + "csi00_vc_select":1, + "csi01_datatype_select0":43, + "csi01_datatype_select1":42, + "csi01_vc_select":2, + "csi02_datatype_select0":43, + "csi02_datatype_select1":42, + "csi02_vc_select":4, + "csi1_used":1, + "csi1_sony_wdr":0, + "csi1_lane_nb":2, + "csi1_dl0_map":3, + "csi1_dl1_map":4, + "csi1_dl2_map":1, + "csi1_dl3_map":2, + "csi10_datatype_select0":43, + "csi10_datatype_select1":42, + "csi10_vc_select":1 + }, + "isp_vi":{ + "vi_wrap":{ + "dphy_mode":0, + "sony_mode":0, + "sensor0_interface_en":1, + "sensor0_tpg_w_en":0, + "sensor0_tpg_r_en":0, + "sensor0_wdr_sensor_vendor":0, + "sensor0_wdr_mode":0, + "sensor0_mipi_mode":0, + "sensor0_isp_pipeline":1, + "sensor1_interface_en":1, + "sensor1_tpg_w_en":0, + "sensor1_tpg_r_en":0, + "sensor1_wdr_sensor_vendor":0, + "sensor1_wdr_mode":0, + "sensor1_mipi_mode":0, + "sensor1_isp_pipeline":2, + "sensor2_interface_en":0, + "sensor2_tpg_w_en":0, + "sensor2_tpg_r_en":0, + "sensor2_wdr_sensor_vendor":0, + "sensor2_wdr_mode":0, + "sensor2_mipi_mode":0, + "sensor2_isp_pipeline":2 + }, + "vi_pipe00":{ + "p00_win_mode_en":1, + "p00_input_ch_sel":1, + "p00_ch_mode_sel":1, + "p00_pixel_type":0, + "p00_yuv_in_format":0, + "p00_yuv_out_format":0, + "p00_yuv422_order":0, + "p00_pixel_width":1, + "p00_data_out_timming_ctrl":3, + "p00_sync_pulse_mode":0, + "p00_sen_mipi_clk_pol":1, + "p00_sen_mipi_vsync_pol":0, + "p00_sen_mipi_hsync_pol":0, + "p00_sen_mipi_field_pol":1, + "p00_isp_clk_pol":1, + "p00_isp_vsync_pol":1, + "p00_isp_hsync_pol":1, + "p00_isp_field_pol":1, + "p00_tpg_w_en":0, + "p00_tpg_r_en":0, + "p00_w_st_width":0, + "p00_w_st_height":16383, + "p00_r_st_width":279, + "p00_r_st_height":44, + "p00_tof_mode_enable":0, + "p00_vi_pipe_tpg_tof_frm_num":3, + "p00_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe01":{ + "p01_win_mode_en":1, + "p01_input_ch_sel":1, + "p01_ch_mode_sel":1, + "p01_pixel_type":0, + "p01_yuv_in_format":0, + "p01_yuv_out_format":0, + "p01_yuv422_order":0, + "p01_pixel_width":1, + "p01_data_out_timming_ctrl":3, + "p01_sync_pulse_mode":0, + "p01_sen_mipi_clk_pol":1, + "p01_sen_mipi_vsync_pol":0, + "p01_sen_mipi_hsync_pol":0, + "p01_sen_mipi_field_pol":1, + "p01_isp_clk_pol":1, + "p01_isp_vsync_pol":1, + "p01_isp_hsync_pol":1, + "p01_isp_field_pol":1, + "p01_tpg_w_en":0, + "p01_tpg_r_en":0, + "p01_total_width":2640, + "p01_total_height":2500, + "p01_in_width":1920, + "p01_in_height":1080, + "p01_w_st_width":0, + "p01_w_st_height":16383, + "p01_r_st_width":279, + "p01_r_st_height":44, + "p01_vi_pipe_w_addr_y0 ":0, + "p01_vi_pipe_w_addr_y1 ":0, + "p01_vi_pipe_w_addr_uv0":0, + "p01_vi_pipe_w_addr_uv1":0, + "p01_vi_pipe_r_addr_y0 ":0, + "p01_vi_pipe_r_addr_y1 ":0, + "p01_vi_pipe_addr_stride":0, + "p01_tof_mode_enable":0, + "p01_vi_pipe_tpg_tof_frm_num":3, + "p01_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe02":{ + "p02_win_mode_en":1, + "p02_input_ch_sel":1, + "p02_ch_mode_sel":1, + "p02_pixel_type":0, + "p02_yuv_in_format":0, + "p02_yuv_out_format":0, + "p02_yuv422_order":0, + "p02_pixel_width":1, + "p02_data_out_timming_ctrl":3, + "p02_sync_pulse_mode":0, + "p02_sen_mipi_clk_pol":1, + "p02_sen_mipi_vsync_pol":0, + "p02_sen_mipi_hsync_pol":0, + "p02_sen_mipi_field_pol":1, + "p02_isp_clk_pol":1, + "p02_isp_vsync_pol":1, + "p02_isp_hsync_pol":1, + "p02_isp_field_pol":1, + "p02_tpg_w_en":0, + "p02_tpg_r_en":0, + "p02_total_width":2640, + "p02_total_height":2500, + "p02_in_width":1920, + "p02_in_height":1080, + "p02_w_st_width":0, + "p02_w_st_height":16383, + "p02_r_st_width":279, + "p02_r_st_height":44, + "p02_vi_pipe_w_addr_y0 ":0, + "p02_vi_pipe_w_addr_y1 ":0, + "p02_vi_pipe_w_addr_uv0":0, + "p02_vi_pipe_w_addr_uv1":0, + "p02_vi_pipe_r_addr_y0 ":0, + "p02_vi_pipe_r_addr_y1 ":0, + "p02_vi_pipe_addr_stride":0, + "p02_tof_mode_enable":0, + "p02_vi_pipe_tpg_tof_frm_num":3, + "p02_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe10":{ + "p10_win_mode_en":1, + "p10_input_ch_sel":1, + "p10_ch_mode_sel":1, + "p10_pixel_type":0, + "p10_yuv_in_format":0, + "p10_yuv_out_format":0, + "p10_yuv422_order":0, + "p10_pixel_width":1, + "p10_data_out_timming_ctrl":3, + "p10_sync_pulse_mode":0, + "p10_sen_mipi_clk_pol":1, + "p10_sen_mipi_vsync_pol":0, + "p10_sen_mipi_hsync_pol":0, + "p10_sen_mipi_field_pol":1, + "p10_isp_clk_pol":1, + "p10_isp_vsync_pol":1, + "p10_isp_hsync_pol":1, + "p10_isp_field_pol":1, + "p10_tpg_w_en":0, + "p10_tpg_r_en":0, + "p10_total_width":1920, + "p10_total_height":1250, + "p10_in_width":1280, + "p10_in_height":960, + "p10_w_st_width":0, + "p10_w_st_height":16383, + "p10_r_st_width":279, + "p10_r_st_height":44, + "p10_vi_pipe_w_addr_y0 ":0, + "p10_vi_pipe_w_addr_y1 ":0, + "p10_vi_pipe_w_addr_uv0":0, + "p10_vi_pipe_w_addr_uv1":0, + "p10_vi_pipe_r_addr_y0 ":0, + "p10_vi_pipe_r_addr_y1 ":0, + "p10_vi_pipe_addr_stride":0, + "p10_tof_mode_enable":0, + "p10_vi_pipe_tpg_tof_frm_num":3, + "p10_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_dvp00":{ + "dvp00_win_mode_en":1, + "dvp00_input_ch_sel":1, + "dvp00_ch_mode_sel":1, + "dvp00_pixel_type":0, + "dvp00_yuv_in_format":0, + "dvp00_yuv_out_format":0, + "dvp00_yuv422_order":0, + "dvp00_pixel_width":1, + "dvp00_data_out_timming_ctrl":3, + "dvp00_sync_pulse_mode":0, + "dvp00_sen_mipi_clk_pol":1, + "dvp00_sen_mipi_vsync_pol":0, + "dvp00_sen_mipi_hsync_pol":0, + "dvp00_sen_mipi_field_pol":1, + "dvp00_isp_clk_pol":1, + "dvp00_isp_vsync_pol":1, + "dvp00_isp_hsync_pol":1, + "dvp00_isp_field_pol":1, + "dvp00_tpg_w_en":0, + "dvp00_tpg_r_en":0, + "dvp00_total_width":1920, + "dvp00_total_height":1250, + "dvp00_in_width":1280, + "dvp00_in_height":960, + "dvp00_w_st_width":0, + "dvp00_w_st_height":16383, + "dvp00_r_st_width":279, + "dvp00_r_st_height":44, + "dvp00_vi_pipe_w_addr_y0 ":0, + "dvp00_vi_pipe_w_addr_y1 ":0, + "dvp00_vi_pipe_w_addr_uv0":0, + "dvp00_vi_pipe_w_addr_uv1":0, + "dvp00_vi_pipe_r_addr_y0 ":0, + "dvp00_vi_pipe_r_addr_y1 ":0, + "dvp00_vi_pipe_addr_stride":0, + "dvp00_tof_mode_enable":0, + "dvp00_vi_pipe_tpg_tof_frm_num":3, + "dvp00_vi_pipe_tpg_tof_frm_stride":66432 + } + } +} diff --git a/package/mediactl_lib/src/config/video_drm_gc2093_1920x1080_gc2145_1600x1200.conf b/package/mediactl_lib/src/config/video_drm_gc2093_1920x1080_gc2145_1600x1200.conf new file mode 100644 index 0000000..047bb2d --- /dev/null +++ b/package/mediactl_lib/src/config/video_drm_gc2093_1920x1080_gc2145_1600x1200.conf @@ -0,0 +1,322 @@ +{ + "sensor0":{ + "sensor0_name":"m00_f_gc2093 0-0037", + "sensor0_cfg_file":"gc2093.conf", + "sensor0_total_size":{ + "sensor0_total_width":2640, + "sensor0_total_height":2500 + }, + "sensor0_active_size":{ + "sensor0_active_width":1920, + "sensor0_active_height":1080 + }, + "/dev/video2":{ + "video2_used":0, + "video2_width":1920, + "video2_height":1080, + "video2_out_format":1 + }, + "/dev/video3":{ + "video3_used":1, + "video3_width":1080, + "video3_height":720, + "video3_out_format":1 + }, + "/dev/video4":{ + "video4_used":0, + "video4_width":640, + "video4_height":480, + "video4_out_format":1 + }, + "/dev/video5":{ + "video5_used":0, + "video5_width":320, + "video5_height":320, + "video5_height_r":240, + "video5_out_format":1, + "video5_pitch":320 + } + }, + "sensor1":{ + "sensor1_name":"m01_f_gc2145 3-003c", + "sensor1_cfg_file":"gc2145.conf", + "sensor1_total_size":{ + "sensor1_total_width":1920, + "sensor1_total_height":1250 + }, + "sensor1_active_size":{ + "sensor1_active_width":1600, + "sensor1_active_height":1200 + }, + "/dev/video6":{ + "video6_used":0, + "video6_width":1600, + "video6_height":1200, + "video6_out_format":1 + }, + "/dev/video7":{ + "video7_used":1, + "video7_width":1080, + "video7_height":720, + "video7_out_format":1 + }, + "/dev/video8":{ + "video8_used":0, + "video8_width":640, + "video8_height":480, + "video8_out_format":1 + }, + "/dev/video9":{ + "video9_used":0, + "video9_width":320, + "video9_height":240, + "video9_height_r":240, + "video9_out_format":1, + "video9_pitch":320 + } + }, + "mipi_csi2":{ + "csi0_used":1, + "csi0_sony_wdr":0, + "csi0_lane_nb":2, + "csi0_dl0_map":1, + "csi0_dl1_map":2, + "csi0_dl2_map":3, + "csi0_dl3_map":4, + "csi00_datatype_select0":43, + "csi00_datatype_select1":42, + "csi00_vc_select":1, + "csi01_datatype_select0":43, + "csi01_datatype_select1":42, + "csi01_vc_select":2, + "csi02_datatype_select0":43, + "csi02_datatype_select1":42, + "csi02_vc_select":4, + "csi1_used":1, + "csi1_sony_wdr":0, + "csi1_lane_nb":2, + "csi1_dl0_map":3, + "csi1_dl1_map":4, + "csi1_dl2_map":1, + "csi1_dl3_map":2, + "csi10_datatype_select0":43, + "csi10_datatype_select1":42, + "csi10_vc_select":1 + }, + "isp_vi":{ + "vi_wrap":{ + "dphy_mode":0, + "sony_mode":0, + "sensor0_interface_en":1, + "sensor0_tpg_w_en":0, + "sensor0_tpg_r_en":0, + "sensor0_wdr_sensor_vendor":0, + "sensor0_wdr_mode":0, + "sensor0_mipi_mode":0, + "sensor0_isp_pipeline":1, + "sensor1_interface_en":1, + "sensor1_tpg_w_en":0, + "sensor1_tpg_r_en":0, + "sensor1_wdr_sensor_vendor":0, + "sensor1_wdr_mode":0, + "sensor1_mipi_mode":0, + "sensor1_isp_pipeline":2, + "sensor2_interface_en":0, + "sensor2_tpg_w_en":0, + "sensor2_tpg_r_en":0, + "sensor2_wdr_sensor_vendor":0, + "sensor2_wdr_mode":0, + "sensor2_mipi_mode":0, + "sensor2_isp_pipeline":2 + }, + "vi_pipe00":{ + "p00_win_mode_en":1, + "p00_input_ch_sel":1, + "p00_ch_mode_sel":1, + "p00_pixel_type":0, + "p00_yuv_in_format":0, + "p00_yuv_out_format":0, + "p00_yuv422_order":0, + "p00_pixel_width":1, + "p00_data_out_timming_ctrl":3, + "p00_sync_pulse_mode":0, + "p00_sen_mipi_clk_pol":1, + "p00_sen_mipi_vsync_pol":0, + "p00_sen_mipi_hsync_pol":0, + "p00_sen_mipi_field_pol":1, + "p00_isp_clk_pol":1, + "p00_isp_vsync_pol":1, + "p00_isp_hsync_pol":1, + "p00_isp_field_pol":1, + "p00_tpg_w_en":0, + "p00_tpg_r_en":0, + "p00_w_st_width":0, + "p00_w_st_height":16383, + "p00_r_st_width":279, + "p00_r_st_height":44, + "p00_tof_mode_enable":0, + "p00_vi_pipe_tpg_tof_frm_num":3, + "p00_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe01":{ + "p01_win_mode_en":1, + "p01_input_ch_sel":1, + "p01_ch_mode_sel":1, + "p01_pixel_type":0, + "p01_yuv_in_format":0, + "p01_yuv_out_format":0, + "p01_yuv422_order":0, + "p01_pixel_width":1, + "p01_data_out_timming_ctrl":3, + "p01_sync_pulse_mode":0, + "p01_sen_mipi_clk_pol":1, + "p01_sen_mipi_vsync_pol":0, + "p01_sen_mipi_hsync_pol":0, + "p01_sen_mipi_field_pol":1, + "p01_isp_clk_pol":1, + "p01_isp_vsync_pol":1, + "p01_isp_hsync_pol":1, + "p01_isp_field_pol":1, + "p01_tpg_w_en":0, + "p01_tpg_r_en":0, + "p01_total_width":2640, + "p01_total_height":2500, + "p01_in_width":1920, + "p01_in_height":1080, + "p01_w_st_width":0, + "p01_w_st_height":16383, + "p01_r_st_width":279, + "p01_r_st_height":44, + "p01_vi_pipe_w_addr_y0 ":0, + "p01_vi_pipe_w_addr_y1 ":0, + "p01_vi_pipe_w_addr_uv0":0, + "p01_vi_pipe_w_addr_uv1":0, + "p01_vi_pipe_r_addr_y0 ":0, + "p01_vi_pipe_r_addr_y1 ":0, + "p01_vi_pipe_addr_stride":0, + "p01_tof_mode_enable":0, + "p01_vi_pipe_tpg_tof_frm_num":3, + "p01_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe02":{ + "p02_win_mode_en":1, + "p02_input_ch_sel":1, + "p02_ch_mode_sel":1, + "p02_pixel_type":0, + "p02_yuv_in_format":0, + "p02_yuv_out_format":0, + "p02_yuv422_order":0, + "p02_pixel_width":1, + "p02_data_out_timming_ctrl":3, + "p02_sync_pulse_mode":0, + "p02_sen_mipi_clk_pol":1, + "p02_sen_mipi_vsync_pol":0, + "p02_sen_mipi_hsync_pol":0, + "p02_sen_mipi_field_pol":1, + "p02_isp_clk_pol":1, + "p02_isp_vsync_pol":1, + "p02_isp_hsync_pol":1, + "p02_isp_field_pol":1, + "p02_tpg_w_en":0, + "p02_tpg_r_en":0, + "p02_total_width":2640, + "p02_total_height":2500, + "p02_in_width":1920, + "p02_in_height":1080, + "p02_w_st_width":0, + "p02_w_st_height":16383, + "p02_r_st_width":279, + "p02_r_st_height":44, + "p02_vi_pipe_w_addr_y0 ":0, + "p02_vi_pipe_w_addr_y1 ":0, + "p02_vi_pipe_w_addr_uv0":0, + "p02_vi_pipe_w_addr_uv1":0, + "p02_vi_pipe_r_addr_y0 ":0, + "p02_vi_pipe_r_addr_y1 ":0, + "p02_vi_pipe_addr_stride":0, + "p02_tof_mode_enable":0, + "p02_vi_pipe_tpg_tof_frm_num":3, + "p02_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe10":{ + "p10_win_mode_en":1, + "p10_input_ch_sel":1, + "p10_ch_mode_sel":1, + "p10_pixel_type":0, + "p10_yuv_in_format":0, + "p10_yuv_out_format":0, + "p10_yuv422_order":0, + "p10_pixel_width":1, + "p10_data_out_timming_ctrl":3, + "p10_sync_pulse_mode":0, + "p10_sen_mipi_clk_pol":1, + "p10_sen_mipi_vsync_pol":0, + "p10_sen_mipi_hsync_pol":0, + "p10_sen_mipi_field_pol":1, + "p10_isp_clk_pol":1, + "p10_isp_vsync_pol":1, + "p10_isp_hsync_pol":1, + "p10_isp_field_pol":1, + "p10_tpg_w_en":0, + "p10_tpg_r_en":0, + "p10_total_width":1920, + "p10_total_height":1250, + "p10_in_width":1600, + "p10_in_height":1200, + "p10_w_st_width":0, + "p10_w_st_height":16383, + "p10_r_st_width":279, + "p10_r_st_height":44, + "p10_vi_pipe_w_addr_y0 ":0, + "p10_vi_pipe_w_addr_y1 ":0, + "p10_vi_pipe_w_addr_uv0":0, + "p10_vi_pipe_w_addr_uv1":0, + "p10_vi_pipe_r_addr_y0 ":0, + "p10_vi_pipe_r_addr_y1 ":0, + "p10_vi_pipe_addr_stride":0, + "p10_tof_mode_enable":0, + "p10_vi_pipe_tpg_tof_frm_num":3, + "p10_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_dvp00":{ + "dvp00_win_mode_en":1, + "dvp00_input_ch_sel":1, + "dvp00_ch_mode_sel":1, + "dvp00_pixel_type":0, + "dvp00_yuv_in_format":0, + "dvp00_yuv_out_format":0, + "dvp00_yuv422_order":0, + "dvp00_pixel_width":1, + "dvp00_data_out_timming_ctrl":3, + "dvp00_sync_pulse_mode":0, + "dvp00_sen_mipi_clk_pol":1, + "dvp00_sen_mipi_vsync_pol":0, + "dvp00_sen_mipi_hsync_pol":0, + "dvp00_sen_mipi_field_pol":1, + "dvp00_isp_clk_pol":1, + "dvp00_isp_vsync_pol":1, + "dvp00_isp_hsync_pol":1, + "dvp00_isp_field_pol":1, + "dvp00_tpg_w_en":0, + "dvp00_tpg_r_en":0, + "dvp00_total_width":1920, + "dvp00_total_height":1250, + "dvp00_in_width":1600, + "dvp00_in_height":1200, + "dvp00_w_st_width":0, + "dvp00_w_st_height":16383, + "dvp00_r_st_width":279, + "dvp00_r_st_height":44, + "dvp00_vi_pipe_w_addr_y0 ":0, + "dvp00_vi_pipe_w_addr_y1 ":0, + "dvp00_vi_pipe_w_addr_uv0":0, + "dvp00_vi_pipe_w_addr_uv1":0, + "dvp00_vi_pipe_r_addr_y0 ":0, + "dvp00_vi_pipe_r_addr_y1 ":0, + "dvp00_vi_pipe_addr_stride":0, + "dvp00_tof_mode_enable":0, + "dvp00_vi_pipe_tpg_tof_frm_num":3, + "dvp00_vi_pipe_tpg_tof_frm_stride":66432 + } + } +} diff --git a/package/mediactl_lib/src/config/video_drm_gc2093_800x1080_gc2145_1280x960.conf b/package/mediactl_lib/src/config/video_drm_gc2093_800x1080_gc2145_1280x960.conf new file mode 100755 index 0000000..c22b90c --- /dev/null +++ b/package/mediactl_lib/src/config/video_drm_gc2093_800x1080_gc2145_1280x960.conf @@ -0,0 +1,322 @@ +{ + "sensor0":{ + "sensor0_name":"m00_f_gc2093 0-0037", + "sensor0_cfg_file":"gc2093.conf", + "sensor0_total_size":{ + "sensor0_total_width":2640, + "sensor0_total_height":2500 + }, + "sensor0_active_size":{ + "sensor0_active_width":800, + "sensor0_active_height":1080 + }, + "/dev/video2":{ + "video2_used":0, + "video2_width":800, + "video2_height":1080, + "video2_out_format":1 + }, + "/dev/video3":{ + "video3_used":1, + "video3_width":800, + "video3_height":600, + "video3_out_format":1 + }, + "/dev/video4":{ + "video4_used":0, + "video4_width":640, + "video4_height":480, + "video4_out_format":1 + }, + "/dev/video5":{ + "video5_used":0, + "video5_width":320, + "video5_height":320, + "video5_height_r":240, + "video5_out_format":1, + "video5_pitch":320 + } + }, + "sensor1":{ + "sensor1_name":"m01_f_gc2145 3-003c", + "sensor1_cfg_file":"gc2145.conf", + "sensor1_total_size":{ + "sensor1_total_width":1920, + "sensor1_total_height":1250 + }, + "sensor1_active_size":{ + "sensor1_active_width":1280, + "sensor1_active_height":960 + }, + "/dev/video6":{ + "video6_used":0, + "video6_width":1280, + "video6_height":960, + "video6_out_format":1 + }, + "/dev/video7":{ + "video7_used":1, + "video7_width":1080, + "video7_height":720, + "video7_out_format":1 + }, + "/dev/video8":{ + "video8_used":0, + "video8_width":640, + "video8_height":480, + "video8_out_format":1 + }, + "/dev/video9":{ + "video9_used":0, + "video9_width":320, + "video9_height":240, + "video9_height_r":240, + "video9_out_format":1, + "video9_pitch":320 + } + }, + "mipi_csi2":{ + "csi0_used":1, + "csi0_sony_wdr":0, + "csi0_lane_nb":2, + "csi0_dl0_map":1, + "csi0_dl1_map":2, + "csi0_dl2_map":3, + "csi0_dl3_map":4, + "csi00_datatype_select0":43, + "csi00_datatype_select1":42, + "csi00_vc_select":1, + "csi01_datatype_select0":43, + "csi01_datatype_select1":42, + "csi01_vc_select":2, + "csi02_datatype_select0":43, + "csi02_datatype_select1":42, + "csi02_vc_select":4, + "csi1_used":1, + "csi1_sony_wdr":0, + "csi1_lane_nb":2, + "csi1_dl0_map":3, + "csi1_dl1_map":4, + "csi1_dl2_map":1, + "csi1_dl3_map":2, + "csi10_datatype_select0":43, + "csi10_datatype_select1":42, + "csi10_vc_select":1 + }, + "isp_vi":{ + "vi_wrap":{ + "dphy_mode":0, + "sony_mode":0, + "sensor0_interface_en":1, + "sensor0_tpg_w_en":0, + "sensor0_tpg_r_en":0, + "sensor0_wdr_sensor_vendor":0, + "sensor0_wdr_mode":0, + "sensor0_mipi_mode":0, + "sensor0_isp_pipeline":1, + "sensor1_interface_en":1, + "sensor1_tpg_w_en":0, + "sensor1_tpg_r_en":0, + "sensor1_wdr_sensor_vendor":0, + "sensor1_wdr_mode":0, + "sensor1_mipi_mode":0, + "sensor1_isp_pipeline":2, + "sensor2_interface_en":0, + "sensor2_tpg_w_en":0, + "sensor2_tpg_r_en":0, + "sensor2_wdr_sensor_vendor":0, + "sensor2_wdr_mode":0, + "sensor2_mipi_mode":0, + "sensor2_isp_pipeline":2 + }, + "vi_pipe00":{ + "p00_win_mode_en":1, + "p00_input_ch_sel":1, + "p00_ch_mode_sel":1, + "p00_pixel_type":0, + "p00_yuv_in_format":0, + "p00_yuv_out_format":0, + "p00_yuv422_order":0, + "p00_pixel_width":1, + "p00_data_out_timming_ctrl":3, + "p00_sync_pulse_mode":0, + "p00_sen_mipi_clk_pol":1, + "p00_sen_mipi_vsync_pol":0, + "p00_sen_mipi_hsync_pol":0, + "p00_sen_mipi_field_pol":1, + "p00_isp_clk_pol":1, + "p00_isp_vsync_pol":1, + "p00_isp_hsync_pol":1, + "p00_isp_field_pol":1, + "p00_tpg_w_en":0, + "p00_tpg_r_en":0, + "p00_w_st_width":0, + "p00_w_st_height":16383, + "p00_r_st_width":279, + "p00_r_st_height":44, + "p00_tof_mode_enable":0, + "p00_vi_pipe_tpg_tof_frm_num":3, + "p00_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe01":{ + "p01_win_mode_en":1, + "p01_input_ch_sel":1, + "p01_ch_mode_sel":1, + "p01_pixel_type":0, + "p01_yuv_in_format":0, + "p01_yuv_out_format":0, + "p01_yuv422_order":0, + "p01_pixel_width":1, + "p01_data_out_timming_ctrl":3, + "p01_sync_pulse_mode":0, + "p01_sen_mipi_clk_pol":1, + "p01_sen_mipi_vsync_pol":0, + "p01_sen_mipi_hsync_pol":0, + "p01_sen_mipi_field_pol":1, + "p01_isp_clk_pol":1, + "p01_isp_vsync_pol":1, + "p01_isp_hsync_pol":1, + "p01_isp_field_pol":1, + "p01_tpg_w_en":0, + "p01_tpg_r_en":0, + "p01_total_width":2640, + "p01_total_height":2500, + "p01_in_width":800, + "p01_in_height":1080, + "p01_w_st_width":0, + "p01_w_st_height":16383, + "p01_r_st_width":279, + "p01_r_st_height":44, + "p01_vi_pipe_w_addr_y0 ":0, + "p01_vi_pipe_w_addr_y1 ":0, + "p01_vi_pipe_w_addr_uv0":0, + "p01_vi_pipe_w_addr_uv1":0, + "p01_vi_pipe_r_addr_y0 ":0, + "p01_vi_pipe_r_addr_y1 ":0, + "p01_vi_pipe_addr_stride":0, + "p01_tof_mode_enable":0, + "p01_vi_pipe_tpg_tof_frm_num":3, + "p01_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe02":{ + "p02_win_mode_en":1, + "p02_input_ch_sel":1, + "p02_ch_mode_sel":1, + "p02_pixel_type":0, + "p02_yuv_in_format":0, + "p02_yuv_out_format":0, + "p02_yuv422_order":0, + "p02_pixel_width":1, + "p02_data_out_timming_ctrl":3, + "p02_sync_pulse_mode":0, + "p02_sen_mipi_clk_pol":1, + "p02_sen_mipi_vsync_pol":0, + "p02_sen_mipi_hsync_pol":0, + "p02_sen_mipi_field_pol":1, + "p02_isp_clk_pol":1, + "p02_isp_vsync_pol":1, + "p02_isp_hsync_pol":1, + "p02_isp_field_pol":1, + "p02_tpg_w_en":0, + "p02_tpg_r_en":0, + "p02_total_width":2640, + "p02_total_height":2500, + "p02_in_width":800, + "p02_in_height":1080, + "p02_w_st_width":0, + "p02_w_st_height":16383, + "p02_r_st_width":279, + "p02_r_st_height":44, + "p02_vi_pipe_w_addr_y0 ":0, + "p02_vi_pipe_w_addr_y1 ":0, + "p02_vi_pipe_w_addr_uv0":0, + "p02_vi_pipe_w_addr_uv1":0, + "p02_vi_pipe_r_addr_y0 ":0, + "p02_vi_pipe_r_addr_y1 ":0, + "p02_vi_pipe_addr_stride":0, + "p02_tof_mode_enable":0, + "p02_vi_pipe_tpg_tof_frm_num":3, + "p02_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe10":{ + "p10_win_mode_en":1, + "p10_input_ch_sel":1, + "p10_ch_mode_sel":1, + "p10_pixel_type":0, + "p10_yuv_in_format":0, + "p10_yuv_out_format":0, + "p10_yuv422_order":0, + "p10_pixel_width":1, + "p10_data_out_timming_ctrl":3, + "p10_sync_pulse_mode":0, + "p10_sen_mipi_clk_pol":1, + "p10_sen_mipi_vsync_pol":0, + "p10_sen_mipi_hsync_pol":0, + "p10_sen_mipi_field_pol":1, + "p10_isp_clk_pol":1, + "p10_isp_vsync_pol":1, + "p10_isp_hsync_pol":1, + "p10_isp_field_pol":1, + "p10_tpg_w_en":0, + "p10_tpg_r_en":0, + "p10_total_width":1920, + "p10_total_height":1250, + "p10_in_width":1280, + "p10_in_height":960, + "p10_w_st_width":0, + "p10_w_st_height":16383, + "p10_r_st_width":279, + "p10_r_st_height":44, + "p10_vi_pipe_w_addr_y0 ":0, + "p10_vi_pipe_w_addr_y1 ":0, + "p10_vi_pipe_w_addr_uv0":0, + "p10_vi_pipe_w_addr_uv1":0, + "p10_vi_pipe_r_addr_y0 ":0, + "p10_vi_pipe_r_addr_y1 ":0, + "p10_vi_pipe_addr_stride":0, + "p10_tof_mode_enable":0, + "p10_vi_pipe_tpg_tof_frm_num":3, + "p10_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_dvp00":{ + "dvp00_win_mode_en":1, + "dvp00_input_ch_sel":1, + "dvp00_ch_mode_sel":1, + "dvp00_pixel_type":0, + "dvp00_yuv_in_format":0, + "dvp00_yuv_out_format":0, + "dvp00_yuv422_order":0, + "dvp00_pixel_width":1, + "dvp00_data_out_timming_ctrl":3, + "dvp00_sync_pulse_mode":0, + "dvp00_sen_mipi_clk_pol":1, + "dvp00_sen_mipi_vsync_pol":0, + "dvp00_sen_mipi_hsync_pol":0, + "dvp00_sen_mipi_field_pol":1, + "dvp00_isp_clk_pol":1, + "dvp00_isp_vsync_pol":1, + "dvp00_isp_hsync_pol":1, + "dvp00_isp_field_pol":1, + "dvp00_tpg_w_en":0, + "dvp00_tpg_r_en":0, + "dvp00_total_width":1920, + "dvp00_total_height":1250, + "dvp00_in_width":1280, + "dvp00_in_height":960, + "dvp00_w_st_width":0, + "dvp00_w_st_height":16383, + "dvp00_r_st_width":279, + "dvp00_r_st_height":44, + "dvp00_vi_pipe_w_addr_y0 ":0, + "dvp00_vi_pipe_w_addr_y1 ":0, + "dvp00_vi_pipe_w_addr_uv0":0, + "dvp00_vi_pipe_w_addr_uv1":0, + "dvp00_vi_pipe_r_addr_y0 ":0, + "dvp00_vi_pipe_r_addr_y1 ":0, + "dvp00_vi_pipe_addr_stride":0, + "dvp00_tof_mode_enable":0, + "dvp00_vi_pipe_tpg_tof_frm_num":3, + "dvp00_vi_pipe_tpg_tof_frm_stride":66432 + } + } +} diff --git a/package/mediactl_lib/src/config/video_drm_gc2093_800x1080_gc2145_1600x1200.conf b/package/mediactl_lib/src/config/video_drm_gc2093_800x1080_gc2145_1600x1200.conf new file mode 100755 index 0000000..d49363a --- /dev/null +++ b/package/mediactl_lib/src/config/video_drm_gc2093_800x1080_gc2145_1600x1200.conf @@ -0,0 +1,322 @@ +{ + "sensor0":{ + "sensor0_name":"m00_f_gc2093 0-0037", + "sensor0_cfg_file":"gc2093.conf", + "sensor0_total_size":{ + "sensor0_total_width":2640, + "sensor0_total_height":2500 + }, + "sensor0_active_size":{ + "sensor0_active_width":800, + "sensor0_active_height":1080 + }, + "/dev/video2":{ + "video2_used":0, + "video2_width":800, + "video2_height":1080, + "video2_out_format":1 + }, + "/dev/video3":{ + "video3_used":1, + "video3_width":800, + "video3_height":600, + "video3_out_format":1 + }, + "/dev/video4":{ + "video4_used":0, + "video4_width":640, + "video4_height":480, + "video4_out_format":1 + }, + "/dev/video5":{ + "video5_used":0, + "video5_width":320, + "video5_height":320, + "video5_height_r":240, + "video5_out_format":1, + "video5_pitch":320 + } + }, + "sensor1":{ + "sensor1_name":"m01_f_gc2145 3-003c", + "sensor1_cfg_file":"gc2145.conf", + "sensor1_total_size":{ + "sensor1_total_width":1920, + "sensor1_total_height":1250 + }, + "sensor1_active_size":{ + "sensor1_active_width":1600, + "sensor1_active_height":1200 + }, + "/dev/video6":{ + "video6_used":0, + "video6_width":1600, + "video6_height":1200, + "video6_out_format":1 + }, + "/dev/video7":{ + "video7_used":1, + "video7_width":1080, + "video7_height":720, + "video7_out_format":1 + }, + "/dev/video8":{ + "video8_used":0, + "video8_width":640, + "video8_height":480, + "video8_out_format":1 + }, + "/dev/video9":{ + "video9_used":0, + "video9_width":320, + "video9_height":240, + "video9_height_r":240, + "video9_out_format":1, + "video9_pitch":320 + } + }, + "mipi_csi2":{ + "csi0_used":1, + "csi0_sony_wdr":0, + "csi0_lane_nb":2, + "csi0_dl0_map":1, + "csi0_dl1_map":2, + "csi0_dl2_map":3, + "csi0_dl3_map":4, + "csi00_datatype_select0":43, + "csi00_datatype_select1":42, + "csi00_vc_select":1, + "csi01_datatype_select0":43, + "csi01_datatype_select1":42, + "csi01_vc_select":2, + "csi02_datatype_select0":43, + "csi02_datatype_select1":42, + "csi02_vc_select":4, + "csi1_used":1, + "csi1_sony_wdr":0, + "csi1_lane_nb":2, + "csi1_dl0_map":3, + "csi1_dl1_map":4, + "csi1_dl2_map":1, + "csi1_dl3_map":2, + "csi10_datatype_select0":43, + "csi10_datatype_select1":42, + "csi10_vc_select":1 + }, + "isp_vi":{ + "vi_wrap":{ + "dphy_mode":0, + "sony_mode":0, + "sensor0_interface_en":1, + "sensor0_tpg_w_en":0, + "sensor0_tpg_r_en":0, + "sensor0_wdr_sensor_vendor":0, + "sensor0_wdr_mode":0, + "sensor0_mipi_mode":0, + "sensor0_isp_pipeline":1, + "sensor1_interface_en":1, + "sensor1_tpg_w_en":0, + "sensor1_tpg_r_en":0, + "sensor1_wdr_sensor_vendor":0, + "sensor1_wdr_mode":0, + "sensor1_mipi_mode":0, + "sensor1_isp_pipeline":2, + "sensor2_interface_en":0, + "sensor2_tpg_w_en":0, + "sensor2_tpg_r_en":0, + "sensor2_wdr_sensor_vendor":0, + "sensor2_wdr_mode":0, + "sensor2_mipi_mode":0, + "sensor2_isp_pipeline":2 + }, + "vi_pipe00":{ + "p00_win_mode_en":1, + "p00_input_ch_sel":1, + "p00_ch_mode_sel":1, + "p00_pixel_type":0, + "p00_yuv_in_format":0, + "p00_yuv_out_format":0, + "p00_yuv422_order":0, + "p00_pixel_width":1, + "p00_data_out_timming_ctrl":3, + "p00_sync_pulse_mode":0, + "p00_sen_mipi_clk_pol":1, + "p00_sen_mipi_vsync_pol":0, + "p00_sen_mipi_hsync_pol":0, + "p00_sen_mipi_field_pol":1, + "p00_isp_clk_pol":1, + "p00_isp_vsync_pol":1, + "p00_isp_hsync_pol":1, + "p00_isp_field_pol":1, + "p00_tpg_w_en":0, + "p00_tpg_r_en":0, + "p00_w_st_width":0, + "p00_w_st_height":16383, + "p00_r_st_width":279, + "p00_r_st_height":44, + "p00_tof_mode_enable":0, + "p00_vi_pipe_tpg_tof_frm_num":3, + "p00_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe01":{ + "p01_win_mode_en":1, + "p01_input_ch_sel":1, + "p01_ch_mode_sel":1, + "p01_pixel_type":0, + "p01_yuv_in_format":0, + "p01_yuv_out_format":0, + "p01_yuv422_order":0, + "p01_pixel_width":1, + "p01_data_out_timming_ctrl":3, + "p01_sync_pulse_mode":0, + "p01_sen_mipi_clk_pol":1, + "p01_sen_mipi_vsync_pol":0, + "p01_sen_mipi_hsync_pol":0, + "p01_sen_mipi_field_pol":1, + "p01_isp_clk_pol":1, + "p01_isp_vsync_pol":1, + "p01_isp_hsync_pol":1, + "p01_isp_field_pol":1, + "p01_tpg_w_en":0, + "p01_tpg_r_en":0, + "p01_total_width":2640, + "p01_total_height":2500, + "p01_in_width":800, + "p01_in_height":1080, + "p01_w_st_width":0, + "p01_w_st_height":16383, + "p01_r_st_width":279, + "p01_r_st_height":44, + "p01_vi_pipe_w_addr_y0 ":0, + "p01_vi_pipe_w_addr_y1 ":0, + "p01_vi_pipe_w_addr_uv0":0, + "p01_vi_pipe_w_addr_uv1":0, + "p01_vi_pipe_r_addr_y0 ":0, + "p01_vi_pipe_r_addr_y1 ":0, + "p01_vi_pipe_addr_stride":0, + "p01_tof_mode_enable":0, + "p01_vi_pipe_tpg_tof_frm_num":3, + "p01_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe02":{ + "p02_win_mode_en":1, + "p02_input_ch_sel":1, + "p02_ch_mode_sel":1, + "p02_pixel_type":0, + "p02_yuv_in_format":0, + "p02_yuv_out_format":0, + "p02_yuv422_order":0, + "p02_pixel_width":1, + "p02_data_out_timming_ctrl":3, + "p02_sync_pulse_mode":0, + "p02_sen_mipi_clk_pol":1, + "p02_sen_mipi_vsync_pol":0, + "p02_sen_mipi_hsync_pol":0, + "p02_sen_mipi_field_pol":1, + "p02_isp_clk_pol":1, + "p02_isp_vsync_pol":1, + "p02_isp_hsync_pol":1, + "p02_isp_field_pol":1, + "p02_tpg_w_en":0, + "p02_tpg_r_en":0, + "p02_total_width":2640, + "p02_total_height":2500, + "p02_in_width":800, + "p02_in_height":1080, + "p02_w_st_width":0, + "p02_w_st_height":16383, + "p02_r_st_width":279, + "p02_r_st_height":44, + "p02_vi_pipe_w_addr_y0 ":0, + "p02_vi_pipe_w_addr_y1 ":0, + "p02_vi_pipe_w_addr_uv0":0, + "p02_vi_pipe_w_addr_uv1":0, + "p02_vi_pipe_r_addr_y0 ":0, + "p02_vi_pipe_r_addr_y1 ":0, + "p02_vi_pipe_addr_stride":0, + "p02_tof_mode_enable":0, + "p02_vi_pipe_tpg_tof_frm_num":3, + "p02_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe10":{ + "p10_win_mode_en":1, + "p10_input_ch_sel":1, + "p10_ch_mode_sel":1, + "p10_pixel_type":0, + "p10_yuv_in_format":0, + "p10_yuv_out_format":0, + "p10_yuv422_order":0, + "p10_pixel_width":1, + "p10_data_out_timming_ctrl":3, + "p10_sync_pulse_mode":0, + "p10_sen_mipi_clk_pol":1, + "p10_sen_mipi_vsync_pol":0, + "p10_sen_mipi_hsync_pol":0, + "p10_sen_mipi_field_pol":1, + "p10_isp_clk_pol":1, + "p10_isp_vsync_pol":1, + "p10_isp_hsync_pol":1, + "p10_isp_field_pol":1, + "p10_tpg_w_en":0, + "p10_tpg_r_en":0, + "p10_total_width":1920, + "p10_total_height":1250, + "p10_in_width":1600, + "p10_in_height":1200, + "p10_w_st_width":0, + "p10_w_st_height":16383, + "p10_r_st_width":279, + "p10_r_st_height":44, + "p10_vi_pipe_w_addr_y0 ":0, + "p10_vi_pipe_w_addr_y1 ":0, + "p10_vi_pipe_w_addr_uv0":0, + "p10_vi_pipe_w_addr_uv1":0, + "p10_vi_pipe_r_addr_y0 ":0, + "p10_vi_pipe_r_addr_y1 ":0, + "p10_vi_pipe_addr_stride":0, + "p10_tof_mode_enable":0, + "p10_vi_pipe_tpg_tof_frm_num":3, + "p10_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_dvp00":{ + "dvp00_win_mode_en":1, + "dvp00_input_ch_sel":1, + "dvp00_ch_mode_sel":1, + "dvp00_pixel_type":0, + "dvp00_yuv_in_format":0, + "dvp00_yuv_out_format":0, + "dvp00_yuv422_order":0, + "dvp00_pixel_width":1, + "dvp00_data_out_timming_ctrl":3, + "dvp00_sync_pulse_mode":0, + "dvp00_sen_mipi_clk_pol":1, + "dvp00_sen_mipi_vsync_pol":0, + "dvp00_sen_mipi_hsync_pol":0, + "dvp00_sen_mipi_field_pol":1, + "dvp00_isp_clk_pol":1, + "dvp00_isp_vsync_pol":1, + "dvp00_isp_hsync_pol":1, + "dvp00_isp_field_pol":1, + "dvp00_tpg_w_en":0, + "dvp00_tpg_r_en":0, + "dvp00_total_width":1920, + "dvp00_total_height":1250, + "dvp00_in_width":1600, + "dvp00_in_height":1200, + "dvp00_w_st_width":0, + "dvp00_w_st_height":16383, + "dvp00_r_st_width":279, + "dvp00_r_st_height":44, + "dvp00_vi_pipe_w_addr_y0 ":0, + "dvp00_vi_pipe_w_addr_y1 ":0, + "dvp00_vi_pipe_w_addr_uv0":0, + "dvp00_vi_pipe_w_addr_uv1":0, + "dvp00_vi_pipe_r_addr_y0 ":0, + "dvp00_vi_pipe_r_addr_y1 ":0, + "dvp00_vi_pipe_addr_stride":0, + "dvp00_tof_mode_enable":0, + "dvp00_vi_pipe_tpg_tof_frm_num":3, + "dvp00_vi_pipe_tpg_tof_frm_stride":66432 + } + } +} diff --git a/package/mediactl_lib/src/config/video_drm_gc2093_gc2053_isp_mux.conf b/package/mediactl_lib/src/config/video_drm_gc2093_gc2053_isp_mux.conf new file mode 100644 index 0000000..b306991 --- /dev/null +++ b/package/mediactl_lib/src/config/video_drm_gc2093_gc2053_isp_mux.conf @@ -0,0 +1,322 @@ +{ + "sensor0":{ + "sensor0_name":"m00_f_gc2093 0-007e", + "sensor0_cfg_file":"gc2093.conf", + "sensor0_total_size":{ + "sensor0_total_width":2640, + "sensor0_total_height":1125 + }, + "sensor0_active_size":{ + "sensor0_active_width":1920, + "sensor0_active_height":1080 + }, + "/dev/video2":{ + "video2_used":0, + "video2_width":1920, + "video2_height":1080, + "video2_out_format":1 + }, + "/dev/video3":{ + "video3_used":1, + "video3_width":1080, + "video3_height":720, + "video3_out_format":1 + }, + "/dev/video4":{ + "video4_used":0, + "video4_width":640, + "video4_height":480, + "video4_out_format":1 + }, + "/dev/video5":{ + "video5_used":0, + "video5_width":320, + "video5_height":320, + "video5_height_r":240, + "video5_out_format":1, + "video5_pitch":320 + } + }, + "sensor1":{ + "sensor1_name":"m01_f_gc2053 0-0037", + "sensor1_cfg_file":"gc2053.conf", + "sensor1_total_size":{ + "sensor1_total_width":2200, + "sensor1_total_height":1125 + }, + "sensor1_active_size":{ + "sensor1_active_width":1920, + "sensor1_active_height":1080 + }, + "/dev/video6":{ + "video6_used":0, + "video6_width":1920, + "video6_height":1080, + "video6_out_format":1 + }, + "/dev/video7":{ + "video7_used":1, + "video7_width":1080, + "video7_height":720, + "video7_out_format":1 + }, + "/dev/video8":{ + "video8_used":0, + "video8_width":640, + "video8_height":480, + "video8_out_format":1 + }, + "/dev/video9":{ + "video9_used":0, + "video9_width":320, + "video9_height":240, + "video9_height_r":240, + "video9_out_format":1, + "video9_pitch":320 + } + }, + "mipi_csi2":{ + "csi0_used":1, + "csi0_sony_wdr":0, + "csi0_lane_nb":2, + "csi0_dl0_map":1, + "csi0_dl1_map":2, + "csi0_dl2_map":3, + "csi0_dl3_map":4, + "csi00_datatype_select0":43, + "csi00_datatype_select1":42, + "csi00_vc_select":1, + "csi01_datatype_select0":43, + "csi01_datatype_select1":42, + "csi01_vc_select":2, + "csi02_datatype_select0":43, + "csi02_datatype_select1":42, + "csi02_vc_select":4, + "csi1_used":1, + "csi1_sony_wdr":0, + "csi1_lane_nb":2, + "csi1_dl0_map":3, + "csi1_dl1_map":4, + "csi1_dl2_map":1, + "csi1_dl3_map":2, + "csi10_datatype_select0":43, + "csi10_datatype_select1":42, + "csi10_vc_select":1 + }, + "isp_vi":{ + "vi_wrap":{ + "dphy_mode":0, + "sony_mode":0, + "sensor0_interface_en":1, + "sensor0_tpg_w_en":0, + "sensor0_tpg_r_en":0, + "sensor0_wdr_sensor_vendor":0, + "sensor0_wdr_mode":0, + "sensor0_mipi_mode":0, + "sensor0_isp_pipeline":2, + "sensor1_interface_en":1, + "sensor1_tpg_w_en":0, + "sensor1_tpg_r_en":0, + "sensor1_wdr_sensor_vendor":0, + "sensor1_wdr_mode":0, + "sensor1_mipi_mode":0, + "sensor1_isp_pipeline":1, + "sensor2_interface_en":0, + "sensor2_tpg_w_en":0, + "sensor2_tpg_r_en":0, + "sensor2_wdr_sensor_vendor":0, + "sensor2_wdr_mode":0, + "sensor2_mipi_mode":0, + "sensor2_isp_pipeline":2 + }, + "vi_pipe00":{ + "p00_win_mode_en":1, + "p00_input_ch_sel":1, + "p00_ch_mode_sel":1, + "p00_pixel_type":0, + "p00_yuv_in_format":0, + "p00_yuv_out_format":0, + "p00_yuv422_order":0, + "p00_pixel_width":1, + "p00_data_out_timming_ctrl":3, + "p00_sync_pulse_mode":0, + "p00_sen_mipi_clk_pol":1, + "p00_sen_mipi_vsync_pol":0, + "p00_sen_mipi_hsync_pol":0, + "p00_sen_mipi_field_pol":1, + "p00_isp_clk_pol":1, + "p00_isp_vsync_pol":1, + "p00_isp_hsync_pol":1, + "p00_isp_field_pol":1, + "p00_tpg_w_en":0, + "p00_tpg_r_en":0, + "p00_w_st_width":0, + "p00_w_st_height":16383, + "p00_r_st_width":279, + "p00_r_st_height":44, + "p00_tof_mode_enable":0, + "p00_vi_pipe_tpg_tof_frm_num":3, + "p00_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe01":{ + "p01_win_mode_en":1, + "p01_input_ch_sel":1, + "p01_ch_mode_sel":1, + "p01_pixel_type":0, + "p01_yuv_in_format":0, + "p01_yuv_out_format":0, + "p01_yuv422_order":0, + "p01_pixel_width":1, + "p01_data_out_timming_ctrl":3, + "p01_sync_pulse_mode":0, + "p01_sen_mipi_clk_pol":1, + "p01_sen_mipi_vsync_pol":0, + "p01_sen_mipi_hsync_pol":0, + "p01_sen_mipi_field_pol":1, + "p01_isp_clk_pol":1, + "p01_isp_vsync_pol":1, + "p01_isp_hsync_pol":1, + "p01_isp_field_pol":1, + "p01_tpg_w_en":0, + "p01_tpg_r_en":0, + "p01_total_width":3476, + "p01_total_height":1166, + "p01_in_width":1920, + "p01_in_height":1080, + "p01_w_st_width":0, + "p01_w_st_height":16383, + "p01_r_st_width":279, + "p01_r_st_height":44, + "p01_vi_pipe_w_addr_y0 ":0, + "p01_vi_pipe_w_addr_y1 ":0, + "p01_vi_pipe_w_addr_uv0":0, + "p01_vi_pipe_w_addr_uv1":0, + "p01_vi_pipe_r_addr_y0 ":0, + "p01_vi_pipe_r_addr_y1 ":0, + "p01_vi_pipe_addr_stride":0, + "p01_tof_mode_enable":0, + "p01_vi_pipe_tpg_tof_frm_num":3, + "p01_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe02":{ + "p02_win_mode_en":1, + "p02_input_ch_sel":1, + "p02_ch_mode_sel":1, + "p02_pixel_type":0, + "p02_yuv_in_format":0, + "p02_yuv_out_format":0, + "p02_yuv422_order":0, + "p02_pixel_width":1, + "p02_data_out_timming_ctrl":3, + "p02_sync_pulse_mode":0, + "p02_sen_mipi_clk_pol":1, + "p02_sen_mipi_vsync_pol":0, + "p02_sen_mipi_hsync_pol":0, + "p02_sen_mipi_field_pol":1, + "p02_isp_clk_pol":1, + "p02_isp_vsync_pol":1, + "p02_isp_hsync_pol":1, + "p02_isp_field_pol":1, + "p02_tpg_w_en":0, + "p02_tpg_r_en":0, + "p02_total_width":3476, + "p02_total_height":1166, + "p02_in_width":1920, + "p02_in_height":1080, + "p02_w_st_width":0, + "p02_w_st_height":16383, + "p02_r_st_width":279, + "p02_r_st_height":44, + "p02_vi_pipe_w_addr_y0 ":0, + "p02_vi_pipe_w_addr_y1 ":0, + "p02_vi_pipe_w_addr_uv0":0, + "p02_vi_pipe_w_addr_uv1":0, + "p02_vi_pipe_r_addr_y0 ":0, + "p02_vi_pipe_r_addr_y1 ":0, + "p02_vi_pipe_addr_stride":0, + "p02_tof_mode_enable":0, + "p02_vi_pipe_tpg_tof_frm_num":3, + "p02_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_pipe10":{ + "p10_win_mode_en":1, + "p10_input_ch_sel":1, + "p10_ch_mode_sel":1, + "p10_pixel_type":0, + "p10_yuv_in_format":0, + "p10_yuv_out_format":0, + "p10_yuv422_order":0, + "p10_pixel_width":1, + "p10_data_out_timming_ctrl":3, + "p10_sync_pulse_mode":0, + "p10_sen_mipi_clk_pol":1, + "p10_sen_mipi_vsync_pol":0, + "p10_sen_mipi_hsync_pol":0, + "p10_sen_mipi_field_pol":1, + "p10_isp_clk_pol":1, + "p10_isp_vsync_pol":1, + "p10_isp_hsync_pol":1, + "p10_isp_field_pol":1, + "p10_tpg_w_en":0, + "p10_tpg_r_en":0, + "p10_total_width":3476, + "p10_total_height":1166, + "p10_in_width":1920, + "p10_in_height":1080, + "p10_w_st_width":0, + "p10_w_st_height":16383, + "p10_r_st_width":279, + "p10_r_st_height":44, + "p10_vi_pipe_w_addr_y0 ":0, + "p10_vi_pipe_w_addr_y1 ":0, + "p10_vi_pipe_w_addr_uv0":0, + "p10_vi_pipe_w_addr_uv1":0, + "p10_vi_pipe_r_addr_y0 ":0, + "p10_vi_pipe_r_addr_y1 ":0, + "p10_vi_pipe_addr_stride":0, + "p10_tof_mode_enable":0, + "p10_vi_pipe_tpg_tof_frm_num":3, + "p10_vi_pipe_tpg_tof_frm_stride":66432 + }, + "vi_dvp00":{ + "dvp00_win_mode_en":1, + "dvp00_input_ch_sel":1, + "dvp00_ch_mode_sel":1, + "dvp00_pixel_type":0, + "dvp00_yuv_in_format":0, + "dvp00_yuv_out_format":0, + "dvp00_yuv422_order":0, + "dvp00_pixel_width":1, + "dvp00_data_out_timming_ctrl":3, + "dvp00_sync_pulse_mode":0, + "dvp00_sen_mipi_clk_pol":1, + "dvp00_sen_mipi_vsync_pol":0, + "dvp00_sen_mipi_hsync_pol":0, + "dvp00_sen_mipi_field_pol":1, + "dvp00_isp_clk_pol":1, + "dvp00_isp_vsync_pol":1, + "dvp00_isp_hsync_pol":1, + "dvp00_isp_field_pol":1, + "dvp00_tpg_w_en":0, + "dvp00_tpg_r_en":0, + "dvp00_total_width":3476, + "dvp00_total_height":1166, + "dvp00_in_width":1920, + "dvp00_in_height":1080, + "dvp00_w_st_width":0, + "dvp00_w_st_height":16383, + "dvp00_r_st_width":279, + "dvp00_r_st_height":44, + "dvp00_vi_pipe_w_addr_y0 ":0, + "dvp00_vi_pipe_w_addr_y1 ":0, + "dvp00_vi_pipe_w_addr_uv0":0, + "dvp00_vi_pipe_w_addr_uv1":0, + "dvp00_vi_pipe_r_addr_y0 ":0, + "dvp00_vi_pipe_r_addr_y1 ":0, + "dvp00_vi_pipe_addr_stride":0, + "dvp00_tof_mode_enable":0, + "dvp00_vi_pipe_tpg_tof_frm_num":3, + "dvp00_vi_pipe_tpg_tof_frm_stride":66432 + } + } +} diff --git a/package/mediactl_lib/src/config/video_drm_sc035_640x480.conf b/package/mediactl_lib/src/config/video_drm_sc035_640x480.conf new file mode 100644 index 0000000..7ea24dd --- /dev/null +++ b/package/mediactl_lib/src/config/video_drm_sc035_640x480.conf @@ -0,0 +1,322 @@ +{ + "sensor0": { + "sensor0_name": "m00_f_sc035hgs 0-0030", + "sensor0_cfg_file": "sc035hgs.conf", + "sensor0_total_size": { + "sensor0_total_width": 852, + "sensor0_total_height": 1056 + }, + "sensor0_active_size": { + "sensor0_active_width": 640, + "sensor0_active_height": 480 + }, + "/dev/video2": { + "video2_used": 1, + "video2_width": 640, + "video2_height": 480, + "video2_out_format": 1 + }, + "/dev/video3": { + "video3_used": 0, + "video3_width": 640, + "video3_height": 480, + "video3_out_format": 1 + }, + "/dev/video4": { + "video4_used": 0, + "video4_width": 640, + "video4_height": 480, + "video4_out_format": 1 + }, + "/dev/video5": { + "video5_used": 0, + "video5_width": 320, + "video5_height": 320, + "video5_height_r": 240, + "video5_out_format": 1, + "video5_pitch": 320 + } + }, + "sensor1": { + "sensor1_name": "m01_f_imx219_1 3-0010", + "sensor1_cfg_file": "imx219_1.conf", + "sensor1_total_size": { + "sensor1_total_width": 3476, + "sensor1_total_height": 1166 + }, + "sensor1_active_size": { + "sensor1_active_width": 1920, + "sensor1_active_height": 1080 + }, + "/dev/video6": { + "video6_used": 0, + "video6_width": 1920, + "video6_height": 1080, + "video6_out_format": 1 + }, + "/dev/video7": { + "video7_used": 0, + "video7_width": 1080, + "video7_height": 720, + "video7_out_format": 1 + }, + "/dev/video8": { + "video8_used": 0, + "video8_width": 640, + "video8_height": 480, + "video8_out_format": 1 + }, + "/dev/video9": { + "video9_used": 0, + "video9_width": 320, + "video9_height": 240, + "video9_height_r": 240, + "video9_out_format": 1, + "video9_pitch": 320 + } + }, + "mipi_csi2": { + "csi0_used": 1, + "csi0_sony_wdr": 0, + "csi0_lane_nb": 2, + "csi0_dl0_map": 1, + "csi0_dl1_map": 2, + "csi0_dl2_map": 3, + "csi0_dl3_map": 4, + "csi00_datatype_select0": 43, + "csi00_datatype_select1": 42, + "csi00_vc_select": 1, + "csi01_datatype_select0": 43, + "csi01_datatype_select1": 42, + "csi01_vc_select": 2, + "csi02_datatype_select0": 43, + "csi02_datatype_select1": 42, + "csi02_vc_select": 4, + "csi1_used": 1, + "csi1_sony_wdr": 0, + "csi1_lane_nb": 2, + "csi1_dl0_map": 1, + "csi1_dl1_map": 2, + "csi1_dl2_map": 3, + "csi1_dl3_map": 4, + "csi10_datatype_select0": 43, + "csi10_datatype_select1": 42, + "csi10_vc_select": 1 + }, + "isp_vi": { + "vi_wrap": { + "dphy_mode": 0, + "sony_mode": 0, + "sensor0_interface_en": 1, + "sensor0_tpg_w_en": 0, + "sensor0_tpg_r_en": 0, + "sensor0_wdr_sensor_vendor": 0, + "sensor0_wdr_mode": 0, + "sensor0_mipi_mode": 0, + "sensor0_isp_pipeline": 1, + "sensor1_interface_en": 1, + "sensor1_tpg_w_en": 0, + "sensor1_tpg_r_en": 0, + "sensor1_wdr_sensor_vendor": 0, + "sensor1_wdr_mode": 0, + "sensor1_mipi_mode": 0, + "sensor1_isp_pipeline": 2, + "sensor2_interface_en": 0, + "sensor2_tpg_w_en": 0, + "sensor2_tpg_r_en": 0, + "sensor2_wdr_sensor_vendor": 0, + "sensor2_wdr_mode": 0, + "sensor2_mipi_mode": 0, + "sensor2_isp_pipeline": 2 + }, + "vi_pipe00": { + "p00_win_mode_en": 1, + "p00_input_ch_sel": 1, + "p00_ch_mode_sel": 1, + "p00_pixel_type": 0, + "p00_yuv_in_format": 0, + "p00_yuv_out_format": 0, + "p00_yuv422_order": 0, + "p00_pixel_width": 2, + "p00_data_out_timming_ctrl": 3, + "p00_sync_pulse_mode": 0, + "p00_sen_mipi_clk_pol": 1, + "p00_sen_mipi_vsync_pol": 0, + "p00_sen_mipi_hsync_pol": 0, + "p00_sen_mipi_field_pol": 1, + "p00_isp_clk_pol": 1, + "p00_isp_vsync_pol": 1, + "p00_isp_hsync_pol": 1, + "p00_isp_field_pol": 1, + "p00_tpg_w_en": 0, + "p00_tpg_r_en": 0, + "p00_w_st_width": 0, + "p00_w_st_height": 16383, + "p00_r_st_width": 279, + "p00_r_st_height": 44, + "p00_tof_mode_enable": 0, + "p00_vi_pipe_tpg_tof_frm_num": 3, + "p00_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe01": { + "p01_win_mode_en": 1, + "p01_input_ch_sel": 1, + "p01_ch_mode_sel": 1, + "p01_pixel_type": 0, + "p01_yuv_in_format": 0, + "p01_yuv_out_format": 0, + "p01_yuv422_order": 0, + "p01_pixel_width": 2, + "p01_data_out_timming_ctrl": 3, + "p01_sync_pulse_mode": 0, + "p01_sen_mipi_clk_pol": 1, + "p01_sen_mipi_vsync_pol": 0, + "p01_sen_mipi_hsync_pol": 0, + "p01_sen_mipi_field_pol": 1, + "p01_isp_clk_pol": 1, + "p01_isp_vsync_pol": 1, + "p01_isp_hsync_pol": 1, + "p01_isp_field_pol": 1, + "p01_tpg_w_en": 0, + "p01_tpg_r_en": 0, + "p01_total_width": 852, + "p01_total_height": 1056, + "p01_in_width": 640, + "p01_in_height": 480, + "p01_w_st_width": 0, + "p01_w_st_height": 16383, + "p01_r_st_width": 279, + "p01_r_st_height": 44, + "p01_vi_pipe_w_addr_y0 ": 0, + "p01_vi_pipe_w_addr_y1 ": 0, + "p01_vi_pipe_w_addr_uv0": 0, + "p01_vi_pipe_w_addr_uv1": 0, + "p01_vi_pipe_r_addr_y0 ": 0, + "p01_vi_pipe_r_addr_y1 ": 0, + "p01_vi_pipe_addr_stride": 0, + "p01_tof_mode_enable": 0, + "p01_vi_pipe_tpg_tof_frm_num": 3, + "p01_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe02": { + "p02_win_mode_en": 1, + "p02_input_ch_sel": 1, + "p02_ch_mode_sel": 1, + "p02_pixel_type": 0, + "p02_yuv_in_format": 0, + "p02_yuv_out_format": 0, + "p02_yuv422_order": 0, + "p02_pixel_width": 2, + "p02_data_out_timming_ctrl": 3, + "p02_sync_pulse_mode": 0, + "p02_sen_mipi_clk_pol": 1, + "p02_sen_mipi_vsync_pol": 0, + "p02_sen_mipi_hsync_pol": 0, + "p02_sen_mipi_field_pol": 1, + "p02_isp_clk_pol": 1, + "p02_isp_vsync_pol": 1, + "p02_isp_hsync_pol": 1, + "p02_isp_field_pol": 1, + "p02_tpg_w_en": 0, + "p02_tpg_r_en": 0, + "p02_total_width": 852, + "p02_total_height": 1056, + "p02_in_width": 640, + "p02_in_height": 480, + "p02_w_st_width": 0, + "p02_w_st_height": 16383, + "p02_r_st_width": 279, + "p02_r_st_height": 44, + "p02_vi_pipe_w_addr_y0 ": 0, + "p02_vi_pipe_w_addr_y1 ": 0, + "p02_vi_pipe_w_addr_uv0": 0, + "p02_vi_pipe_w_addr_uv1": 0, + "p02_vi_pipe_r_addr_y0 ": 0, + "p02_vi_pipe_r_addr_y1 ": 0, + "p02_vi_pipe_addr_stride": 0, + "p02_tof_mode_enable": 0, + "p02_vi_pipe_tpg_tof_frm_num": 3, + "p02_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_pipe10": { + "p10_win_mode_en": 1, + "p10_input_ch_sel": 1, + "p10_ch_mode_sel": 1, + "p10_pixel_type": 0, + "p10_yuv_in_format": 0, + "p10_yuv_out_format": 0, + "p10_yuv422_order": 0, + "p10_pixel_width": 2, + "p10_data_out_timming_ctrl": 3, + "p10_sync_pulse_mode": 0, + "p10_sen_mipi_clk_pol": 1, + "p10_sen_mipi_vsync_pol": 0, + "p10_sen_mipi_hsync_pol": 0, + "p10_sen_mipi_field_pol": 1, + "p10_isp_clk_pol": 1, + "p10_isp_vsync_pol": 1, + "p10_isp_hsync_pol": 1, + "p10_isp_field_pol": 1, + "p10_tpg_w_en": 0, + "p10_tpg_r_en": 0, + "p10_total_width": 2200, + "p10_total_height": 1125, + "p10_in_width": 1920, + "p10_in_height": 1080, + "p10_w_st_width": 0, + "p10_w_st_height": 16383, + "p10_r_st_width": 279, + "p10_r_st_height": 44, + "p10_vi_pipe_w_addr_y0 ": 0, + "p10_vi_pipe_w_addr_y1 ": 0, + "p10_vi_pipe_w_addr_uv0": 0, + "p10_vi_pipe_w_addr_uv1": 0, + "p10_vi_pipe_r_addr_y0 ": 0, + "p10_vi_pipe_r_addr_y1 ": 0, + "p10_vi_pipe_addr_stride": 0, + "p10_tof_mode_enable": 0, + "p10_vi_pipe_tpg_tof_frm_num": 3, + "p10_vi_pipe_tpg_tof_frm_stride": 66432 + }, + "vi_dvp00": { + "dvp00_win_mode_en": 1, + "dvp00_input_ch_sel": 1, + "dvp00_ch_mode_sel": 1, + "dvp00_pixel_type": 0, + "dvp00_yuv_in_format": 0, + "dvp00_yuv_out_format": 0, + "dvp00_yuv422_order": 0, + "dvp00_pixel_width": 2, + "dvp00_data_out_timming_ctrl": 3, + "dvp00_sync_pulse_mode": 0, + "dvp00_sen_mipi_clk_pol": 1, + "dvp00_sen_mipi_vsync_pol": 0, + "dvp00_sen_mipi_hsync_pol": 0, + "dvp00_sen_mipi_field_pol": 1, + "dvp00_isp_clk_pol": 1, + "dvp00_isp_vsync_pol": 1, + "dvp00_isp_hsync_pol": 1, + "dvp00_isp_field_pol": 1, + "dvp00_tpg_w_en": 0, + "dvp00_tpg_r_en": 0, + "dvp00_total_width": 2200, + "dvp00_total_height": 1125, + "dvp00_in_width": 1920, + "dvp00_in_height": 1080, + "dvp00_w_st_width": 0, + "dvp00_w_st_height": 16383, + "dvp00_r_st_width": 279, + "dvp00_r_st_height": 44, + "dvp00_vi_pipe_w_addr_y0 ": 0, + "dvp00_vi_pipe_w_addr_y1 ": 0, + "dvp00_vi_pipe_w_addr_uv0": 0, + "dvp00_vi_pipe_w_addr_uv1": 0, + "dvp00_vi_pipe_r_addr_y0 ": 0, + "dvp00_vi_pipe_r_addr_y1 ": 0, + "dvp00_vi_pipe_addr_stride": 0, + "dvp00_tof_mode_enable": 0, + "dvp00_vi_pipe_tpg_tof_frm_num": 3, + "dvp00_vi_pipe_tpg_tof_frm_stride": 66432 + } + } +} diff --git a/package/mediactl_lib/src/isp/isp_cfg.c b/package/mediactl_lib/src/isp/isp_cfg.c index 9a9d02b..00054d8 100644 --- a/package/mediactl_lib/src/isp/isp_cfg.c +++ b/package/mediactl_lib/src/isp/isp_cfg.c @@ -21,1226 +21,1234 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/****************************************************************************** - File Name : isp_cfg.c - Version : Initial Draft - Author : - Created : - Description : - History : - 1.Date : - Author : - Modification: Created file - -******************************************************************************/ - -#include -#include -#include -#include -#include "../linux/k510isp.h" - -#include "../media/mediactl-priv.h" -#include "isp_com.h" -#include "isp.h" -#include "vi.h" -#include "mipi_csi2.h" - -#define calc_stride(x) ((x+15)/16*16) - -/** - * @brief - * - * @param entity - * @return int - */ -int sysctl_rst_mipicsi2(struct media_entity *entity) -{ - int ret = 0; - - ret = v4l2_subdev_open(entity); - if (ret < 0) - return ret; - // - unsigned int rst_en = 1; - ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_CSI,&rst_en); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - v4l2_subdev_close(entity); - return ret; -} -/** - * @brief - * - * @param entity - * @param mipi_csi2 - * @return int - */ -int mipicsi2_cfg(struct media_entity *entity,struct isp_csi2_info *mipi_csi2) -{ - int ret = 0; - - ret = v4l2_subdev_open(entity); - if (ret < 0) - return ret; - // - unsigned int rst_en = 1; - ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_CSI,&rst_en); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - // - ret = ioctl(entity->fd, VIDIOC_K510ISP_CSI2_CFG,mipi_csi2); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - - v4l2_subdev_close(entity); - return 0; -} -/** - * @brief - * - * @param entity - * @return int - */ -int sysctl_rst_vi(struct media_entity *entity) -{ - int ret = 0; - - ret = v4l2_subdev_open(entity); - if (ret < 0) - return ret; - // - unsigned int rst_en = 1; - ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_VI,&rst_en); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - - v4l2_subdev_close(entity); - return 0; -} -/** - * @brief - * - * @param entity - * @param vi_cfg - * @return int - */ -int isp_vi_cfg(struct media_entity *entity,struct vi_cfg_info *vi_cfg) -{ - int ret = 0; - - ret = v4l2_subdev_open(entity); - if (ret < 0) - return ret; - // - unsigned int rst_en = 1; - ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_VI,&rst_en); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - // - ret = ioctl(entity->fd, VIDIOC_K510ISP_VI_CFG,vi_cfg); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - - v4l2_subdev_close(entity); - return 0; -} -/** - * @brief - * - * @param entity - * @return int - */ -int sysctl_rst_f2k(struct media_entity *entity) -{ - int ret = 0; - // - ret = v4l2_subdev_open(entity); - if (ret < 0) - return ret; - // - unsigned int rst_en = 1; - ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_F2K,&rst_en); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - - v4l2_subdev_close(entity); - return ret; -} -/** - * @brief - * @param entity - * @param isp_cfg - * @return int - */ -int isp_f2k_cfg(struct media_entity *entity,struct isp_cfg_info *isp_cfg,uint32_t phyAddr) -{ - int ret = 0; - struct isp_wrap_cfg_info *isp_wrap_info = &isp_cfg->isp_wrap_cfg; - struct isp_core_cfg_info *isp_core_info = &isp_cfg->isp_core_cfg; - struct isp_ds_cfg_info *isp_ds_info = &isp_cfg->isp_ds_cfg; - unsigned int width = 0,height = 0; - unsigned int line_stride = 0; - - // - ret = v4l2_subdev_open(entity); - if (ret < 0) - return ret; - // - width = isp_wrap_info->mainInfo.main_size.width; - printf("%s:%d\n",__func__,isp_wrap_info->mainInfo.main_size.width); - line_stride = calc_stride(width); - isp_wrap_info->mainInfo.main_line_stride = line_stride; - isp_wrap_info->mainInfo.main_y_buf0_base = phyAddr; - isp_wrap_info->mainInfo.main_y_buf1_base = phyAddr; - isp_wrap_info->mainInfo.main_uv_buf0_base = phyAddr + line_stride*height; - isp_wrap_info->mainInfo.main_uv_buf1_base = phyAddr + line_stride*height; + */ - // 3dnr - isp_wrap_info->nr3dInfo.nr3d_y_line_stride = line_stride; - isp_wrap_info->nr3dInfo.nr3d_uv_line_stride = line_stride; - isp_wrap_info->nr3dInfo.nr3d_y_buf_base = phyAddr + 4096 * 1024; - isp_wrap_info->nr3dInfo.nr3d_uv_buf_base = phyAddr + 4096 * 1024 + line_stride * height; +#include +#include +#include +#include +#include "../linux/k510isp.h" - // ldc - isp_wrap_info->ldcInfo.ldc_line_stride = line_stride; - isp_wrap_info->ldcInfo.ldc_y_buf_base = phyAddr + 4096 * 1024 * 2; - isp_wrap_info->ldcInfo.ldc_uv_buf_base = phyAddr + 4096 * 1024 * 2 + line_stride * height; +#include "../media/mediactl-priv.h" +#include "isp_com.h" +#include "isp.h" +#include "vi.h" +#include "mipi_csi2.h" - // - width = isp_wrap_info->ds0Info.ds0_size.width; - height = isp_wrap_info->mainInfo.main_size.height; - line_stride = calc_stride(width); - //isp_wrap_info->ds0Info.ds0_out_en = 1;//must enable - //isp_ds_info->dsInfo[0].scale_en = 1; - //isp_ds_info->dsInfo[0].vscale_filter_en = 1; - //isp_ds_info->dsInfo[0].hscale_filter_en = 1; - isp_wrap_info->ds0Info.ds0_line_stride = line_stride; - isp_wrap_info->ds0Info.ds0_y_buf0_base = phyAddr; - isp_wrap_info->ds0Info.ds0_y_buf1_base = phyAddr; - isp_wrap_info->ds0Info.ds0_uv_buf0_base = phyAddr+line_stride*height; - isp_wrap_info->ds0Info.ds0_uv_buf1_base = phyAddr+line_stride*height; - // - width = isp_wrap_info->ds1Info.ds1_size.width; - line_stride = calc_stride(width); - isp_wrap_info->ds1Info.ds1_line_stride = line_stride; - isp_wrap_info->ds1Info.ds1_y_buf0_base = phyAddr; - isp_wrap_info->ds1Info.ds1_y_buf1_base = phyAddr; - isp_wrap_info->ds1Info.ds1_uv_buf0_base = phyAddr+line_stride*height; - isp_wrap_info->ds1Info.ds1_uv_buf1_base = phyAddr+line_stride*height; - - // - //width = isp_wrap_info->ds2Info.ds2_size.width; - width = isp_wrap_info->ds2Info.ds2_size.pitch; // add pitch - line_stride = calc_stride(width); - if( OUT_ARGB == isp_wrap_info->ds2Info.ds2_out_img_out_format) - { - isp_wrap_info->ds2Info.ds2_line_stride = line_stride*4; - isp_wrap_info->ds2Info.ds2_r_buf0_base = phyAddr; - isp_wrap_info->ds2Info.ds2_r_buf1_base = phyAddr; - isp_wrap_info->ds2Info.ds2_g_buf0_base = phyAddr + line_stride*2; - isp_wrap_info->ds2Info.ds2_g_buf1_base = phyAddr + line_stride*2; - isp_wrap_info->ds2Info.ds2_b_buf0_base = phyAddr + line_stride*3; - isp_wrap_info->ds2Info.ds2_b_buf1_base = phyAddr + line_stride*3; - } - else - { - isp_wrap_info->ds2Info.ds2_line_stride = line_stride; - isp_wrap_info->ds2Info.ds2_r_buf0_base = phyAddr; - isp_wrap_info->ds2Info.ds2_r_buf1_base = phyAddr; - isp_wrap_info->ds2Info.ds2_g_buf0_base = phyAddr + line_stride*height; - isp_wrap_info->ds2Info.ds2_g_buf1_base = phyAddr + line_stride*height; - isp_wrap_info->ds2Info.ds2_b_buf0_base = phyAddr + line_stride*height*2; - isp_wrap_info->ds2Info.ds2_b_buf1_base = phyAddr + line_stride*height*2; - } - ret = ioctl(entity->fd, VIDIOC_K510ISP_F2K_WRAP_CFG,isp_wrap_info); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - // - printf("%s:total_width =%d,total_height =%d\n",__func__,isp_core_info->itcInfo.total_size.width,isp_core_info->itcInfo.total_size.height); - isp_core_info->otcInfo.otc_out_size.width_st = (isp_core_info->itcInfo.itc_size.width - isp_wrap_info->mainInfo.main_size.width)/2; - isp_core_info->otcInfo.otc_out_size.width = isp_wrap_info->mainInfo.main_size.width; - isp_core_info->otcInfo.otc_out_size.height_st= (isp_core_info->itcInfo.itc_size.height -isp_wrap_info->mainInfo.main_size.height)/2; - isp_core_info->otcInfo.otc_out_size.height = isp_wrap_info->mainInfo.main_size.height; - ret = ioctl(entity->fd, VIDIOC_K510ISP_F2K_CORE_CFG,isp_core_info); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - // - ret = ioctl(entity->fd, VIDIOC_K510ISP_F2K_DS_CFG,isp_ds_info); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - // - ret = ioctl(entity->fd,VIDIOC_K510ISP_F2K_CFG_SET,isp_cfg); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - v4l2_subdev_close(entity); - return 0; -} -/** - * @brief - * - * @param entity - * @return int - */ -int sysctl_rst_r2k(struct media_entity *entity) -{ - int ret = 0; - // - ret = v4l2_subdev_open(entity); - if (ret < 0) - return ret; - // - unsigned int rst_en = 1; - ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_R2K,&rst_en); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - - v4l2_subdev_close(entity); - return ret; -} -/** - * @brief - * @param entity - * @param isp_cfg - * @return int - */ -int isp_r2k_cfg(struct media_entity *entity,struct isp_cfg_info *isp_cfg,uint32_t phyAddr) -{ - int ret = 0; - struct isp_wrap_cfg_info *isp_wrap_info = &isp_cfg->isp_wrap_cfg; - struct isp_core_cfg_info *isp_core_info = &isp_cfg->isp_core_cfg; - struct isp_ds_cfg_info *isp_ds_info = &isp_cfg->isp_ds_cfg; - unsigned int width = 0,height = 0; - unsigned int line_stride = 0; - // - ret = v4l2_subdev_open(entity); - if (ret < 0) - return ret; - // - width = isp_wrap_info->mainInfo.main_size.width; - height = isp_wrap_info->mainInfo.main_size.height; - line_stride = calc_stride(width); - isp_wrap_info->mainInfo.main_line_stride = line_stride; - isp_wrap_info->mainInfo.main_y_buf0_base = phyAddr; - isp_wrap_info->mainInfo.main_y_buf1_base = phyAddr; - isp_wrap_info->mainInfo.main_uv_buf0_base = phyAddr + line_stride*height; - isp_wrap_info->mainInfo.main_uv_buf1_base = phyAddr + line_stride*height; +#define calc_stride(x) ((x+15)/16*16) - /* - // 3dnr - isp_wrap_info->nr3dInfo.nr3d_y_line_stride = line_stride; - isp_wrap_info->nr3dInfo.nr3d_uv_line_stride = line_stride; - isp_wrap_info->nr3dInfo.nr3d_y_buf_base = phyAddr + 4096 * 1024; - isp_wrap_info->nr3dInfo.nr3d_uv_buf_base = phyAddr + 4096 * 1024 + line_stride * height; +/** + * @brief + * + * @param entity + * @return int + */ +int sysctl_rst_mipicsi2(struct media_entity *entity) +{ + int ret = 0; + + ret = v4l2_subdev_open(entity); + if (ret < 0) + return ret; + // + unsigned int rst_en = 1; + ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_CSI,&rst_en); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + v4l2_subdev_close(entity); + return ret; +} +/** + * @brief + * + * @param entity + * @param mipi_csi2 + * @return int + */ +int mipicsi2_cfg(struct media_entity *entity,struct isp_csi2_info *mipi_csi2) +{ + int ret = 0; + + ret = v4l2_subdev_open(entity); + if (ret < 0) + return ret; + // + unsigned int rst_en = 1; + ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_CSI,&rst_en); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + // + ret = ioctl(entity->fd, VIDIOC_K510ISP_CSI2_CFG,mipi_csi2); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + + v4l2_subdev_close(entity); + return 0; +} +/** + * @brief + * + * @param entity + * @return int + */ +int sysctl_rst_vi(struct media_entity *entity) +{ + int ret = 0; + + ret = v4l2_subdev_open(entity); + if (ret < 0) + return ret; + // + unsigned int rst_en = 1; + ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_VI,&rst_en); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + + v4l2_subdev_close(entity); + return 0; +} +/** + * @brief + * + * @param entity + * @param vi_cfg + * @return int + */ +int isp_vi_cfg(struct media_entity *entity,struct vi_cfg_info *vi_cfg) +{ + int ret = 0; + + ret = v4l2_subdev_open(entity); + if (ret < 0) + return ret; + // + unsigned int rst_en = 1; + ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_VI,&rst_en); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + // + ret = ioctl(entity->fd, VIDIOC_K510ISP_VI_CFG,vi_cfg); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + + v4l2_subdev_close(entity); + return 0; +} +/** + * @brief + * + * @param entity + * @return int + */ +int sysctl_rst_f2k(struct media_entity *entity) +{ + int ret = 0; + // + ret = v4l2_subdev_open(entity); + if (ret < 0) + return ret; + // + unsigned int rst_en = 1; + ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_F2K,&rst_en); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + + v4l2_subdev_close(entity); + return ret; +} +/** + * @brief + * @param entity + * @param isp_cfg + * @return int + */ +int isp_f2k_cfg(struct media_entity *entity,struct isp_cfg_info *isp_cfg,uint32_t phyAddr) +{ + int ret = 0; + struct isp_wrap_cfg_info *isp_wrap_info = &isp_cfg->isp_wrap_cfg; + struct isp_core_cfg_info *isp_core_info = &isp_cfg->isp_core_cfg; + struct isp_ds_cfg_info *isp_ds_info = &isp_cfg->isp_ds_cfg; + unsigned int width = 0,height = 0; + unsigned int line_stride = 0; + + // + ret = v4l2_subdev_open(entity); + if (ret < 0) + return ret; + // + width = isp_wrap_info->mainInfo.main_size.width; + printf("%s:%d\n",__func__,isp_wrap_info->mainInfo.main_size.width); + line_stride = calc_stride(width); + isp_wrap_info->mainInfo.main_line_stride = line_stride; + isp_wrap_info->mainInfo.main_y_buf0_base = phyAddr; + isp_wrap_info->mainInfo.main_y_buf1_base = phyAddr; + isp_wrap_info->mainInfo.main_uv_buf0_base = phyAddr + line_stride*height; + isp_wrap_info->mainInfo.main_uv_buf1_base = phyAddr + line_stride*height; + + // 3dnr + isp_wrap_info->nr3dInfo.nr3d_y_line_stride = line_stride; + isp_wrap_info->nr3dInfo.nr3d_uv_line_stride = line_stride; + isp_wrap_info->nr3dInfo.nr3d_y_buf_base = phyAddr + 4096 * 1024; + isp_wrap_info->nr3dInfo.nr3d_uv_buf_base = phyAddr + 4096 * 1024 + line_stride * height; + + // ldc + isp_wrap_info->ldcInfo.ldc_line_stride = line_stride; + isp_wrap_info->ldcInfo.ldc_y_buf_base = phyAddr + 4096 * 1024 * 2; + isp_wrap_info->ldcInfo.ldc_uv_buf_base = phyAddr + 4096 * 1024 * 5; - // ldc - isp_wrap_info->ldcInfo.ldc_line_stride = line_stride; - isp_wrap_info->ldcInfo.ldc_y_buf_base = phyAddr + 4096 * 1024 * 2; - isp_wrap_info->ldcInfo.ldc_uv_buf_base = phyAddr + 4096 * 1024 * 2 + line_stride * height; - */ + // + width = isp_wrap_info->ds0Info.ds0_size.width; + height = isp_wrap_info->mainInfo.main_size.height; + line_stride = calc_stride(width); + //isp_wrap_info->ds0Info.ds0_out_en = 1;//must enable + //isp_ds_info->dsInfo[0].scale_en = 1; + //isp_ds_info->dsInfo[0].vscale_filter_en = 1; + //isp_ds_info->dsInfo[0].hscale_filter_en = 1; + isp_wrap_info->ds0Info.ds0_line_stride = line_stride; + isp_wrap_info->ds0Info.ds0_y_buf0_base = phyAddr; + isp_wrap_info->ds0Info.ds0_y_buf1_base = phyAddr; + isp_wrap_info->ds0Info.ds0_uv_buf0_base = phyAddr+line_stride*height; + isp_wrap_info->ds0Info.ds0_uv_buf1_base = phyAddr+line_stride*height; + // + width = isp_wrap_info->ds1Info.ds1_size.width; + line_stride = calc_stride(width); + isp_wrap_info->ds1Info.ds1_line_stride = line_stride; + isp_wrap_info->ds1Info.ds1_y_buf0_base = phyAddr; + isp_wrap_info->ds1Info.ds1_y_buf1_base = phyAddr; + isp_wrap_info->ds1Info.ds1_uv_buf0_base = phyAddr+line_stride*height; + isp_wrap_info->ds1Info.ds1_uv_buf1_base = phyAddr+line_stride*height; + + // + //width = isp_wrap_info->ds2Info.ds2_size.width; + width = isp_wrap_info->ds2Info.ds2_size.pitch; // add pitch + line_stride = calc_stride(width); + if( OUT_ARGB == isp_wrap_info->ds2Info.ds2_out_img_out_format) + { + isp_wrap_info->ds2Info.ds2_line_stride = line_stride*4; + isp_wrap_info->ds2Info.ds2_r_buf0_base = phyAddr; + isp_wrap_info->ds2Info.ds2_r_buf1_base = phyAddr; + isp_wrap_info->ds2Info.ds2_g_buf0_base = phyAddr + line_stride*2; + isp_wrap_info->ds2Info.ds2_g_buf1_base = phyAddr + line_stride*2; + isp_wrap_info->ds2Info.ds2_b_buf0_base = phyAddr + line_stride*3; + isp_wrap_info->ds2Info.ds2_b_buf1_base = phyAddr + line_stride*3; + } + else + { + isp_wrap_info->ds2Info.ds2_line_stride = line_stride; + isp_wrap_info->ds2Info.ds2_r_buf0_base = phyAddr; + isp_wrap_info->ds2Info.ds2_r_buf1_base = phyAddr; + isp_wrap_info->ds2Info.ds2_g_buf0_base = phyAddr + line_stride*height; + isp_wrap_info->ds2Info.ds2_g_buf1_base = phyAddr + line_stride*height; + isp_wrap_info->ds2Info.ds2_b_buf0_base = phyAddr + line_stride*height*2; + isp_wrap_info->ds2Info.ds2_b_buf1_base = phyAddr + line_stride*height*2; + } + + // enable pixel remap + isp_wrap_info->mainInfo.main_pix_remap_en = 1; + isp_wrap_info->ds0Info.pix_remap_out0_en = 1; + isp_wrap_info->ds1Info.pix_remap_out1_en = 1; + + ret = ioctl(entity->fd, VIDIOC_K510ISP_F2K_WRAP_CFG,isp_wrap_info); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + // + printf("%s:total_width =%d,total_height =%d\n",__func__,isp_core_info->itcInfo.total_size.width,isp_core_info->itcInfo.total_size.height); + isp_core_info->otcInfo.otc_out_size.width_st = (isp_core_info->itcInfo.itc_size.width - isp_wrap_info->mainInfo.main_size.width)/2; + if (isp_core_info->otcInfo.otc_out_size.width_st == 0) + isp_core_info->otcInfo.otc_out_size.width_st = 4; + isp_core_info->otcInfo.otc_out_size.width = isp_wrap_info->mainInfo.main_size.width; + isp_core_info->otcInfo.otc_out_size.height_st= (isp_core_info->itcInfo.itc_size.height -isp_wrap_info->mainInfo.main_size.height)/2; + if (isp_core_info->otcInfo.otc_out_size.height_st == 0) + isp_core_info->otcInfo.otc_out_size.height_st = 4; + isp_core_info->otcInfo.otc_out_size.height = isp_wrap_info->mainInfo.main_size.height; + ret = ioctl(entity->fd, VIDIOC_K510ISP_F2K_CORE_CFG,isp_core_info); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + // + ret = ioctl(entity->fd, VIDIOC_K510ISP_F2K_DS_CFG,isp_ds_info); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + // + ret = ioctl(entity->fd,VIDIOC_K510ISP_F2K_CFG_SET,isp_cfg); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + v4l2_subdev_close(entity); + return 0; +} +/** + * @brief + * + * @param entity + * @return int + */ +int sysctl_rst_r2k(struct media_entity *entity) +{ + int ret = 0; + // + ret = v4l2_subdev_open(entity); + if (ret < 0) + return ret; + // + unsigned int rst_en = 1; + ret = ioctl(entity->fd,VIDIOC_K510ISP_SYSCTL_RST_R2K,&rst_en); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + + v4l2_subdev_close(entity); + return ret; +} +/** + * @brief + * @param entity + * @param isp_cfg + * @return int + */ +int isp_r2k_cfg(struct media_entity *entity,struct isp_cfg_info *isp_cfg,uint32_t phyAddr) +{ + int ret = 0; + struct isp_wrap_cfg_info *isp_wrap_info = &isp_cfg->isp_wrap_cfg; + struct isp_core_cfg_info *isp_core_info = &isp_cfg->isp_core_cfg; + struct isp_ds_cfg_info *isp_ds_info = &isp_cfg->isp_ds_cfg; + unsigned int width = 0,height = 0; + unsigned int line_stride = 0; + // + ret = v4l2_subdev_open(entity); + if (ret < 0) + return ret; + // + width = isp_wrap_info->mainInfo.main_size.width; + height = isp_wrap_info->mainInfo.main_size.height; + line_stride = calc_stride(width); + isp_wrap_info->mainInfo.main_line_stride = line_stride; + isp_wrap_info->mainInfo.main_y_buf0_base = phyAddr; + isp_wrap_info->mainInfo.main_y_buf1_base = phyAddr; + isp_wrap_info->mainInfo.main_uv_buf0_base = phyAddr + line_stride*height; + isp_wrap_info->mainInfo.main_uv_buf1_base = phyAddr + line_stride*height; + + /* + // 3dnr + isp_wrap_info->nr3dInfo.nr3d_y_line_stride = line_stride; + isp_wrap_info->nr3dInfo.nr3d_uv_line_stride = line_stride; + isp_wrap_info->nr3dInfo.nr3d_y_buf_base = phyAddr + 4096 * 1024; + isp_wrap_info->nr3dInfo.nr3d_uv_buf_base = phyAddr + 4096 * 1024 + line_stride * height; + + // ldc + isp_wrap_info->ldcInfo.ldc_line_stride = line_stride; + isp_wrap_info->ldcInfo.ldc_y_buf_base = phyAddr + 4096 * 1024 * 2; + isp_wrap_info->ldcInfo.ldc_uv_buf_base = phyAddr + 4096 * 1024 * 2 + line_stride * height; + */ + + // + width = isp_wrap_info->ds0Info.ds0_size.width; + line_stride = calc_stride(width); + isp_wrap_info->ds0Info.ds0_line_stride = line_stride; + isp_wrap_info->ds0Info.ds0_out_en = 1;//must enable + isp_ds_info->dsInfo[0].scale_en = 1; + isp_ds_info->dsInfo[0].vscale_filter_en = 1; + isp_ds_info->dsInfo[0].hscale_filter_en = 1; + isp_wrap_info->ds0Info.ds0_y_buf0_base = phyAddr; + isp_wrap_info->ds0Info.ds0_y_buf1_base = phyAddr; + isp_wrap_info->ds0Info.ds0_uv_buf0_base = phyAddr+line_stride*height; + isp_wrap_info->ds0Info.ds0_uv_buf1_base = phyAddr+line_stride*height; + // + width = isp_wrap_info->ds1Info.ds1_size.width; + line_stride = calc_stride(width); + isp_wrap_info->ds1Info.ds1_line_stride = line_stride; + isp_wrap_info->ds1Info.ds1_y_buf0_base = phyAddr; + isp_wrap_info->ds1Info.ds1_y_buf1_base = phyAddr; + isp_wrap_info->ds1Info.ds1_uv_buf0_base = phyAddr+line_stride*height; + isp_wrap_info->ds1Info.ds1_uv_buf1_base = phyAddr+line_stride*height; + + // + //width = isp_wrap_info->ds2Info.ds2_size.width; + width = isp_wrap_info->ds2Info.ds2_size.pitch; + line_stride = calc_stride(width); + if( OUT_ARGB == isp_wrap_info->ds2Info.ds2_out_img_out_format) + { + isp_wrap_info->ds2Info.ds2_line_stride = line_stride*4; + isp_wrap_info->ds2Info.ds2_r_buf0_base = phyAddr; + isp_wrap_info->ds2Info.ds2_r_buf1_base = phyAddr; + isp_wrap_info->ds2Info.ds2_g_buf0_base = phyAddr + line_stride*2; + isp_wrap_info->ds2Info.ds2_g_buf1_base = phyAddr + line_stride*2; + isp_wrap_info->ds2Info.ds2_b_buf0_base = phyAddr + line_stride*3; + isp_wrap_info->ds2Info.ds2_b_buf1_base = phyAddr + line_stride*3; + } + else + { + isp_wrap_info->ds2Info.ds2_line_stride = line_stride; + isp_wrap_info->ds2Info.ds2_r_buf0_base = phyAddr; + isp_wrap_info->ds2Info.ds2_r_buf1_base = phyAddr; + isp_wrap_info->ds2Info.ds2_g_buf0_base = phyAddr + line_stride*height; + isp_wrap_info->ds2Info.ds2_g_buf1_base = phyAddr + line_stride*height; + isp_wrap_info->ds2Info.ds2_b_buf0_base = phyAddr + line_stride*height*2; + isp_wrap_info->ds2Info.ds2_b_buf1_base = phyAddr + line_stride*height*2; + } + + // enable pixel remap + isp_wrap_info->mainInfo.main_pix_remap_en = 1; + isp_wrap_info->ds0Info.pix_remap_out0_en = 1; + isp_wrap_info->ds1Info.pix_remap_out1_en = 1; + + ret = ioctl(entity->fd, VIDIOC_K510ISP_R2K_WRAP_CFG,isp_wrap_info); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + // + isp_core_info->otcInfo.otc_out_size.width_st = (isp_core_info->itcInfo.itc_size.width - isp_wrap_info->mainInfo.main_size.width)/2; + if (isp_core_info->otcInfo.otc_out_size.width_st == 0) + isp_core_info->otcInfo.otc_out_size.width_st = 4; + isp_core_info->otcInfo.otc_out_size.width = isp_wrap_info->mainInfo.main_size.width; + isp_core_info->otcInfo.otc_out_size.height_st= (isp_core_info->itcInfo.itc_size.height -isp_wrap_info->mainInfo.main_size.height)/2; + if (isp_core_info->otcInfo.otc_out_size.height_st == 0) + isp_core_info->otcInfo.otc_out_size.height_st = 4; + isp_core_info->otcInfo.otc_out_size.height = isp_wrap_info->mainInfo.main_size.height; + ret = ioctl(entity->fd, VIDIOC_K510ISP_R2K_CORE_CFG,isp_core_info); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + // + ret = ioctl(entity->fd, VIDIOC_K510ISP_R2K_DS_CFG,isp_ds_info); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + // + ret = ioctl(entity->fd,VIDIOC_K510ISP_R2K_CFG_SET,isp_cfg); + if (ret < 0) + { + printf("%s: ioctl failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(entity); + return -errno; + } + + v4l2_subdev_close(entity); + return 0; +} +/** + * @brief + * + * @param mipi_csi2 + */ +void print_csi2_info(struct isp_csi2_info *mipi_csi2) +{ + printf("%s:start\n",__func__); + printf("csi0_used:%d\n",mipi_csi2->csi0_used); + printf("csi0_sony_wdr:%d\n",mipi_csi2->csi0_sony_wdr); + printf("csi0_lane_nb:%d\n",mipi_csi2->csi0_lane_nb); + printf("csi0_dl0_map:%d\n",mipi_csi2->csi0_dl0_map); + printf("csi0_dl1_map:%d\n",mipi_csi2->csi0_dl1_map); + printf("csi0_dl2_map:%d\n",mipi_csi2->csi0_dl2_map); + printf("csi0_dl3_map:%d\n",mipi_csi2->csi0_dl3_map); + // + printf("csi00_datatype_select0:%d\n",mipi_csi2->csi00_datatype_select0); + printf("csi00_datatype_select1:%d\n",mipi_csi2->csi00_datatype_select1); + printf("csi00_vc_select:%d\n",mipi_csi2->csi00_vc_select); + // + printf("csi01_datatype_select0:%d\n",mipi_csi2->csi01_datatype_select0); + printf("csi01_datatype_select1:%d\n",mipi_csi2->csi01_datatype_select1); + printf("csi01_vc_select:%d\n",mipi_csi2->csi01_vc_select); + // + printf("csi02_datatype_select0:%d\n",mipi_csi2->csi02_datatype_select0); + printf("csi02_datatype_select1:%d\n",mipi_csi2->csi02_datatype_select1); + printf("csi02_vc_select:%d\n",mipi_csi2->csi02_vc_select); + // + printf("csi1_used:%d\n",mipi_csi2->csi1_used); + printf("csi1_sony_wdr:%d\n",mipi_csi2->csi1_sony_wdr); + printf("csi1_lane_nb:%d\n",mipi_csi2->csi1_lane_nb); + printf("csi1_dl0_map:%d\n",mipi_csi2->csi1_dl0_map); + printf("csi1_dl1_map:%d\n",mipi_csi2->csi1_dl1_map); + printf("csi1_dl2_map:%d\n",mipi_csi2->csi1_dl2_map); + printf("csi1_dl3_map:%d\n",mipi_csi2->csi1_dl3_map); + // + printf("csi10_datatype_select0:%d\n",mipi_csi2->csi10_datatype_select0); + printf("csi10_datatype_select1:%d\n",mipi_csi2->csi10_datatype_select1); + printf("csi10_vc_select:%d\n",mipi_csi2->csi10_vc_select); + printf("%s:end\n",__func__); +} +/** + * @brief + * + * @param vi_cfg + */ +void print_vi_info(struct vi_cfg_info *vi_cfg) +{ + printf("%s:start\n",__func__); + // + struct vi_wrap_cfg_info *vi_wrap_cfg = &vi_cfg->vi_wrap_cfg; + printf("dphy_mode:%d\n",vi_wrap_cfg->dphy_mode); + printf("sony_mode:%d\n",vi_wrap_cfg->sony_mode); + struct sensor_info_s *sensor_info= &vi_wrap_cfg->sensor_info[0]; + printf("0 sensor_interface_en:%d\n",sensor_info->sensor_interface_en); + printf("0 tpg_w_en:%d\n",sensor_info->tpg_w_en); + printf("0 tpg_r_en:%d\n",sensor_info->tpg_r_en); + printf("0 wdr_sensor_vendor:%d\n",sensor_info->wdr_sensor_vendor); + printf("0 wdr_mode:%d\n",sensor_info->wdr_mode); + printf("0 mipi_mode:%d\n",sensor_info->mipi_mode); + printf("0 isp_pipeline:%d\n",sensor_info->isp_pipeline); + sensor_info = &vi_wrap_cfg->sensor_info[1]; + printf("1 sensor_interface_en:%d\n",sensor_info->sensor_interface_en); + printf("1 tpg_w_en:%d\n",sensor_info->tpg_w_en); + printf("1 tpg_r_en:%d\n",sensor_info->tpg_r_en); + printf("1 wdr_sensor_vendor:%d\n",sensor_info->wdr_sensor_vendor); + printf("1 wdr_mode:%d\n",sensor_info->wdr_mode); + printf("1 mipi_mode:%d\n",sensor_info->mipi_mode); + printf("1 isp_pipeline:%d\n",sensor_info->isp_pipeline); + sensor_info = &vi_wrap_cfg->sensor_info[2]; + printf("2 sensor_interface_en:%d\n",sensor_info->sensor_interface_en); + printf("2 tpg_w_en:%d\n",sensor_info->tpg_w_en); + printf("2 tpg_r_en:%d\n",sensor_info->tpg_r_en); + printf("2 wdr_sensor_vendor:%d\n",sensor_info->wdr_sensor_vendor); + printf("2 wdr_mode:%d\n",sensor_info->wdr_mode); + printf("2 mipi_mode:%d\n",sensor_info->mipi_mode); + printf("2 isp_pipeline:%d\n",sensor_info->isp_pipeline); + // + struct vi_pipe_cfg_info *vi_pipe_cfg = &vi_cfg->vi_pipe_cfg[0]; + printf("p00 win_mode_en:%d\n",vi_pipe_cfg->win_mode_en); + printf("p00 input_ch_sel:%d\n",vi_pipe_cfg->input_ch_sel); + printf("p00 ch_mode_sel:%d\n",vi_pipe_cfg->ch_mode_sel); + printf("p00 pixel_type:%d\n",vi_pipe_cfg->pixel_type); + printf("p00 yuv_in_format:%d\n",vi_pipe_cfg->yuv_in_format); + printf("p00 yuv_out_format:%d\n",vi_pipe_cfg->yuv_out_format); + printf("p00 yuv422_order:%d\n",vi_pipe_cfg->yuv422_order); + printf("p00 pixel_width:%d\n",vi_pipe_cfg->pixel_width); + printf("p00 data_out_timming_ctrl:%d\n",vi_pipe_cfg->data_out_timming_ctrl); + printf("p00 sync_pulse_mode:%d\n",vi_pipe_cfg->sync_pulse_mode); + printf("p00 sen_mipi_clk_pol:%d\n",vi_pipe_cfg->sen_mipi_clk_pol); + printf("p00 sen_mipi_vsync_pol:%d\n",vi_pipe_cfg->sen_mipi_vsync_pol); + printf("p00 sen_mipi_hsync_pol:%d\n",vi_pipe_cfg->sen_mipi_hsync_pol); + printf("p00 sen_mipi_field_pol:%d\n",vi_pipe_cfg->sen_mipi_field_pol); + printf("p00 isp_clk_pol:%d\n",vi_pipe_cfg->isp_clk_pol); + printf("p00 isp_vsync_pol:%d\n",vi_pipe_cfg->isp_vsync_pol); + printf("p00 isp_hsync_pol:%d\n",vi_pipe_cfg->isp_hsync_pol); + printf("p00 isp_field_pol:%d\n",vi_pipe_cfg->isp_field_pol); + printf("p00 tpg_w_en:%d\n",vi_pipe_cfg->tpg_w_en); + printf("p00 tpg_r_en:%d\n",vi_pipe_cfg->tpg_r_en); + printf("p00 total_size.width:%d\n",vi_pipe_cfg->total_size.width); + printf("p00 total_size.height:%d\n",vi_pipe_cfg->total_size.height); + printf("p00 in_size.width:%d\n",vi_pipe_cfg->in_size.width); + printf("p00 in_size.height:%d\n",vi_pipe_cfg->in_size.height); + printf("p00 w_size_st.width:%d\n",vi_pipe_cfg->w_size_st.width); + printf("p00 w_size_st.height:%d\n",vi_pipe_cfg->w_size_st.height); + printf("p00 r_size_st.width:%d\n",vi_pipe_cfg->r_size_st.width); + printf("p00 r_size_st.height:%d\n",vi_pipe_cfg->r_size_st.height); + printf("p00 vi_pipe_w_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y0); + printf("p00 vi_pipe_w_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y1); + printf("p00 vi_pipe_w_addr_uv0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv0); + printf("p00 vi_pipe_w_addr_uv1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv1); + printf("p00 vi_pipe_r_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y0); + printf("p00 vi_pipe_r_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y1); + printf("p00 vi_pipe_addr_stride:%d\n",vi_pipe_cfg->vi_pipe_addr_stride); + printf("p00 tof_mode_enable:%d\n",vi_pipe_cfg->tof_mode_enable); + printf("p00 vi_pipe_tpg_tof_frm_num:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_num); + printf("p00 vi_pipe_tpg_tof_frm_stride:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_stride); + //p01 + vi_pipe_cfg = &vi_cfg->vi_pipe_cfg[1]; + printf("p01 win_mode_en:%d\n",vi_pipe_cfg->win_mode_en); + printf("p01 input_ch_sel:%d\n",vi_pipe_cfg->input_ch_sel); + printf("p01 ch_mode_sel:%d\n",vi_pipe_cfg->ch_mode_sel); + printf("p01 pixel_type:%d\n",vi_pipe_cfg->pixel_type); + printf("p01 yuv_in_format:%d\n",vi_pipe_cfg->yuv_in_format); + printf("p01 yuv_out_format:%d\n",vi_pipe_cfg->yuv_out_format); + printf("p01 yuv422_order:%d\n",vi_pipe_cfg->yuv422_order); + printf("p01 pixel_width:%d\n",vi_pipe_cfg->pixel_width); + printf("p01 data_out_timming_ctrl:%d\n",vi_pipe_cfg->data_out_timming_ctrl); + printf("p01 sync_pulse_mode:%d\n",vi_pipe_cfg->sync_pulse_mode); + printf("p01 sen_mipi_clk_pol:%d\n",vi_pipe_cfg->sen_mipi_clk_pol); + printf("p01 sen_mipi_vsync_pol:%d\n",vi_pipe_cfg->sen_mipi_vsync_pol); + printf("p01 sen_mipi_hsync_pol:%d\n",vi_pipe_cfg->sen_mipi_hsync_pol); + printf("p01 sen_mipi_field_pol:%d\n",vi_pipe_cfg->sen_mipi_field_pol); + printf("p01 isp_clk_pol:%d\n",vi_pipe_cfg->isp_clk_pol); + printf("p01 isp_vsync_pol:%d\n",vi_pipe_cfg->isp_vsync_pol); + printf("p01 isp_hsync_pol:%d\n",vi_pipe_cfg->isp_hsync_pol); + printf("p01 isp_field_pol:%d\n",vi_pipe_cfg->isp_field_pol); + printf("p01 tpg_w_en:%d\n",vi_pipe_cfg->tpg_w_en); + printf("p01 tpg_r_en:%d\n",vi_pipe_cfg->tpg_r_en); + printf("p01 total_size.width:%d\n",vi_pipe_cfg->total_size.width); + printf("p01 total_size.height:%d\n",vi_pipe_cfg->total_size.height); + printf("p01 in_size.width:%d\n",vi_pipe_cfg->in_size.width); + printf("p01 in_size.height:%d\n",vi_pipe_cfg->in_size.height); + printf("p01 w_size_st.width:%d\n",vi_pipe_cfg->w_size_st.width); + printf("p01 w_size_st.height:%d\n",vi_pipe_cfg->w_size_st.height); + printf("p01 r_size_st.width:%d\n",vi_pipe_cfg->r_size_st.width); + printf("p01 r_size_st.height:%d\n",vi_pipe_cfg->r_size_st.height); + printf("p01 vi_pipe_w_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y0); + printf("p01 vi_pipe_w_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y1); + printf("p01 vi_pipe_w_addr_uv0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv0); + printf("p01 vi_pipe_w_addr_uv1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv1); + printf("p01 vi_pipe_r_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y0); + printf("p01 vi_pipe_r_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y1); + printf("p01 vi_pipe_addr_stride:%d\n",vi_pipe_cfg->vi_pipe_addr_stride); + printf("p01 tof_mode_enable:%d\n",vi_pipe_cfg->tof_mode_enable); + printf("p01 vi_pipe_tpg_tof_frm_num:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_num); + printf("p01 vi_pipe_tpg_tof_frm_stride:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_stride); + //p02 + vi_pipe_cfg = &vi_cfg->vi_pipe_cfg[2]; + printf("p02 win_mode_en:%d\n",vi_pipe_cfg->win_mode_en); + printf("p02 input_ch_sel:%d\n",vi_pipe_cfg->input_ch_sel); + printf("p02 ch_mode_sel:%d\n",vi_pipe_cfg->ch_mode_sel); + printf("p02 pixel_type:%d\n",vi_pipe_cfg->pixel_type); + printf("p02 yuv_in_format:%d\n",vi_pipe_cfg->yuv_in_format); + printf("p02 yuv_out_format:%d\n",vi_pipe_cfg->yuv_out_format); + printf("p02 yuv422_order:%d\n",vi_pipe_cfg->yuv422_order); + printf("p02 pixel_width:%d\n",vi_pipe_cfg->pixel_width); + printf("p02 data_out_timming_ctrl:%d\n",vi_pipe_cfg->data_out_timming_ctrl); + printf("p02 sync_pulse_mode:%d\n",vi_pipe_cfg->sync_pulse_mode); + printf("p02 sen_mipi_clk_pol:%d\n",vi_pipe_cfg->sen_mipi_clk_pol); + printf("p02 sen_mipi_vsync_pol:%d\n",vi_pipe_cfg->sen_mipi_vsync_pol); + printf("p02 sen_mipi_hsync_pol:%d\n",vi_pipe_cfg->sen_mipi_hsync_pol); + printf("p02 sen_mipi_field_pol:%d\n",vi_pipe_cfg->sen_mipi_field_pol); + printf("p02 isp_clk_pol:%d\n",vi_pipe_cfg->isp_clk_pol); + printf("p02 isp_vsync_pol:%d\n",vi_pipe_cfg->isp_vsync_pol); + printf("p02 isp_hsync_pol:%d\n",vi_pipe_cfg->isp_hsync_pol); + printf("p02 isp_field_pol:%d\n",vi_pipe_cfg->isp_field_pol); + printf("p02 tpg_w_en:%d\n",vi_pipe_cfg->tpg_w_en); + printf("p02 tpg_r_en:%d\n",vi_pipe_cfg->tpg_r_en); + printf("p02 total_size.width:%d\n",vi_pipe_cfg->total_size.width); + printf("p02 total_size.height:%d\n",vi_pipe_cfg->total_size.height); + printf("p02 in_size.width:%d\n",vi_pipe_cfg->in_size.width); + printf("p02 in_size.height:%d\n",vi_pipe_cfg->in_size.height); + printf("p02 w_size_st.width:%d\n",vi_pipe_cfg->w_size_st.width); + printf("p02 w_size_st.height:%d\n",vi_pipe_cfg->w_size_st.height); + printf("p02 r_size_st.width:%d\n",vi_pipe_cfg->r_size_st.width); + printf("p02 r_size_st.height:%d\n",vi_pipe_cfg->r_size_st.height); + printf("p02 vi_pipe_w_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y0); + printf("p02 vi_pipe_w_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y1); + printf("p02 vi_pipe_w_addr_uv0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv0); + printf("p02 vi_pipe_w_addr_uv1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv1); + printf("p02 vi_pipe_r_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y0); + printf("p02 vi_pipe_r_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y1); + printf("p02 vi_pipe_addr_stride:%d\n",vi_pipe_cfg->vi_pipe_addr_stride); + printf("p02 tof_mode_enable:%d\n",vi_pipe_cfg->tof_mode_enable); + printf("p02 vi_pipe_tpg_tof_frm_num:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_num); + printf("p02 vi_pipe_tpg_tof_frm_stride:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_stride); + //p10 + vi_pipe_cfg = &vi_cfg->vi_pipe_cfg[3]; + printf("p10 win_mode_en:%d\n",vi_pipe_cfg->win_mode_en); + printf("p10 input_ch_sel:%d\n",vi_pipe_cfg->input_ch_sel); + printf("p10 ch_mode_sel:%d\n",vi_pipe_cfg->ch_mode_sel); + printf("p10 pixel_type:%d\n",vi_pipe_cfg->pixel_type); + printf("p10 yuv_in_format:%d\n",vi_pipe_cfg->yuv_in_format); + printf("p10 yuv_out_format:%d\n",vi_pipe_cfg->yuv_out_format); + printf("p10 yuv422_order:%d\n",vi_pipe_cfg->yuv422_order); + printf("p10 pixel_width:%d\n",vi_pipe_cfg->pixel_width); + printf("p10 data_out_timming_ctrl:%d\n",vi_pipe_cfg->data_out_timming_ctrl); + printf("p10 sync_pulse_mode:%d\n",vi_pipe_cfg->sync_pulse_mode); + printf("p10 sen_mipi_clk_pol:%d\n",vi_pipe_cfg->sen_mipi_clk_pol); + printf("p10 sen_mipi_vsync_pol:%d\n",vi_pipe_cfg->sen_mipi_vsync_pol); + printf("p10 sen_mipi_hsync_pol:%d\n",vi_pipe_cfg->sen_mipi_hsync_pol); + printf("p10 sen_mipi_field_pol:%d\n",vi_pipe_cfg->sen_mipi_field_pol); + printf("p10 isp_clk_pol:%d\n",vi_pipe_cfg->isp_clk_pol); + printf("p10 isp_vsync_pol:%d\n",vi_pipe_cfg->isp_vsync_pol); + printf("p10 isp_hsync_pol:%d\n",vi_pipe_cfg->isp_hsync_pol); + printf("p10 isp_field_pol:%d\n",vi_pipe_cfg->isp_field_pol); + printf("p10 tpg_w_en:%d\n",vi_pipe_cfg->tpg_w_en); + printf("p10 tpg_r_en:%d\n",vi_pipe_cfg->tpg_r_en); + printf("p10 total_size.width:%d\n",vi_pipe_cfg->total_size.width); + printf("p10 total_size.height:%d\n",vi_pipe_cfg->total_size.height); + printf("p10 in_size.width:%d\n",vi_pipe_cfg->in_size.width); + printf("p10 in_size.height:%d\n",vi_pipe_cfg->in_size.height); + printf("p10 w_size_st.width:%d\n",vi_pipe_cfg->w_size_st.width); + printf("p10 w_size_st.height:%d\n",vi_pipe_cfg->w_size_st.height); + printf("p10 r_size_st.width:%d\n",vi_pipe_cfg->r_size_st.width); + printf("p10 r_size_st.height:%d\n",vi_pipe_cfg->r_size_st.height); + printf("p10 vi_pipe_w_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y0); + printf("p10 vi_pipe_w_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y1); + printf("p10 vi_pipe_w_addr_uv0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv0); + printf("p10 vi_pipe_w_addr_uv1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv1); + printf("p10 vi_pipe_r_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y0); + printf("p10 vi_pipe_r_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y1); + printf("p10 vi_pipe_addr_stride:%d\n",vi_pipe_cfg->vi_pipe_addr_stride); + printf("p10 tof_mode_enable:%d\n",vi_pipe_cfg->tof_mode_enable); + printf("p10 vi_pipe_tpg_tof_frm_num:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_num); + printf("p10 vi_pipe_tpg_tof_frm_stride:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_stride); + //dvp + vi_pipe_cfg = &vi_cfg->vi_pipe_cfg[6]; + printf("dvp00 win_mode_en:%d\n",vi_pipe_cfg->win_mode_en); + printf("dvp00 input_ch_sel:%d\n",vi_pipe_cfg->input_ch_sel); + printf("dvp00 ch_mode_sel:%d\n",vi_pipe_cfg->ch_mode_sel); + printf("dvp00 pixel_type:%d\n",vi_pipe_cfg->pixel_type); + printf("dvp00 yuv_in_format:%d\n",vi_pipe_cfg->yuv_in_format); + printf("dvp00 yuv_out_format:%d\n",vi_pipe_cfg->yuv_out_format); + printf("dvp00 yuv422_order:%d\n",vi_pipe_cfg->yuv422_order); + printf("dvp00 pixel_width:%d\n",vi_pipe_cfg->pixel_width); + printf("dvp00 data_out_timming_ctrl:%d\n",vi_pipe_cfg->data_out_timming_ctrl); + printf("dvp00 sync_pulse_mode:%d\n",vi_pipe_cfg->sync_pulse_mode); + printf("dvp00 sen_mipi_clk_pol:%d\n",vi_pipe_cfg->sen_mipi_clk_pol); + printf("dvp00 sen_mipi_vsync_pol:%d\n",vi_pipe_cfg->sen_mipi_vsync_pol); + printf("dvp00 sen_mipi_hsync_pol:%d\n",vi_pipe_cfg->sen_mipi_hsync_pol); + printf("dvp00 sen_mipi_field_pol:%d\n",vi_pipe_cfg->sen_mipi_field_pol); + printf("dvp00 isp_clk_pol:%d\n",vi_pipe_cfg->isp_clk_pol); + printf("dvp00 isp_vsync_pol:%d\n",vi_pipe_cfg->isp_vsync_pol); + printf("dvp00 isp_hsync_pol:%d\n",vi_pipe_cfg->isp_hsync_pol); + printf("dvp00 isp_field_pol:%d\n",vi_pipe_cfg->isp_field_pol); + printf("dvp00 tpg_w_en:%d\n",vi_pipe_cfg->tpg_w_en); + printf("dvp00 tpg_r_en:%d\n",vi_pipe_cfg->tpg_r_en); + printf("dvp00 total_size.width:%d\n",vi_pipe_cfg->total_size.width); + printf("dvp00 total_size.height:%d\n",vi_pipe_cfg->total_size.height); + printf("dvp00 in_size.width:%d\n",vi_pipe_cfg->in_size.width); + printf("dvp00 in_size.height:%d\n",vi_pipe_cfg->in_size.height); + printf("dvp00 w_size_st.width:%d\n",vi_pipe_cfg->w_size_st.width); + printf("dvp00 w_size_st.height:%d\n",vi_pipe_cfg->w_size_st.height); + printf("dvp00 r_size_st.width:%d\n",vi_pipe_cfg->r_size_st.width); + printf("dvp00 r_size_st.height:%d\n",vi_pipe_cfg->r_size_st.height); + printf("dvp00 vi_pipe_w_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y0); + printf("dvp00 vi_pipe_w_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y1); + printf("dvp00 vi_pipe_w_addr_uv0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv0); + printf("dvp00 vi_pipe_w_addr_uv1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv1); + printf("dvp00 vi_pipe_r_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y0); + printf("dvp00 vi_pipe_r_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y1); + printf("dvp00 vi_pipe_addr_stride:%d\n",vi_pipe_cfg->vi_pipe_addr_stride); + printf("dvp00 tof_mode_enable:%d\n",vi_pipe_cfg->tof_mode_enable); + printf("dvp00 vi_pipe_tpg_tof_frm_num:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_num); + printf("dvp00 vi_pipe_tpg_tof_frm_stride:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_stride); + + printf("%s:end\n",__func__); +} +/** + * @brief + * + * @param isp_cfg + */ +void print_isp_info(struct isp_cfg_info *isp_cfg) +{ + printf("%s:start\n",__func__); + // + struct isp_wrap_cfg_info *isp_wrap_cfg = &isp_cfg->isp_wrap_cfg; + printf("isp_out_sel:%d\n",isp_wrap_cfg->isp_out_sel); + printf("dvp_ch_mode:%d\n",isp_wrap_cfg->dvp_ch_mode); + printf("hist_3a_out_en:%d\n",isp_wrap_cfg->hist_3a_out_en); + // + struct isp_wrap_wdr_info *wwdrInfo = &isp_wrap_cfg->wdrInfo; + printf("wdr_mode:%d\n",wwdrInfo->wdr_mode); + printf("wdr_long_ch_mode:%d\n",wwdrInfo->wdr_long_ch_mode); + printf("wdr_long_l2_buf_en:%d\n",wwdrInfo->wdr_long_l2_buf_en); + printf("wdr_short_s1_buf_en:%d\n",wwdrInfo->wdr_short_s1_buf_en); + printf("wdr_dynamic_switch_en:%d\n",wwdrInfo->wdr_dynamic_switch_en); + printf("wdr_long_l2_buf_depth:%d\n",wwdrInfo->wdr_long_l2_buf_depth); + printf("wdr_long_img_format:%d\n",wwdrInfo->wdr_long_img_format); + printf("wdr_long_yuv_in_format:%d\n",wwdrInfo->wdr_long_yuv_in_format); + printf("wdr_long_img_out_format:%d\n",wwdrInfo->wdr_long_img_out_format); + printf("wdr_long_yuv422_pxl_order:%d\n",wwdrInfo->wdr_long_yuv422_pxl_order); + printf("wdr_long_pixel_width:%d\n",wwdrInfo->wdr_long_pixel_width); + printf("wdr_buf_base:%d\n",wwdrInfo->wdr_buf_base); + printf("wdr_line_stride:%d\n",wwdrInfo->wdr_line_stride); + printf("wdr_frame_buf_size:%d\n",wwdrInfo->wdr_frame_buf_size); + // + struct isp_wrap_3dnr_info *wnr3dInfo = &isp_wrap_cfg->nr3dInfo; + printf("nr3d_en:%d\n",wnr3dInfo->nr3d_en ); + printf("nr3d_fbcd_en:%d\n",wnr3dInfo->nr3d_fbcd_en); + printf("nr3d_mv_out_en:%d\n",wnr3dInfo->nr3d_mv_out_en); + printf("nr3d_y_img_format:%d\n",wnr3dInfo->nr3d_y_img_format); + printf("nr3d_y_yuv_in_format:%d\n",wnr3dInfo->nr3d_y_yuv_in_format); + printf("nr3d_y_img_out_format:%d\n",wnr3dInfo->nr3d_y_img_out_format); + printf("nr3d_y_yuv422_pxl_order:%d\n",wnr3dInfo->nr3d_y_yuv422_pxl_order); + printf("nr3d_y_pixel_width:%d\n",wnr3dInfo->nr3d_y_pixel_width); + printf("nr3d_uv_img_format:%d\n",wnr3dInfo->nr3d_uv_img_format); + printf("nr3d_uv_yuv_in_format:%d\n",wnr3dInfo->nr3d_uv_yuv_in_format); + printf("nr3d_uv_mig_out_format:%d\n",wnr3dInfo->nr3d_uv_mig_out_format); + printf("nr3d_uv_yuv422_pxl_order:%d\n",wnr3dInfo->nr3d_uv_yuv422_pxl_order); + printf("nr3d_uv_pixel_width:%d\n",wnr3dInfo->nr3d_uv_pixel_width); + printf("nr3d_y_buf_base:%d\n",wnr3dInfo->nr3d_y_buf_base); + printf("nr3d_uv_buf_base:%d\n",wnr3dInfo->nr3d_uv_buf_base); + printf("nr3d_y_line_stride:%d\n",wnr3dInfo->nr3d_y_line_stride); + printf("nr3d_uv_line_stride:%d\n",wnr3dInfo->nr3d_uv_line_stride); + printf("nr3d_frame_buf_size:%d\n",wnr3dInfo->nr3d_frame_buf_size); + // + struct isp_wrap_ldc_info *wldcInfo = &isp_wrap_cfg->ldcInfo; + printf("ldc_en:%d\n",wldcInfo->ldc_en); + printf("ldc_y_buf_base:%d\n",wldcInfo->ldc_y_buf_base); + printf("ldc_uv_buf_base:%d\n",wldcInfo->ldc_uv_buf_base); + printf("ldc_line_stride:%d\n",wldcInfo->ldc_line_stride); + printf("ldc_frame_buf_size:%d\n",wldcInfo->ldc_frame_buf_size); + // + struct isp_wrap_main_info *mainInfo = &isp_wrap_cfg->mainInfo; + printf("main_out_en:%d\n",mainInfo->main_out_en); + printf("main_size.width:%d\n",mainInfo->main_size.width); + printf("main_size.height:%d\n",mainInfo->main_size.height); + printf("main_pix_remap_en:%d\n",mainInfo->main_pix_remap_en); + printf("main_out_img_format:%d\n",mainInfo->main_out_img_format); + printf("main_out_yuv_in_format:%d\n",mainInfo->main_out_yuv_in_format); + printf("main_out_img_out_format:%d\n",mainInfo->main_out_img_out_format); + printf("main_out_yuv422_pxl_order:%d\n",mainInfo->main_out_yuv422_pxl_order); + printf("main_out_pxl_width:%d\n",mainInfo->main_out_pxl_width); + printf("main_y_buf0_base:%d\n",mainInfo->main_y_buf0_base); + printf("main_y_buf1_base:%d\n",mainInfo->main_y_buf1_base); + printf("main_uv_buf0_base:%d\n",mainInfo->main_uv_buf0_base); + printf("main_uv_buf1_base:%d\n",mainInfo->main_uv_buf1_base); + printf("main_line_stride:%d\n",mainInfo->main_line_stride); + printf("main_frame_buf_size:%d\n",mainInfo->main_frame_buf_size); + // + struct isp_wrap_ds0_info *ds0Info = &isp_wrap_cfg->ds0Info; + printf("ds0_out_en:%d\n",ds0Info->ds0_out_en); + printf("ds0_osd0_en:%d\n",ds0Info->ds0_osd0_en ); + printf("ds0_osd1_en:%d\n",ds0Info->ds0_osd1_en ); + printf("ds0_osd2_en:%d\n",ds0Info->ds0_osd2_en ); + printf("pix_remap_out0_en:%d\n",ds0Info->pix_remap_out0_en); + printf("ds0_size.width:%d\n",ds0Info->ds0_size.width); + printf("ds0_size.height:%d\n",ds0Info->ds0_size.height); + printf("ds0_out_img_format:%d\n",ds0Info->ds0_out_img_format); + printf("ds0_out_yuv_in_format:%d\n",ds0Info->ds0_out_yuv_in_format); + printf("ds0_out_img_out_format:%d\n",ds0Info->ds0_out_img_out_format); + printf("ds0_out_yuv422_pxl_order:%d\n",ds0Info->ds0_out_yuv422_pxl_order); + printf("ds0_out_pxl_width:%d\n",ds0Info->ds0_out_pxl_width); + printf("ds0_y_buf0_base:%d\n",ds0Info->ds0_y_buf0_base); + printf("ds0_y_buf1_base:%d\n",ds0Info->ds0_y_buf1_base); + printf("ds0_uv_buf0_base:%d\n",ds0Info->ds0_uv_buf0_base); + printf("ds0_uv_buf1_base:%d\n",ds0Info->ds0_uv_buf1_base); + printf("ds0_line_stride:%d\n",ds0Info->ds0_line_stride); + printf("ds0_frame_buf_size:%d\n",ds0Info->ds0_frame_buf_size); + // + struct isp_wrap_ds1_info *ds1Info = &isp_wrap_cfg->ds1Info; + printf("ds1_out_en:%d\n",ds1Info->ds1_out_en); + printf("ds1_osd0_en:%d\n",ds1Info->ds1_osd0_en ); + printf("ds1_osd1_en:%d\n",ds1Info->ds1_osd1_en ); + printf("ds1_osd2_en:%d\n",ds1Info->ds1_osd2_en ); + printf("pix_remap_out1_en:%d\n",ds1Info->pix_remap_out1_en); + printf("ds1_size.width:%d\n",ds1Info->ds1_size.width); + printf("ds1_size.height:%d\n",ds1Info->ds1_size.height); + printf("ds1_out_img_format:%d\n",ds1Info->ds1_out_img_format); + printf("ds1_out_yuv_in_format:%d\n",ds1Info->ds1_out_yuv_in_format); + printf("ds1_out_img_out_format:%d\n",ds1Info->ds1_out_img_out_format); + printf("ds1_out_yuv422_pxl_order:%d\n",ds1Info->ds1_out_yuv422_pxl_order); + printf("ds1_out_pxl_width:%d\n",ds1Info->ds1_out_pxl_width); + printf("ds1_y_buf0_base:%d\n",ds1Info->ds1_y_buf0_base); + printf("ds1_y_buf1_base:%d\n",ds1Info->ds1_y_buf1_base); + printf("ds1_uv_buf0_base:%d\n",ds1Info->ds1_uv_buf0_base); + printf("ds1_uv_buf1_base:%d\n",ds1Info->ds1_uv_buf1_base); + printf("ds1_line_stride:%d\n",ds1Info->ds1_line_stride); + printf("ds1_frame_buf_size:%d\n",ds1Info->ds1_frame_buf_size); + // + struct isp_wrap_ds2_info *ds2Info = &isp_wrap_cfg->ds2Info; + printf("ds2_out_en:%d\n",ds2Info->ds2_out_en); + printf("ds2_osd0_en:%d\n",ds2Info->ds2_osd0_en ); + printf("ds2_osd1_en:%d\n",ds2Info->ds2_osd1_en ); + printf("ds2_osd2_en:%d\n",ds2Info->ds2_osd2_en ); + printf("ds2_size.width:%d\n",ds2Info->ds2_size.width); + printf("ds2_size.height:%d\n",ds2Info->ds2_size.height); + printf("ds2_out_img_format:%d\n",ds2Info->ds2_out_img_format); + printf("ds2_out_yuv_in_format:%d\n",ds2Info->ds2_out_yuv_in_format); + printf("ds2_out_img_out_format:%d\n",ds2Info->ds2_out_img_out_format); + printf("ds2_out_yuv422_pxl_order:%d\n",ds2Info->ds2_out_yuv422_pxl_order); + printf("ds2_out_pxl_width:%d\n",ds2Info->ds2_out_pxl_width); + printf("ds2_r_buf0_base:%d\n",ds2Info->ds2_r_buf0_base); + printf("ds2_r_buf1_base:%d\n",ds2Info->ds2_r_buf1_base); + printf("ds2_g_buf0_base:%d\n",ds2Info->ds2_g_buf0_base); + printf("ds2_g_buf1_base:%d\n",ds2Info->ds2_g_buf1_base); + printf("ds2_b_buf0_base:%d\n",ds2Info->ds2_b_buf0_base); + printf("ds2_b_buf1_base:%d\n",ds2Info->ds2_b_buf1_base); + printf("ds2_line_stride:%d\n",ds2Info->ds2_line_stride); + printf("ds2_frame_buf_size:%d\n",ds2Info->ds2_frame_buf_size); + // + struct isp_core_cfg_info *isp_core_cfg = &isp_cfg->isp_core_cfg; + //itc + struct itc_info_s *itcInfo = &isp_core_cfg->itcInfo; + printf("hsync_pol:%d\n",itcInfo->hsync_pol); + printf("vsync_pol:%d\n",itcInfo->vsync_pol); + printf("hsync_input_timing:%d\n",itcInfo->hsync_input_timing); + printf("vsync_input_timing:%d\n",itcInfo->vsync_input_timing); + printf("flip_ctl:%d\n",itcInfo->flip_ctl); + printf("video_fmt_sel:%d\n",itcInfo->video_fmt_sel); + printf("total_size.width:%d\n",itcInfo->total_size.width); + printf("total_size.height:%d\n",itcInfo->total_size.height); + printf("itc_size.width:%d\n",itcInfo->itc_size.width); + printf("itc_size.width_st:%d\n",itcInfo->itc_size.width_st); + printf("itc_size.height:%d\n",itcInfo->itc_size.height); + printf("itc_size.height_st:%d\n",itcInfo->itc_size.height_st); + //tpg * + struct tpg_info_s *tpgInfo = &isp_core_cfg->tpgInfo; + printf("tpg_en:%d\n",tpgInfo->tpg_en); + printf("tpg_sel:%d\n",tpgInfo->tpg_sel); + printf("bayer_mode_sel:%d\n",tpgInfo->bayer_mode_sel); + printf("motion_mode_sel:%d\n",tpgInfo->motion_mode_sel); + printf("wdr_l_mul_data:%d\n",tpgInfo->wdr_l_mul_data); + printf("wdr_m_mul_data:%d\n",tpgInfo->wdr_m_mul_data); + printf("wdr_s_mul_data:%d\n",tpgInfo->wdr_s_mul_data); + //blc * + struct blc_info_s *blcInfo = &isp_core_cfg->blcInfo; + printf("blc_en:%d\n",blcInfo->blc_en); + printf("blc_offset:%d\n",blcInfo->blc_offset); + printf("blc_ratio:%d\n",blcInfo->blc_ratio); + //lsc * + struct lsc_info_s *lscInfo = &isp_core_cfg->lscInfo; + printf("lsc_en:%d\n",lscInfo->lsc_en); + printf("lsc_h_center:%d\n",lscInfo->lsc_h_center); + printf("lsc_v_center:%d\n",lscInfo->lsc_v_center); + printf("lsc_r_ratio:%d\n",lscInfo->lsc_r_ratio); + printf("lsc_g_ratio:%d\n",lscInfo->lsc_g_ratio); + printf("lsc_b_ratio:%d\n",lscInfo->lsc_b_ratio); + printf("lsc_ir_ratio:%d\n",lscInfo->lsc_ir_ratio); + //ae * + struct ae_info_s *aeInfo = &isp_core_cfg->aeInfo; + printf("ae_as_en:%d\n",aeInfo->ae_as_en); + printf("ae_ag_en:%d\n",aeInfo->ae_ag_en); + printf("ae_airis_en:%d\n",aeInfo->ae_airis_en); + printf("ae_enter_ls_sel:%d\n",aeInfo->ae_enter_ls_sel); + printf("ae_exit_ls_sel:%d\n",aeInfo->ae_exit_ls_sel); + printf("ae_win_mode_sel:%d\n",aeInfo->ae_win_mode_sel); + printf("ae_back_light_mode_sel:%d\n",aeInfo->ae_back_light_mode_sel); + printf("ae_day_change_en:%d\n",aeInfo->ae_day_change_en); + printf("ae_day_change_sel:%d\n",aeInfo->ae_day_change_sel); + printf("ae_win_size.v_start:%d\n",aeInfo->ae_win_size.v_start); + printf("ae_win_size.h_start:%d\n",aeInfo->ae_win_size.h_start); + printf("ae_win_size.v_end:%d\n",aeInfo->ae_win_size.v_end); + printf("ae_win_size.h_end:%d\n",aeInfo->ae_win_size.h_end); + printf("ae_tar_bright:%d\n",aeInfo->ae_tar_bright); + printf("ae_tar_bright_range:%d\n",aeInfo->ae_tar_bright_range); + printf("ae_l_ex_time:%d\n",aeInfo->ae_l_ex_time); + printf("ae_m_ex_time:%d\n",aeInfo->ae_m_ex_time); + printf("ae_s_ex_time:%d\n",aeInfo->ae_s_ex_time); + printf("ae_agc:%d\n",aeInfo->ae_agc); + printf("ae_ad_shuttle_freq:%d\n",aeInfo->ae_ad_shuttle_freq); + printf("ae_ad_gain_freq:%d\n",aeInfo->ae_ad_gain_freq); + printf("ae_adjust_step_max:%d\n",aeInfo->ae_adjust_step_max); + printf("ae_ex_value_max:%d\n",aeInfo->ae_ex_value_max); + printf("ae_ex_value_mid:%d\n",aeInfo->ae_ex_value_mid); + printf("ae_ex_value_min:%d\n",aeInfo->ae_ex_value_min); + printf("ae_gain_value_max:%d\n",aeInfo->ae_gain_value_max); + printf("ae_gain_value_mid:%d\n",aeInfo->ae_gain_value_mid); + printf("ae_gain_value_min:%d\n",aeInfo->ae_gain_value_min); + printf("ae_dn_switch_ad_step_max:%d\n",aeInfo->ae_dn_switch_ad_step_max); + printf("ae_dn_switch_wait_time:%d\n",aeInfo->ae_dn_switch_wait_time); + printf("ape_max_diff:%d\n",aeInfo->ape_max_diff); + printf("ape_drv_signal_max:%d\n",aeInfo->ape_drv_signal_max); + printf("ape_coeff_distance:%d\n",aeInfo->ape_coeff_distance); + printf("ape_coeff_speed:%d\n",aeInfo->ape_coeff_speed); + printf("ape_coeff_acceleration:%d\n",aeInfo->ape_coeff_acceleration); + printf("ape_drv_manual_value:%d\n",aeInfo->ape_drv_manual_value); + printf("ape_damp_manual_value:%d\n",aeInfo->ape_damp_manual_value); + //awb * + struct awb_info_s *awbInfo = &isp_core_cfg->awbInfo; + printf("awb_d65_en:%d\n",awbInfo->awb_d65_en); + printf("awb_ccm_en:%d\n",awbInfo->awb_ccm_en); + printf("awb_en:%d\n",awbInfo->awb_en); + printf("awb_mode_sel:%d\n",awbInfo->awb_mode_sel); + printf("awb_hist_mode_sel:%d\n",awbInfo->awb_hist_mode_sel); + printf("awb_veri_en:%d\n",awbInfo->awb_veri_en); + printf("awb_fb_en:%d\n",awbInfo->awb_fb_en); + printf("awb_value_save_en:%d\n",awbInfo->awb_value_save_en); + printf("awb_ccm_adp_adjust_en:%d\n",awbInfo->awb_ccm_adp_adjust_en); + printf("awb_stab_en:%d\n",awbInfo->awb_stab_en); + printf("awb_d65_red_gain:%d\n",awbInfo->awb_d65_red_gain); + printf("awb_d65_blue_gain:%d\n",awbInfo->awb_d65_blue_gain); + printf("ccm_coff[0][0]:%d\n",awbInfo->ccm_coff[0][0]); + printf("ccm_coff[0][1]:%d\n",awbInfo->ccm_coff[0][1]); + printf("ccm_coff[0][2]:%d\n",awbInfo->ccm_coff[0][2]); + printf("ccm_coff[1][0]:%d\n",awbInfo->ccm_coff[1][0]); + printf("ccm_coff[1][1]:%d\n",awbInfo->ccm_coff[1][1]); + printf("ccm_coff[1][2]:%d\n",awbInfo->ccm_coff[1][2]); + printf("ccm_coff[2][0]:%d\n",awbInfo->ccm_coff[2][0]); + printf("ccm_coff[2][1]:%d\n",awbInfo->ccm_coff[2][1]); + printf("ccm_coff[2][2]:%d\n",awbInfo->ccm_coff[2][2]); + printf("ccm_correct_coff:%d\n",awbInfo->ccm_correct_coff); + printf("awb_win_size.v_start:%d\n",awbInfo->awb_win_size.v_start); + printf("awb_win_size.h_start:%d\n",awbInfo->awb_win_size.h_start); + printf("awb_win_size.v_end:%d\n",awbInfo->awb_win_size.v_end); + printf("awb_win_size.h_end:%d\n",awbInfo->awb_win_size.h_end); + printf("awb_correct_diff_th:%d\n",awbInfo->awb_correct_diff_th); + printf("awb_color_changeres_time:%d\n",awbInfo->awb_color_changeres_time); + printf("awb_historgram_th:%d\n",awbInfo->awb_historgram_th); + printf("awb_red_gain_adjust:%d\n",awbInfo->awb_red_gain_adjust); + printf("awb_green_gain_adjust:%d\n",awbInfo->awb_green_gain_adjust); + printf("awb_blue_gain_adjust:%d\n",awbInfo->awb_blue_gain_adjust); + printf("awb_red_max_value:%d\n",awbInfo->awb_red_max_value); + printf("awb_blue_max_value:%d\n",awbInfo->awb_blue_max_value); + printf("awb_red_min_value:%d\n",awbInfo->awb_red_min_value); + printf("awb_blue_min_value:%d\n",awbInfo->awb_blue_min_value); + printf("awb_red_obj_value:%d\n",awbInfo->awb_red_obj_value); + printf("awb_blue_obj_value:%d\n",awbInfo->awb_blue_obj_value); + //wdr * + struct wdr_Info_s *wdrInfo = &isp_core_cfg->wdrInfo; + printf(" wdr_fusion_en:%d\n",wdrInfo->wdr_fusion_en); + printf(" wdr_frame_sel:%d\n",wdrInfo->wdr_frame_sel); + printf(" wdr_adp_adjust_en:%d\n",wdrInfo->wdr_adp_adjust_en); + printf(" wdr_stab_en:%d\n",wdrInfo->wdr_stab_en); + printf(" wdr_en:%d\n",wdrInfo->wdr_en); + printf(" wdr_ghost_remove_en:%d\n",wdrInfo->wdr_ghost_remove_en); + printf(" wdr_3frame_out_mode:%d\n",wdrInfo->wdr_3frame_out_mode); + printf(" wdr_mode_sel:%d\n",wdrInfo->wdr_mode_sel); + printf(" wdr_2frame_ex_ratio:%d\n",wdrInfo->wdr_2frame_ex_ratio); + printf(" wdr_3frame_ex_ratio:%d\n",wdrInfo->wdr_3frame_ex_ratio); + printf(" wdr_stat_img_sel:%d\n",wdrInfo->wdr_stat_img_sel); + printf(" wdr_ltm_data_sel:%d\n",wdrInfo->wdr_ltm_data_sel); + printf(" wdr_tz_data_sel:%d\n",wdrInfo->wdr_tz_data_sel); + printf(" wdr_remove_purple_en:%d\n",wdrInfo->wdr_remove_purple_en); + printf(" wdr_over_ex_ratio_th1:%d\n",wdrInfo->wdr_over_ex_ratio_th1); + printf(" wdr_over_ex_ratio_th2:%d\n",wdrInfo->wdr_over_ex_ratio_th2); + printf(" wdr_fusion_ratio_th:%d\n",wdrInfo->wdr_fusion_ratio_th); + printf(" wdr_fusion_value1 :%d\n",wdrInfo->wdr_fusion_value1); + printf(" wdr_fusion_value2:%d\n",wdrInfo->wdr_fusion_value2); + //csc * + struct csc_info_s *cscInfo = &isp_core_cfg->cscInfo; + printf("csc_r2y[0][0]:%d\n",cscInfo->csc_r2y[0][0]); + printf("csc_r2y[0][1]:%d\n",cscInfo->csc_r2y[0][1]); + printf("csc_r2y[0][2]:%d\n",cscInfo->csc_r2y[0][2]); + printf("csc_r2y[1][0]:%d\n",cscInfo->csc_r2y[1][0]); + printf("csc_r2y[1][1]:%d\n",cscInfo->csc_r2y[1][1]); + printf("csc_r2y[1][2]:%d\n",cscInfo->csc_r2y[1][2]); + printf("csc_r2y[2][0]:%d\n",cscInfo->csc_r2y[2][0]); + printf("csc_r2y[2][1]:%d\n",cscInfo->csc_r2y[2][1]); + printf("csc_r2y[2][2]:%d\n",cscInfo->csc_r2y[2][2]); + //ada * + struct ada_info_s *adaInfo = &isp_core_cfg->adaInfo; + printf("ada_rgb_gamma_en:\n",adaInfo->ada_rgb_gamma_en); + printf("ada_yuv_gamma_en:\n",adaInfo->ada_yuv_gamma_en); + printf("ada_adjust_en:\n",adaInfo->ada_adjust_en); + printf("ada_img_stab_en:\n",adaInfo->ada_img_stab_en); + printf("ada_ccr_en:\n",adaInfo->ada_ccr_en); + printf("ada_adp_en:\n",adaInfo->ada_adp_en); + printf("ada_adp_ccr_en:\n",adaInfo->ada_adp_ccr_en); + printf("ada_stat_mode_sel:\n",adaInfo->ada_stat_mode_sel); + printf("ada_enh_mode_sel:\n",adaInfo->ada_enh_mode_sel); + printf("ada_stat_max_value:\n",adaInfo->ada_stat_max_value); + printf("ada_ad_stren_max_value:\n",adaInfo->ada_ad_stren_max_value); + printf("ada_win_size.v_start:\n",adaInfo->ada_win_size.v_start); + printf("ada_win_size.h_start:\n",adaInfo->ada_win_size.h_start); + printf("ada_win_size.v_end:\n",adaInfo->ada_win_size.v_end); + printf("ada_win_size.h_end:\n",adaInfo->ada_win_size.h_end); + //rgbir * + struct rgbir_info_s *rgbirInfo = &isp_core_cfg->rgbirInfo; + printf("rgbir_en:%d\n",rgbirInfo->rgbir_en); + printf("rgbir_rtf_en:%d\n",rgbirInfo->rgbir_rtf_en); + printf("rgbir_rpc_en:%d\n",rgbirInfo->rgbir_rpc_en); + printf("rgbir_fusion_en:%d\n",rgbirInfo->rgbir_fusion_en); + printf("rgbir_output_sel:%d\n",rgbirInfo->rgbir_output_sel); + printf("rgbir_rpc_max_value:%d\n",rgbirInfo->rgbir_rpc_max_value); + printf("rgbir_rpc_color_coff:%d\n",rgbirInfo->rgbir_rpc_color_coff); + printf("rgbir_rpc_luma_coff:%d\n",rgbirInfo->rgbir_rpc_luma_coff); + printf("rgbir_rpc_th:%d\n",rgbirInfo->rgbir_rpc_th); + printf("rgbir_rpc_th1:%d\n",rgbirInfo->rgbir_rpc_th1); + //nr2d * + struct nr2d_info_s *nr2dInfo = &isp_core_cfg->nr2dInfo; + printf("d2nr_pcf_en:%d\n",nr2dInfo->d2nr_pcf_en); + printf("d2nr_raw_en:%d\n",nr2dInfo->d2nr_raw_en); + printf("d2nr_edge_en:%d\n",nr2dInfo->d2nr_edge_en); + printf("d2nr_bap_en:%d\n",nr2dInfo->d2nr_bap_en); + printf("d2nr_luma_en:%d\n",nr2dInfo->d2nr_luma_en); + printf("d2nr_chroma_en:%d\n",nr2dInfo->d2nr_chroma_en); + printf("d2nr_pcf_adp_en:%d\n",nr2dInfo->d2nr_pcf_adp_en); + printf("d2nr_raw_adp_en:%d\n",nr2dInfo->d2nr_raw_adp_en); + printf("d2nr_luma_adp_en:%d\n",nr2dInfo->d2nr_luma_adp_en); + printf("d2nr_chroma_adp_en:%d\n",nr2dInfo->d2nr_chroma_adp_en); + printf("d2nr_raw_intensity:%d\n",nr2dInfo->d2nr_raw_intensity); + printf("d2nr_bap_intensity:%d\n",nr2dInfo->d2nr_bap_intensity); + printf("d2nr_edge_intensity:%d\n",nr2dInfo->d2nr_edge_intensity); + printf("d2nr_luma_intensity:%d\n",nr2dInfo->d2nr_luma_intensity); + printf("d2nr_chroma_intensity:%d\n",nr2dInfo->d2nr_chroma_intensity); + //nr3d * + struct nr3d_info_s *nr3dInfo = &isp_core_cfg->nr3dInfo; + printf("d3nr_en:%d\n",nr3dInfo->d3nr_en); + printf("d3nr_pre_luma_en:%d\n",nr3dInfo->d3nr_pre_luma_en); + printf("d3nr_pre_chroma_en:%d\n",nr3dInfo->d3nr_pre_chroma_en); + printf("d3nr_main_luma_en:%d\n",nr3dInfo->d3nr_main_luma_en); + printf("d3nr_main_chroma_en:%d\n",nr3dInfo->d3nr_main_chroma_en); + printf("d3nr_post_luma_en:%d\n",nr3dInfo->d3nr_post_luma_en); + printf("d3nr_post_chroma_en:%d\n",nr3dInfo->d3nr_post_chroma_en); + printf("d3nr_2d_luma_en:%d\n",nr3dInfo->d3nr_2d_luma_en); + printf("d3nr_2d_chroma_en:%d\n",nr3dInfo->d3nr_2d_chroma_en); + printf("d3nr_wb_en:%d\n",nr3dInfo->d3nr_wb_en); + printf("d3nr_wb_sel:%d\n",nr3dInfo->d3nr_wb_sel); + printf("d3nr_adp_luma_en:%d\n",nr3dInfo->d3nr_adp_luma_en); + printf("d3nr_adp_chroma_en:%d\n",nr3dInfo->d3nr_adp_chroma_en); + printf("d3nr_pre_luma_th:%d\n",nr3dInfo->d3nr_pre_luma_th); + printf("d3nr_pre_luma_intensity:%d\n",nr3dInfo->d3nr_pre_luma_intensity); + printf("d3nr_pre_chroma_intensity:%d\n",nr3dInfo->d3nr_pre_chroma_intensity); + printf("d3nr_mid_filter_th:%d\n",nr3dInfo->d3nr_mid_filter_th); + printf("d3nr_pre_mid_filter_th:%d\n",nr3dInfo->d3nr_pre_mid_filter_th); + printf("d3nr_cur_mid_filter_th:%d\n",nr3dInfo->d3nr_cur_mid_filter_th); + printf("d3nr_low_pass_filter_th:%d\n",nr3dInfo->d3nr_low_pass_filter_th); + printf("d3nr_luma_th:%d\n",nr3dInfo->d3nr_luma_th); + printf("d3nr_min_value:%d\n",nr3dInfo->d3nr_min_value); + printf("d3nr_luma_intensity:%d\n",nr3dInfo->d3nr_luma_intensity); + printf("d3nr_chroma_intensity:%d\n",nr3dInfo->d3nr_chroma_intensity); + printf("d3nr_post_edge_th:%d\n",nr3dInfo->d3nr_post_edge_th); + printf("d3nr_post_luma_intensity:%d\n",nr3dInfo->d3nr_post_luma_intensity); + printf("d3nr_post_chroma_intensity:%d\n",nr3dInfo->d3nr_post_chroma_intensity); + //enh * + struct enh_info_s *enhInfo = &isp_core_cfg->enhInfo; + printf("enh_ltm_en:\n",enhInfo->enh_ltm_en); + printf("enh_sharp_en:\n",enhInfo->enh_sharp_en); + printf("enh_cc_en:\n",enhInfo->enh_cc_en); + printf("enh_adp_ltm_en:\n",enhInfo->enh_adp_ltm_en); + printf("enh_adp_sharp_en:\n",enhInfo->enh_adp_sharp_en); + printf("enh_adp_cc_en:\n",enhInfo->enh_adp_cc_en); + printf("ltm_gain:\n",enhInfo->ltm_gain); + printf("ltm_th:\n",enhInfo->ltm_th); + printf("enh_nr_th:\n",enhInfo->enh_nr_th); + printf("enh_th1:\n",enhInfo->enh_th1); + printf("enh_th2:\n",enhInfo->enh_th2); + printf("sharp_gain:\n",enhInfo->sharp_gain); + //post ctrl * + struct post_info_s *postInfo = &isp_core_cfg->postInfo; + printf("post_cont_ad_en:%d\n",postInfo->post_cont_ad_en); + printf("post_luma_ad_en:%d\n",postInfo->post_luma_ad_en); + printf("post_satu_ad_en:%d\n",postInfo->post_satu_ad_en); + printf("cont_ad_intensity:%d\n",postInfo->cont_ad_intensity); + printf("luma_ad_intensity:%d\n",postInfo->luma_ad_intensity); + printf("satu_ad_intensity:%d\n",postInfo->satu_ad_intensity); + //otc * + struct otc_info_s *otcInfo = &isp_core_cfg->otcInfo; + printf("post_otc_en:%d\n",otcInfo->post_otc_en); + printf("otc_yc_sel:%d\n",otcInfo->otc_yc_sel); + printf("otc_uv_format_sel:%d\n",otcInfo->otc_uv_format_sel); + printf("otc_hsync_pol_sel:%d\n",otcInfo->otc_hsync_pol_sel); + printf("otc_vsync_pol_sel:%d\n",otcInfo->otc_vsync_pol_sel); + printf("otc_out_size.width_st:%d\n",otcInfo->otc_out_size.width_st); + printf("otc_out_size.height_st:%d\n",otcInfo->otc_out_size.height_st); + printf("otc_out_size.width:%d\n",otcInfo->otc_out_size.width); + printf("otc_out_size.height:%d\n",otcInfo->otc_out_size.height); + //ldc * + struct ldc_info_s *ldcInfo = &isp_core_cfg->ldcInfo; + printf("ldc_en:%d\n",ldcInfo->ldc_en); + printf("ldc_arith_en:%d\n",ldcInfo->ldc_arith_en); + printf("ldc_req_freq:%d\n",ldcInfo->ldc_req_freq); + printf("ldc_stt_ln:%d\n",ldcInfo->ldc_stt_ln); + printf("ldc_h_center_pos:%d\n",ldcInfo->ldc_h_center_pos); + printf("ldc_v_center_pos:%d\n",ldcInfo->ldc_v_center_pos); + printf("ldc_rectify_cr:%d\n",ldcInfo->ldc_rectify_cr); + printf("ldc_rectify_cz:%d\n",ldcInfo->ldc_rectify_cz); + //af * + struct af_info_s *afInfo = &isp_core_cfg->afInfo; + printf("af_stat_en:%d\n",afInfo->af_stat_en); + printf("af_stat_mode_sel:%d\n",afInfo->af_stat_mode_sel); + printf("v_start:%d\n",afInfo->af_win_size.v_start); + printf("h_start:%d\n",afInfo->af_win_size.h_start); + printf("v_end:%d\n",afInfo->af_win_size.v_end); + printf("h_end:%d\n",afInfo->af_win_size.h_end); + // + struct isp_ds_cfg_info *isp_ds_cfg = &isp_cfg->isp_ds_cfg; + printf("dsInSizeInfo.width:%d\n",isp_ds_cfg->dsInSizeInfo.width); + printf("dsInSizeInfo.height:%d\n",isp_ds_cfg->dsInSizeInfo.height); + // + printf("osd_rgb2yuv_coeff[0][0]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[0][0]); + printf("osd_rgb2yuv_coeff[0][1]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[0][1]); + printf("osd_rgb2yuv_coeff[0][2]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[0][2]); + printf("osd_rgb2yuv_coeff[0][3]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[0][3]); + printf("osd_rgb2yuv_coeff[1][0]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[1][0]); + printf("osd_rgb2yuv_coeff[1][1]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[1][1]); + printf("osd_rgb2yuv_coeff[1][2]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[1][2]); + printf("osd_rgb2yuv_coeff[1][3]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[1][3]); + printf("osd_rgb2yuv_coeff[2][0]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[2][0]); + printf("osd_rgb2yuv_coeff[2][1]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[2][1]); + printf("osd_rgb2yuv_coeff[2][2]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[2][2]); + printf("osd_rgb2yuv_coeff[2][3]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[2][3]); + // + printf("osd_yuv2rgb_coeff[0][0]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[0][0]); + printf("osd_yuv2rgb_coeff[0][1]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[0][1]); + printf("osd_yuv2rgb_coeff[0][2]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[0][2]); + printf("osd_yuv2rgb_coeff[0][3]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[0][3]); + printf("osd_yuv2rgb_coeff[1][0]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[1][0]); + printf("osd_yuv2rgb_coeff[1][1]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[1][1]); + printf("osd_yuv2rgb_coeff[1][2]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[1][2]); + printf("osd_yuv2rgb_coeff[1][3]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[1][3]); + printf("osd_yuv2rgb_coeff[2][0]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[2][0]); + printf("osd_yuv2rgb_coeff[2][1]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[2][1]); + printf("osd_yuv2rgb_coeff[2][2]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[2][2]); + printf("osd_yuv2rgb_coeff[2][3]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[2][3]); + // + struct isp_ds_info_s *dsInfo = &isp_ds_cfg->dsInfo[0]; //ISP_DS_CH_NUM + printf("0 scale_en:%d\n",dsInfo->scale_en); + printf("0 vscale_filter_en:%d\n",dsInfo->vscale_filter_en); + printf("0 hscale_filter_en:%d\n",dsInfo->hscale_filter_en); + printf("0 ds_out_size.width:%d\n",dsInfo->ds_out_size.width); + printf("0 ds_out_size.height:%d\n",dsInfo->ds_out_size.height); + printf("0 out_rgb_mode:%d\n",dsInfo->out_rgb_mode); + printf("0 out_rgb_en:%d\n",dsInfo->out_rgb_en); + printf("0 out_yuv_mode:%d\n",dsInfo->out_yuv_mode); + printf("0 out_uv_swap:%d\n",dsInfo->out_uv_swap); + // + dsInfo = &isp_ds_cfg->dsInfo[1]; + printf("1 scale_en:%d\n",dsInfo->scale_en); + printf("1 vscale_filter_en:%d\n",dsInfo->vscale_filter_en); + printf("1 hscale_filter_en:%d\n",dsInfo->hscale_filter_en); + printf("1 ds_out_size.width:%d\n",dsInfo->ds_out_size.width); + printf("1 ds_out_size.height:%d\n",dsInfo->ds_out_size.height); + printf("1 out_rgb_mode:%d\n",dsInfo->out_rgb_mode); + printf("1 out_rgb_en:%d\n",dsInfo->out_rgb_en); + printf("1 out_yuv_mode:%d\n",dsInfo->out_yuv_mode); + printf("1 out_uv_swap:%d\n",dsInfo->out_uv_swap); + // + dsInfo = &isp_ds_cfg->dsInfo[2]; + printf("2 scale_en:%d\n",dsInfo->scale_en); + printf("2 vscale_filter_en:%d\n",dsInfo->vscale_filter_en); + printf("2 hscale_filter_en:%d\n",dsInfo->hscale_filter_en); + printf("2 ds_out_size.width:%d\n",dsInfo->ds_out_size.width); + printf("2 ds_out_size.height:%d\n",dsInfo->ds_out_size.height); + printf("2 out_rgb_mode:%d\n",dsInfo->out_rgb_mode); + printf("2 out_rgb_en:%d\n",dsInfo->out_rgb_en); + printf("2 out_yuv_mode:%d\n",dsInfo->out_yuv_mode); + printf("2 out_uv_swap:%d\n",dsInfo->out_uv_swap); + printf("%s:end\n",__func__); +} - // - width = isp_wrap_info->ds0Info.ds0_size.width; - line_stride = calc_stride(width); - isp_wrap_info->ds0Info.ds0_line_stride = line_stride; - isp_wrap_info->ds0Info.ds0_out_en = 1;//must enable - isp_ds_info->dsInfo[0].scale_en = 1; - isp_ds_info->dsInfo[0].vscale_filter_en = 1; - isp_ds_info->dsInfo[0].hscale_filter_en = 1; - isp_wrap_info->ds0Info.ds0_y_buf0_base = phyAddr; - isp_wrap_info->ds0Info.ds0_y_buf1_base = phyAddr; - isp_wrap_info->ds0Info.ds0_uv_buf0_base = phyAddr+line_stride*height; - isp_wrap_info->ds0Info.ds0_uv_buf1_base = phyAddr+line_stride*height; - // - width = isp_wrap_info->ds1Info.ds1_size.width; - line_stride = calc_stride(width); - isp_wrap_info->ds1Info.ds1_line_stride = line_stride; - isp_wrap_info->ds1Info.ds1_y_buf0_base = phyAddr; - isp_wrap_info->ds1Info.ds1_y_buf1_base = phyAddr; - isp_wrap_info->ds1Info.ds1_uv_buf0_base = phyAddr+line_stride*height; - isp_wrap_info->ds1Info.ds1_uv_buf1_base = phyAddr+line_stride*height; - - // - //width = isp_wrap_info->ds2Info.ds2_size.width; - width = isp_wrap_info->ds2Info.ds2_size.pitch; - line_stride = calc_stride(width); - if( OUT_ARGB == isp_wrap_info->ds2Info.ds2_out_img_out_format) - { - isp_wrap_info->ds2Info.ds2_line_stride = line_stride*4; - isp_wrap_info->ds2Info.ds2_r_buf0_base = phyAddr; - isp_wrap_info->ds2Info.ds2_r_buf1_base = phyAddr; - isp_wrap_info->ds2Info.ds2_g_buf0_base = phyAddr + line_stride*2; - isp_wrap_info->ds2Info.ds2_g_buf1_base = phyAddr + line_stride*2; - isp_wrap_info->ds2Info.ds2_b_buf0_base = phyAddr + line_stride*3; - isp_wrap_info->ds2Info.ds2_b_buf1_base = phyAddr + line_stride*3; - } - else - { - isp_wrap_info->ds2Info.ds2_line_stride = line_stride; - isp_wrap_info->ds2Info.ds2_r_buf0_base = phyAddr; - isp_wrap_info->ds2Info.ds2_r_buf1_base = phyAddr; - isp_wrap_info->ds2Info.ds2_g_buf0_base = phyAddr + line_stride*height; - isp_wrap_info->ds2Info.ds2_g_buf1_base = phyAddr + line_stride*height; - isp_wrap_info->ds2Info.ds2_b_buf0_base = phyAddr + line_stride*height*2; - isp_wrap_info->ds2Info.ds2_b_buf1_base = phyAddr + line_stride*height*2; - } - ret = ioctl(entity->fd, VIDIOC_K510ISP_R2K_WRAP_CFG,isp_wrap_info); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - // - isp_core_info->otcInfo.otc_out_size.width_st = (isp_core_info->itcInfo.itc_size.width - isp_wrap_info->mainInfo.main_size.width)/2; - isp_core_info->otcInfo.otc_out_size.width = isp_wrap_info->mainInfo.main_size.width; - isp_core_info->otcInfo.otc_out_size.height_st= (isp_core_info->itcInfo.itc_size.height -isp_wrap_info->mainInfo.main_size.height)/2; - isp_core_info->otcInfo.otc_out_size.height = isp_wrap_info->mainInfo.main_size.height; - ret = ioctl(entity->fd, VIDIOC_K510ISP_R2K_CORE_CFG,isp_core_info); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - // - ret = ioctl(entity->fd, VIDIOC_K510ISP_R2K_DS_CFG,isp_ds_info); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - // - ret = ioctl(entity->fd,VIDIOC_K510ISP_R2K_CFG_SET,isp_cfg); - if (ret < 0) - { - printf("%s: ioctl failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(entity); - return -errno; - } - - v4l2_subdev_close(entity); - return 0; -} -/** - * @brief - * - * @param mipi_csi2 - */ -void print_csi2_info(struct isp_csi2_info *mipi_csi2) -{ - printf("%s:start\n",__func__); - printf("csi0_used:%d\n",mipi_csi2->csi0_used); - printf("csi0_sony_wdr:%d\n",mipi_csi2->csi0_sony_wdr); - printf("csi0_lane_nb:%d\n",mipi_csi2->csi0_lane_nb); - printf("csi0_dl0_map:%d\n",mipi_csi2->csi0_dl0_map); - printf("csi0_dl1_map:%d\n",mipi_csi2->csi0_dl1_map); - printf("csi0_dl2_map:%d\n",mipi_csi2->csi0_dl2_map); - printf("csi0_dl3_map:%d\n",mipi_csi2->csi0_dl3_map); -// - printf("csi00_datatype_select0:%d\n",mipi_csi2->csi00_datatype_select0); - printf("csi00_datatype_select1:%d\n",mipi_csi2->csi00_datatype_select1); - printf("csi00_vc_select:%d\n",mipi_csi2->csi00_vc_select); -// - printf("csi01_datatype_select0:%d\n",mipi_csi2->csi01_datatype_select0); - printf("csi01_datatype_select1:%d\n",mipi_csi2->csi01_datatype_select1); - printf("csi01_vc_select:%d\n",mipi_csi2->csi01_vc_select); -// - printf("csi02_datatype_select0:%d\n",mipi_csi2->csi02_datatype_select0); - printf("csi02_datatype_select1:%d\n",mipi_csi2->csi02_datatype_select1); - printf("csi02_vc_select:%d\n",mipi_csi2->csi02_vc_select); -// - printf("csi1_used:%d\n",mipi_csi2->csi1_used); - printf("csi1_sony_wdr:%d\n",mipi_csi2->csi1_sony_wdr); - printf("csi1_lane_nb:%d\n",mipi_csi2->csi1_lane_nb); - printf("csi1_dl0_map:%d\n",mipi_csi2->csi1_dl0_map); - printf("csi1_dl1_map:%d\n",mipi_csi2->csi1_dl1_map); - printf("csi1_dl2_map:%d\n",mipi_csi2->csi1_dl2_map); - printf("csi1_dl3_map:%d\n",mipi_csi2->csi1_dl3_map); -// - printf("csi10_datatype_select0:%d\n",mipi_csi2->csi10_datatype_select0); - printf("csi10_datatype_select1:%d\n",mipi_csi2->csi10_datatype_select1); - printf("csi10_vc_select:%d\n",mipi_csi2->csi10_vc_select); - printf("%s:end\n",__func__); -} -/** - * @brief - * - * @param vi_cfg - */ -void print_vi_info(struct vi_cfg_info *vi_cfg) -{ - printf("%s:start\n",__func__); - // - struct vi_wrap_cfg_info *vi_wrap_cfg = &vi_cfg->vi_wrap_cfg; - printf("dphy_mode:%d\n",vi_wrap_cfg->dphy_mode); - printf("sony_mode:%d\n",vi_wrap_cfg->sony_mode); - struct sensor_info_s *sensor_info= &vi_wrap_cfg->sensor_info[0]; - printf("0 sensor_interface_en:%d\n",sensor_info->sensor_interface_en); - printf("0 tpg_w_en:%d\n",sensor_info->tpg_w_en); - printf("0 tpg_r_en:%d\n",sensor_info->tpg_r_en); - printf("0 wdr_sensor_vendor:%d\n",sensor_info->wdr_sensor_vendor); - printf("0 wdr_mode:%d\n",sensor_info->wdr_mode); - printf("0 mipi_mode:%d\n",sensor_info->mipi_mode); - printf("0 isp_pipeline:%d\n",sensor_info->isp_pipeline); - sensor_info = &vi_wrap_cfg->sensor_info[1]; - printf("1 sensor_interface_en:%d\n",sensor_info->sensor_interface_en); - printf("1 tpg_w_en:%d\n",sensor_info->tpg_w_en); - printf("1 tpg_r_en:%d\n",sensor_info->tpg_r_en); - printf("1 wdr_sensor_vendor:%d\n",sensor_info->wdr_sensor_vendor); - printf("1 wdr_mode:%d\n",sensor_info->wdr_mode); - printf("1 mipi_mode:%d\n",sensor_info->mipi_mode); - printf("1 isp_pipeline:%d\n",sensor_info->isp_pipeline); - sensor_info = &vi_wrap_cfg->sensor_info[2]; - printf("2 sensor_interface_en:%d\n",sensor_info->sensor_interface_en); - printf("2 tpg_w_en:%d\n",sensor_info->tpg_w_en); - printf("2 tpg_r_en:%d\n",sensor_info->tpg_r_en); - printf("2 wdr_sensor_vendor:%d\n",sensor_info->wdr_sensor_vendor); - printf("2 wdr_mode:%d\n",sensor_info->wdr_mode); - printf("2 mipi_mode:%d\n",sensor_info->mipi_mode); - printf("2 isp_pipeline:%d\n",sensor_info->isp_pipeline); - // - struct vi_pipe_cfg_info *vi_pipe_cfg = &vi_cfg->vi_pipe_cfg[0]; - printf("p00 win_mode_en:%d\n",vi_pipe_cfg->win_mode_en); - printf("p00 input_ch_sel:%d\n",vi_pipe_cfg->input_ch_sel); - printf("p00 ch_mode_sel:%d\n",vi_pipe_cfg->ch_mode_sel); - printf("p00 pixel_type:%d\n",vi_pipe_cfg->pixel_type); - printf("p00 yuv_in_format:%d\n",vi_pipe_cfg->yuv_in_format); - printf("p00 yuv_out_format:%d\n",vi_pipe_cfg->yuv_out_format); - printf("p00 yuv422_order:%d\n",vi_pipe_cfg->yuv422_order); - printf("p00 pixel_width:%d\n",vi_pipe_cfg->pixel_width); - printf("p00 data_out_timming_ctrl:%d\n",vi_pipe_cfg->data_out_timming_ctrl); - printf("p00 sync_pulse_mode:%d\n",vi_pipe_cfg->sync_pulse_mode); - printf("p00 sen_mipi_clk_pol:%d\n",vi_pipe_cfg->sen_mipi_clk_pol); - printf("p00 sen_mipi_vsync_pol:%d\n",vi_pipe_cfg->sen_mipi_vsync_pol); - printf("p00 sen_mipi_hsync_pol:%d\n",vi_pipe_cfg->sen_mipi_hsync_pol); - printf("p00 sen_mipi_field_pol:%d\n",vi_pipe_cfg->sen_mipi_field_pol); - printf("p00 isp_clk_pol:%d\n",vi_pipe_cfg->isp_clk_pol); - printf("p00 isp_vsync_pol:%d\n",vi_pipe_cfg->isp_vsync_pol); - printf("p00 isp_hsync_pol:%d\n",vi_pipe_cfg->isp_hsync_pol); - printf("p00 isp_field_pol:%d\n",vi_pipe_cfg->isp_field_pol); - printf("p00 tpg_w_en:%d\n",vi_pipe_cfg->tpg_w_en); - printf("p00 tpg_r_en:%d\n",vi_pipe_cfg->tpg_r_en); - printf("p00 total_size.width:%d\n",vi_pipe_cfg->total_size.width); - printf("p00 total_size.height:%d\n",vi_pipe_cfg->total_size.height); - printf("p00 in_size.width:%d\n",vi_pipe_cfg->in_size.width); - printf("p00 in_size.height:%d\n",vi_pipe_cfg->in_size.height); - printf("p00 w_size_st.width:%d\n",vi_pipe_cfg->w_size_st.width); - printf("p00 w_size_st.height:%d\n",vi_pipe_cfg->w_size_st.height); - printf("p00 r_size_st.width:%d\n",vi_pipe_cfg->r_size_st.width); - printf("p00 r_size_st.height:%d\n",vi_pipe_cfg->r_size_st.height); - printf("p00 vi_pipe_w_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y0); - printf("p00 vi_pipe_w_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y1); - printf("p00 vi_pipe_w_addr_uv0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv0); - printf("p00 vi_pipe_w_addr_uv1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv1); - printf("p00 vi_pipe_r_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y0); - printf("p00 vi_pipe_r_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y1); - printf("p00 vi_pipe_addr_stride:%d\n",vi_pipe_cfg->vi_pipe_addr_stride); - printf("p00 tof_mode_enable:%d\n",vi_pipe_cfg->tof_mode_enable); - printf("p00 vi_pipe_tpg_tof_frm_num:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_num); - printf("p00 vi_pipe_tpg_tof_frm_stride:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_stride); - //p01 - vi_pipe_cfg = &vi_cfg->vi_pipe_cfg[1]; - printf("p01 win_mode_en:%d\n",vi_pipe_cfg->win_mode_en); - printf("p01 input_ch_sel:%d\n",vi_pipe_cfg->input_ch_sel); - printf("p01 ch_mode_sel:%d\n",vi_pipe_cfg->ch_mode_sel); - printf("p01 pixel_type:%d\n",vi_pipe_cfg->pixel_type); - printf("p01 yuv_in_format:%d\n",vi_pipe_cfg->yuv_in_format); - printf("p01 yuv_out_format:%d\n",vi_pipe_cfg->yuv_out_format); - printf("p01 yuv422_order:%d\n",vi_pipe_cfg->yuv422_order); - printf("p01 pixel_width:%d\n",vi_pipe_cfg->pixel_width); - printf("p01 data_out_timming_ctrl:%d\n",vi_pipe_cfg->data_out_timming_ctrl); - printf("p01 sync_pulse_mode:%d\n",vi_pipe_cfg->sync_pulse_mode); - printf("p01 sen_mipi_clk_pol:%d\n",vi_pipe_cfg->sen_mipi_clk_pol); - printf("p01 sen_mipi_vsync_pol:%d\n",vi_pipe_cfg->sen_mipi_vsync_pol); - printf("p01 sen_mipi_hsync_pol:%d\n",vi_pipe_cfg->sen_mipi_hsync_pol); - printf("p01 sen_mipi_field_pol:%d\n",vi_pipe_cfg->sen_mipi_field_pol); - printf("p01 isp_clk_pol:%d\n",vi_pipe_cfg->isp_clk_pol); - printf("p01 isp_vsync_pol:%d\n",vi_pipe_cfg->isp_vsync_pol); - printf("p01 isp_hsync_pol:%d\n",vi_pipe_cfg->isp_hsync_pol); - printf("p01 isp_field_pol:%d\n",vi_pipe_cfg->isp_field_pol); - printf("p01 tpg_w_en:%d\n",vi_pipe_cfg->tpg_w_en); - printf("p01 tpg_r_en:%d\n",vi_pipe_cfg->tpg_r_en); - printf("p01 total_size.width:%d\n",vi_pipe_cfg->total_size.width); - printf("p01 total_size.height:%d\n",vi_pipe_cfg->total_size.height); - printf("p01 in_size.width:%d\n",vi_pipe_cfg->in_size.width); - printf("p01 in_size.height:%d\n",vi_pipe_cfg->in_size.height); - printf("p01 w_size_st.width:%d\n",vi_pipe_cfg->w_size_st.width); - printf("p01 w_size_st.height:%d\n",vi_pipe_cfg->w_size_st.height); - printf("p01 r_size_st.width:%d\n",vi_pipe_cfg->r_size_st.width); - printf("p01 r_size_st.height:%d\n",vi_pipe_cfg->r_size_st.height); - printf("p01 vi_pipe_w_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y0); - printf("p01 vi_pipe_w_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y1); - printf("p01 vi_pipe_w_addr_uv0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv0); - printf("p01 vi_pipe_w_addr_uv1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv1); - printf("p01 vi_pipe_r_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y0); - printf("p01 vi_pipe_r_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y1); - printf("p01 vi_pipe_addr_stride:%d\n",vi_pipe_cfg->vi_pipe_addr_stride); - printf("p01 tof_mode_enable:%d\n",vi_pipe_cfg->tof_mode_enable); - printf("p01 vi_pipe_tpg_tof_frm_num:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_num); - printf("p01 vi_pipe_tpg_tof_frm_stride:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_stride); - //p02 - vi_pipe_cfg = &vi_cfg->vi_pipe_cfg[2]; - printf("p02 win_mode_en:%d\n",vi_pipe_cfg->win_mode_en); - printf("p02 input_ch_sel:%d\n",vi_pipe_cfg->input_ch_sel); - printf("p02 ch_mode_sel:%d\n",vi_pipe_cfg->ch_mode_sel); - printf("p02 pixel_type:%d\n",vi_pipe_cfg->pixel_type); - printf("p02 yuv_in_format:%d\n",vi_pipe_cfg->yuv_in_format); - printf("p02 yuv_out_format:%d\n",vi_pipe_cfg->yuv_out_format); - printf("p02 yuv422_order:%d\n",vi_pipe_cfg->yuv422_order); - printf("p02 pixel_width:%d\n",vi_pipe_cfg->pixel_width); - printf("p02 data_out_timming_ctrl:%d\n",vi_pipe_cfg->data_out_timming_ctrl); - printf("p02 sync_pulse_mode:%d\n",vi_pipe_cfg->sync_pulse_mode); - printf("p02 sen_mipi_clk_pol:%d\n",vi_pipe_cfg->sen_mipi_clk_pol); - printf("p02 sen_mipi_vsync_pol:%d\n",vi_pipe_cfg->sen_mipi_vsync_pol); - printf("p02 sen_mipi_hsync_pol:%d\n",vi_pipe_cfg->sen_mipi_hsync_pol); - printf("p02 sen_mipi_field_pol:%d\n",vi_pipe_cfg->sen_mipi_field_pol); - printf("p02 isp_clk_pol:%d\n",vi_pipe_cfg->isp_clk_pol); - printf("p02 isp_vsync_pol:%d\n",vi_pipe_cfg->isp_vsync_pol); - printf("p02 isp_hsync_pol:%d\n",vi_pipe_cfg->isp_hsync_pol); - printf("p02 isp_field_pol:%d\n",vi_pipe_cfg->isp_field_pol); - printf("p02 tpg_w_en:%d\n",vi_pipe_cfg->tpg_w_en); - printf("p02 tpg_r_en:%d\n",vi_pipe_cfg->tpg_r_en); - printf("p02 total_size.width:%d\n",vi_pipe_cfg->total_size.width); - printf("p02 total_size.height:%d\n",vi_pipe_cfg->total_size.height); - printf("p02 in_size.width:%d\n",vi_pipe_cfg->in_size.width); - printf("p02 in_size.height:%d\n",vi_pipe_cfg->in_size.height); - printf("p02 w_size_st.width:%d\n",vi_pipe_cfg->w_size_st.width); - printf("p02 w_size_st.height:%d\n",vi_pipe_cfg->w_size_st.height); - printf("p02 r_size_st.width:%d\n",vi_pipe_cfg->r_size_st.width); - printf("p02 r_size_st.height:%d\n",vi_pipe_cfg->r_size_st.height); - printf("p02 vi_pipe_w_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y0); - printf("p02 vi_pipe_w_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y1); - printf("p02 vi_pipe_w_addr_uv0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv0); - printf("p02 vi_pipe_w_addr_uv1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv1); - printf("p02 vi_pipe_r_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y0); - printf("p02 vi_pipe_r_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y1); - printf("p02 vi_pipe_addr_stride:%d\n",vi_pipe_cfg->vi_pipe_addr_stride); - printf("p02 tof_mode_enable:%d\n",vi_pipe_cfg->tof_mode_enable); - printf("p02 vi_pipe_tpg_tof_frm_num:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_num); - printf("p02 vi_pipe_tpg_tof_frm_stride:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_stride); - //p10 - vi_pipe_cfg = &vi_cfg->vi_pipe_cfg[3]; - printf("p10 win_mode_en:%d\n",vi_pipe_cfg->win_mode_en); - printf("p10 input_ch_sel:%d\n",vi_pipe_cfg->input_ch_sel); - printf("p10 ch_mode_sel:%d\n",vi_pipe_cfg->ch_mode_sel); - printf("p10 pixel_type:%d\n",vi_pipe_cfg->pixel_type); - printf("p10 yuv_in_format:%d\n",vi_pipe_cfg->yuv_in_format); - printf("p10 yuv_out_format:%d\n",vi_pipe_cfg->yuv_out_format); - printf("p10 yuv422_order:%d\n",vi_pipe_cfg->yuv422_order); - printf("p10 pixel_width:%d\n",vi_pipe_cfg->pixel_width); - printf("p10 data_out_timming_ctrl:%d\n",vi_pipe_cfg->data_out_timming_ctrl); - printf("p10 sync_pulse_mode:%d\n",vi_pipe_cfg->sync_pulse_mode); - printf("p10 sen_mipi_clk_pol:%d\n",vi_pipe_cfg->sen_mipi_clk_pol); - printf("p10 sen_mipi_vsync_pol:%d\n",vi_pipe_cfg->sen_mipi_vsync_pol); - printf("p10 sen_mipi_hsync_pol:%d\n",vi_pipe_cfg->sen_mipi_hsync_pol); - printf("p10 sen_mipi_field_pol:%d\n",vi_pipe_cfg->sen_mipi_field_pol); - printf("p10 isp_clk_pol:%d\n",vi_pipe_cfg->isp_clk_pol); - printf("p10 isp_vsync_pol:%d\n",vi_pipe_cfg->isp_vsync_pol); - printf("p10 isp_hsync_pol:%d\n",vi_pipe_cfg->isp_hsync_pol); - printf("p10 isp_field_pol:%d\n",vi_pipe_cfg->isp_field_pol); - printf("p10 tpg_w_en:%d\n",vi_pipe_cfg->tpg_w_en); - printf("p10 tpg_r_en:%d\n",vi_pipe_cfg->tpg_r_en); - printf("p10 total_size.width:%d\n",vi_pipe_cfg->total_size.width); - printf("p10 total_size.height:%d\n",vi_pipe_cfg->total_size.height); - printf("p10 in_size.width:%d\n",vi_pipe_cfg->in_size.width); - printf("p10 in_size.height:%d\n",vi_pipe_cfg->in_size.height); - printf("p10 w_size_st.width:%d\n",vi_pipe_cfg->w_size_st.width); - printf("p10 w_size_st.height:%d\n",vi_pipe_cfg->w_size_st.height); - printf("p10 r_size_st.width:%d\n",vi_pipe_cfg->r_size_st.width); - printf("p10 r_size_st.height:%d\n",vi_pipe_cfg->r_size_st.height); - printf("p10 vi_pipe_w_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y0); - printf("p10 vi_pipe_w_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y1); - printf("p10 vi_pipe_w_addr_uv0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv0); - printf("p10 vi_pipe_w_addr_uv1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv1); - printf("p10 vi_pipe_r_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y0); - printf("p10 vi_pipe_r_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y1); - printf("p10 vi_pipe_addr_stride:%d\n",vi_pipe_cfg->vi_pipe_addr_stride); - printf("p10 tof_mode_enable:%d\n",vi_pipe_cfg->tof_mode_enable); - printf("p10 vi_pipe_tpg_tof_frm_num:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_num); - printf("p10 vi_pipe_tpg_tof_frm_stride:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_stride); - //dvp - vi_pipe_cfg = &vi_cfg->vi_pipe_cfg[6]; - printf("dvp00 win_mode_en:%d\n",vi_pipe_cfg->win_mode_en); - printf("dvp00 input_ch_sel:%d\n",vi_pipe_cfg->input_ch_sel); - printf("dvp00 ch_mode_sel:%d\n",vi_pipe_cfg->ch_mode_sel); - printf("dvp00 pixel_type:%d\n",vi_pipe_cfg->pixel_type); - printf("dvp00 yuv_in_format:%d\n",vi_pipe_cfg->yuv_in_format); - printf("dvp00 yuv_out_format:%d\n",vi_pipe_cfg->yuv_out_format); - printf("dvp00 yuv422_order:%d\n",vi_pipe_cfg->yuv422_order); - printf("dvp00 pixel_width:%d\n",vi_pipe_cfg->pixel_width); - printf("dvp00 data_out_timming_ctrl:%d\n",vi_pipe_cfg->data_out_timming_ctrl); - printf("dvp00 sync_pulse_mode:%d\n",vi_pipe_cfg->sync_pulse_mode); - printf("dvp00 sen_mipi_clk_pol:%d\n",vi_pipe_cfg->sen_mipi_clk_pol); - printf("dvp00 sen_mipi_vsync_pol:%d\n",vi_pipe_cfg->sen_mipi_vsync_pol); - printf("dvp00 sen_mipi_hsync_pol:%d\n",vi_pipe_cfg->sen_mipi_hsync_pol); - printf("dvp00 sen_mipi_field_pol:%d\n",vi_pipe_cfg->sen_mipi_field_pol); - printf("dvp00 isp_clk_pol:%d\n",vi_pipe_cfg->isp_clk_pol); - printf("dvp00 isp_vsync_pol:%d\n",vi_pipe_cfg->isp_vsync_pol); - printf("dvp00 isp_hsync_pol:%d\n",vi_pipe_cfg->isp_hsync_pol); - printf("dvp00 isp_field_pol:%d\n",vi_pipe_cfg->isp_field_pol); - printf("dvp00 tpg_w_en:%d\n",vi_pipe_cfg->tpg_w_en); - printf("dvp00 tpg_r_en:%d\n",vi_pipe_cfg->tpg_r_en); - printf("dvp00 total_size.width:%d\n",vi_pipe_cfg->total_size.width); - printf("dvp00 total_size.height:%d\n",vi_pipe_cfg->total_size.height); - printf("dvp00 in_size.width:%d\n",vi_pipe_cfg->in_size.width); - printf("dvp00 in_size.height:%d\n",vi_pipe_cfg->in_size.height); - printf("dvp00 w_size_st.width:%d\n",vi_pipe_cfg->w_size_st.width); - printf("dvp00 w_size_st.height:%d\n",vi_pipe_cfg->w_size_st.height); - printf("dvp00 r_size_st.width:%d\n",vi_pipe_cfg->r_size_st.width); - printf("dvp00 r_size_st.height:%d\n",vi_pipe_cfg->r_size_st.height); - printf("dvp00 vi_pipe_w_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y0); - printf("dvp00 vi_pipe_w_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_y1); - printf("dvp00 vi_pipe_w_addr_uv0:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv0); - printf("dvp00 vi_pipe_w_addr_uv1:%d\n",vi_pipe_cfg->vi_pipe_w_addr_uv1); - printf("dvp00 vi_pipe_r_addr_y0:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y0); - printf("dvp00 vi_pipe_r_addr_y1:%d\n",vi_pipe_cfg->vi_pipe_r_addr_y1); - printf("dvp00 vi_pipe_addr_stride:%d\n",vi_pipe_cfg->vi_pipe_addr_stride); - printf("dvp00 tof_mode_enable:%d\n",vi_pipe_cfg->tof_mode_enable); - printf("dvp00 vi_pipe_tpg_tof_frm_num:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_num); - printf("dvp00 vi_pipe_tpg_tof_frm_stride:%d\n",vi_pipe_cfg->vi_pipe_tpg_tof_frm_stride); - - printf("%s:end\n",__func__); -} -/** - * @brief - * - * @param isp_cfg - */ -void print_isp_info(struct isp_cfg_info *isp_cfg) -{ - printf("%s:start\n",__func__); - // - struct isp_wrap_cfg_info *isp_wrap_cfg = &isp_cfg->isp_wrap_cfg; - printf("isp_out_sel:%d\n",isp_wrap_cfg->isp_out_sel); - printf("dvp_ch_mode:%d\n",isp_wrap_cfg->dvp_ch_mode); - printf("hist_3a_out_en:%d\n",isp_wrap_cfg->hist_3a_out_en); - // - struct isp_wrap_wdr_info *wwdrInfo = &isp_wrap_cfg->wdrInfo; - printf("wdr_mode:%d\n",wwdrInfo->wdr_mode); - printf("wdr_long_ch_mode:%d\n",wwdrInfo->wdr_long_ch_mode); - printf("wdr_long_l2_buf_en:%d\n",wwdrInfo->wdr_long_l2_buf_en); - printf("wdr_short_s1_buf_en:%d\n",wwdrInfo->wdr_short_s1_buf_en); - printf("wdr_dynamic_switch_en:%d\n",wwdrInfo->wdr_dynamic_switch_en); - printf("wdr_long_l2_buf_depth:%d\n",wwdrInfo->wdr_long_l2_buf_depth); - printf("wdr_long_img_format:%d\n",wwdrInfo->wdr_long_img_format); - printf("wdr_long_yuv_in_format:%d\n",wwdrInfo->wdr_long_yuv_in_format); - printf("wdr_long_img_out_format:%d\n",wwdrInfo->wdr_long_img_out_format); - printf("wdr_long_yuv422_pxl_order:%d\n",wwdrInfo->wdr_long_yuv422_pxl_order); - printf("wdr_long_pixel_width:%d\n",wwdrInfo->wdr_long_pixel_width); - printf("wdr_buf_base:%d\n",wwdrInfo->wdr_buf_base); - printf("wdr_line_stride:%d\n",wwdrInfo->wdr_line_stride); - printf("wdr_frame_buf_size:%d\n",wwdrInfo->wdr_frame_buf_size); - // - struct isp_wrap_3dnr_info *wnr3dInfo = &isp_wrap_cfg->nr3dInfo; - printf("nr3d_en:%d\n",wnr3dInfo->nr3d_en ); - printf("nr3d_fbcd_en:%d\n",wnr3dInfo->nr3d_fbcd_en); - printf("nr3d_mv_out_en:%d\n",wnr3dInfo->nr3d_mv_out_en); - printf("nr3d_y_img_format:%d\n",wnr3dInfo->nr3d_y_img_format); - printf("nr3d_y_yuv_in_format:%d\n",wnr3dInfo->nr3d_y_yuv_in_format); - printf("nr3d_y_img_out_format:%d\n",wnr3dInfo->nr3d_y_img_out_format); - printf("nr3d_y_yuv422_pxl_order:%d\n",wnr3dInfo->nr3d_y_yuv422_pxl_order); - printf("nr3d_y_pixel_width:%d\n",wnr3dInfo->nr3d_y_pixel_width); - printf("nr3d_uv_img_format:%d\n",wnr3dInfo->nr3d_uv_img_format); - printf("nr3d_uv_yuv_in_format:%d\n",wnr3dInfo->nr3d_uv_yuv_in_format); - printf("nr3d_uv_mig_out_format:%d\n",wnr3dInfo->nr3d_uv_mig_out_format); - printf("nr3d_uv_yuv422_pxl_order:%d\n",wnr3dInfo->nr3d_uv_yuv422_pxl_order); - printf("nr3d_uv_pixel_width:%d\n",wnr3dInfo->nr3d_uv_pixel_width); - printf("nr3d_y_buf_base:%d\n",wnr3dInfo->nr3d_y_buf_base); - printf("nr3d_uv_buf_base:%d\n",wnr3dInfo->nr3d_uv_buf_base); - printf("nr3d_y_line_stride:%d\n",wnr3dInfo->nr3d_y_line_stride); - printf("nr3d_uv_line_stride:%d\n",wnr3dInfo->nr3d_uv_line_stride); - printf("nr3d_frame_buf_size:%d\n",wnr3dInfo->nr3d_frame_buf_size); - // - struct isp_wrap_ldc_info *wldcInfo = &isp_wrap_cfg->ldcInfo; - printf("ldc_en:%d\n",wldcInfo->ldc_en); - printf("ldc_y_buf_base:%d\n",wldcInfo->ldc_y_buf_base); - printf("ldc_uv_buf_base:%d\n",wldcInfo->ldc_uv_buf_base); - printf("ldc_line_stride:%d\n",wldcInfo->ldc_line_stride); - printf("ldc_frame_buf_size:%d\n",wldcInfo->ldc_frame_buf_size); - // - struct isp_wrap_main_info *mainInfo = &isp_wrap_cfg->mainInfo; - printf("main_out_en:%d\n",mainInfo->main_out_en); - printf("main_size.width:%d\n",mainInfo->main_size.width); - printf("main_size.height:%d\n",mainInfo->main_size.height); - printf("main_pix_remap_en:%d\n",mainInfo->main_pix_remap_en); - printf("main_out_img_format:%d\n",mainInfo->main_out_img_format); - printf("main_out_yuv_in_format:%d\n",mainInfo->main_out_yuv_in_format); - printf("main_out_img_out_format:%d\n",mainInfo->main_out_img_out_format); - printf("main_out_yuv422_pxl_order:%d\n",mainInfo->main_out_yuv422_pxl_order); - printf("main_out_pxl_width:%d\n",mainInfo->main_out_pxl_width); - printf("main_y_buf0_base:%d\n",mainInfo->main_y_buf0_base); - printf("main_y_buf1_base:%d\n",mainInfo->main_y_buf1_base); - printf("main_uv_buf0_base:%d\n",mainInfo->main_uv_buf0_base); - printf("main_uv_buf1_base:%d\n",mainInfo->main_uv_buf1_base); - printf("main_line_stride:%d\n",mainInfo->main_line_stride); - printf("main_frame_buf_size:%d\n",mainInfo->main_frame_buf_size); - // - struct isp_wrap_ds0_info *ds0Info = &isp_wrap_cfg->ds0Info; - printf("ds0_out_en:%d\n",ds0Info->ds0_out_en); - printf("ds0_osd0_en:%d\n",ds0Info->ds0_osd0_en ); - printf("ds0_osd1_en:%d\n",ds0Info->ds0_osd1_en ); - printf("ds0_osd2_en:%d\n",ds0Info->ds0_osd2_en ); - printf("pix_remap_out0_en:%d\n",ds0Info->pix_remap_out0_en); - printf("ds0_size.width:%d\n",ds0Info->ds0_size.width); - printf("ds0_size.height:%d\n",ds0Info->ds0_size.height); - printf("ds0_out_img_format:%d\n",ds0Info->ds0_out_img_format); - printf("ds0_out_yuv_in_format:%d\n",ds0Info->ds0_out_yuv_in_format); - printf("ds0_out_img_out_format:%d\n",ds0Info->ds0_out_img_out_format); - printf("ds0_out_yuv422_pxl_order:%d\n",ds0Info->ds0_out_yuv422_pxl_order); - printf("ds0_out_pxl_width:%d\n",ds0Info->ds0_out_pxl_width); - printf("ds0_y_buf0_base:%d\n",ds0Info->ds0_y_buf0_base); - printf("ds0_y_buf1_base:%d\n",ds0Info->ds0_y_buf1_base); - printf("ds0_uv_buf0_base:%d\n",ds0Info->ds0_uv_buf0_base); - printf("ds0_uv_buf1_base:%d\n",ds0Info->ds0_uv_buf1_base); - printf("ds0_line_stride:%d\n",ds0Info->ds0_line_stride); - printf("ds0_frame_buf_size:%d\n",ds0Info->ds0_frame_buf_size); - // - struct isp_wrap_ds1_info *ds1Info = &isp_wrap_cfg->ds1Info; - printf("ds1_out_en:%d\n",ds1Info->ds1_out_en); - printf("ds1_osd0_en:%d\n",ds1Info->ds1_osd0_en ); - printf("ds1_osd1_en:%d\n",ds1Info->ds1_osd1_en ); - printf("ds1_osd2_en:%d\n",ds1Info->ds1_osd2_en ); - printf("pix_remap_out1_en:%d\n",ds1Info->pix_remap_out1_en); - printf("ds1_size.width:%d\n",ds1Info->ds1_size.width); - printf("ds1_size.height:%d\n",ds1Info->ds1_size.height); - printf("ds1_out_img_format:%d\n",ds1Info->ds1_out_img_format); - printf("ds1_out_yuv_in_format:%d\n",ds1Info->ds1_out_yuv_in_format); - printf("ds1_out_img_out_format:%d\n",ds1Info->ds1_out_img_out_format); - printf("ds1_out_yuv422_pxl_order:%d\n",ds1Info->ds1_out_yuv422_pxl_order); - printf("ds1_out_pxl_width:%d\n",ds1Info->ds1_out_pxl_width); - printf("ds1_y_buf0_base:%d\n",ds1Info->ds1_y_buf0_base); - printf("ds1_y_buf1_base:%d\n",ds1Info->ds1_y_buf1_base); - printf("ds1_uv_buf0_base:%d\n",ds1Info->ds1_uv_buf0_base); - printf("ds1_uv_buf1_base:%d\n",ds1Info->ds1_uv_buf1_base); - printf("ds1_line_stride:%d\n",ds1Info->ds1_line_stride); - printf("ds1_frame_buf_size:%d\n",ds1Info->ds1_frame_buf_size); - // - struct isp_wrap_ds2_info *ds2Info = &isp_wrap_cfg->ds2Info; - printf("ds2_out_en:%d\n",ds2Info->ds2_out_en); - printf("ds2_osd0_en:%d\n",ds2Info->ds2_osd0_en ); - printf("ds2_osd1_en:%d\n",ds2Info->ds2_osd1_en ); - printf("ds2_osd2_en:%d\n",ds2Info->ds2_osd2_en ); - printf("ds2_size.width:%d\n",ds2Info->ds2_size.width); - printf("ds2_size.height:%d\n",ds2Info->ds2_size.height); - printf("ds2_out_img_format:%d\n",ds2Info->ds2_out_img_format); - printf("ds2_out_yuv_in_format:%d\n",ds2Info->ds2_out_yuv_in_format); - printf("ds2_out_img_out_format:%d\n",ds2Info->ds2_out_img_out_format); - printf("ds2_out_yuv422_pxl_order:%d\n",ds2Info->ds2_out_yuv422_pxl_order); - printf("ds2_out_pxl_width:%d\n",ds2Info->ds2_out_pxl_width); - printf("ds2_r_buf0_base:%d\n",ds2Info->ds2_r_buf0_base); - printf("ds2_r_buf1_base:%d\n",ds2Info->ds2_r_buf1_base); - printf("ds2_g_buf0_base:%d\n",ds2Info->ds2_g_buf0_base); - printf("ds2_g_buf1_base:%d\n",ds2Info->ds2_g_buf1_base); - printf("ds2_b_buf0_base:%d\n",ds2Info->ds2_b_buf0_base); - printf("ds2_b_buf1_base:%d\n",ds2Info->ds2_b_buf1_base); - printf("ds2_line_stride:%d\n",ds2Info->ds2_line_stride); - printf("ds2_frame_buf_size:%d\n",ds2Info->ds2_frame_buf_size); - // - struct isp_core_cfg_info *isp_core_cfg = &isp_cfg->isp_core_cfg; -//itc - struct itc_info_s *itcInfo = &isp_core_cfg->itcInfo; - printf("hsync_pol:%d\n",itcInfo->hsync_pol); - printf("vsync_pol:%d\n",itcInfo->vsync_pol); - printf("hsync_input_timing:%d\n",itcInfo->hsync_input_timing); - printf("vsync_input_timing:%d\n",itcInfo->vsync_input_timing); - printf("flip_ctl:%d\n",itcInfo->flip_ctl); - printf("video_fmt_sel:%d\n",itcInfo->video_fmt_sel); - printf("total_size.width:%d\n",itcInfo->total_size.width); - printf("total_size.height:%d\n",itcInfo->total_size.height); - printf("itc_size.width:%d\n",itcInfo->itc_size.width); - printf("itc_size.width_st:%d\n",itcInfo->itc_size.width_st); - printf("itc_size.height:%d\n",itcInfo->itc_size.height); - printf("itc_size.height_st:%d\n",itcInfo->itc_size.height_st); -//tpg * - struct tpg_info_s *tpgInfo = &isp_core_cfg->tpgInfo; - printf("tpg_en:%d\n",tpgInfo->tpg_en); - printf("tpg_sel:%d\n",tpgInfo->tpg_sel); - printf("bayer_mode_sel:%d\n",tpgInfo->bayer_mode_sel); - printf("motion_mode_sel:%d\n",tpgInfo->motion_mode_sel); - printf("wdr_l_mul_data:%d\n",tpgInfo->wdr_l_mul_data); - printf("wdr_m_mul_data:%d\n",tpgInfo->wdr_m_mul_data); - printf("wdr_s_mul_data:%d\n",tpgInfo->wdr_s_mul_data); -//blc * - struct blc_info_s *blcInfo = &isp_core_cfg->blcInfo; - printf("blc_en:%d\n",blcInfo->blc_en); - printf("blc_offset:%d\n",blcInfo->blc_offset); - printf("blc_ratio:%d\n",blcInfo->blc_ratio); -//lsc * - struct lsc_info_s *lscInfo = &isp_core_cfg->lscInfo; - printf("lsc_en:%d\n",lscInfo->lsc_en); - printf("lsc_h_center:%d\n",lscInfo->lsc_h_center); - printf("lsc_v_center:%d\n",lscInfo->lsc_v_center); - printf("lsc_r_ratio:%d\n",lscInfo->lsc_r_ratio); - printf("lsc_g_ratio:%d\n",lscInfo->lsc_g_ratio); - printf("lsc_b_ratio:%d\n",lscInfo->lsc_b_ratio); - printf("lsc_ir_ratio:%d\n",lscInfo->lsc_ir_ratio); -//ae * - struct ae_info_s *aeInfo = &isp_core_cfg->aeInfo; - printf("ae_as_en:%d\n",aeInfo->ae_as_en); - printf("ae_ag_en:%d\n",aeInfo->ae_ag_en); - printf("ae_airis_en:%d\n",aeInfo->ae_airis_en); - printf("ae_enter_ls_sel:%d\n",aeInfo->ae_enter_ls_sel); - printf("ae_exit_ls_sel:%d\n",aeInfo->ae_exit_ls_sel); - printf("ae_win_mode_sel:%d\n",aeInfo->ae_win_mode_sel); - printf("ae_back_light_mode_sel:%d\n",aeInfo->ae_back_light_mode_sel); - printf("ae_day_change_en:%d\n",aeInfo->ae_day_change_en); - printf("ae_day_change_sel:%d\n",aeInfo->ae_day_change_sel); - printf("ae_win_size.v_start:%d\n",aeInfo->ae_win_size.v_start); - printf("ae_win_size.h_start:%d\n",aeInfo->ae_win_size.h_start); - printf("ae_win_size.v_end:%d\n",aeInfo->ae_win_size.v_end); - printf("ae_win_size.h_end:%d\n",aeInfo->ae_win_size.h_end); - printf("ae_tar_bright:%d\n",aeInfo->ae_tar_bright); - printf("ae_tar_bright_range:%d\n",aeInfo->ae_tar_bright_range); - printf("ae_l_ex_time:%d\n",aeInfo->ae_l_ex_time); - printf("ae_m_ex_time:%d\n",aeInfo->ae_m_ex_time); - printf("ae_s_ex_time:%d\n",aeInfo->ae_s_ex_time); - printf("ae_agc:%d\n",aeInfo->ae_agc); - printf("ae_ad_shuttle_freq:%d\n",aeInfo->ae_ad_shuttle_freq); - printf("ae_ad_gain_freq:%d\n",aeInfo->ae_ad_gain_freq); - printf("ae_adjust_step_max:%d\n",aeInfo->ae_adjust_step_max); - printf("ae_ex_value_max:%d\n",aeInfo->ae_ex_value_max); - printf("ae_ex_value_mid:%d\n",aeInfo->ae_ex_value_mid); - printf("ae_ex_value_min:%d\n",aeInfo->ae_ex_value_min); - printf("ae_gain_value_max:%d\n",aeInfo->ae_gain_value_max); - printf("ae_gain_value_mid:%d\n",aeInfo->ae_gain_value_mid); - printf("ae_gain_value_min:%d\n",aeInfo->ae_gain_value_min); - printf("ae_dn_switch_ad_step_max:%d\n",aeInfo->ae_dn_switch_ad_step_max); - printf("ae_dn_switch_wait_time:%d\n",aeInfo->ae_dn_switch_wait_time); - printf("ape_max_diff:%d\n",aeInfo->ape_max_diff); - printf("ape_drv_signal_max:%d\n",aeInfo->ape_drv_signal_max); - printf("ape_coeff_distance:%d\n",aeInfo->ape_coeff_distance); - printf("ape_coeff_speed:%d\n",aeInfo->ape_coeff_speed); - printf("ape_coeff_acceleration:%d\n",aeInfo->ape_coeff_acceleration); - printf("ape_drv_manual_value:%d\n",aeInfo->ape_drv_manual_value); - printf("ape_damp_manual_value:%d\n",aeInfo->ape_damp_manual_value); -//awb * - struct awb_info_s *awbInfo = &isp_core_cfg->awbInfo; - printf("awb_d65_en:%d\n",awbInfo->awb_d65_en); - printf("awb_ccm_en:%d\n",awbInfo->awb_ccm_en); - printf("awb_en:%d\n",awbInfo->awb_en); - printf("awb_mode_sel:%d\n",awbInfo->awb_mode_sel); - printf("awb_hist_mode_sel:%d\n",awbInfo->awb_hist_mode_sel); - printf("awb_veri_en:%d\n",awbInfo->awb_veri_en); - printf("awb_fb_en:%d\n",awbInfo->awb_fb_en); - printf("awb_value_save_en:%d\n",awbInfo->awb_value_save_en); - printf("awb_ccm_adp_adjust_en:%d\n",awbInfo->awb_ccm_adp_adjust_en); - printf("awb_stab_en:%d\n",awbInfo->awb_stab_en); - printf("awb_d65_red_gain:%d\n",awbInfo->awb_d65_red_gain); - printf("awb_d65_blue_gain:%d\n",awbInfo->awb_d65_blue_gain); - printf("ccm_coff[0][0]:%d\n",awbInfo->ccm_coff[0][0]); - printf("ccm_coff[0][1]:%d\n",awbInfo->ccm_coff[0][1]); - printf("ccm_coff[0][2]:%d\n",awbInfo->ccm_coff[0][2]); - printf("ccm_coff[1][0]:%d\n",awbInfo->ccm_coff[1][0]); - printf("ccm_coff[1][1]:%d\n",awbInfo->ccm_coff[1][1]); - printf("ccm_coff[1][2]:%d\n",awbInfo->ccm_coff[1][2]); - printf("ccm_coff[2][0]:%d\n",awbInfo->ccm_coff[2][0]); - printf("ccm_coff[2][1]:%d\n",awbInfo->ccm_coff[2][1]); - printf("ccm_coff[2][2]:%d\n",awbInfo->ccm_coff[2][2]); - printf("ccm_correct_coff:%d\n",awbInfo->ccm_correct_coff); - printf("awb_win_size.v_start:%d\n",awbInfo->awb_win_size.v_start); - printf("awb_win_size.h_start:%d\n",awbInfo->awb_win_size.h_start); - printf("awb_win_size.v_end:%d\n",awbInfo->awb_win_size.v_end); - printf("awb_win_size.h_end:%d\n",awbInfo->awb_win_size.h_end); - printf("awb_correct_diff_th:%d\n",awbInfo->awb_correct_diff_th); - printf("awb_color_changeres_time:%d\n",awbInfo->awb_color_changeres_time); - printf("awb_historgram_th:%d\n",awbInfo->awb_historgram_th); - printf("awb_red_gain_adjust:%d\n",awbInfo->awb_red_gain_adjust); - printf("awb_green_gain_adjust:%d\n",awbInfo->awb_green_gain_adjust); - printf("awb_blue_gain_adjust:%d\n",awbInfo->awb_blue_gain_adjust); - printf("awb_red_max_value:%d\n",awbInfo->awb_red_max_value); - printf("awb_blue_max_value:%d\n",awbInfo->awb_blue_max_value); - printf("awb_red_min_value:%d\n",awbInfo->awb_red_min_value); - printf("awb_blue_min_value:%d\n",awbInfo->awb_blue_min_value); - printf("awb_red_obj_value:%d\n",awbInfo->awb_red_obj_value); - printf("awb_blue_obj_value:%d\n",awbInfo->awb_blue_obj_value); -//wdr * - struct wdr_Info_s *wdrInfo = &isp_core_cfg->wdrInfo; - printf(" wdr_fusion_en:%d\n",wdrInfo->wdr_fusion_en); - printf(" wdr_frame_sel:%d\n",wdrInfo->wdr_frame_sel); - printf(" wdr_adp_adjust_en:%d\n",wdrInfo->wdr_adp_adjust_en); - printf(" wdr_stab_en:%d\n",wdrInfo->wdr_stab_en); - printf(" wdr_en:%d\n",wdrInfo->wdr_en); - printf(" wdr_ghost_remove_en:%d\n",wdrInfo->wdr_ghost_remove_en); - printf(" wdr_3frame_out_mode:%d\n",wdrInfo->wdr_3frame_out_mode); - printf(" wdr_mode_sel:%d\n",wdrInfo->wdr_mode_sel); - printf(" wdr_2frame_ex_ratio:%d\n",wdrInfo->wdr_2frame_ex_ratio); - printf(" wdr_3frame_ex_ratio:%d\n",wdrInfo->wdr_3frame_ex_ratio); - printf(" wdr_stat_img_sel:%d\n",wdrInfo->wdr_stat_img_sel); - printf(" wdr_ltm_data_sel:%d\n",wdrInfo->wdr_ltm_data_sel); - printf(" wdr_tz_data_sel:%d\n",wdrInfo->wdr_tz_data_sel); - printf(" wdr_remove_purple_en:%d\n",wdrInfo->wdr_remove_purple_en); - printf(" wdr_over_ex_ratio_th1:%d\n",wdrInfo->wdr_over_ex_ratio_th1); - printf(" wdr_over_ex_ratio_th2:%d\n",wdrInfo->wdr_over_ex_ratio_th2); - printf(" wdr_fusion_ratio_th:%d\n",wdrInfo->wdr_fusion_ratio_th); - printf(" wdr_fusion_value1 :%d\n",wdrInfo->wdr_fusion_value1); - printf(" wdr_fusion_value2:%d\n",wdrInfo->wdr_fusion_value2); -//csc * - struct csc_info_s *cscInfo = &isp_core_cfg->cscInfo; - printf("csc_r2y[0][0]:%d\n",cscInfo->csc_r2y[0][0]); - printf("csc_r2y[0][1]:%d\n",cscInfo->csc_r2y[0][1]); - printf("csc_r2y[0][2]:%d\n",cscInfo->csc_r2y[0][2]); - printf("csc_r2y[1][0]:%d\n",cscInfo->csc_r2y[1][0]); - printf("csc_r2y[1][1]:%d\n",cscInfo->csc_r2y[1][1]); - printf("csc_r2y[1][2]:%d\n",cscInfo->csc_r2y[1][2]); - printf("csc_r2y[2][0]:%d\n",cscInfo->csc_r2y[2][0]); - printf("csc_r2y[2][1]:%d\n",cscInfo->csc_r2y[2][1]); - printf("csc_r2y[2][2]:%d\n",cscInfo->csc_r2y[2][2]); -//ada * - struct ada_info_s *adaInfo = &isp_core_cfg->adaInfo; - printf("ada_rgb_gamma_en:\n",adaInfo->ada_rgb_gamma_en); - printf("ada_yuv_gamma_en:\n",adaInfo->ada_yuv_gamma_en); - printf("ada_adjust_en:\n",adaInfo->ada_adjust_en); - printf("ada_img_stab_en:\n",adaInfo->ada_img_stab_en); - printf("ada_ccr_en:\n",adaInfo->ada_ccr_en); - printf("ada_adp_en:\n",adaInfo->ada_adp_en); - printf("ada_adp_ccr_en:\n",adaInfo->ada_adp_ccr_en); - printf("ada_stat_mode_sel:\n",adaInfo->ada_stat_mode_sel); - printf("ada_enh_mode_sel:\n",adaInfo->ada_enh_mode_sel); - printf("ada_stat_max_value:\n",adaInfo->ada_stat_max_value); - printf("ada_ad_stren_max_value:\n",adaInfo->ada_ad_stren_max_value); - printf("ada_win_size.v_start:\n",adaInfo->ada_win_size.v_start); - printf("ada_win_size.h_start:\n",adaInfo->ada_win_size.h_start); - printf("ada_win_size.v_end:\n",adaInfo->ada_win_size.v_end); - printf("ada_win_size.h_end:\n",adaInfo->ada_win_size.h_end); -//rgbir * - struct rgbir_info_s *rgbirInfo = &isp_core_cfg->rgbirInfo; - printf("rgbir_en:%d\n",rgbirInfo->rgbir_en); - printf("rgbir_rtf_en:%d\n",rgbirInfo->rgbir_rtf_en); - printf("rgbir_rpc_en:%d\n",rgbirInfo->rgbir_rpc_en); - printf("rgbir_fusion_en:%d\n",rgbirInfo->rgbir_fusion_en); - printf("rgbir_output_sel:%d\n",rgbirInfo->rgbir_output_sel); - printf("rgbir_rpc_max_value:%d\n",rgbirInfo->rgbir_rpc_max_value); - printf("rgbir_rpc_color_coff:%d\n",rgbirInfo->rgbir_rpc_color_coff); - printf("rgbir_rpc_luma_coff:%d\n",rgbirInfo->rgbir_rpc_luma_coff); - printf("rgbir_rpc_th:%d\n",rgbirInfo->rgbir_rpc_th); - printf("rgbir_rpc_th1:%d\n",rgbirInfo->rgbir_rpc_th1); -//nr2d * - struct nr2d_info_s *nr2dInfo = &isp_core_cfg->nr2dInfo; - printf("d2nr_pcf_en:%d\n",nr2dInfo->d2nr_pcf_en); - printf("d2nr_raw_en:%d\n",nr2dInfo->d2nr_raw_en); - printf("d2nr_edge_en:%d\n",nr2dInfo->d2nr_edge_en); - printf("d2nr_bap_en:%d\n",nr2dInfo->d2nr_bap_en); - printf("d2nr_luma_en:%d\n",nr2dInfo->d2nr_luma_en); - printf("d2nr_chroma_en:%d\n",nr2dInfo->d2nr_chroma_en); - printf("d2nr_pcf_adp_en:%d\n",nr2dInfo->d2nr_pcf_adp_en); - printf("d2nr_raw_adp_en:%d\n",nr2dInfo->d2nr_raw_adp_en); - printf("d2nr_luma_adp_en:%d\n",nr2dInfo->d2nr_luma_adp_en); - printf("d2nr_chroma_adp_en:%d\n",nr2dInfo->d2nr_chroma_adp_en); - printf("d2nr_raw_intensity:%d\n",nr2dInfo->d2nr_raw_intensity); - printf("d2nr_bap_intensity:%d\n",nr2dInfo->d2nr_bap_intensity); - printf("d2nr_edge_intensity:%d\n",nr2dInfo->d2nr_edge_intensity); - printf("d2nr_luma_intensity:%d\n",nr2dInfo->d2nr_luma_intensity); - printf("d2nr_chroma_intensity:%d\n",nr2dInfo->d2nr_chroma_intensity); -//nr3d * - struct nr3d_info_s *nr3dInfo = &isp_core_cfg->nr3dInfo; - printf("d3nr_en:%d\n",nr3dInfo->d3nr_en); - printf("d3nr_pre_luma_en:%d\n",nr3dInfo->d3nr_pre_luma_en); - printf("d3nr_pre_chroma_en:%d\n",nr3dInfo->d3nr_pre_chroma_en); - printf("d3nr_main_luma_en:%d\n",nr3dInfo->d3nr_main_luma_en); - printf("d3nr_main_chroma_en:%d\n",nr3dInfo->d3nr_main_chroma_en); - printf("d3nr_post_luma_en:%d\n",nr3dInfo->d3nr_post_luma_en); - printf("d3nr_post_chroma_en:%d\n",nr3dInfo->d3nr_post_chroma_en); - printf("d3nr_2d_luma_en:%d\n",nr3dInfo->d3nr_2d_luma_en); - printf("d3nr_2d_chroma_en:%d\n",nr3dInfo->d3nr_2d_chroma_en); - printf("d3nr_wb_en:%d\n",nr3dInfo->d3nr_wb_en); - printf("d3nr_wb_sel:%d\n",nr3dInfo->d3nr_wb_sel); - printf("d3nr_adp_luma_en:%d\n",nr3dInfo->d3nr_adp_luma_en); - printf("d3nr_adp_chroma_en:%d\n",nr3dInfo->d3nr_adp_chroma_en); - printf("d3nr_pre_luma_th:%d\n",nr3dInfo->d3nr_pre_luma_th); - printf("d3nr_pre_luma_intensity:%d\n",nr3dInfo->d3nr_pre_luma_intensity); - printf("d3nr_pre_chroma_intensity:%d\n",nr3dInfo->d3nr_pre_chroma_intensity); - printf("d3nr_mid_filter_th:%d\n",nr3dInfo->d3nr_mid_filter_th); - printf("d3nr_pre_mid_filter_th:%d\n",nr3dInfo->d3nr_pre_mid_filter_th); - printf("d3nr_cur_mid_filter_th:%d\n",nr3dInfo->d3nr_cur_mid_filter_th); - printf("d3nr_low_pass_filter_th:%d\n",nr3dInfo->d3nr_low_pass_filter_th); - printf("d3nr_luma_th:%d\n",nr3dInfo->d3nr_luma_th); - printf("d3nr_min_value:%d\n",nr3dInfo->d3nr_min_value); - printf("d3nr_luma_intensity:%d\n",nr3dInfo->d3nr_luma_intensity); - printf("d3nr_chroma_intensity:%d\n",nr3dInfo->d3nr_chroma_intensity); - printf("d3nr_post_edge_th:%d\n",nr3dInfo->d3nr_post_edge_th); - printf("d3nr_post_luma_intensity:%d\n",nr3dInfo->d3nr_post_luma_intensity); - printf("d3nr_post_chroma_intensity:%d\n",nr3dInfo->d3nr_post_chroma_intensity); -//enh * - struct enh_info_s *enhInfo = &isp_core_cfg->enhInfo; - printf("enh_ltm_en:\n",enhInfo->enh_ltm_en); - printf("enh_sharp_en:\n",enhInfo->enh_sharp_en); - printf("enh_cc_en:\n",enhInfo->enh_cc_en); - printf("enh_adp_ltm_en:\n",enhInfo->enh_adp_ltm_en); - printf("enh_adp_sharp_en:\n",enhInfo->enh_adp_sharp_en); - printf("enh_adp_cc_en:\n",enhInfo->enh_adp_cc_en); - printf("ltm_gain:\n",enhInfo->ltm_gain); - printf("ltm_th:\n",enhInfo->ltm_th); - printf("enh_nr_th:\n",enhInfo->enh_nr_th); - printf("enh_th1:\n",enhInfo->enh_th1); - printf("enh_th2:\n",enhInfo->enh_th2); - printf("sharp_gain:\n",enhInfo->sharp_gain); -//post ctrl * - struct post_info_s *postInfo = &isp_core_cfg->postInfo; - printf("post_cont_ad_en:%d\n",postInfo->post_cont_ad_en); - printf("post_luma_ad_en:%d\n",postInfo->post_luma_ad_en); - printf("post_satu_ad_en:%d\n",postInfo->post_satu_ad_en); - printf("cont_ad_intensity:%d\n",postInfo->cont_ad_intensity); - printf("luma_ad_intensity:%d\n",postInfo->luma_ad_intensity); - printf("satu_ad_intensity:%d\n",postInfo->satu_ad_intensity); -//otc * - struct otc_info_s *otcInfo = &isp_core_cfg->otcInfo; - printf("post_otc_en:%d\n",otcInfo->post_otc_en); - printf("otc_yc_sel:%d\n",otcInfo->otc_yc_sel); - printf("otc_uv_format_sel:%d\n",otcInfo->otc_uv_format_sel); - printf("otc_hsync_pol_sel:%d\n",otcInfo->otc_hsync_pol_sel); - printf("otc_vsync_pol_sel:%d\n",otcInfo->otc_vsync_pol_sel); - printf("otc_out_size.width_st:%d\n",otcInfo->otc_out_size.width_st); - printf("otc_out_size.height_st:%d\n",otcInfo->otc_out_size.height_st); - printf("otc_out_size.width:%d\n",otcInfo->otc_out_size.width); - printf("otc_out_size.height:%d\n",otcInfo->otc_out_size.height); -//ldc * - struct ldc_info_s *ldcInfo = &isp_core_cfg->ldcInfo; - printf("ldc_en:%d\n",ldcInfo->ldc_en); - printf("ldc_arith_en:%d\n",ldcInfo->ldc_arith_en); - printf("ldc_req_freq:%d\n",ldcInfo->ldc_req_freq); - printf("ldc_stt_ln:%d\n",ldcInfo->ldc_stt_ln); - printf("ldc_h_center_pos:%d\n",ldcInfo->ldc_h_center_pos); - printf("ldc_v_center_pos:%d\n",ldcInfo->ldc_v_center_pos); - printf("ldc_rectify_cr:%d\n",ldcInfo->ldc_rectify_cr); - printf("ldc_rectify_cz:%d\n",ldcInfo->ldc_rectify_cz); -//af * - struct af_info_s *afInfo = &isp_core_cfg->afInfo; - printf("af_stat_en:%d\n",afInfo->af_stat_en); - printf("af_stat_mode_sel:%d\n",afInfo->af_stat_mode_sel); - printf("v_start:%d\n",afInfo->af_win_size.v_start); - printf("h_start:%d\n",afInfo->af_win_size.h_start); - printf("v_end:%d\n",afInfo->af_win_size.v_end); - printf("h_end:%d\n",afInfo->af_win_size.h_end); - // - struct isp_ds_cfg_info *isp_ds_cfg = &isp_cfg->isp_ds_cfg; - printf("dsInSizeInfo.width:%d\n",isp_ds_cfg->dsInSizeInfo.width); - printf("dsInSizeInfo.height:%d\n",isp_ds_cfg->dsInSizeInfo.height); - // - printf("osd_rgb2yuv_coeff[0][0]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[0][0]); - printf("osd_rgb2yuv_coeff[0][1]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[0][1]); - printf("osd_rgb2yuv_coeff[0][2]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[0][2]); - printf("osd_rgb2yuv_coeff[0][3]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[0][3]); - printf("osd_rgb2yuv_coeff[1][0]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[1][0]); - printf("osd_rgb2yuv_coeff[1][1]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[1][1]); - printf("osd_rgb2yuv_coeff[1][2]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[1][2]); - printf("osd_rgb2yuv_coeff[1][3]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[1][3]); - printf("osd_rgb2yuv_coeff[2][0]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[2][0]); - printf("osd_rgb2yuv_coeff[2][1]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[2][1]); - printf("osd_rgb2yuv_coeff[2][2]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[2][2]); - printf("osd_rgb2yuv_coeff[2][3]:%d\n",isp_ds_cfg->osd_rgb2yuv_coeff[2][3]); - // - printf("osd_yuv2rgb_coeff[0][0]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[0][0]); - printf("osd_yuv2rgb_coeff[0][1]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[0][1]); - printf("osd_yuv2rgb_coeff[0][2]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[0][2]); - printf("osd_yuv2rgb_coeff[0][3]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[0][3]); - printf("osd_yuv2rgb_coeff[1][0]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[1][0]); - printf("osd_yuv2rgb_coeff[1][1]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[1][1]); - printf("osd_yuv2rgb_coeff[1][2]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[1][2]); - printf("osd_yuv2rgb_coeff[1][3]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[1][3]); - printf("osd_yuv2rgb_coeff[2][0]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[2][0]); - printf("osd_yuv2rgb_coeff[2][1]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[2][1]); - printf("osd_yuv2rgb_coeff[2][2]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[2][2]); - printf("osd_yuv2rgb_coeff[2][3]:%d\n",isp_ds_cfg->osd_yuv2rgb_coeff[2][3]); - // - struct isp_ds_info_s *dsInfo = &isp_ds_cfg->dsInfo[0]; //ISP_DS_CH_NUM - printf("0 scale_en:%d\n",dsInfo->scale_en); - printf("0 vscale_filter_en:%d\n",dsInfo->vscale_filter_en); - printf("0 hscale_filter_en:%d\n",dsInfo->hscale_filter_en); - printf("0 ds_out_size.width:%d\n",dsInfo->ds_out_size.width); - printf("0 ds_out_size.height:%d\n",dsInfo->ds_out_size.height); - printf("0 out_rgb_mode:%d\n",dsInfo->out_rgb_mode); - printf("0 out_rgb_en:%d\n",dsInfo->out_rgb_en); - printf("0 out_yuv_mode:%d\n",dsInfo->out_yuv_mode); - printf("0 out_uv_swap:%d\n",dsInfo->out_uv_swap); - // - dsInfo = &isp_ds_cfg->dsInfo[1]; - printf("1 scale_en:%d\n",dsInfo->scale_en); - printf("1 vscale_filter_en:%d\n",dsInfo->vscale_filter_en); - printf("1 hscale_filter_en:%d\n",dsInfo->hscale_filter_en); - printf("1 ds_out_size.width:%d\n",dsInfo->ds_out_size.width); - printf("1 ds_out_size.height:%d\n",dsInfo->ds_out_size.height); - printf("1 out_rgb_mode:%d\n",dsInfo->out_rgb_mode); - printf("1 out_rgb_en:%d\n",dsInfo->out_rgb_en); - printf("1 out_yuv_mode:%d\n",dsInfo->out_yuv_mode); - printf("1 out_uv_swap:%d\n",dsInfo->out_uv_swap); - // - dsInfo = &isp_ds_cfg->dsInfo[2]; - printf("2 scale_en:%d\n",dsInfo->scale_en); - printf("2 vscale_filter_en:%d\n",dsInfo->vscale_filter_en); - printf("2 hscale_filter_en:%d\n",dsInfo->hscale_filter_en); - printf("2 ds_out_size.width:%d\n",dsInfo->ds_out_size.width); - printf("2 ds_out_size.height:%d\n",dsInfo->ds_out_size.height); - printf("2 out_rgb_mode:%d\n",dsInfo->out_rgb_mode); - printf("2 out_rgb_en:%d\n",dsInfo->out_rgb_en); - printf("2 out_yuv_mode:%d\n",dsInfo->out_yuv_mode); - printf("2 out_uv_swap:%d\n",dsInfo->out_uv_swap); - printf("%s:end\n",__func__); -} - diff --git a/package/mediactl_lib/src/isp/json_parse.c b/package/mediactl_lib/src/isp/json_parse.c index 860e64e..5ce8d18 100755 --- a/package/mediactl_lib/src/isp/json_parse.c +++ b/package/mediactl_lib/src/isp/json_parse.c @@ -110,14 +110,14 @@ void doit_video_cfg(char *text,struct vi_cfg_info *vi_cfg,struct sensor_info *se //sensor0_active_size object=cJSON_GetArrayItem(arrayItem,i++); item=cJSON_GetObjectItem(object,"sensor0_active_width"); - item->valueint = (item->valueint + 15) / 16 * 16; + // item->valueint = (item->valueint + 15) / 16 * 16; //printf("%s:active_width %p\n",__func__,item); if(item != NULL) { - itcInfo->itc_size.width = item->valueint; - vi_cfg->vi_pipe_cfg[0].in_size.width = item->valueint; - vi_cfg->vi_pipe_cfg[1].in_size.width = item->valueint; - vi_cfg->vi_pipe_cfg[2].in_size.width = item->valueint; + itcInfo->itc_size.width = (item->valueint + 15) / 16 * 16; + vi_cfg->vi_pipe_cfg[0].in_size.width = (item->valueint + 15) / 16 * 16; + vi_cfg->vi_pipe_cfg[1].in_size.width = (item->valueint + 15) / 16 * 16; + vi_cfg->vi_pipe_cfg[2].in_size.width = (item->valueint + 15) / 16 * 16; //printf("cJSON_GetObjectItem: type=%d, string is %s, valueint is %d\n",item->type,item->string,item->valueint); } @@ -147,12 +147,12 @@ void doit_video_cfg(char *text,struct vi_cfg_info *vi_cfg,struct sensor_info *se } item=cJSON_GetObjectItem(object,"video2_width"); - item->valueint = (item->valueint + 15) / 16 * 16; + // item->valueint = (item->valueint + 15) / 16 * 16; //printf("%s:active_height %p\n",__func__,item); if(item != NULL) { dev_info[0].video_width[0] = item->valueint; - mainInfo->main_size.width = item->valueint; + mainInfo->main_size.width = (item->valueint + 15) / 16 * 16; otcInfo->otc_out_size.width = mainInfo->main_size.width; dsInSizeInfo->width = mainInfo->main_size.width; //printf("cJSON_GetObjectItem: type=%d, string is %s, valueint is %d\n",item->type,item->string,item->valueint); @@ -195,12 +195,12 @@ void doit_video_cfg(char *text,struct vi_cfg_info *vi_cfg,struct sensor_info *se } item=cJSON_GetObjectItem(object,"video3_width"); - item->valueint = (item->valueint + 15) / 16 * 16; + // item->valueint = (item->valueint + 15) / 16 * 16; //printf("%s:active_height %p\n",__func__,item); if(item != NULL) { dev_info[0].video_width[1] = item->valueint; - wds0Info->ds0_size.width = item->valueint; + wds0Info->ds0_size.width = (item->valueint + 15) / 16 * 16; ds0Info->ds_out_size.width = wds0Info->ds0_size.width; //printf("cJSON_GetObjectItem: type=%d, string is %s, valueint is %d\n",item->type,item->string,item->valueint); } @@ -241,12 +241,12 @@ void doit_video_cfg(char *text,struct vi_cfg_info *vi_cfg,struct sensor_info *se } item=cJSON_GetObjectItem(object,"video4_width"); - item->valueint = (item->valueint + 15) / 16 * 16; + // item->valueint = (item->valueint + 15) / 16 * 16; //printf("%s:active_height %p\n",__func__,item); if(item != NULL) { dev_info[0].video_width[2] = item->valueint; - wds1Info->ds1_size.width = item->valueint; + wds1Info->ds1_size.width = (item->valueint + 15) / 16 * 16; ds1Info->ds_out_size.width = wds1Info->ds1_size.width; //printf("cJSON_GetObjectItem: type=%d, string is %s, valueint is %d\n",item->type,item->string,item->valueint); } @@ -287,12 +287,12 @@ void doit_video_cfg(char *text,struct vi_cfg_info *vi_cfg,struct sensor_info *se } item=cJSON_GetObjectItem(object,"video5_width"); - item->valueint = (item->valueint + 15) / 16 * 16; + // item->valueint = (item->valueint + 15) / 16 * 16; //printf("%s:active_height %p\n",__func__,item); if(item != NULL) { dev_info[0].video_width[3] = item->valueint; - wds2Info->ds2_size.width = item->valueint; + wds2Info->ds2_size.width = (item->valueint + 15) / 16 * 16; ds2Info->ds_out_size.width = wds2Info->ds2_size.width; //printf("cJSON_GetObjectItem: type=%d, string is %s, valueint is %d\n",item->type,item->string,item->valueint); } @@ -389,12 +389,12 @@ void doit_video_cfg(char *text,struct vi_cfg_info *vi_cfg,struct sensor_info *se //sensor1_active_size object=cJSON_GetArrayItem(arrayItem,i++); item=cJSON_GetObjectItem(object,"sensor1_active_width"); - item->valueint = (item->valueint + 15) / 16 * 16; + // item->valueint = (item->valueint + 15) / 16 * 16; //printf("%s:active_width %p\n",__func__,item); if(item != NULL) { - itcInfo->itc_size.width = item->valueint; - vi_cfg->vi_pipe_cfg[3].in_size.width = item->valueint; + itcInfo->itc_size.width = (item->valueint + 15) / 16 * 16; + vi_cfg->vi_pipe_cfg[3].in_size.width = (item->valueint + 15) / 16 * 16; //printf("cJSON_GetObjectItem: type=%d, string is %s, valueint is %d\n",item->type,item->string,item->valueint); } @@ -422,12 +422,12 @@ void doit_video_cfg(char *text,struct vi_cfg_info *vi_cfg,struct sensor_info *se } item=cJSON_GetObjectItem(object,"video6_width"); - item->valueint = (item->valueint + 15) / 16 * 16; + // item->valueint = (item->valueint + 15) / 16 * 16; //printf("%s:active_height %p\n",__func__,item); if(item != NULL) { dev_info[1].video_width[0] = item->valueint; - mainInfo->main_size.width = item->valueint; + mainInfo->main_size.width = (item->valueint + 15) / 16 * 16; otcInfo->otc_out_size.width = mainInfo->main_size.width; dsInSizeInfo->width = mainInfo->main_size.width; //printf("cJSON_GetObjectItem: type=%d, string is %s, valueint is %d\n",item->type,item->string,item->valueint); @@ -470,12 +470,12 @@ void doit_video_cfg(char *text,struct vi_cfg_info *vi_cfg,struct sensor_info *se } item=cJSON_GetObjectItem(object,"video7_width"); - item->valueint = (item->valueint + 15) / 16 * 16; + // item->valueint = (item->valueint + 15) / 16 * 16; //printf("%s:active_height %p\n",__func__,item); if(item != NULL) { dev_info[1].video_width[1] = item->valueint; - wds0Info->ds0_size.width = item->valueint; + wds0Info->ds0_size.width = (item->valueint + 15) / 16 * 16; ds0Info->ds_out_size.width = wds0Info->ds0_size.width; //printf("cJSON_GetObjectItem: type=%d, string is %s, valueint is %d\n",item->type,item->string,item->valueint); } @@ -516,12 +516,12 @@ void doit_video_cfg(char *text,struct vi_cfg_info *vi_cfg,struct sensor_info *se } item=cJSON_GetObjectItem(object,"video8_width"); - item->valueint = (item->valueint + 15) / 16 * 16; + // item->valueint = (item->valueint + 15) / 16 * 16; //printf("%s:active_height %p\n",__func__,item); if(item != NULL) { dev_info[1].video_width[2] = item->valueint; - wds1Info->ds1_size.width = item->valueint; + wds1Info->ds1_size.width = (item->valueint + 15) / 16 * 16; ds1Info->ds_out_size.width = wds1Info->ds1_size.width; //printf("cJSON_GetObjectItem: type=%d, string is %s, valueint is %d\n",item->type,item->string,item->valueint); } @@ -562,11 +562,11 @@ void doit_video_cfg(char *text,struct vi_cfg_info *vi_cfg,struct sensor_info *se } item=cJSON_GetObjectItem(object,"video9_width"); - item->valueint = (item->valueint + 15) / 16 * 16; + // item->valueint = (item->valueint + 15) / 16 * 16; //printf("%s:active_height %p\n",__func__,item); if(item != NULL) { - wds2Info->ds2_size.width = item->valueint; + wds2Info->ds2_size.width = (item->valueint + 15) / 16 * 16; ds2Info->ds_out_size.width = wds2Info->ds2_size.width; dev_info[1].video_width[3] = item->valueint; //printf("cJSON_GetObjectItem: type=%d, string is %s, valueint is %d\n",item->type,item->string,item->valueint); @@ -6009,6 +6009,7 @@ void doit_isp(char *text,struct isp_cfg_info *isp_cfg) //ldc object=cJSON_GetArrayItem(arrayItem,14); parse_ldc(object,&isp_core_cfg->ldcInfo); + isp_wrap_cfg->ldcInfo.ldc_en = isp_core_cfg->ldcInfo.ldc_en; //af object=cJSON_GetArrayItem(arrayItem,15); parse_af(object,&isp_core_cfg->afInfo); diff --git a/package/mediactl_lib/src/lib3actl.so b/package/mediactl_lib/src/lib3actl.so new file mode 100755 index 0000000..2a5eee7 Binary files /dev/null and b/package/mediactl_lib/src/lib3actl.so differ diff --git a/package/mediactl_lib/src/libadaptive.so b/package/mediactl_lib/src/libadaptive.so new file mode 100755 index 0000000..0e0d3b6 Binary files /dev/null and b/package/mediactl_lib/src/libadaptive.so differ diff --git a/package/mediactl_lib/src/linux/canaan-camera-module.h b/package/mediactl_lib/src/linux/canaan-camera-module.h new file mode 100755 index 0000000..e1ae2db --- /dev/null +++ b/package/mediactl_lib/src/linux/canaan-camera-module.h @@ -0,0 +1,97 @@ +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#ifndef _CANAAN_CAMERA_MODULE__H +#define _CANAAN_CAMERA_MODULE__H + +#include + +#define CNMODULE_NAME_LEN 64 + +#define CANAANMODULE_CAMERA_MODULE_INDEX "canaanchip,camera-module-index" +#define CANAANMODULE_CAMERA_MODULE_FACING "canaanchip,camera-module-facing" +#define CANAANMODULE_CAMERA_MODULE_NAME "canaanchip,camera-module-name" +#define CANAANMODULE_CAMERA_LENS_NAME "canaanchip,camera-module-lens-name" + + +#define CNMODULE_GET_MODULE_INFO \ + _IOR('V', BASE_VIDIOC_PRIVATE + 0, struct cnmodule_inf) + +#define CNMODULE_NORMAL_AE_EXP_CFG \ + _IOW('V', BASE_VIDIOC_PRIVATE + 1, struct cnmodule_normal_ae_cfg) + +#define CNMODULE_HDR_AE_EXP_CFG \ + _IOW('V', BASE_VIDIOC_PRIVATE + 2, struct cnmodule_hdr_ae_cfg) + +#define CNMODULE_GET_HDR_CFG \ + _IOR('V', BASE_VIDIOC_PRIVATE + 3, struct cnmodule_hdr_cfg) + +#define CNMODULE_SET_HDR_CFG \ + _IOW('V', BASE_VIDIOC_PRIVATE + 4, struct cnmodule_hdr_cfg) + + + +/** + * struct cnmodule_base_inf - module base information + * + */ +struct cnmodule_base_inf { + char sensor[CNMODULE_NAME_LEN]; + char module[CNMODULE_NAME_LEN]; + char lens[CNMODULE_NAME_LEN]; +}; + +/** + * struct cnmodule_inf - module information + * + */ +struct cnmodule_inf { + struct cnmodule_base_inf base; + //struct cnmodule_fac_inf fac; + //struct cnmodule_awb_inf awb; + //struct cnmodule_lsc_inf lsc; + //struct cnmodule_af_inf af; +}; + +/** + * struct cnmodule_hdr_ae_exp_cfg + * + */ +struct cnmodule_normal_ae_cfg { + __u32 exp_val; + __u32 gain_val; +}; + +/** + * struct cnmodule_hdr_ae_exp_cfg + * + */ +struct cnmodule_hdr_ae_cfg { + __u32 long_exp_val; + __u32 long_gain_val; + __u32 middle_exp_val; + __u32 middle_gain_val; + __u32 short_exp_val; + __u32 short_gain_val; +}; + +struct cnmodule_hdr_cfg { + __u32 hdr_mode; +}; + +/** + * NO_HDR: linear mode + * HDR_X2: hdr two frame mode + * HDR_X3: hdr three frame mode + */ +enum cnmodule_hdr_mode { + NO_HDR = 0, + HDR_X2 = 1, + HDR_X3 = 2, +}; + +#endif /* _CANAAN_CAMERA_MODULE__H */ diff --git a/package/mediactl_lib/src/linux/k510isp.h b/package/mediactl_lib/src/linux/k510isp.h index b1f585e..ddbf175 100644 --- a/package/mediactl_lib/src/linux/k510isp.h +++ b/package/mediactl_lib/src/linux/k510isp.h @@ -56,7 +56,7 @@ #define VIDIOC_K510ISP_F2K_REMAP_OUT1_CFG \ _IOWR('V', BASE_VIDIOC_PRIVATE + 7,struct isp_remap_cfg_info) #define VIDIOC_K510ISP_F2K_FBCD_CFG \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 8,struct isp_remap_cfg_info) + _IOWR('V', BASE_VIDIOC_PRIVATE + 8,struct isp_remap_cfg_info) #define VIDIOC_K510ISP_R2K_WRAP_CFG \ _IOWR('V', BASE_VIDIOC_PRIVATE + 9,struct isp_wrap_cfg_info) #define VIDIOC_K510ISP_R2K_CORE_CFG \ @@ -114,7 +114,7 @@ #define VIDIOC_K510ISP_F2K_CORE_CFG_GET \ _IOWR('V', BASE_VIDIOC_PRIVATE + 36,struct isp_core_cfg_info) #define VIDIOC_K510ISP_R2K_CORE_CFG_GET \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 37,struct isp_core_cfg_info) + _IOWR('V', BASE_VIDIOC_PRIVATE + 37,struct isp_core_cfg_info) #define VIDIOC_K510ISP_SYSCTL_RST_CSI \ _IOWR('V', BASE_VIDIOC_PRIVATE + 38,unsigned long) #define VIDIOC_K510ISP_SYSCTL_RST_VI \ @@ -123,18 +123,14 @@ _IOWR('V', BASE_VIDIOC_PRIVATE + 40,unsigned long) #define VIDIOC_K510ISP_SYSCTL_RST_R2K \ _IOWR('V', BASE_VIDIOC_PRIVATE + 41,unsigned long) -#define VIDIOC_K510ISP_F2K_AWB_VAL_GET \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 42, struct k510isp_awb_sync_info) -#define VIDIOC_K510ISP_R2K_AWB_VAL_SET \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 43, struct k510isp_awb_sync_info) #define VIDIOC_K510ISP_F2K_CORE_REG_SET \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 44, struct k510isp_reg_val) + _IOWR('V', BASE_VIDIOC_PRIVATE + 42, struct k510isp_reg_val) #define VIDIOC_K510ISP_F2K_CORE_REG_GET \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 45, struct k510isp_reg_val) + _IOWR('V', BASE_VIDIOC_PRIVATE + 43, struct k510isp_reg_val) #define VIDIOC_K510ISP_R2K_CORE_REG_SET \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 46, struct k510isp_reg_val) + _IOWR('V', BASE_VIDIOC_PRIVATE + 44, struct k510isp_reg_val) #define VIDIOC_K510ISP_R2K_CORE_REG_GET \ - _IOWR('V', BASE_VIDIOC_PRIVATE + 47, struct k510isp_reg_val) + _IOWR('V', BASE_VIDIOC_PRIVATE + 45, struct k510isp_reg_val) // /* * Events @@ -197,7 +193,7 @@ struct k510isp_awb_sync_info { struct k510isp_awb_stats{ // __u32 bfb_pos;//Blue hist value of AWB in feedback mode - __u32 bfb_pot;//Blue hist pixels of AWB in feedback mode + __u32 bfb_pot;//Blue hist pixels of AWB in feedback mode __u32 rfb_pos;//Red hist value of AWB in feedback mode __u32 rfb_pot;//Red hist pixels of AWB in feedback mode // @@ -315,4 +311,4 @@ struct k510isp_reg_val { __u32 reg_addr; __u32 reg_value; }; -#endif \ No newline at end of file +#endif diff --git a/package/mediactl_lib/src/media_ctl.c b/package/mediactl_lib/src/media_ctl.c index c71ce8b..b91f422 100644 --- a/package/mediactl_lib/src/media_ctl.c +++ b/package/mediactl_lib/src/media_ctl.c @@ -59,14 +59,21 @@ #include "linux/k510isp.h" #include "isp/json_parse.h" -#define MEDIA_DEVICE "/dev/media0" -#define ENTITY_DPHY "K510 ISP DPHY" -#define ENTITY_CSI2 "K510 ISP CSI2" -#define ENTITY_VI "K510 ISP VI" -#define ENTITY_F2K "K510 ISP F2K" -#define ENTITY_R2K "K510 ISP R2K" - -// share memory +#include "adaptive/adaptive_user_func.h" +#include "adaptive/adaptive_params.h" +#include "3a_ctl/ae_ctl.h" +#include "3a_ctl/ae_cfg_param.h" + +#include "linux/canaan-camera-module.h" + +#define MEDIA_DEVICE "/dev/media0" +#define ENTITY_DPHY "K510 ISP DPHY" +#define ENTITY_CSI2 "K510 ISP CSI2" +#define ENTITY_VI "K510 ISP VI" +#define ENTITY_F2K "K510 ISP F2K" +#define ENTITY_R2K "K510 ISP R2K" + +// share memory struct share_memory_alloc_align_args { uint32_t size; uint32_t alignment; @@ -85,68 +92,87 @@ int fd_mem_map = -1; #define SHARE_MEMORY_DEV "/dev/k510-share-memory" #define MAP_MEMORY_DEV "/dev/mem" int *virtual_addr[MEMORY_TEST_BLOCK_NUM]= {0}; -bool DualCamera_Sync = TRUE; -bool Sensor1_Sync = FALSE; -bool Awb_Sync_Init = TRUE; - - +// bool DualCamera_Sync = TRUE; +// bool Sensor1_Sync = FALSE; +// bool Awb_Sync_Init = TRUE; + +/* hw/sw ae scl */ +bool ae_hw_set_f2k = FALSE; +bool ae_hw_set_r2k = FALSE; +typedef int (* __mediactl_pfunc)(enum isp_pipeline_e); +__mediactl_pfunc mediactl_all_set_ae = mediactl_sw_set_ae; + +/* ae ctl */ +extern bool Sensor1_Sync; +extern int AESmoothSteps; //将AE收敛分为9步完成,可设置, >=7 +extern int ETDelayFrameNumber[2]; //Sensor ET设置生效所需帧数 +extern struct ISP_AE_Parameters AE_Para_Inf[2]; +int anti_flicker_count = 0; +AE_CTL_AE_STAT_T ae_ctl_callback[2]; +AE_CTL_AE_STAT_T ae_ctl_callback_back[2]; +ADAPTIVE_ATTR_STAT_FLAG_U attr_page_flag_u[2]; +int ae_attr_set_et_count[2] = {0, 0}; +int ae_attr_set_gain_count[2] = {0, 0}; +/* adaptive */ +bool adaptive_enable_scl = TRUE; struct share_memory_alloc_align_args allocAlignMem[MEMORY_TEST_BLOCK_NUM] = {0}; // enum isp_pipeline { - ISP_F2K, - ISP_R2K, - ISP_3D, - NO_ISP, + ISP_F2K, + ISP_R2K, + ISP_3D, + NO_ISP, }; struct video_entity_info_s{ unsigned int used; char video_entity_name[50]; - struct image_size_s video_size; - unsigned int video_out_format; + struct image_size_s video_size; + unsigned int video_out_format; }; struct isp_pipeline_s{ - unsigned int pipeline_en; - char sensor_name[20]; - struct image_size_s total_size; + unsigned int pipeline_en; + char sensor_name[32]; + struct image_size_s total_size; struct image_size_s sensor_size; - struct v4l2_mbus_framefmt format_in; - struct v4l2_mbus_framefmt format_crop; - struct v4l2_mbus_framefmt format_out; - struct video_entity_info_s video_entity_info[4]; + struct v4l2_mbus_framefmt format_in; + struct v4l2_mbus_framefmt format_crop; + struct v4l2_mbus_framefmt format_out; + struct video_entity_info_s video_entity_info[4]; + unsigned int hdr_mode; }; struct v4l_isp_device { - struct isp_pipeline_s isp_pipeline[2]; - // - struct media_device *mdev; - struct media_entity *sensor0; - struct media_entity *sensor1; - struct media_entity *dphy; - struct media_entity *csi2; - struct media_entity *vi; - struct media_entity *f2k; - struct media_entity *r2k; - struct media_entity *video[10]; + struct isp_pipeline_s isp_pipeline[2]; + // + struct media_device *mdev; + struct media_entity *sensor0; + struct media_entity *sensor1; + struct media_entity *dphy; + struct media_entity *csi2; + struct media_entity *vi; + struct media_entity *f2k; + struct media_entity *r2k; + struct media_entity *video[10]; }; struct v4l_isp_device v4l_isp; /************************************************************************* * -*************************************************************************/ + *************************************************************************/ /** * @brief Construct a new isp entity init object - * - * @param isp + * + * @param isp */ static int isp_entity_init(struct v4l_isp_device *isp) { - struct media_entity *entity; + // struct media_entity *entity; unsigned int i; - /* + /* * Start by locating the three entities. The output video node is * located by looking for a devnode connected to the VI. */ @@ -160,673 +186,668 @@ static int isp_entity_init(struct v4l_isp_device *isp) } } - if( isp->isp_pipeline[ISP_R2K].pipeline_en == 1) - { - isp->sensor1 = media_get_entity_by_name(isp->mdev,isp->isp_pipeline[ISP_R2K].sensor_name, - strlen(isp->isp_pipeline[ISP_R2K].sensor_name)); - if (isp->sensor1 == NULL) { - printf("%s error: unable to locate sensor1.\n",__func__); - return -ENOENT; - } - } + if( isp->isp_pipeline[ISP_R2K].pipeline_en == 1) + { + isp->sensor1 = media_get_entity_by_name(isp->mdev,isp->isp_pipeline[ISP_R2K].sensor_name, + strlen(isp->isp_pipeline[ISP_R2K].sensor_name)); + if (isp->sensor1 == NULL) { + printf("%s error: unable to locate sensor1.\n",__func__); + return -ENOENT; + } + } - isp->csi2 = media_get_entity_by_name(isp->mdev, ENTITY_CSI2, - strlen(ENTITY_CSI2)); - if (isp->csi2 == NULL) { - printf("%s error: unable to locate CSI2.\n",__func__); - return -ENOENT; - } + isp->csi2 = media_get_entity_by_name(isp->mdev, ENTITY_CSI2, + strlen(ENTITY_CSI2)); + if (isp->csi2 == NULL) { + printf("%s error: unable to locate CSI2.\n",__func__); + return -ENOENT; + } - isp->vi = media_get_entity_by_name(isp->mdev, ENTITY_VI, - strlen(ENTITY_VI)); - if (isp->vi == NULL) { - printf("%s error: unable to locate VI.\n",__func__); - return -ENOENT; - } + isp->vi = media_get_entity_by_name(isp->mdev, ENTITY_VI, + strlen(ENTITY_VI)); + if (isp->vi == NULL) { + printf("%s error: unable to locate VI.\n",__func__); + return -ENOENT; + } - isp->f2k = media_get_entity_by_name(isp->mdev, ENTITY_F2K, - strlen(ENTITY_F2K)); - if (isp->f2k == NULL) { - printf("%s error: unable to locate F2K.\n",__func__); - return -ENOENT; - } + isp->f2k = media_get_entity_by_name(isp->mdev, ENTITY_F2K, + strlen(ENTITY_F2K)); + if (isp->f2k == NULL) { + printf("%s error: unable to locate F2K.\n",__func__); + return -ENOENT; + } - isp->r2k = media_get_entity_by_name(isp->mdev, ENTITY_R2K, - strlen(ENTITY_R2K)); - if (isp->r2k == NULL) { - printf("%s error: unable to locate R2K.\n",__func__); - return -ENOENT; - } - return 0; + isp->r2k = media_get_entity_by_name(isp->mdev, ENTITY_R2K, + strlen(ENTITY_R2K)); + if (isp->r2k == NULL) { + printf("%s error: unable to locate R2K.\n",__func__); + return -ENOENT; + } + return 0; } /** - * @brief - * - * @param isp - * @return int + * @brief + * + * @param isp + * @return int */ static int isp_f2k_video_init(struct v4l_isp_device *isp) { - struct media_entity *entity; - unsigned int i; - unsigned int j; - - struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_F2K]; - for(j = 0;j<4;j++) - { - //printf("%s:%d,%s\n",__func__,isp_pipeline->video_entity_info[j].used,isp_pipeline->video_entity_info[j].video_entity_name); - if(isp_pipeline->video_entity_info[j].used == 1) - { - isp->video[j+2] = media_get_entity_by_name(isp->mdev,isp_pipeline->video_entity_info[j].video_entity_name, - strlen(isp_pipeline->video_entity_info[j].video_entity_name)); - if (isp->video[j+2] == NULL) { - printf("%s error: unable to locate video.\n",__func__); - return -ENOENT; - } - //printf("%s:video entity (0x%x):locate entities OK!\n",__func__,isp->video[j+2]); - - //F2K - for (i = 0; i < isp->f2k->info.links+1; ++i) { - //printf("links[%d]:0x%x,sink:0x%x,source:0x%x\n",i,isp->f2k->links[i],isp->f2k->links[i].sink,isp->f2k->links[i].source); - entity = isp->f2k->links[i].sink->entity; - //printf("%s:%d,media_entity_type:0x%x,0x%x\n",__func__,i,media_entity_type(entity),entity); - if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) - { - //printf("%s:MEDIA_ENT_T_DEVNODE\n",__func__); - if(entity == isp->video[j+2]) - { - printf("%s:entity(0x%x)isp->video(0x%x)\n",__func__,entity,isp->video[j+2]); - break; - } - } - } + struct media_entity *entity; + unsigned int i; + unsigned int j; + + struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_F2K]; + for(j = 0;j<4;j++) + { + //printf("%s:%d,%s\n",__func__,isp_pipeline->video_entity_info[j].used,isp_pipeline->video_entity_info[j].video_entity_name); + if(isp_pipeline->video_entity_info[j].used == 1) + { + isp->video[j+2] = media_get_entity_by_name(isp->mdev,isp_pipeline->video_entity_info[j].video_entity_name, + strlen(isp_pipeline->video_entity_info[j].video_entity_name)); + if (isp->video[j+2] == NULL) { + printf("%s error: unable to locate video.\n",__func__); + return -ENOENT; + } + //printf("%s:video entity (0x%x):locate entities OK!\n",__func__,isp->video[j+2]); + + //F2K + for (i = 0; i < isp->f2k->info.links+1; ++i) { + //printf("links[%d]:0x%x,sink:0x%x,source:0x%x\n",i,isp->f2k->links[i],isp->f2k->links[i].sink,isp->f2k->links[i].source); + entity = isp->f2k->links[i].sink->entity; + //printf("%s:%d,media_entity_type:0x%x,0x%x\n",__func__,i,media_entity_type(entity),entity); + if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) + { + //printf("%s:MEDIA_ENT_T_DEVNODE\n",__func__); + if(entity == isp->video[j+2]) + { + printf("%s:entity(0x%x)isp->video(0x%x)\n",__func__,entity,isp->video[j+2]); + break; + } + } + } - if (i == isp->f2k->info.links+1) { //2 - printf("%s error: unable to locate F2K output video node.\n",__func__); - return -ENOENT; - } + if (i == isp->f2k->info.links+1) { //2 + printf("%s error: unable to locate F2K output video node.\n",__func__); + return -ENOENT; + } - isp->video[j+2] = entity; - } - } - return 0; + isp->video[j+2] = entity; + } + } + return 0; } /** - * @brief - * - * @param isp - * @return int + * @brief + * + * @param isp + * @return int */ static int isp_r2k_video_init(struct v4l_isp_device *isp) { - struct media_entity *entity; - unsigned int i; - unsigned int j; - - struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_R2K]; - for(j = 0;j<4;j++) - { - if(isp_pipeline->video_entity_info[j].used == 1) - { - isp->video[j+6] = media_get_entity_by_name(isp->mdev,isp_pipeline->video_entity_info[j].video_entity_name, - strlen(isp_pipeline->video_entity_info[j].video_entity_name)); - if (isp->video[j+6] == NULL) { - printf("%s error: unable to locate video.\n",__func__); - return -ENOENT; - } - //printf("%s:video entity (0x%x):locate entities OK!\n",__func__,isp->video[j+6]); - - //R2K - for (i = 0; i < isp->r2k->info.links+1; ++i) { - //printf("links[%d]:0x%x,sink:0x%x,source:0x%x\n",i,isp->r2k->links[i],isp->r2k->links[i].sink,isp->r2k->links[i].source); - entity = isp->r2k->links[i].sink->entity; - //printf("%s:%d,media_entity_type:0x%x,0x%x\n",__func__,i,media_entity_type(entity),entity); - if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) - { - //printf("%s:MEDIA_ENT_T_DEVNODE\n",__func__); - if(entity == isp->video[j+6]) - { - printf("%s:entity(0x%x)isp->video(0x%x)\n",__func__,entity,isp->video[j+6]); - break; - } - } - } + struct media_entity *entity; + unsigned int i; + unsigned int j; + + struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_R2K]; + for(j = 0;j<4;j++) + { + if(isp_pipeline->video_entity_info[j].used == 1) + { + isp->video[j+6] = media_get_entity_by_name(isp->mdev,isp_pipeline->video_entity_info[j].video_entity_name, + strlen(isp_pipeline->video_entity_info[j].video_entity_name)); + if (isp->video[j+6] == NULL) { + printf("%s error: unable to locate video.\n",__func__); + return -ENOENT; + } + //printf("%s:video entity (0x%x):locate entities OK!\n",__func__,isp->video[j+6]); + + //R2K + for (i = 0; i < isp->r2k->info.links+1; ++i) { + //printf("links[%d]:0x%x,sink:0x%x,source:0x%x\n",i,isp->r2k->links[i],isp->r2k->links[i].sink,isp->r2k->links[i].source); + entity = isp->r2k->links[i].sink->entity; + //printf("%s:%d,media_entity_type:0x%x,0x%x\n",__func__,i,media_entity_type(entity),entity); + if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) + { + //printf("%s:MEDIA_ENT_T_DEVNODE\n",__func__); + if(entity == isp->video[j+6]) + { + printf("%s:entity(0x%x)isp->video(0x%x)\n",__func__,entity,isp->video[j+6]); + break; + } + } + } - if (i == isp->r2k->info.links+1) { //2 - printf("%s error: unable to locate R2K output video node.\n",__func__); - return -ENOENT; - } + if (i == isp->r2k->info.links+1) { //2 + printf("%s error: unable to locate R2K output video node.\n",__func__); + return -ENOENT; + } - isp->video[j+6] = entity; - } - } + isp->video[j+6] = entity; + } + } - return 0; + return 0; } /** - * @brief - * - * @param isp - * @return int + * @brief + * + * @param isp + * @return int */ static int isp_setup_link(struct v4l_isp_device *isp) { - int ret; + int ret = 0; /* Enable the Sensor->vi->f2k -> memory links. */ - // printf("isp->csi2->pads[CSI2_PAD_SOURCE0] =0x%x,&isp->vi->pads[VI_PAD_SINK_CSI0] =0x%x\n\n",&isp->csi2->pads[CSI2_PAD_SOURCE1],&isp->vi->pads[VI_PAD_SINK_CSI1]); - ret = media_setup_link(isp->mdev, &isp->csi2->pads[CSI2_PAD_SOURCE0], - &isp->vi->pads[VI_PAD_SINK_CSI0], MEDIA_LNK_FL_ENABLED); - if (ret < 0) { - printf("%s error: unable to setup csi2 -> vi link.\n",__func__); - return ret; - } + // printf("isp->csi2->pads[CSI2_PAD_SOURCE0] =0x%x,&isp->vi->pads[VI_PAD_SINK_CSI0] =0x%x\n\n",&isp->csi2->pads[CSI2_PAD_SOURCE1],&isp->vi->pads[VI_PAD_SINK_CSI1]); + ret = media_setup_link(isp->mdev, &isp->csi2->pads[CSI2_PAD_SOURCE0], + &isp->vi->pads[VI_PAD_SINK_CSI0], MEDIA_LNK_FL_ENABLED); + if (ret < 0) { + printf("%s error: unable to setup csi2 -> vi link.\n",__func__); + return ret; + } - //printf("isp->csi2->pads[CSI2_PAD_SOURCE1] =0x%x,&isp->vi->pads[VI_PAD_SINK_CSI1] =0x%x\n\n",&isp->csi2->pads[CSI2_PAD_SOURCE0],&isp->vi->pads[VI_PAD_SINK_CSI0]); - ret = media_setup_link(isp->mdev, &isp->csi2->pads[CSI2_PAD_SOURCE1], - &isp->vi->pads[VI_PAD_SINK_CSI1], MEDIA_LNK_FL_ENABLED); - if (ret < 0) { - printf("%s error: unable to setup csi2 -> vi link.\n",__func__); - return ret; - } + //printf("isp->csi2->pads[CSI2_PAD_SOURCE1] =0x%x,&isp->vi->pads[VI_PAD_SINK_CSI1] =0x%x\n\n",&isp->csi2->pads[CSI2_PAD_SOURCE0],&isp->vi->pads[VI_PAD_SINK_CSI0]); + ret = media_setup_link(isp->mdev, &isp->csi2->pads[CSI2_PAD_SOURCE1], + &isp->vi->pads[VI_PAD_SINK_CSI1], MEDIA_LNK_FL_ENABLED); + if (ret < 0) { + printf("%s error: unable to setup csi2 -> vi link.\n",__func__); + return ret; + } - //printf("%s:isp->sensor0->pads[0] =0x%x,&isp->csi2->pads[CSI2_PAD_SINK0] =0x%x\n",__func__,&isp->sensor0->pads[0],&isp->csi2->pads[CSI2_PAD_SINK0]); - if( isp->isp_pipeline[ISP_F2K].pipeline_en == 1) - { - ret = media_setup_link(isp->mdev, &isp->sensor0->pads[0], - &isp->csi2->pads[CSI2_PAD_SINK0], MEDIA_LNK_FL_ENABLED); - if (ret < 0) { - printf("%s error: unable to setup sensor0 -> csi2 link.\n",__func__); - return ret; - } + //printf("%s:isp->sensor0->pads[0] =0x%x,&isp->csi2->pads[CSI2_PAD_SINK0] =0x%x\n",__func__,&isp->sensor0->pads[0],&isp->csi2->pads[CSI2_PAD_SINK0]); + if( isp->isp_pipeline[ISP_F2K].pipeline_en == 1) + { + ret = media_setup_link(isp->mdev, &isp->sensor0->pads[0], + &isp->csi2->pads[CSI2_PAD_SINK0], MEDIA_LNK_FL_ENABLED); + if (ret < 0) { + printf("%s error: unable to setup sensor0 -> csi2 link.\n",__func__); + return ret; + } - //printf("isp->vi->pads[VI_PAD_SOURCE_F2K] =0x%x,&isp->f2k->pads[ISP_F2K_PAD_SINK] =0x%x\n\n",&isp->vi->pads[VI_PAD_SOURCE_F2K],&isp->f2k->pads[ISP_F2K_PAD_SINK]); - ret = media_setup_link(isp->mdev, &isp->vi->pads[VI_PAD_SOURCE_F2K], - &isp->f2k->pads[ISP_F2K_PAD_SINK], MEDIA_LNK_FL_ENABLED); - if (ret < 0) { - printf("%s error: unable to setup vi -> f2k link.\n",__func__); - return ret; - } - } + //printf("isp->vi->pads[VI_PAD_SOURCE_F2K] =0x%x,&isp->f2k->pads[ISP_F2K_PAD_SINK] =0x%x\n\n",&isp->vi->pads[VI_PAD_SOURCE_F2K],&isp->f2k->pads[ISP_F2K_PAD_SINK]); + ret = media_setup_link(isp->mdev, &isp->vi->pads[VI_PAD_SOURCE_F2K], + &isp->f2k->pads[ISP_F2K_PAD_SINK], MEDIA_LNK_FL_ENABLED); + if (ret < 0) { + printf("%s error: unable to setup vi -> f2k link.\n",__func__); + return ret; + } + } - if( isp->isp_pipeline[ISP_R2K].pipeline_en == 1) - { - //printf("isp->sensor1->pads[0] =0x%x,&isp->csi2->pads[CSI2_PAD_SINK1] =0x%x\n",&isp->sensor1->pads[0],&isp->csi2->pads[CSI2_PAD_SINK1]); - ret = media_setup_link(isp->mdev, &isp->sensor1->pads[0], - &isp->csi2->pads[CSI2_PAD_SINK1], MEDIA_LNK_FL_ENABLED); - if (ret < 0) { - printf("%s error: unable to setup sensor1 -> csi2 link.\n",__func__); - return ret; - } + if( isp->isp_pipeline[ISP_R2K].pipeline_en == 1) + { + //printf("isp->sensor1->pads[0] =0x%x,&isp->csi2->pads[CSI2_PAD_SINK1] =0x%x\n",&isp->sensor1->pads[0],&isp->csi2->pads[CSI2_PAD_SINK1]); + ret = media_setup_link(isp->mdev, &isp->sensor1->pads[0], + &isp->csi2->pads[CSI2_PAD_SINK1], MEDIA_LNK_FL_ENABLED); + if (ret < 0) { + printf("%s error: unable to setup sensor1 -> csi2 link.\n",__func__); + return ret; + } - //printf("isp->vi->pads[VI_PAD_SOURCE_R2K] =0x%x,&isp->r2k->pads[ISP_R2K_PAD_SINK] =0x%x\n\n",&isp->vi->pads[VI_PAD_SOURCE_R2K],&isp->r2k->pads[ISP_R2K_PAD_SINK]); - ret = media_setup_link(isp->mdev, &isp->vi->pads[VI_PAD_SOURCE_R2K], - &isp->r2k->pads[ISP_R2K_PAD_SINK], MEDIA_LNK_FL_ENABLED); - if (ret < 0) { - printf("%s error: unable to setup vi -> r2k link.\n",__func__); - return ret; - } - } - return 0; + //printf("isp->vi->pads[VI_PAD_SOURCE_R2K] =0x%x,&isp->r2k->pads[ISP_R2K_PAD_SINK] =0x%x\n\n",&isp->vi->pads[VI_PAD_SOURCE_R2K],&isp->r2k->pads[ISP_R2K_PAD_SINK]); + ret = media_setup_link(isp->mdev, &isp->vi->pads[VI_PAD_SOURCE_R2K], + &isp->r2k->pads[ISP_R2K_PAD_SINK], MEDIA_LNK_FL_ENABLED); + if (ret < 0) { + printf("%s error: unable to setup vi -> r2k link.\n",__func__); + return ret; + } + } + return 0; } /** - * @brief - * - * @param isp - * @param source_pad - * @return int + * @brief + * + * @param isp + * @param source_pad + * @return int */ static int isp_f2k_video_link(struct v4l_isp_device *isp) { - int ret; - unsigned int i = 0; - struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_F2K]; + int ret; + unsigned int i = 0; + struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_F2K]; - for(i = 0; i< 4; i++) - { - if(isp_pipeline->video_entity_info[i].used == 1) - { - ret = media_setup_link(isp->mdev, &isp->f2k->pads[ISP_F2K_PAD_MAIN_SOURCE + i], - &isp->video[i+2]->pads[0], MEDIA_LNK_FL_ENABLED); - if (ret < 0) { - printf("%s error: unable to setup F2K -> devnode link.\n",__func__); - return ret; - } - } - } - printf("%s:media_setup_link setup!\n",__func__); - return 0; + for(i = 0; i< 4; i++) + { + if(isp_pipeline->video_entity_info[i].used == 1) + { + ret = media_setup_link(isp->mdev, &isp->f2k->pads[ISP_F2K_PAD_MAIN_SOURCE + i], + &isp->video[i+2]->pads[0], MEDIA_LNK_FL_ENABLED); + if (ret < 0) { + printf("%s error: unable to setup F2K -> devnode link.\n",__func__); + return ret; + } + } + } + printf("%s:media_setup_link setup!\n",__func__); + return 0; } /** - * @brief - * - * @param isp - * @param source_pad - * @return int + * @brief + * + * @param isp + * @param source_pad + * @return int */ static int isp_r2k_video_link(struct v4l_isp_device *isp) { - int ret; - unsigned int i = 0; - struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_R2K]; + int ret; + unsigned int i = 0; + struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_R2K]; - for(i = 0; i< 4; i++) - { - if(isp_pipeline->video_entity_info[i].used == 1) - { - ret = media_setup_link(isp->mdev, &isp->r2k->pads[ISP_R2K_PAD_MAIN_SOURCE + i], - &isp->video[i+6]->pads[0], MEDIA_LNK_FL_ENABLED); - if (ret < 0) { - printf("%s error: unable to setup R2K -> devnode link.\n",__func__); - return ret; - } - } - } - printf("%s:media_setup_link setup!\n",__func__); - return 0; + for(i = 0; i< 4; i++) + { + if(isp_pipeline->video_entity_info[i].used == 1) + { + ret = media_setup_link(isp->mdev, &isp->r2k->pads[ISP_R2K_PAD_MAIN_SOURCE + i], + &isp->video[i+6]->pads[0], MEDIA_LNK_FL_ENABLED); + if (ret < 0) { + printf("%s error: unable to setup R2K -> devnode link.\n",__func__); + return ret; + } + } + } + printf("%s:media_setup_link setup!\n",__func__); + return 0; } /** - * @brief - * - * @param isp - * @return int + * @brief + * + * @param isp + * @return int * Configure formats. Retrieve the default format at the sensor output * and propagate it through the pipeline. As the VI will not perform * any cropping we can just apply the same format on all pads. * struct v4l2_mbus_framefmt { - * __u32 width; - * __u32 height; - * __u32 code; - * __u32 field; - * __u32 colorspace; - * __u16 ycbcr_enc; - * __u16 quantization; - * __u16 xfer_func; - * __u16 reserved[11]; - * }; + * __u32 width; + * __u32 height; + * __u32 code; + * __u32 field; + * __u32 colorspace; + * __u16 ycbcr_enc; + * __u16 quantization; + * __u16 xfer_func; + * __u16 reserved[11]; + * }; */ static int isp_f2k_set_format(struct v4l_isp_device *isp) { - struct v4l2_mbus_framefmt format; - struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_F2K]; - int ret; - unsigned int i = 0; - //sensor - ret = v4l2_subdev_get_format(isp->sensor0, &format, 0, - V4L2_SUBDEV_FORMAT_ACTIVE);//V4L2_SUBDEV_FORMAT_TRY); - if (ret < 0) { - printf("%s error: get format on sensor0 output failed.\n",__func__); - return ret; - } - //printf("%s :v4l2_subdev_set_format sensor(g) width:(%d),height:(%d)\n",__func__,format.width,format.height); - - memcpy(&isp_pipeline->format_in,&format,sizeof(struct v4l2_mbus_framefmt)); - isp_pipeline->format_in.width = isp_pipeline->sensor_size.width;//ACTIVE_WIDTH;//1080; - isp_pipeline->format_in.height = isp_pipeline->sensor_size.height;//ACTIVE_HEIGHT;//1920 - ret = v4l2_subdev_set_format(isp->sensor0, &isp_pipeline->format_in, 0, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n", - __func__,isp->sensor0->info.name, 0); - return ret; - } - //printf("%s:v4l2_subdev_set_format sensor(s) width:(%d),height:(%d),code:(0x%x)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height,isp_pipeline->format_in.code); - - //csi2 - ret = v4l2_subdev_set_format(isp->csi2, &isp_pipeline->format_in, CSI2_PAD_SINK0, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n",__func__, - isp->csi2->info.name, 1); - return ret; - } - //printf("%s:v4l2_subdev_set_format csi2(s) width:(%d),height:(%d),code:(0x%x)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height,isp_pipeline->format_in.code); + struct v4l2_mbus_framefmt format; + struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_F2K]; + int ret; + unsigned int i = 0; + //sensor + ret = v4l2_subdev_get_format(isp->sensor0, &format, 0, + V4L2_SUBDEV_FORMAT_ACTIVE);//V4L2_SUBDEV_FORMAT_TRY); + if (ret < 0) { + printf("%s error: get format on sensor0 output failed.\n",__func__); + return ret; + } + //printf("%s :v4l2_subdev_set_format sensor(g) width:(%d),height:(%d)\n",__func__,format.width,format.height); + + memcpy(&isp_pipeline->format_in,&format,sizeof(struct v4l2_mbus_framefmt)); + isp_pipeline->format_in.width = isp_pipeline->sensor_size.width;//ACTIVE_WIDTH;//1080; + isp_pipeline->format_in.height = isp_pipeline->sensor_size.height;//ACTIVE_HEIGHT;//1920 + ret = v4l2_subdev_set_format(isp->sensor0, &isp_pipeline->format_in, 0, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n", + __func__,isp->sensor0->info.name, 0); + return ret; + } + //printf("%s:v4l2_subdev_set_format sensor(s) width:(%d),height:(%d),code:(0x%x)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height,isp_pipeline->format_in.code); + + //csi2 + ret = v4l2_subdev_set_format(isp->csi2, &isp_pipeline->format_in, CSI2_PAD_SINK0, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n",__func__, + isp->csi2->info.name, 1); + return ret; + } + //printf("%s:v4l2_subdev_set_format csi2(s) width:(%d),height:(%d),code:(0x%x)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height,isp_pipeline->format_in.code); + + ret = v4l2_subdev_set_format(isp->csi2, &isp_pipeline->format_in, CSI2_PAD_SOURCE0, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n",__func__, + isp->csi2->info.name, 1); + return ret; + } + //printf("%s:v4l2_subdev_set_format csi2(s1) width:(%d),height:(%d)\n",__func__, + //isp_pipeline->format_in.width,isp_pipeline->format_in.height); + + //vi + ret = v4l2_subdev_set_format(isp->vi, &isp_pipeline->format_in, VI_PAD_SINK_CSI0, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n",__func__, + isp->vi->info.name, 1); + return ret; + } + //printf("%s:v4l2_subdev_set_format vi(s) width:(%d),height:(%d)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height); - ret = v4l2_subdev_set_format(isp->csi2, &isp_pipeline->format_in, CSI2_PAD_SOURCE0, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n",__func__, - isp->csi2->info.name, 1); - return ret; - } - //printf("%s:v4l2_subdev_set_format csi2(s1) width:(%d),height:(%d)\n",__func__, - //isp_pipeline->format_in.width,isp_pipeline->format_in.height); - //vi - ret = v4l2_subdev_set_format(isp->vi, &isp_pipeline->format_in, VI_PAD_SINK_CSI0, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n",__func__, - isp->vi->info.name, 1); - return ret; - } - //printf("%s:v4l2_subdev_set_format vi(s) width:(%d),height:(%d)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height); - + ret = v4l2_subdev_set_format(isp->vi, &isp_pipeline->format_in, VI_PAD_SOURCE_F2K, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n",__func__, + isp->vi->info.name, 1); + return ret; + } + //printf("%s:v4l2_subdev_set_format vi(s1) width:(%d),height:(%d)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height); - ret = v4l2_subdev_set_format(isp->vi, &isp_pipeline->format_in, VI_PAD_SOURCE_F2K, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n",__func__, - isp->vi->info.name, 1); - return ret; - } - //printf("%s:v4l2_subdev_set_format vi(s1) width:(%d),height:(%d)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height); + //isp_pipeline->format_in.code =MEDIA_BUS_FMT_SRGGB12_1X12;//MEDIA_BUS_FMT_SRGGB10_1X10; + ret = v4l2_subdev_set_format(isp->f2k, &isp_pipeline->format_in, ISP_F2K_PAD_SINK, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n",__func__, + isp->f2k->info.name, 1); + return ret; + } - //isp_pipeline->format_in.code =MEDIA_BUS_FMT_SRGGB12_1X12;//MEDIA_BUS_FMT_SRGGB10_1X10; - ret = v4l2_subdev_set_format(isp->f2k, &isp_pipeline->format_in, ISP_F2K_PAD_SINK, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n",__func__, - isp->f2k->info.name, 1); - return ret; - } + //printf("%s:v4l2_subdev_set_format isp(s) width:(%d),height:(%d)\n",__func__,isp->format_in.width,isp->format_in.height); + memcpy(&isp_pipeline->format_crop,&isp_pipeline->format_in,sizeof(struct v4l2_mbus_framefmt)); + //printf("%s:v4l2_subdev_set_format isp(s1) width:(%d),height:(%d)\n",__func__,isp->format_crop.width,isp->format_crop.height); + memcpy(&isp_pipeline->format_out,&isp_pipeline->format_crop,sizeof(struct v4l2_mbus_framefmt)); + //isp->format_out.width = isp->video_width;//VIDEO_WIDTH;//1080; + //isp->format_out.height = isp->video_height;//VIDEO_HEIGHT;//720; + for(i = 0; i < 4; i++) + { + //printf("%s:%d,%d\n",__func__,i,isp_pipeline->video_entity_info[i].used); + if(isp_pipeline->video_entity_info[i].used == 1) + { + isp_pipeline->format_out.width = isp_pipeline->video_entity_info[i].video_size.width;//VIDEO_WIDTH;//1080; + isp_pipeline->format_out.height = isp_pipeline->video_entity_info[i].video_size.height;//VIDEO_HEIGHT;//720; + if( isp_pipeline->video_entity_info[i].video_out_format == 1) + { + isp_pipeline->format_out.code = MEDIA_BUS_FMT_Y12_1X12; //MEDIA_BUS_FMT_UYVY8_1_5X8,MEDIA_BUS_FMT_VYUY8_1_5X8,MEDIA_BUS_FMT_YUYV8_1_5X8,MEDIA_BUS_FMT_YVYU8_1_5X8 + if(i == 3) + isp_pipeline->format_out.code = MEDIA_BUS_FMT_ARGB8888_1X32; + } + else + { + isp_pipeline->format_out.code = MEDIA_BUS_FMT_YUYV8_2X8;//MEDIA_BUS_FMT_YVYU8_2X8,MEDIA_BUS_FMT_UYVY8_1X16,MEDIA_BUS_FMT_YUYV8_1X16,MEDIA_BUS_FMT_YVYU8_1X16,MEDIA_BUS_FMT_VYUY8_1X16, + if(i == 3) + isp_pipeline->format_out.code = MEDIA_BUS_FMT_RGB888_1X24;//MEDIA_BUS_FMT_RBG888_1X24,MEDIA_BUS_FMT_BGR888_1X24,MEDIA_BUS_FMT_BGR888_3X8,MEDIA_BUS_FMT_GBR888_1X24,MEDIA_BUS_FMT_RGB888_1X24 + } - //printf("%s:v4l2_subdev_set_format isp(s) width:(%d),height:(%d)\n",__func__,isp->format_in.width,isp->format_in.height); - memcpy(&isp_pipeline->format_crop,&isp_pipeline->format_in,sizeof(struct v4l2_mbus_framefmt)); - //printf("%s:v4l2_subdev_set_format isp(s1) width:(%d),height:(%d)\n",__func__,isp->format_crop.width,isp->format_crop.height); - memcpy(&isp_pipeline->format_out,&isp_pipeline->format_crop,sizeof(struct v4l2_mbus_framefmt)); - //isp->format_out.width = isp->video_width;//VIDEO_WIDTH;//1080; - //isp->format_out.height = isp->video_height;//VIDEO_HEIGHT;//720; - for(i = 0; i < 4; i++) - { - //printf("%s:%d,%d\n",__func__,i,isp_pipeline->video_entity_info[i].used); - if(isp_pipeline->video_entity_info[i].used == 1) - { - isp_pipeline->format_out.width = isp_pipeline->video_entity_info[i].video_size.width;//VIDEO_WIDTH;//1080; - isp_pipeline->format_out.height = isp_pipeline->video_entity_info[i].video_size.height;//VIDEO_HEIGHT;//720; - if( isp_pipeline->video_entity_info[i].video_out_format == 1) - { - isp_pipeline->format_out.code = MEDIA_BUS_FMT_Y12_1X12; //MEDIA_BUS_FMT_UYVY8_1_5X8,MEDIA_BUS_FMT_VYUY8_1_5X8,MEDIA_BUS_FMT_YUYV8_1_5X8,MEDIA_BUS_FMT_YVYU8_1_5X8 - if(i == 3) - isp_pipeline->format_out.code = MEDIA_BUS_FMT_ARGB8888_1X32; - } - else - { - isp_pipeline->format_out.code = MEDIA_BUS_FMT_YUYV8_2X8;//MEDIA_BUS_FMT_YVYU8_2X8,MEDIA_BUS_FMT_UYVY8_1X16,MEDIA_BUS_FMT_YUYV8_1X16,MEDIA_BUS_FMT_YVYU8_1X16,MEDIA_BUS_FMT_VYUY8_1X16, - if(i == 3) - isp_pipeline->format_out.code = MEDIA_BUS_FMT_RGB888_1X24;//MEDIA_BUS_FMT_RBG888_1X24,MEDIA_BUS_FMT_BGR888_1X24,MEDIA_BUS_FMT_BGR888_3X8,MEDIA_BUS_FMT_GBR888_1X24,MEDIA_BUS_FMT_RGB888_1X24 - } + //printf("%s:isp_pipeline->format_out.width(%d),isp_pipeline->format_out.height(%d) isp_pipeline->format_out.code (0x%x)\n",__func__,isp_pipeline->format_out.width,isp_pipeline->format_out.height,isp_pipeline->format_out.code); + ret = v4l2_subdev_set_format(isp->f2k, &isp_pipeline->format_out,ISP_F2K_PAD_MAIN_SOURCE + i, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n",__func__, + isp->vi->info.name, 1); + return ret; + } + } + } - //printf("%s:isp_pipeline->format_out.width(%d),isp_pipeline->format_out.height(%d) isp_pipeline->format_out.code (0x%x)\n",__func__,isp_pipeline->format_out.width,isp_pipeline->format_out.height,isp_pipeline->format_out.code); - ret = v4l2_subdev_set_format(isp->f2k, &isp_pipeline->format_out,ISP_F2K_PAD_MAIN_SOURCE + i, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n",__func__, - isp->vi->info.name, 1); - return ret; - } - } - } - - return 0; + return 0; } /** - * @brief - * - * @param isp - * @return int + * @brief + * + * @param isp + * @return int */ static int isp_r2k_set_format(struct v4l_isp_device *isp) { - struct v4l2_mbus_framefmt format; - struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_R2K]; - int ret; - unsigned int i = 0; - - //sensor - ret = v4l2_subdev_get_format(isp->sensor1, &format, 0, - V4L2_SUBDEV_FORMAT_ACTIVE);//V4L2_SUBDEV_FORMAT_TRY); - if (ret < 0) { - printf("%s error: get format on sensor0 output failed.\n",__func__); - return ret; - } - printf("%s :v4l2_subdev_set_format sensor(g) width:(%d),height:(%d)\n",__func__,format.width,format.height); + struct v4l2_mbus_framefmt format; + struct isp_pipeline_s *isp_pipeline = &isp->isp_pipeline[ISP_R2K]; + int ret; + unsigned int i = 0; + + //sensor + ret = v4l2_subdev_get_format(isp->sensor1, &format, 0, + V4L2_SUBDEV_FORMAT_ACTIVE);//V4L2_SUBDEV_FORMAT_TRY); + if (ret < 0) { + printf("%s error: get format on sensor0 output failed.\n",__func__); + return ret; + } + printf("%s :v4l2_subdev_set_format sensor(g) width:(%d),height:(%d)\n",__func__,format.width,format.height); + + memcpy(&isp_pipeline->format_in,&format,sizeof(struct v4l2_mbus_framefmt)); + isp_pipeline->format_in.width = isp_pipeline->sensor_size.width;//ACTIVE_WIDTH;//1080; + isp_pipeline->format_in.height = isp_pipeline->sensor_size.height;//ACTIVE_HEIGHT;//1920 + ret = v4l2_subdev_set_format(isp->sensor1, &isp_pipeline->format_in, 0, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n", + __func__,isp->sensor1->info.name, 0); + return ret; + } - memcpy(&isp_pipeline->format_in,&format,sizeof(struct v4l2_mbus_framefmt)); - isp_pipeline->format_in.width = isp_pipeline->sensor_size.width;//ACTIVE_WIDTH;//1080; - isp_pipeline->format_in.height = isp_pipeline->sensor_size.height;//ACTIVE_HEIGHT;//1920 - ret = v4l2_subdev_set_format(isp->sensor1, &isp_pipeline->format_in, 0, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n", - __func__,isp->sensor1->info.name, 0); - return ret; - } + // printf("%s:v4l2_subdev_set_format sensor(s) width:(%d),height:(%d)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height); -// printf("%s:v4l2_subdev_set_format sensor(s) width:(%d),height:(%d)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height); + ret = v4l2_subdev_set_format(isp->csi2, &isp_pipeline->format_in, CSI2_PAD_SINK1, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n",__func__, + isp->csi2->info.name, 1); + return ret; + } - ret = v4l2_subdev_set_format(isp->csi2, &isp_pipeline->format_in, CSI2_PAD_SINK1, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n",__func__, - isp->csi2->info.name, 1); - return ret; - } + ret = v4l2_subdev_set_format(isp->csi2, &isp_pipeline->format_in, CSI2_PAD_SOURCE1, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n",__func__, + isp->csi2->info.name, 1); + return ret; + } - ret = v4l2_subdev_set_format(isp->csi2, &isp_pipeline->format_in, CSI2_PAD_SOURCE1, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n",__func__, - isp->csi2->info.name, 1); - return ret; - } + //vi + // isp_pipeline->format_in.width,isp_pipeline->format_in.height); + ret = v4l2_subdev_set_format(isp->vi, &isp_pipeline->format_in, VI_PAD_SINK_CSI1, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("error: set format failed on %s:%u.\n", + isp->vi->info.name, 1); + return ret; + } - //vi - // isp_pipeline->format_in.width,isp_pipeline->format_in.height); - ret = v4l2_subdev_set_format(isp->vi, &isp_pipeline->format_in, VI_PAD_SINK_CSI1, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("error: set format failed on %s:%u.\n", - isp->vi->info.name, 1); - return ret; - } + ret = v4l2_subdev_set_format(isp->vi, &isp_pipeline->format_in, VI_PAD_SOURCE_R2K, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n",__func__, + isp->vi->info.name, 1); + return ret; + } - ret = v4l2_subdev_set_format(isp->vi, &isp_pipeline->format_in, VI_PAD_SOURCE_R2K, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n",__func__, - isp->vi->info.name, 1); - return ret; - } + //isp_pipeline->format_in.code = MEDIA_BUS_FMT_SRGGB10_1X10; + ret = v4l2_subdev_set_format(isp->r2k, &isp_pipeline->format_in, ISP_R2K_PAD_SINK, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n",__func__, + isp->r2k->info.name, 1); + return ret; + } - //isp_pipeline->format_in.code = MEDIA_BUS_FMT_SRGGB10_1X10; - ret = v4l2_subdev_set_format(isp->r2k, &isp_pipeline->format_in, ISP_R2K_PAD_SINK, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n",__func__, - isp->r2k->info.name, 1); - return ret; - } + //printf("%s:v4l2_subdev_set_format isp(s) width:(%d),height:(%d)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height); + memcpy(&isp_pipeline->format_crop,&isp_pipeline->format_in,sizeof(struct v4l2_mbus_framefmt)); + //printf("%s:v4l2_subdev_set_format isp(s1) width:(%d),height:(%d)\n",__func__,isp_pipeline->format_crop.width,isp_pipeline->format_crop.height); + memcpy(&isp_pipeline->format_out,&isp_pipeline->format_crop,sizeof(struct v4l2_mbus_framefmt)); + for(i = 0; i < 4; i++) + { + if(isp_pipeline->video_entity_info[i].used == 1) + { + isp_pipeline->format_out.width = isp_pipeline->video_entity_info[i].video_size.width;//VIDEO_WIDTH;//1080; + isp_pipeline->format_out.height = isp_pipeline->video_entity_info[i].video_size.height;//VIDEO_HEIGHT;//720; + + if( isp_pipeline->video_entity_info[i].video_out_format == 1) + { + isp_pipeline->format_out.code = MEDIA_BUS_FMT_Y12_1X12; //MEDIA_BUS_FMT_UYVY8_1_5X8,MEDIA_BUS_FMT_VYUY8_1_5X8,MEDIA_BUS_FMT_YUYV8_1_5X8,MEDIA_BUS_FMT_YVYU8_1_5X8 + if(i == 3) + isp_pipeline->format_out.code = MEDIA_BUS_FMT_ARGB8888_1X32; + } + else + { + isp_pipeline->format_out.code = MEDIA_BUS_FMT_YUYV8_2X8;//MEDIA_BUS_FMT_YVYU8_2X8,MEDIA_BUS_FMT_UYVY8_1X16,MEDIA_BUS_FMT_YUYV8_1X16,MEDIA_BUS_FMT_YVYU8_1X16,MEDIA_BUS_FMT_VYUY8_1X16, + if(i == 3) + isp_pipeline->format_out.code = MEDIA_BUS_FMT_RGB888_1X24;//MEDIA_BUS_FMT_RBG888_1X24,MEDIA_BUS_FMT_BGR888_1X24,MEDIA_BUS_FMT_BGR888_3X8,MEDIA_BUS_FMT_GBR888_1X24,MEDIA_BUS_FMT_RGB888_1X24 + } - //printf("%s:v4l2_subdev_set_format isp(s) width:(%d),height:(%d)\n",__func__,isp_pipeline->format_in.width,isp_pipeline->format_in.height); - memcpy(&isp_pipeline->format_crop,&isp_pipeline->format_in,sizeof(struct v4l2_mbus_framefmt)); - //printf("%s:v4l2_subdev_set_format isp(s1) width:(%d),height:(%d)\n",__func__,isp_pipeline->format_crop.width,isp_pipeline->format_crop.height); - memcpy(&isp_pipeline->format_out,&isp_pipeline->format_crop,sizeof(struct v4l2_mbus_framefmt)); - for(i = 0; i < 4; i++) - { - if(isp_pipeline->video_entity_info[i].used == 1) - { - isp_pipeline->format_out.width = isp_pipeline->video_entity_info[i].video_size.width;//VIDEO_WIDTH;//1080; - isp_pipeline->format_out.height = isp_pipeline->video_entity_info[i].video_size.height;//VIDEO_HEIGHT;//720; - - if( isp_pipeline->video_entity_info[i].video_out_format == 1) - { - isp_pipeline->format_out.code = MEDIA_BUS_FMT_Y12_1X12; //MEDIA_BUS_FMT_UYVY8_1_5X8,MEDIA_BUS_FMT_VYUY8_1_5X8,MEDIA_BUS_FMT_YUYV8_1_5X8,MEDIA_BUS_FMT_YVYU8_1_5X8 - if(i == 3) - isp_pipeline->format_out.code = MEDIA_BUS_FMT_ARGB8888_1X32; - } - else - { - isp_pipeline->format_out.code = MEDIA_BUS_FMT_YUYV8_2X8;//MEDIA_BUS_FMT_YVYU8_2X8,MEDIA_BUS_FMT_UYVY8_1X16,MEDIA_BUS_FMT_YUYV8_1X16,MEDIA_BUS_FMT_YVYU8_1X16,MEDIA_BUS_FMT_VYUY8_1X16, - if(i == 3) - isp_pipeline->format_out.code = MEDIA_BUS_FMT_RGB888_1X24;//MEDIA_BUS_FMT_RBG888_1X24,MEDIA_BUS_FMT_BGR888_1X24,MEDIA_BUS_FMT_BGR888_3X8,MEDIA_BUS_FMT_GBR888_1X24,MEDIA_BUS_FMT_RGB888_1X24 - } + printf("%s:isp_pipeline->format_out.width(%d),isp_pipeline->format_out.height(%d) isp_pipeline->format_out.code (0x%x)\n",__func__,isp_pipeline->format_out.width,isp_pipeline->format_out.height,isp_pipeline->format_out.code); + ret = v4l2_subdev_set_format(isp->r2k, &isp_pipeline->format_out,ISP_R2K_PAD_MAIN_SOURCE + i, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret < 0) { + printf("%s error: set format failed on %s:%u.\n",__func__, + isp->vi->info.name, 1); + return ret; + } + } + } - printf("%s:isp_pipeline->format_out.width(%d),isp_pipeline->format_out.height(%d) isp_pipeline->format_out.code (0x%x)\n",__func__,isp_pipeline->format_out.width,isp_pipeline->format_out.height,isp_pipeline->format_out.code); - ret = v4l2_subdev_set_format(isp->r2k, &isp_pipeline->format_out,ISP_R2K_PAD_MAIN_SOURCE + i, - V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret < 0) { - printf("%s error: set format failed on %s:%u.\n",__func__, - isp->vi->info.name, 1); - return ret; - } - } - } - - return 0; + return 0; } -#define ISP_CORE_AWB_CTL (0x0104) -#define ISP_CORE_AWB_HANDLE_MODE (0x03f7) -#define ISP_CORE_AWB_HANDLE_MODE_CHECK (0x0008) +static int isp_hdr_mode_cfg(struct v4l_isp_device *isp, unsigned int mode) +{ + int ret; + struct media_entity *entity; + enum cnmodule_hdr_mode hdr_mode; + struct cnmodule_hdr_cfg hdr_cfg; + printf("isp_hdr_mode_cfg,hdr_mode:%d\n", mode); + + switch (mode) { + case 0: + hdr_mode = NO_HDR; + break; + case 1: + hdr_mode = HDR_X2; + break; + case 2: + hdr_mode = HDR_X3; + break; + default: + hdr_mode = NO_HDR; + break; + } + + //FIXME:only isp f2k support hdr sensor, by default,sensor0 use the f2k. + entity = isp->sensor0; + ret = v4l2_subdev_open(entity); + if (ret < 0) { + printf("%s, open subdev entity(%s) failed(%d)\n", __func__, entity->devname, ret); + return ret; + } + + memset(&hdr_cfg, 0 , sizeof(struct cnmodule_hdr_cfg)); + hdr_cfg.hdr_mode = hdr_mode; + ret = ioctl(entity->fd, CNMODULE_SET_HDR_CFG, &hdr_cfg); + if (ret < 0) { + printf("%s, ioctl CNMODULE_SET_HDR_CFG failed(%d)\n", __func__, ret); + v4l2_subdev_close(entity); + return ret; + } + v4l2_subdev_close(entity); + + return 0; +} /** * @brief * + * @param isp + * @return int */ -static int isp_awb_sync_init() +static int isp_pipeline_setup(struct v4l_isp_device *isp) { - int ret; - struct k510isp_reg_val r2k_awb_reg_val,r2k_awb_reg_val_write; - struct media_entity *pipe_f2k,*pipe_r2k; - pipe_r2k = v4l_isp.r2k; + /* Reset all links to make sure we're in a consistent, known state. */ + int ret = 0; - r2k_awb_reg_val.reg_addr = ISP_CORE_AWB_CTL; - r2k_awb_reg_val.reg_value = 0x0000; + ret = media_reset_links(isp->mdev); + if (ret < 0) { + printf("error: unable to reset links.\n"); + return ret; + } - ret = v4l2_subdev_open(pipe_r2k); - if (ret < 0) - return ret; - // get r2k awb ctl value - ret = ioctl(pipe_r2k->fd,VIDIOC_K510ISP_R2K_CORE_REG_GET,&r2k_awb_reg_val); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_K510ISP_R2K_CORE_REG_GET) failed ret(%d)\n", __func__,ret); - v4l2_subdev_close(pipe_r2k); - return ret; - } - // check r2k is handle mode or not, if auto mode then set to handle mode - if ((r2k_awb_reg_val.reg_value & ISP_CORE_AWB_HANDLE_MODE_CHECK) == ISP_CORE_AWB_HANDLE_MODE_CHECK) - { - r2k_awb_reg_val_write.reg_addr = ISP_CORE_AWB_CTL; - r2k_awb_reg_val_write.reg_value = r2k_awb_reg_val.reg_value & ISP_CORE_AWB_HANDLE_MODE; - ret = ioctl(pipe_r2k->fd,VIDIOC_K510ISP_R2K_CORE_REG_SET,&r2k_awb_reg_val_write); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_K510ISP_R2K_CORE_REG_SET) failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(pipe_r2k); - return ret; - } - } - v4l2_subdev_close(pipe_r2k); - return 0; -} - -/** - * @brief - * - * @param isp - * @return int - */ -static int isp_pipeline_setup(struct v4l_isp_device *isp) -{ - /* Reset all links to make sure we're in a consistent, known state. */ - int ret = 0; - - ret = media_reset_links(isp->mdev); - if (ret < 0) { - printf("error: unable to reset links.\n"); - return ret; - } - - /* Setup a Sensor -> VI -> F2K -> memory pipeline.*/ - // - isp_entity_init(isp); - // - if( isp->isp_pipeline[ISP_F2K].pipeline_en == 1) - isp_f2k_video_init(isp); - if( isp->isp_pipeline[ISP_R2K].pipeline_en == 1) - isp_r2k_video_init(isp); - // - isp_setup_link(isp); - // - if( isp->isp_pipeline[ISP_F2K].pipeline_en == 1) - { - isp_f2k_video_link(isp); - // - isp_f2k_set_format(isp); - } + /* Setup a Sensor -> VI -> F2K -> memory pipeline.*/ + // + isp_entity_init(isp); + // + if( isp->isp_pipeline[ISP_F2K].pipeline_en == 1) + isp_f2k_video_init(isp); + if( isp->isp_pipeline[ISP_R2K].pipeline_en == 1) + isp_r2k_video_init(isp); + // + isp_setup_link(isp); + // + if( isp->isp_pipeline[ISP_F2K].pipeline_en == 1) + { + isp_f2k_video_link(isp); + // + isp_f2k_set_format(isp); - if( isp->isp_pipeline[ISP_R2K].pipeline_en == 1) - { - isp_r2k_video_link(isp); - // - isp_r2k_set_format(isp); - } + isp_hdr_mode_cfg(isp, isp->isp_pipeline[ISP_F2K].hdr_mode); + } - - if((isp->isp_pipeline[ISP_F2K].pipeline_en == 1)&&(isp->isp_pipeline[ISP_R2K].pipeline_en == 1)&&(DualCamera_Sync == TRUE)) - { - Sensor1_Sync = TRUE; - } + if( isp->isp_pipeline[ISP_R2K].pipeline_en == 1) + { + isp_r2k_video_link(isp); + // + isp_r2k_set_format(isp); + } - return 0; + return 0; } /** - * @brief - * - * @param isp_pipeline - * @param isp_cfg + * @brief + * + * @param isp_pipeline + * @param isp_cfg */ void pipline_cfg(struct isp_pipeline_s *isp_pipeline,struct sensor_info *sensor) { - struct isp_wrap_cfg_info *isp_wrap_cfg = &sensor->isp_cfg.isp_wrap_cfg; - struct isp_core_cfg_info *isp_core_cfg = &sensor->isp_cfg.isp_core_cfg; + struct isp_wrap_cfg_info *isp_wrap_cfg = &sensor->isp_cfg.isp_wrap_cfg; + struct isp_core_cfg_info *isp_core_cfg = &sensor->isp_cfg.isp_core_cfg; - isp_pipeline->sensor_size.width = isp_core_cfg->itcInfo.itc_size.width; - isp_pipeline->sensor_size.height = isp_core_cfg->itcInfo.itc_size.height; - // - isp_pipeline->format_in.width = isp_pipeline->sensor_size.width; - isp_pipeline->format_in.height = isp_pipeline->sensor_size.height; - // - isp_pipeline->video_entity_info[0].used = isp_wrap_cfg->mainInfo.main_out_en; - isp_pipeline->video_entity_info[0].video_size.width = isp_wrap_cfg->mainInfo.main_size.width; - isp_pipeline->video_entity_info[0].video_size.height = isp_wrap_cfg->mainInfo.main_size.height; - isp_pipeline->video_entity_info[0].video_out_format = isp_wrap_cfg->mainInfo.main_out_img_out_format; - // + isp_pipeline->hdr_mode = isp_wrap_cfg->wdrInfo.wdr_mode; + + isp_pipeline->sensor_size.width = isp_core_cfg->itcInfo.itc_size.width; + isp_pipeline->sensor_size.height = isp_core_cfg->itcInfo.itc_size.height; + // + isp_pipeline->format_in.width = isp_pipeline->sensor_size.width; + isp_pipeline->format_in.height = isp_pipeline->sensor_size.height; + // + isp_pipeline->video_entity_info[0].used = isp_wrap_cfg->mainInfo.main_out_en; + isp_pipeline->video_entity_info[0].video_size.width = isp_wrap_cfg->mainInfo.main_size.width; + isp_pipeline->video_entity_info[0].video_size.height = isp_wrap_cfg->mainInfo.main_size.height; + isp_pipeline->video_entity_info[0].video_out_format = isp_wrap_cfg->mainInfo.main_out_img_out_format; + // isp_pipeline->format_crop.width = isp_pipeline->video_entity_info[0].video_size.width; - isp_pipeline->format_crop.height = isp_pipeline->video_entity_info[0].video_size.height; - // + isp_pipeline->format_crop.height = isp_pipeline->video_entity_info[0].video_size.height; + // isp_pipeline->format_out.width = isp_pipeline->video_entity_info[0].video_size.width; isp_pipeline->format_out.height = isp_pipeline->video_entity_info[0].video_size.height; // isp_pipeline->video_entity_info[1].used = isp_wrap_cfg->ds0Info.ds0_out_en; isp_pipeline->video_entity_info[1].video_size.width = isp_wrap_cfg->ds0Info.ds0_size.width; isp_pipeline->video_entity_info[1].video_size.height = isp_wrap_cfg->ds0Info.ds0_size.height; - isp_pipeline->video_entity_info[1].video_out_format = isp_wrap_cfg->ds0Info.ds0_out_img_out_format; - // + isp_pipeline->video_entity_info[1].video_out_format = isp_wrap_cfg->ds0Info.ds0_out_img_out_format; + // isp_pipeline->video_entity_info[2].used = isp_wrap_cfg->ds1Info.ds1_out_en; isp_pipeline->video_entity_info[2].video_size.width = isp_wrap_cfg->ds1Info.ds1_size.width; isp_pipeline->video_entity_info[2].video_size.height = isp_wrap_cfg->ds1Info.ds1_size.height; - isp_pipeline->video_entity_info[2].video_out_format = isp_wrap_cfg->ds1Info.ds1_out_img_out_format; - // + isp_pipeline->video_entity_info[2].video_out_format = isp_wrap_cfg->ds1Info.ds1_out_img_out_format; + // isp_pipeline->video_entity_info[3].used = isp_wrap_cfg->ds2Info.ds2_out_en; isp_pipeline->video_entity_info[3].video_size.width = isp_wrap_cfg->ds2Info.ds2_size.width; isp_pipeline->video_entity_info[3].video_size.height = isp_wrap_cfg->ds2Info.ds2_video_height;//isp_wrap_cfg->ds2Info.ds2_size.height; - isp_pipeline->video_entity_info[3].video_size.pitch = isp_wrap_cfg->ds2Info.ds2_size.pitch;//isp_wrap_cfg->ds2Info.ds2_size.height; - isp_pipeline->video_entity_info[3].video_out_format = isp_wrap_cfg->ds2Info.ds2_out_img_out_format; - // - isp_pipeline->pipeline_en = 0; - if( isp_pipeline->video_entity_info[0].used || isp_pipeline->video_entity_info[1].used || isp_pipeline->video_entity_info[2].used ||isp_pipeline->video_entity_info[3].used) - { - isp_pipeline->pipeline_en = 1; - } + isp_pipeline->video_entity_info[3].video_size.pitch = isp_wrap_cfg->ds2Info.ds2_size.pitch;//isp_wrap_cfg->ds2Info.ds2_size.height; + isp_pipeline->video_entity_info[3].video_out_format = isp_wrap_cfg->ds2Info.ds2_out_img_out_format; + // + isp_pipeline->pipeline_en = 0; + if( isp_pipeline->video_entity_info[0].used || isp_pipeline->video_entity_info[1].used || isp_pipeline->video_entity_info[2].used ||isp_pipeline->video_entity_info[3].used) + { + isp_pipeline->pipeline_en = 1; + } } /** - * @brief - * + * @brief + * */ static int isp_share_memory_alloc(void) { @@ -836,7 +857,7 @@ static int isp_share_memory_alloc(void) return 1 ; } - allocAlignMem[0].size = MEMORY_TEST_BLOCK_SIZE * 1024 * 3;//MEMORY_TEST_BLOCK_SIZE; 1920x1080*3/2+1920*1080 + allocAlignMem[0].size = MEMORY_TEST_BLOCK_SIZE * 1024 * 8;//MEMORY_TEST_BLOCK_SIZE; 1920x1080*3/2+1920*1080 allocAlignMem[0].alignment = MEMORY_TEST_BLOCK_ALIGN; allocAlignMem[0].phyAddr = 0; @@ -863,12 +884,12 @@ static int isp_share_memory_alloc(void) return 0; } /** - * @brief - * + * @brief + * */ static void isp_share_memory_free(void) { - unsigned int i = 0; + unsigned int i = 0; for(i = 0; i < MEMORY_TEST_BLOCK_NUM; i++) { if(allocAlignMem[i].phyAddr != 0) @@ -879,132 +900,238 @@ static void isp_share_memory_free(void) } } - close(fd_share_memory); + close(fd_share_memory); } -#if 0 -int mediactl_all_set_ae(enum isp_pipeline_e pipeline) +static ADAPTIVE_ATTRIBUTE_PAGE_T adap_attr_page[] = { - int ret; - struct k510isp_ae_stats ae_stats; - struct media_entity *pipe; - - if(ISP_F2K_PIPELINE == pipeline) + // f2k { - pipe = v4l_isp.f2k; - ret = v4l2_subdev_open(pipe); - if (ret < 0) - return ret; - - - ret = ioctl(pipe->fd,VIDIOC_K510ISP_F2K_AE_STAT_REQ,&ae_stats); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_K510ISP_F2K_AE_STAT_REQ) failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(pipe); - return ret; - } - //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); - v4l2_subdev_close(pipe); - // - struct media_entity *sensor0 = v4l_isp.sensor0; - if( ae_stats.ae_wren == 1) - { - ret = v4l2_subdev_open(sensor0); - if (ret < 0) - return ret; - - struct v4l2_control control_s; - control_s.id = V4L2_CID_EXPOSURE; - control_s.value = ae_stats.ae_expl; - ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor0); - return ret; - } - - control_s.id = V4L2_CID_GAIN; - control_s.value = ae_stats.ae_agco; - ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor0); - return ret; - } - v4l2_subdev_close(sensor0); + .nAdaptiveUserAttrEnable = 1, // 0: disable, 1: enable + .nAdaptiveUserAeMode = 0, // 0: sw, 1: hw + .nWritten = 3, + .nAeSync = 0, + .tUserAttrIspCtl = { + .nAeEnable = 1, + .nAeEnhMode = 0, + .nAwbEnable = 1, + .nLdcEnable = 0, // 0: disable, 1: enable + .nLscEnable = 1, // 0: disable, 1: enable + .nFlip = 0, // 0: normal, 1: hflip, 2: vflip, 3: hvflip + .nAntiflickerScl = 1, // only sw ae use, 0: normal, 1: 50Hz auto, 2: 50Hz force, 3: 60Hz auto, 4: 60Hz force + .nDefogEn = 0, // 0: disable, 1 & 2: reserved, 3: enable + .nWdrEnable = 0, + .nIrCutEnable = 0, // 0: disable, 1: enable + .nIrCutFilterType = 1, // 0: day2night, // 1: night2day + }, + .tUserAttrLimit = { + .nCtScl = 0, // 0: A, 1: U30, 2: U35, 3: TL84, 4: D50, 5: D65 + .nEtRange = {1, 30000}, // [0]: min, [1]: max + .nGainRange = {2, 16}, // [0]: min do not modify, [1]: max + .nIrCutSwMode = 0, // 0: auto, 1: manual + }, + .tUserAttrWeight = { + .n2dnrLevelCoeff = 5, // level 0:10, default 5 + .nBrightnessCoeff = 50, // level: 0 - 100, default 50 + .nContrastCoeff = 50, // level: 0 - 100, default 50 + .nSaturationCoeff = 50, // level: 0 - 100, default 50 + .nSharpnessCoeff = 50, // level: 0 - 100, default 50 + .nAeBacklightCoeff = 0, + .nAeStronglightCoeff = 0, + }, + .tUserMenu3A = { + .nCurExpTime = 30000, + .nCurGain = 2, + .nCurWbRGain = 202, + .nCurWbGGain = 256, + .nCurWbBGain = 356, } - } + }, - if(ISP_R2K_PIPELINE == pipeline) + // r2k { - pipe = v4l_isp.r2k; - ret = v4l2_subdev_open(pipe); - if (ret < 0) - return ret; - - - ret = ioctl(pipe->fd,VIDIOC_K510ISP_R2K_AE_STAT_REQ,&ae_stats); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_K510ISP_R2K_AE_STAT_REQ) failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(pipe); - return ret; - } - //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); - v4l2_subdev_close(pipe); - // - struct media_entity *sensor1 = v4l_isp.sensor1; - if( ae_stats.ae_wren == 1) - { - ret = v4l2_subdev_open(sensor1); - if (ret < 0) - return ret; - - struct v4l2_control control_s; - control_s.id = V4L2_CID_EXPOSURE; - control_s.value = ae_stats.ae_expl; - ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor1); - return ret; - } - - control_s.id = V4L2_CID_GAIN; - control_s.value = ae_stats.ae_agco; - ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor1); - return ret; - } - v4l2_subdev_close(sensor1); + .nAdaptiveUserAttrEnable = 1, // 0: disable, 1: enable + .nAdaptiveUserAeMode = 0, // 0: sw, 1: hw + .nWritten = 3, + .nAeSync = 0, + .tUserAttrIspCtl = { + .nAeEnable = 1, + .nAeEnhMode = 0, + .nAwbEnable = 1, + .nLdcEnable = 0, // 0: disable, 1: enable + .nLscEnable = 1, // 0: disable, 1: enable + .nFlip = 0, // 0: normal, 1: hflip, 2: vflip, 3: hvflip + .nAntiflickerScl = 1, // only sw ae use, 0: normal, 1: 50Hz auto, 2: 50Hz force, 3: 60Hz auto, 4: 60Hz force + .nDefogEn = 0, // 0: disable, 1 & 2: reserved, 3: enable + .nWdrEnable = 0, + .nIrCutEnable = 0, // 0: disable, 1: enable + .nIrCutFilterType = 1, // 0: day2night, 1: night2day + }, + .tUserAttrLimit = { + .nCtScl = 0, // 0: A, 1: U30, 2: U35, 3: TL84, 4: D50, 5: D65 + .nEtRange = {1, 30000}, // [0]: min, [1]: max + .nGainRange = {2, 16}, // [0]: min do not modify, [1]: max + .nIrCutSwMode = 0, // 0: auto, 1: manual + }, + .tUserAttrWeight = { + .n2dnrLevelCoeff = 5, // level 0:10, default 5 + .nBrightnessCoeff = 50, // level: 0 - 100, default 50 + .nContrastCoeff = 50, // level: 0 - 100, default 50 + .nSaturationCoeff = 50, // level: 0 - 100, default 50 + .nSharpnessCoeff = 50, // level: 0 - 100, default 50 + .nAeBacklightCoeff = 0, + .nAeStronglightCoeff = 0, + }, + .tUserMenu3A = { + .nCurExpTime = 30000, + .nCurGain = 2, + .nCurWbRGain = 202, + .nCurWbGGain = 256, + .nCurWbBGain = 356, } - } - + }, +}; + +int attr_page_params_setting(enum isp_pipeline_e pipeline, void * attr_page) +{ + ADAPTIVE_ATTRIBUTE_PAGE_T * attr_rec = (ADAPTIVE_ATTRIBUTE_PAGE_T *)attr_page; + adap_attr_page[pipeline] = *attr_rec; return 0; } -#else + +int attr_page_get_written_stat(enum isp_pipeline_e pipeline) +{ + return adap_attr_page[pipeline].nWritten; +} + +#if 0 int mediactl_all_set_ae(enum isp_pipeline_e pipeline) +{ + int ret; + struct k510isp_ae_stats ae_stats; + struct media_entity *pipe; + + if(ISP_F2K_PIPELINE == pipeline) + { + pipe = v4l_isp.f2k; + ret = v4l2_subdev_open(pipe); + if (ret < 0) + return ret; + + + ret = ioctl(pipe->fd,VIDIOC_K510ISP_F2K_AE_STAT_REQ,&ae_stats); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_K510ISP_F2K_AE_STAT_REQ) failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(pipe); + return ret; + } + //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); + v4l2_subdev_close(pipe); + // + struct media_entity *sensor0 = v4l_isp.sensor0; + if( ae_stats.ae_wren == 1) + { + ret = v4l2_subdev_open(sensor0); + if (ret < 0) + return ret; + + struct v4l2_control control_s; + control_s.id = V4L2_CID_EXPOSURE; + control_s.value = ae_stats.ae_expl; + ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor0); + return ret; + } + + control_s.id = V4L2_CID_GAIN; + control_s.value = ae_stats.ae_agco; + ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor0); + return ret; + } + v4l2_subdev_close(sensor0); + } + } + + if(ISP_R2K_PIPELINE == pipeline) + { + pipe = v4l_isp.r2k; + ret = v4l2_subdev_open(pipe); + if (ret < 0) + return ret; + + + ret = ioctl(pipe->fd,VIDIOC_K510ISP_R2K_AE_STAT_REQ,&ae_stats); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_K510ISP_R2K_AE_STAT_REQ) failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(pipe); + return ret; + } + //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); + v4l2_subdev_close(pipe); + // + struct media_entity *sensor1 = v4l_isp.sensor1; + if( ae_stats.ae_wren == 1) + { + ret = v4l2_subdev_open(sensor1); + if (ret < 0) + return ret; + + struct v4l2_control control_s; + control_s.id = V4L2_CID_EXPOSURE; + control_s.value = ae_stats.ae_expl; + ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor1); + return ret; + } + + control_s.id = V4L2_CID_GAIN; + control_s.value = ae_stats.ae_agco; + ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor1); + return ret; + } + v4l2_subdev_close(sensor1); + } + } + + return 0; +} +#else +// original func: mediactl_all_set_ae(enum isp_pipeline_e pipeline) +int mediactl_hw_set_ae(enum isp_pipeline_e pipeline) { int ret; struct k510isp_ae_stats ae_stats; struct media_entity *pipe; - + if(ISP_F2K_PIPELINE == pipeline) { pipe = v4l_isp.f2k; + if(ae_hw_set_f2k) + { + ae_enable_set(pipeline, pipe); + } ret = v4l2_subdev_open(pipe); if (ret < 0) return ret; @@ -1020,10 +1147,32 @@ int mediactl_all_set_ae(enum isp_pipeline_e pipeline) } //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); v4l2_subdev_close(pipe); + if(adap_attr_page[pipeline].nWritten == 2) + { + adaptive_user_attr_page_parse(pipeline, &adap_attr_page[pipeline]); + + // ae manual set + if(adap_attr_page[pipeline].nAdaptiveUserAttrEnable) + { + if(!adap_attr_page[pipeline].tUserAttrIspCtl.nAeEnable) + { + ae_stats.ae_expl = (unsigned int)et_line_time_convert(pipeline, adap_attr_page[pipeline].tUserMenu3A.nCurExpTime); + ae_stats.ae_agco = (unsigned int)adap_attr_page[pipeline].tUserMenu3A.nCurGain * 256; + } + } + } + adaptive_get_3a_stat(pipeline, pipe); // no change static int expl = 0, agco = 0; if (expl == ae_stats.ae_expl && agco == ae_stats.ae_agco) { + if(adaptive_ex_gt_update_flag(pipeline) == 1) + { + adaptive_ex_st_ae_apply(pipeline, ae_stats.y_av, expl, agco); + adaptive_param_flag_init(pipeline); + adaptive_setting_ctl(pipeline); + adaptive_param_apply(pipeline, pipe); + } return ret; } else { expl = ae_stats.ae_expl; @@ -1058,11 +1207,22 @@ int mediactl_all_set_ae(enum isp_pipeline_e pipeline) return ret; } v4l2_subdev_close(sensor0); + if(adaptive_enable_scl) + { + adaptive_ex_st_ae_apply(pipeline, ae_stats.y_av, expl, agco); + adaptive_setting_ctl(pipeline); + adaptive_param_apply(pipeline, pipe); + } + adap_attr_page[pipeline].nWritten = 3; } if(ISP_R2K_PIPELINE == pipeline) { pipe = v4l_isp.r2k; + if(ae_hw_set_r2k) + { + ae_enable_set(pipeline, pipe); + } ret = v4l2_subdev_open(pipe); if (ret < 0) return ret; @@ -1078,13 +1238,33 @@ int mediactl_all_set_ae(enum isp_pipeline_e pipeline) } //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); v4l2_subdev_close(pipe); - - static int expl = 0, agco = 0; - if (expl == ae_stats.ae_expl && agco == ae_stats.ae_agco) { + if(adap_attr_page[pipeline].nWritten == 2) + { + adaptive_user_attr_page_parse(pipeline, &adap_attr_page[pipeline]); + // ae manual set + if(adap_attr_page[pipeline].nAdaptiveUserAttrEnable) + { + if(!adap_attr_page[pipeline].tUserAttrIspCtl.nAeEnable) + { + ae_stats.ae_expl = (unsigned int)et_line_time_convert(pipeline, adap_attr_page[pipeline].tUserMenu3A.nCurExpTime); + ae_stats.ae_agco = (unsigned int)adap_attr_page[pipeline].tUserMenu3A.nCurGain * 256; + } + } + } + adaptive_get_3a_stat(pipeline, pipe); + static int expl_1 = 0, agco_1 = 0; + if (expl_1 == ae_stats.ae_expl && agco_1 == ae_stats.ae_agco) { + if(adaptive_ex_gt_update_flag(pipeline) == 1) + { + adaptive_ex_st_ae_apply(pipeline, ae_stats.y_av, expl_1, agco_1); + adaptive_param_flag_init(pipeline); + adaptive_setting_ctl(pipeline); + adaptive_param_apply(pipeline, pipe); + } return ret; } else { - expl = ae_stats.ae_expl; - agco = ae_stats.ae_agco; + expl_1 = ae_stats.ae_expl; + agco_1 = ae_stats.ae_agco; } struct media_entity *sensor1 = v4l_isp.sensor1; @@ -1115,251 +1295,304 @@ int mediactl_all_set_ae(enum isp_pipeline_e pipeline) return ret; } v4l2_subdev_close(sensor1); + if(adaptive_enable_scl) + { + adaptive_ex_st_ae_apply(pipeline, ae_stats.y_av, expl_1, agco_1); + adaptive_setting_ctl(pipeline); + adaptive_param_apply(pipeline, pipe); + } + adap_attr_page[pipeline].nWritten = 3; } - return 0; } -#endif -/** - * @brief - * - */ - -#define F2K_AE_DEVICE "/dev/f2k-ae" - -void *run_f2k_ae_video(void *info) +/* sw ae */ +int sw_ae_value_set(enum isp_pipeline_e pipeline, struct media_entity *pipe) { - int fd ; - int i = 0; - fd_set fds; - struct timeval tv; - int r; - int ret; - - printf("run_f2k_ae_video ------------------- start \n"); - fd = open(F2K_AE_DEVICE, O_RDWR); - if (fd < 0) { - printf("open %s error!\r\n", F2K_AE_DEVICE); - return 1; + int ret = 0; + static int y_everage_temp = 0; + struct k510isp_ae_stats ae_stats; + struct media_entity *sensor_n = NULL; + ret = v4l2_subdev_open(pipe); + if (ret < 0) + return ret; + if(ISP_F2K_PIPELINE == pipeline) + { + ioctl(pipe->fd,VIDIOC_K510ISP_F2K_AE_STAT_REQ, &ae_stats); + v4l2_subdev_close(pipe); + y_everage_temp = ae_stats.y_av; + sensor_n = v4l_isp.sensor0; } - - - FD_ZERO(&fds); - FD_SET(fd, &fds); - while (1) { - /* Timeout. */ - tv.tv_sec = 5; - tv.tv_usec = 0; - - r = select(fd + 1, &fds, NULL, NULL, &tv); - if (-1 == r) { - if (EINTR == errno) - continue; - //errno_exit("select"); - //done = true; - printf("error: ae select failed with %d\n",errno); - ret = -1; - break; - } - - if (0 == r) { - //done = true; - printf("%s:ae select timeout\n",__func__); - //exit(EXIT_FAILURE); - ret = -1; - break; - } - - //mediactl_set_ae(); -#if 0 - if(Sensor1_Sync == FALSE) + else if(ISP_R2K_PIPELINE == pipeline) + { + if(Sensor1_Sync == FALSE) { - ret = mediactl_set_ae_single(ISP_F2K_PIPELINE); + ioctl(pipe->fd,VIDIOC_K510ISP_R2K_AE_STAT_REQ, &ae_stats); + v4l2_subdev_close(pipe); + } + else{ + ae_stats.y_av = y_everage_temp; } - else + sensor_n = v4l_isp.sensor1; + } + + // keep current ev when switch to manual ae + + if(adap_attr_page[pipeline].nWritten == 2) + { + if(!adap_attr_page[pipeline].tUserAttrIspCtl.nAeEnable && attr_page_flag_u[pipeline].bits.ae_en_flag) { - ret = mediactl_set_ae_sync(ISP_F2K_PIPELINE); - ret = mediactl_set_awb_sync(ISP_F2K_PIPELINE); + ae_ctl_callback_back[pipeline].nExpTimeLines = ae_ctl_callback[pipeline].nExpTimeLines; + ae_ctl_callback_back[pipeline].nGain = ae_ctl_callback[pipeline].nGain; } -#else -#if 0 - if(i == 0) + if(adap_attr_page[pipeline].nAdaptiveUserAttrEnable == 1 && adap_attr_page[pipeline].tUserAttrIspCtl.nAeEnable == 0) { - usleep(3950); - mediactl_all_set_ae(ISP_F2K_PIPELINE); + if(1) + { + int temp_ae_ctl_exp = et_line_time_convert(pipeline, adap_attr_page[pipeline].tUserMenu3A.nCurExpTime) + 1; + // if(attr_page_flag_u[pipeline].bits.cur_exp_flag) + { + if(ae_attr_set_et_count[pipeline] == 0) + { + ae_ctl_manual_set(AE_CTL_MANUAL_SET_EXP_MODE, NULL, pipeline, ae_ctl_callback_back[pipeline].nExpTimeLines > 0 ? ae_ctl_callback_back[pipeline].nExpTimeLines:temp_ae_ctl_exp, &ae_ctl_callback_back[pipeline]); + adap_attr_page[pipeline].tUserMenu3A.nCurExpTime = line_time_et_convert(pipeline, ae_ctl_callback[pipeline].nExpTimeLines); + ae_attr_set_et_count[pipeline]++; + ae_ctl_callback[pipeline].nExpTimeLines = ae_ctl_callback_back[pipeline].nExpTimeLines > 0 ? ae_ctl_callback_back[pipeline].nExpTimeLines:temp_ae_ctl_exp, &ae_ctl_callback_back[pipeline]; + } + else + { + ae_ctl_manual_set(AE_CTL_MANUAL_SET_EXP_MODE, NULL, pipeline, temp_ae_ctl_exp, &ae_ctl_callback[pipeline]); + ae_ctl_callback[pipeline].nExpTimeLines = temp_ae_ctl_exp; + } + } + // if(attr_page_flag_u[pipeline].bits.cur_gain_flag) + { + if(ae_attr_set_gain_count[pipeline] == 0) + { + ae_ctl_manual_set(AE_CTL_MANUAL_SET_GAIN_MODE, NULL, pipeline, ae_ctl_callback_back[pipeline].nGain > 0 ? ae_ctl_callback_back[pipeline].nGain:adap_attr_page[pipeline].tUserMenu3A.nCurGain * 256, &ae_ctl_callback_back[pipeline]); + adap_attr_page[pipeline].tUserMenu3A.nCurGain = ae_ctl_callback[pipeline].nGain / 256; + ae_attr_set_gain_count[pipeline]++; + ae_ctl_callback[pipeline].nGain = ae_ctl_callback_back[pipeline].nGain > 0 ? ae_ctl_callback_back[pipeline].nGain:adap_attr_page[pipeline].tUserMenu3A.nCurGain * 256; + } + else + { + ae_ctl_manual_set(AE_CTL_MANUAL_SET_GAIN_MODE, NULL, pipeline, adap_attr_page[pipeline].tUserMenu3A.nCurGain * 256, &ae_ctl_callback[pipeline]); + ae_ctl_callback[pipeline].nGain = 12; //adap_attr_page[pipeline].tUserMenu3A.nCurGain * 256; + } + } + } } - - i ++; - if(i == 2) + + if(attr_page_flag_u[pipeline].bits.anti_flicker_flag + attr_page_flag_u[pipeline].bits.gain_min + attr_page_flag_u[pipeline].bits.et_min_flag + attr_page_flag_u[pipeline].bits.et_max_flag + attr_page_flag_u[pipeline].bits.gain_max + attr_page_flag_u[pipeline].bits.ae_en_flag + attr_page_flag_u[pipeline].bits.attr_en_flag) { - i = 0; + ae_ctl_reinit(pipeline); } -#else - // char tmp; - // read(fd, &tmp, 1); - //usleep(3900); - mediactl_all_set_ae(ISP_F2K_PIPELINE); -#endif + } -#endif - - /* EAGAIN - continue select loop. */ - } + if(!adap_attr_page[pipeline].nAdaptiveUserAttrEnable || \ + (adap_attr_page[pipeline].nAdaptiveUserAttrEnable && adap_attr_page[pipeline].tUserAttrIspCtl.nAeEnable)) + { + ae_ctl_calc(pipeline, ae_stats, sensor_n, &ae_ctl_callback[pipeline]); + } + // send ae param to adaptive func + adaptive_ex_st_ae_apply(pipeline, ae_stats.y_av, ae_ctl_callback[pipeline].nExpTimeLines, ae_ctl_callback[pipeline].nGain); - //printf("%s: camera %d fd(%d) mainloop end ret(%d)!\n", __func__,camera_seq,fd,ret); - return ret; + return 0; } - - -#define R2K_AE_DEVICE "/dev/r2k-ae" - -void *run_r2k_ae_video(void *info) +/** + * @brief + * + */ +int mediactl_sw_set_ae(enum isp_pipeline_e pipeline) { - int fd ; - - fd_set fds; - struct timeval tv; - int r; - int ret; - int i = 0; - - printf("run_r2k_ae_video ------------------- start \n"); - - fd = open(R2K_AE_DEVICE, O_RDWR); - if (fd < 0) { - printf("open %s error!\r\n", R2K_AE_DEVICE); - return 1; - } + int ret; + struct media_entity *pipe = NULL; + if(adap_attr_page[pipeline].nWritten == 2) + { + attr_page_flag_u[pipeline].u32 = adaptive_user_attr_page_compare(pipeline, &adap_attr_page[pipeline]); + ae_ctl_attr_page_stat_set_v2(pipeline, attr_page_flag_u[pipeline].u32); + AE_CTL_ATTR_PARAM ae_attr_page_param; + ae_attr_page_param.nAeModeSwitch = adap_attr_page[pipeline].tUserAttrIspCtl.nAeEnable; + ae_attr_page_param.nAttePageEn = adap_attr_page[pipeline].nAdaptiveUserAttrEnable; + ae_ctl_attr_page_param_set(pipeline, ae_attr_page_param); + + if(adap_attr_page[pipeline].nAdaptiveUserAttrEnable) + { + if(attr_page_flag_u[pipeline].bits.ae_sync_flag) + { + if(pipeline == ISP_R2K_PIPELINE) + { + ae_ctl_sync_setting(pipeline, adap_attr_page[pipeline].nAeSync); + } + } + if(attr_page_flag_u[pipeline].bits.anti_flicker_flag) + { + anti_flicker_switch(pipeline, adap_attr_page[pipeline].tUserAttrIspCtl.nAntiflickerScl); + } + } - FD_ZERO(&fds); - FD_SET(fd, &fds); - while (1) { - /* Timeout. */ - tv.tv_sec = 5; - tv.tv_usec = 0; + if(attr_page_flag_u[pipeline].bits.attr_en_flag || \ + (adap_attr_page[pipeline].nAdaptiveUserAttrEnable && adap_attr_page[pipeline].tUserAttrIspCtl.nAeEnable && attr_page_flag_u[pipeline].bits.ae_en_flag)) + { + adap_attr_page[pipeline].tUserAttrLimit.nEtRange[0] = 1; + adap_attr_page[pipeline].tUserAttrLimit.nEtRange[1] = 30000; + adap_attr_page[pipeline].tUserAttrLimit.nGainRange[1] = 16; + } - r = select(fd + 1, &fds, NULL, NULL, &tv); - if (-1 == r) { - if (EINTR == errno) - continue; - //errno_exit("select"); - //done = true; - printf("error: ae select failed with %d\n",errno); - ret = -1; - break; - } + ae_ctl_limit_range(pipeline, adap_attr_page[pipeline].tUserAttrLimit.nEtRange[0], adap_attr_page[pipeline].tUserAttrLimit.nEtRange[1], adap_attr_page[pipeline].tUserAttrLimit.nGainRange[1]); - if (0 == r) { - //done = true; - printf("%s:ae select timeout\n",__func__); - //exit(EXIT_FAILURE); - ret = -1; - break; - } + } - //mediactl_set_ae(); -#if 0 - if(Sensor1_Sync == FALSE) - { - ret = mediactl_set_ae_single(ISP_R2K_PIPELINE); - } - else - { - ret = mediactl_set_ae_sync(ISP_F2K_PIPELINE); - ret = mediactl_set_awb_sync(ISP_F2K_PIPELINE); - } -#else + if(pipeline == ISP_F2K_PIPELINE) + { + pipe = v4l_isp.f2k; + } + else if(pipeline == ISP_R2K_PIPELINE) + { + pipe = v4l_isp.r2k; + } + ret = sw_ae_value_set(pipeline, pipe); + if(!adaptive_enable_scl) + { + // adaptive will not apply + return 0; + } + if(adap_attr_page[pipeline].nWritten == 2) + { + adaptive_user_attr_page_parse(pipeline, &adap_attr_page[pipeline]); + } -#if 0 - if(i == 0) + int total_frame_num = AESmoothSteps + ETDelayFrameNumber[pipeline]; + adaptive_get_3a_stat(pipeline, pipe); + if(AE_Para_Inf[pipeline].Process == total_frame_num && pipeline == ISP_F2K_PIPELINE) + { + adaptive_setting_ctl(pipeline); + adaptive_param_apply(pipeline, pipe); + } + else if((AE_Para_Inf[ISP_R2K_PIPELINE].Process == total_frame_num) && \ + ((Sensor1_Sync == FALSE) || ((Sensor1_Sync == TRUE) && \ + (AE_Para_Inf[ISP_F2K_PIPELINE].Process == total_frame_num)))) + { + adaptive_setting_ctl(pipeline); + adaptive_param_apply(pipeline, pipe); + } + else if(adaptive_ex_gt_update_flag(pipeline) == 1) + { + adaptive_param_flag_init(pipeline); + adaptive_setting_ctl(pipeline); + adaptive_param_apply(pipeline, pipe); + } + else + { + adaptive_ex_st_ev_apply_flag(pipeline, 0); + if(adaptive_ex_gt_awb_apply_flag(pipeline) == 1) { - usleep(3950); - mediactl_all_set_ae(ISP_R2K_PIPELINE); + adaptive_setting_ctl(pipeline); + adaptive_param_apply(pipeline, pipe); } + adaptive_ex_st_ev_apply_flag(pipeline, 1); + } - i ++; - if(i == 2) - { - i = 0; - } -#else - //usleep(3900); - mediactl_all_set_ae(ISP_R2K_PIPELINE); + ae_ctl_manual_set(AE_CTL_MANUAL_SET_TARGET_MODE, NULL, pipeline, adaptive_ex_gt_target_stat(pipeline), NULL); + ae_ctl_manual_set(AE_CTL_MANUAL_SET_TARGET_RANGE_MODE, NULL, pipeline, adaptive_ex_gt_target_range_stat(pipeline), NULL); + attr_page_flag_u[pipeline].u32 = 0; + adap_attr_page[pipeline].nWritten = 3; + return ret; +} #endif -#endif - /* EAGAIN - continue select loop. */ - } - //printf("%s: camera %d fd(%d) mainloop end ret(%d)!\n", __func__,camera_seq,fd,ret); - return ret; +static volatile uint8_t flag_ae_enable = 3; + +void mediactl_disable_ae(enum isp_pipeline_e pipeline) { + if (pipeline == ISP_F2K_PIPELINE) { + flag_ae_enable &= ~1U; + } else if (pipeline == ISP_R2K_PIPELINE) { + flag_ae_enable &= ~2U; + } } +/** + * @brief + * + */ + +#define F2K_AE_DEVICE "/dev/f2k-ae" +#define R2K_AE_DEVICE "/dev/r2k-ae" + void run_all_ae_video(void *info) { - int fd[2]; - int i = 0; + if (flag_ae_enable == 0) { + return; + } + int fd[2] = {-1, -1}; + int i = 0; fd_set fds; + FD_ZERO(&fds); struct timeval tv; int r; - printf("run_all_ae_video ------------------- start \n"); + printf("run_all_ae_video ------------------- start %d \n", flag_ae_enable); - fd[0] = open(F2K_AE_DEVICE, O_RDWR); - if (fd[0] < 0) { - printf("open %s error!\r\n", F2K_AE_DEVICE); - return; - } + if ((flag_ae_enable & 1) && v4l_isp.isp_pipeline[ISP_F2K].pipeline_en) { + fd[0] = open(F2K_AE_DEVICE, O_RDWR); + FD_SET(fd[0], &fds); + if (fd[0] < 0) { + printf("open %s error!\r\n", F2K_AE_DEVICE); + return; + } + fprintf(stderr, "enable F2K AE\n"); + } - fd[1] = open(R2K_AE_DEVICE, O_RDWR); - if (fd[1] < 0) { - printf("open %s error!\r\n", F2K_AE_DEVICE); - return; - } + if ((flag_ae_enable & 2) && v4l_isp.isp_pipeline[ISP_R2K].pipeline_en) { + fd[1] = open(R2K_AE_DEVICE, O_RDWR); + FD_SET(fd[1], &fds); + if (fd[1] < 0) { + printf("open %s error!\r\n", F2K_AE_DEVICE); + return; + } + fprintf(stderr, "enable R2K AE\n"); + } - FD_ZERO(&fds); - FD_SET(fd[0], &fds); - FD_SET(fd[1], &fds); - int max_fd = (fd[0] > fd[1] ? fd[0] : fd[1]) + 1; + int max_fd = (fd[0] > fd[1] ? fd[0] : fd[1]) + 1; while (1) { - /* - static time_t last_tm = 0; - static uint32_t counter = 0; - static uint32_t counter_last = 0; - counter += 1; - if (time(NULL) - last_tm) { - fprintf(stderr, "select %d interrupts per second\n", counter - counter_last); - last_tm = time(NULL); - counter_last = counter; - } - */ + /* + static time_t last_tm = 0; + static uint32_t counter = 0; + static uint32_t counter_last = 0; + counter += 1; + if (time(NULL) - last_tm) { + fprintf(stderr, "select %d interrupts per second\n", counter - counter_last); + last_tm = time(NULL); + counter_last = counter; + } + */ /* Timeout. */ - tv.tv_sec = 2; + tv.tv_sec = 5; tv.tv_usec = 0; - fd_set rfds = fds; + fd_set rfds = fds; r = select(max_fd, &rfds, NULL, NULL, &tv); - if (r > 0) { - if (FD_ISSET(fd[0], &rfds)) { - struct timeval tv1, tv2; - // gettimeofday(&tv1, NULL); - mediactl_all_set_ae(ISP_F2K_PIPELINE); - // gettimeofday(&tv2, NULL); - // fprintf(stderr, "cam %d AE %ldus\n", 0, (tv2.tv_sec - tv1.tv_sec) * 1000000 + (tv2.tv_usec - tv1.tv_usec)); - } - if (FD_ISSET(fd[1], &rfds)) { - struct timeval tv1, tv2; - // gettimeofday(&tv1, NULL); - mediactl_all_set_ae(ISP_R2K_PIPELINE); - // gettimeofday(&tv2, NULL); - // fprintf(stderr, "cam %d AE %ldus\n", 1, (tv2.tv_sec - tv1.tv_sec) * 1000000 + (tv2.tv_usec - tv1.tv_usec)); - } - } else if (r == -1) { + if (r > 0) { + if (v4l_isp.isp_pipeline[ISP_F2K].pipeline_en && FD_ISSET(fd[0], &rfds)) { + struct timeval tv1, tv2; + // gettimeofday(&tv1, NULL); + mediactl_all_set_ae(ISP_F2K_PIPELINE); + // gettimeofday(&tv2, NULL); + // fprintf(stderr, "cam %d AE %ldus\n", 0, (tv2.tv_sec - tv1.tv_sec) * 1000000 + (tv2.tv_usec - tv1.tv_usec)); + } + if (v4l_isp.isp_pipeline[ISP_R2K].pipeline_en && FD_ISSET(fd[1], &rfds)) { + struct timeval tv1, tv2; + // gettimeofday(&tv1, NULL); + mediactl_all_set_ae(ISP_R2K_PIPELINE); + // gettimeofday(&tv2, NULL); + // fprintf(stderr, "cam %d AE %ldus\n", 1, (tv2.tv_sec - tv1.tv_sec) * 1000000 + (tv2.tv_usec - tv1.tv_usec)); + } + } else if (r == -1) { if (EINTR == errno) continue; //errno_exit("select"); @@ -1376,51 +1609,146 @@ void run_all_ae_video(void *info) //mediactl_set_ae(); #if 0 if(Sensor1_Sync == FALSE) - { - ret = mediactl_set_ae_single(ISP_F2K_PIPELINE); - } - else - { - ret = mediactl_set_ae_sync(ISP_F2K_PIPELINE); - ret = mediactl_set_awb_sync(ISP_F2K_PIPELINE); - } + { + ret = mediactl_set_ae_single(ISP_F2K_PIPELINE); + } + else + { + ret = mediactl_set_ae_sync(ISP_F2K_PIPELINE); + ret = mediactl_set_awb_sync(ISP_F2K_PIPELINE); + } #else #if 0 - if(i == 0) - { - //usleep(3500); - mediactl_all_set_ae(ISP_F2K_PIPELINE); - mediactl_all_set_ae(ISP_R2K_PIPELINE); - } - - i ++; - if(i == 4) - { - i = 0; - } + if(i == 0) + { + //usleep(3500); + mediactl_all_set_ae(ISP_F2K_PIPELINE); + mediactl_all_set_ae(ISP_R2K_PIPELINE); + } + + i ++; + if(i == 4) + { + i = 0; + } #else - //usleep(3950); - // mediactl_all_set_ae(ISP_R2K_PIPELINE); - // mediactl_all_set_ae(ISP_F2K_PIPELINE); - + //usleep(3950); + // mediactl_all_set_ae(ISP_R2K_PIPELINE); + // mediactl_all_set_ae(ISP_F2K_PIPELINE); + #endif #endif - + /* EAGAIN - continue select loop. */ } //printf("%s: camera %d fd(%d) mainloop end ret(%d)!\n", __func__,camera_seq,fd,ret); } +int anti_flicker_init(int scl) +{ + anti_flicker_scl(scl); + anti_flicker_count += 1; + return 0; +} + +int ae_select_init(int scl) +{ + switch (scl) + { + case AE_SELECT_SW_MODE: + mediactl_all_set_ae = mediactl_sw_set_ae; + break; + case AE_SELECT_HW_MODE: + mediactl_all_set_ae = mediactl_hw_set_ae; + ae_hw_set_f2k = TRUE; + ae_hw_set_r2k = TRUE; + break; + default: + mediactl_all_set_ae = mediactl_sw_set_ae; + break; + } + return 0; +} + +int adaptive_enable(int scl) +{ + switch (scl) + { + case ADAPTIVE_SELECT_DISABLE: + adaptive_enable_scl = FALSE; + break; + case ADAPTIVE_SELECT_ENABLE: + adaptive_enable_scl = TRUE; + default: + adaptive_enable_scl = TRUE; + break; + } + return 0; +} + +int ae_enable_set(enum isp_pipeline_e pipeline, void * pipe) +{ + // enable normal ae will use + struct media_entity * temp_pipe = (struct media_entity *)pipe; + int ret = 0; + static struct k510isp_reg_val ae_set_reg[] = { + {0x0050, 3}, // ae enable + {0x007c, 1}, // ae adjust + {0x0258, 1023}, // 2dnr adp enable + {0x02bc, 19}, // sharpness adp enable + }; + int reg_val_size = sizeof(struct k510isp_reg_val); + int size = sizeof(ae_set_reg) / reg_val_size; + /* f2k */ + ret = v4l2_subdev_open(temp_pipe); + if (ret < 0) + { + return ret; + } + for(int i = 0; i < size; i++) + { + if(pipeline == ISP_F2K_PIPELINE) + { + ret = ioctl(temp_pipe->fd,VIDIOC_K510ISP_F2K_CORE_REG_SET, &ae_set_reg[i]); + ae_hw_set_f2k = FALSE; + } + else if(pipeline == ISP_R2K_PIPELINE) + { + ret = ioctl(temp_pipe->fd,VIDIOC_K510ISP_R2K_CORE_REG_SET, &ae_set_reg[i]); + ae_hw_set_r2k = FALSE; + } + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_K510ISP_[F2K or R2K]_CORE_REG_SET) failed ret(%d) with %d\n", __func__,ret, i); + v4l2_subdev_close(temp_pipe); + return ret; + } + } + v4l2_subdev_close(temp_pipe); + return 0; +} + +#ifdef CALLBACK_TEST +int test_isp_callback_ircut(void * val) +{ + CB_IR_CUT_T * ir_cut_val = (CB_IR_CUT_T *)val; + printf("ptr : %p\n", val); + printf("ircut callback current ctl mode: %d\n",ir_cut_val->nIrCutCtl); + printf("ircut callback current sensor: %d\n",ir_cut_val->nSensor); + return 10012; +} +#endif + pthread_t isp_f2k_ae, isp_r2k_ae, isp_all_ae; int mediactl_init(char *video_cfg_file,struct video_info *dev_info) { - int ret; + int ret = 0; struct isp_csi2_info mipi_csi2; - struct vi_cfg_info vi_cfg; + struct vi_cfg_info vi_cfg; memset(&v4l_isp, 0, sizeof v4l_isp); struct isp_pipeline_s *isp_pipeline = NULL; struct sensor_info sensor0; @@ -1428,32 +1756,38 @@ int mediactl_init(char *video_cfg_file,struct video_info *dev_info) char *f2k_cfg_file = NULL;//f2k_cfg_file[50]; char *r2k_cfg_file = NULL;//r2k_cfg_file[50]; - if( video_cfg_file != NULL) + // will init here, if antiflicker scl not init once before + if(anti_flicker_count < 1) { - - printf("%s:%s\n",__func__,video_cfg_file); - dofile_video_cfg(video_cfg_file,&vi_cfg,&sensor0,&sensor1,dev_info); - dofile_csi2(video_cfg_file,&mipi_csi2); - dofile_vi(video_cfg_file,&vi_cfg); - f2k_cfg_file = &sensor0.sensor_cfg_file; - r2k_cfg_file = &sensor1.sensor_cfg_file; - } - else - { - printf("%s:Error,no video_cfg_file!\n",__func__); - return -1; + anti_flicker_scl(ANTI_FLICKER_ALL2K_ENABLE); } - if((f2k_cfg_file != NULL)||(r2k_cfg_file != NULL)) - { + if( video_cfg_file != NULL) + { - if(f2k_cfg_file != NULL) - { - printf("%s:%s\n",__func__,f2k_cfg_file); + printf("%s:%s\n",__func__,video_cfg_file); + dofile_video_cfg(video_cfg_file,&vi_cfg,&sensor0,&sensor1,dev_info); + dofile_csi2(video_cfg_file,&mipi_csi2); + dofile_vi(video_cfg_file,&vi_cfg); + f2k_cfg_file = &sensor0.sensor_cfg_file; + r2k_cfg_file = &sensor1.sensor_cfg_file; + } + else + { + printf("%s:Error,no video_cfg_file!\n",__func__); + return -1; + } + + if((f2k_cfg_file != NULL)||(r2k_cfg_file != NULL)) + { + + if(f2k_cfg_file != NULL) + { + printf("%s:%s\n",__func__,f2k_cfg_file); + + dofile_isp(f2k_cfg_file,&sensor0); + isp_pipeline = &v4l_isp.isp_pipeline[ISP_F2K]; - dofile_isp(f2k_cfg_file,&sensor0); - isp_pipeline = &v4l_isp.isp_pipeline[ISP_F2K]; - // sprintf(&isp_pipeline->sensor_name[0],"%s",&sensor0.sensor_name[0]); pipline_cfg(isp_pipeline,&sensor0); @@ -1480,6 +1814,8 @@ int mediactl_init(char *video_cfg_file,struct video_info *dev_info) //print_csi2_info(&mipi_csi2); //print_vi_info(&vi_cfg); //print_isp_info(&f2k_isp_cfg); + /* ae ctl */ + ae_ctl_init(ISP_F2K_PIPELINE, &sensor0.isp_cfg.isp_core_cfg); } if(r2k_cfg_file != NULL) @@ -1502,6 +1838,8 @@ int mediactl_init(char *video_cfg_file,struct video_info *dev_info) sprintf(&isp_pipeline->video_entity_info[1].video_entity_name[0],"%s","CANAAN K510 ISP R2K_DS0 output"); sprintf(&isp_pipeline->video_entity_info[2].video_entity_name[0],"%s","CANAAN K510 ISP R2K_DS1 output"); sprintf(&isp_pipeline->video_entity_info[3].video_entity_name[0],"%s","CANAAN K510 ISP R2K_DS2 output"); + /* ae ctl */ + ae_ctl_init(ISP_R2K_PIPELINE, &sensor1.isp_cfg.isp_core_cfg); } } else @@ -1510,68 +1848,102 @@ int mediactl_init(char *video_cfg_file,struct video_info *dev_info) return -1; } - /* Open the media device and setup the capture pipeline. The pipeline - * topology is hardcoded to sensor -> dphy->csi2->f2k -> f2k output. - */ + /* Open the media device and setup the capture pipeline. The pipeline + * topology is hardcoded to sensor -> dphy->csi2->f2k -> f2k output. + */ int flags = 0; //0--close debug info ;1--open debug info - v4l_isp.mdev = media_open(MEDIA_DEVICE, flags); - if (v4l_isp.mdev == NULL) { - printf("%s error: unable to open media device %s\n", __func__,MEDIA_DEVICE); - return -1; - } + v4l_isp.mdev = media_open(MEDIA_DEVICE, flags); + if (v4l_isp.mdev == NULL) { + printf("%s error: unable to open media device %s\n", __func__,MEDIA_DEVICE); + return -1; + } + // + ret = isp_pipeline_setup(&v4l_isp); + if (ret < 0) { + printf("%s error: unable to setup pipeline\n", __func__); + return -1; + } // - ret = isp_pipeline_setup(&v4l_isp); - if (ret < 0) { - printf("%s error: unable to setup pipeline\n", __func__); - return -1; - } - // #if 0 - ret = sysctl_rst_mipicsi2(v4l_isp.csi2); - if (ret < 0) { - printf("%s:error: unable to sysctl_rst_mipicsi2 %d\n",__func__,ret); - return -1; - } + ret = sysctl_rst_mipicsi2(v4l_isp.csi2); + if (ret < 0) { + printf("%s:error: unable to sysctl_rst_mipicsi2 %d\n",__func__,ret); + return -1; + } - ret = sysctl_rst_vi(v4l_isp.vi); - if (ret < 0) { - printf("%s:error: unable to sysctl_rst_vi %d\n",__func__,ret); - return -1; - } + ret = sysctl_rst_vi(v4l_isp.vi); + if (ret < 0) { + printf("%s:error: unable to sysctl_rst_vi %d\n",__func__,ret); + return -1; + } - ret = sysctl_rst_f2k(v4l_isp.f2k); - if (ret < 0) { - printf("%s:error: unable to sysctl_rst_f2k %d\n",__func__,ret); - return -1; - } + ret = sysctl_rst_f2k(v4l_isp.f2k); + if (ret < 0) { + printf("%s:error: unable to sysctl_rst_f2k %d\n",__func__,ret); + return -1; + } - ret = sysctl_rst_r2k(v4l_isp.r2k); - if (ret < 0) { - printf("%s:error: unable to sysctl_rst_r2k %d\n",__func__,ret); - return -1; - } + ret = sysctl_rst_r2k(v4l_isp.r2k); + if (ret < 0) { + printf("%s:error: unable to sysctl_rst_r2k %d\n",__func__,ret); + return -1; + } #endif - // - if(isp_share_memory_alloc()) - return -1; - // - if( v4l_isp.isp_pipeline[ISP_F2K].pipeline_en == 1 ) - { - ret = isp_f2k_cfg(v4l_isp.f2k,&sensor0.isp_cfg,allocAlignMem[0].phyAddr); - if (ret < 0) { - printf("%s:error: unable to f2k cfg video %d\n",__func__,ret); - return -1; - } - } + // + if(isp_share_memory_alloc()) + return -1; + // + if( v4l_isp.isp_pipeline[ISP_F2K].pipeline_en == 1 ) + { + ret = isp_f2k_cfg(v4l_isp.f2k,&sensor0.isp_cfg,allocAlignMem[0].phyAddr); + if (ret < 0) { + printf("%s:error: unable to f2k cfg video %d\n",__func__,ret); + return -1; + } + + // adaptive_param_init(ISP_F2K_PIPELINE, adaptive_sensor_name_s, sensor0.sensor_name); + + if (ret < 0) { + printf("%s:error: unable to init f2k adaptive %d\n",__func__,ret); + return -1; + } + } + + if( v4l_isp.isp_pipeline[ISP_R2K].pipeline_en == 1 ) + { + ret = isp_r2k_cfg(v4l_isp.r2k,&sensor1.isp_cfg,allocAlignMem[1].phyAddr); + if (ret < 0) { + printf("%s:error: unable to r2k cfg video %d\n",__func__,ret); + return -1; + } + + // adaptive_param_init(ISP_R2K_PIPELINE, adaptive_sensor_name_s, sensor1.sensor_name); - if( v4l_isp.isp_pipeline[ISP_R2K].pipeline_en == 1 ) - { - ret = isp_r2k_cfg(v4l_isp.r2k,&sensor1.isp_cfg,allocAlignMem[1].phyAddr); if (ret < 0) { - printf("%s:error: unable to r2k cfg video %d\n",__func__,ret); + printf("%s:error: unable to init r2k adaptive %d\n",__func__,ret); return -1; - } + } } + // ae ctl + ae_ctl_cfg_init(v4l_isp.isp_pipeline[ISP_F2K].pipeline_en, v4l_isp.isp_pipeline[ISP_R2K].pipeline_en, ae_ctl_sensor_name_s,sensor0.sensor_name, sensor1.sensor_name); + ADAPTIVE_IMG_TIMING_CFG_T adaptive_img_timing; + adaptive_img_timing.nItcTtlV = AE_Para_Inf[ISP_F2K].FrameLines; + adaptive_img_timing.nMaxExpLine = AE_Para_Inf[ISP_F2K].maxET; + adaptive_img_timing.nMinExpLine = AE_Para_Inf[ISP_F2K].minET; + adaptive_img_timing.nMaxGain = AE_Para_Inf[ISP_F2K].maxGain; + adaptive_img_timing.nMinGain = AE_Para_Inf[ISP_F2K].minGain; + adaptive_img_timing.nDefaultSaturation = sensor0.isp_cfg.isp_core_cfg.postInfo.satu_ad_intensity; + adaptive_calc_feture_init(ISP_F2K, adaptive_img_timing); + adaptive_param_init(ISP_F2K_PIPELINE, &adaptive_sensor_name_s, sensor0.sensor_name); + + adaptive_img_timing.nItcTtlV = AE_Para_Inf[ISP_R2K].FrameLines; + adaptive_img_timing.nMaxExpLine = AE_Para_Inf[ISP_R2K].maxET; + adaptive_img_timing.nMinExpLine = AE_Para_Inf[ISP_R2K].minET; + adaptive_img_timing.nMaxGain = AE_Para_Inf[ISP_R2K].maxGain; + adaptive_img_timing.nMinGain = AE_Para_Inf[ISP_R2K].minGain; + adaptive_img_timing.nDefaultSaturation = sensor1.isp_cfg.isp_core_cfg.postInfo.satu_ad_intensity; + adaptive_calc_feture_init(ISP_R2K, adaptive_img_timing); + adaptive_param_init(ISP_R2K_PIPELINE, &adaptive_sensor_name_s, sensor1.sensor_name); // printf("%s:total_size.width(0x%x),total_size.height(0x%x)\n",__func__,vi_cfg.vi_pipe_cfg[0].total_size.width,vi_cfg.vi_pipe_cfg[0].total_size.height); // @@ -1587,351 +1959,356 @@ int mediactl_init(char *video_cfg_file,struct video_info *dev_info) return -1; } + // adaptive_sensor_init(ISP_F2K, v4l_isp.sensor0); + // adaptive_sensor_init(ISP_R2K, v4l_isp.sensor1); + adaptive_device_init(4, v4l_isp.f2k, v4l_isp.r2k, v4l_isp.sensor0, v4l_isp.sensor1); + ae_ctl_device_init(4, v4l_isp.f2k, v4l_isp.r2k, v4l_isp.sensor0, v4l_isp.sensor1); +#ifdef CALLBACK_TEST + ISP_CB_T isp_cb = { + .nIcbId = ISP_CALLBACK_ID_IRCUT, + .nSize = sizeof(CB_IR_CUT_T) / sizeof(int), + .pIspfunc = test_isp_callback_ircut, + }; + isp_module_callback_register(&isp_cb); +#endif #if 0 - if((v4l_isp.isp_pipeline[ISP_F2K].pipeline_en == 1) && ( v4l_isp.isp_pipeline[ISP_R2K].pipeline_en == 1 )) - { - pthread_create(&isp_all_ae,NULL,run_all_ae_video,NULL); - } - else if( v4l_isp.isp_pipeline[ISP_F2K].pipeline_en == 1 ) - { - pthread_create(&isp_f2k_ae,NULL,run_f2k_ae_video,NULL); - } - else if( v4l_isp.isp_pipeline[ISP_R2K].pipeline_en == 1 ) - { - pthread_create(&isp_r2k_ae,NULL,run_r2k_ae_video,NULL); - } + if((v4l_isp.isp_pipeline[ISP_F2K].pipeline_en == 1) && ( v4l_isp.isp_pipeline[ISP_R2K].pipeline_en == 1 )) + { + pthread_create(&isp_all_ae,NULL,run_all_ae_video,NULL); + } + else if( v4l_isp.isp_pipeline[ISP_F2K].pipeline_en == 1 ) + { + pthread_create(&isp_f2k_ae,NULL,run_f2k_ae_video,NULL); + } + else if( v4l_isp.isp_pipeline[ISP_R2K].pipeline_en == 1 ) + { + pthread_create(&isp_r2k_ae,NULL,run_r2k_ae_video,NULL); + } #else - if(v4l_isp.isp_pipeline[ISP_R2K].pipeline_en == 1 && v4l_isp.isp_pipeline[ISP_F2K].pipeline_en == 1) { - pthread_create(&isp_all_ae, NULL, run_all_ae_video, NULL); - //pthread_create(&isp_r2k_ae, NULL, run_r2k_ae_video, NULL); - //pthread_create(&isp_f2k_ae, NULL, run_f2k_ae_video, NULL); - } else if (v4l_isp.isp_pipeline[ISP_R2K].pipeline_en == 1) { - pthread_create(&isp_r2k_ae, NULL, run_r2k_ae_video, NULL); - } else if( v4l_isp.isp_pipeline[ISP_F2K].pipeline_en == 1 ) { - pthread_create(&isp_f2k_ae, NULL, run_f2k_ae_video, NULL); - } + pthread_create(&isp_all_ae, NULL, run_all_ae_video, NULL); #endif - return 0; + return 0; } /** - * @brief - * + * @brief + * */ - int mediactl_set_ae(enum isp_pipeline_e pipeline) +int mediactl_set_ae(enum isp_pipeline_e pipeline) { - int ret; + int ret = 0; #if 0 - if(Sensor1_Sync == FALSE) - { - ret = mediactl_set_ae_single(pipeline); - } - else - { - if(pipeline == ISP_F2K_PIPELINE) - { - ret = mediactl_set_ae_sync(pipeline); - ret = mediactl_set_awb_sync(pipeline); - } - } + if(Sensor1_Sync == FALSE) + { + ret = mediactl_set_ae_single(pipeline); + } + else + { + if(pipeline == ISP_F2K_PIPELINE) + { + ret = mediactl_set_ae_sync(pipeline); + ret = mediactl_set_awb_sync(pipeline); + } + } #endif - return ret; + return ret; +} + +/** + * @brief Use ISP to draw rect. + * @param pipeline + * @param layer 0: main out, 1: DS0, 2: DS1. + * @param area support 32 area, 0 to 31 + * @param x + * @param y + * @param width + * @param height + * @param line_width 0 to 63 pixels + * @param color AYCbCr, Alpha as hight bits, Cr as low bits + * @param border_mask up/right/bottom/left, up as low bit, left as hight bit + * @return return 0 if success, -1 if failed. + */ +int mediactl_rect(enum isp_pipeline_e pipeline, unsigned layer, unsigned area, unsigned x, unsigned y, unsigned width, unsigned height, unsigned line_width, unsigned color, unsigned border_mask) { + struct isp_remap_cfg_info cfg = { + .DrawAreaNum = area, + .LineCtlSet = 0, + .LineDataSet = 0, + .LineEndPosX = x + width, + .LineStartPosX = x, + .LineStartPosY = y, + .LineEndPosY = y + height, + .LineDrawEn = 1, + .VlineRightEn = (border_mask >> 1) & 1, + .VlineLeftEn = (border_mask >> 3) & 1, + .HlineBottomEn = (border_mask >> 2) & 1, + .HlineUpEn = border_mask & 1, + .LineWidthL = line_width & 0b111, + .LineWidthH = line_width >> 3, + .ValueCr = color & 0xff, + .ValueCb = (color >> 8) & 0xff, + .ValueY = (color >> 16) & 0xff, + .ValueAlpha = color >> 24 + }; + struct media_entity *pipe; + if (pipeline == ISP_F2K_PIPELINE) { + pipe = v4l_isp.f2k; + } else if (pipeline == ISP_R2K_PIPELINE) { + pipe = v4l_isp.r2k; + } else { + return -1; + } + int ret = v4l2_subdev_open(pipe); + if (ret < 0) { + return ret; + } + unsigned long req[2][3] = { + {VIDIOC_K510ISP_F2K_REMAP_MAIN_CFG, VIDIOC_K510ISP_F2K_REMAP_OUT0_CFG, VIDIOC_K510ISP_F2K_REMAP_OUT1_CFG}, + {VIDIOC_K510ISP_R2K_REMAP_MAIN_CFG, VIDIOC_K510ISP_R2K_REMAP_OUT0_CFG, VIDIOC_K510ISP_R2K_REMAP_OUT1_CFG}, + }; + ret = ioctl(pipe->fd, req[pipeline - ISP_F2K_PIPELINE][layer], &cfg); + v4l2_subdev_close(pipe); + return ret; } int mediactl_set_ae_single(enum isp_pipeline_e pipeline) { - int ret, i; - struct k510isp_ae_stats ae_stats; - struct media_entity *pipe; - static unsigned int ET_sensor0 = 0; - static unsigned int ET_sensor1 = 0; - static unsigned int Gain_sensor0 = 0; - static unsigned int Gain_sensor1 = 0; - - if(ISP_F2K_PIPELINE == pipeline) - { - - pipe = v4l_isp.f2k; - ret = v4l2_subdev_open(pipe); - if (ret < 0) - return ret; - - ret = ioctl(pipe->fd,VIDIOC_K510ISP_F2K_AE_STAT_REQ,&ae_stats); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_K510ISP_F2K_AE_STAT_REQ) failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(pipe); - return ret; - } - - //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); - v4l2_subdev_close(pipe); - // - struct media_entity *sensor0 = v4l_isp.sensor0; - if( ae_stats.ae_wren == 1) - { - ret = v4l2_subdev_open(sensor0); - if (ret < 0) - return ret; + int ret; + struct k510isp_ae_stats ae_stats; + struct media_entity *pipe; + static unsigned int ET_sensor0 = 0; + static unsigned int ET_sensor1 = 0; + static unsigned int Gain_sensor0 = 0; + static unsigned int Gain_sensor1 = 0; + + if(ISP_F2K_PIPELINE == pipeline) + { + + pipe = v4l_isp.f2k; + ret = v4l2_subdev_open(pipe); + if (ret < 0) + return ret; + + ret = ioctl(pipe->fd,VIDIOC_K510ISP_F2K_AE_STAT_REQ,&ae_stats); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_K510ISP_F2K_AE_STAT_REQ) failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(pipe); + return ret; + } - struct v4l2_control control_s; - - if (ae_stats.ae_expl != ET_sensor0) - { - control_s.id = V4L2_CID_EXPOSURE; - control_s.value = ae_stats.ae_expl; - ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor0); - return ret; - } - ET_sensor0 = control_s.value; - } + //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); + v4l2_subdev_close(pipe); + // + struct media_entity *sensor0 = v4l_isp.sensor0; + if( ae_stats.ae_wren == 1) + { + ret = v4l2_subdev_open(sensor0); + if (ret < 0) + return ret; + + struct v4l2_control control_s; + + if (ae_stats.ae_expl != ET_sensor0) + { + control_s.id = V4L2_CID_EXPOSURE; + control_s.value = ae_stats.ae_expl; + ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor0); + return ret; + } + ET_sensor0 = control_s.value; + } - if(ae_stats.ae_agco != Gain_sensor0) - { - control_s.id = V4L2_CID_GAIN; - control_s.value = ae_stats.ae_agco; - ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor0); - return ret; - } - Gain_sensor0 = control_s.value; - } - v4l2_subdev_close(sensor0); - } - } + if(ae_stats.ae_agco != Gain_sensor0) + { + control_s.id = V4L2_CID_GAIN; + control_s.value = ae_stats.ae_agco; + ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor0); + return ret; + } + Gain_sensor0 = control_s.value; + } + v4l2_subdev_close(sensor0); + } + } - if(ISP_R2K_PIPELINE == pipeline) - { + if(ISP_R2K_PIPELINE == pipeline) + { - pipe = v4l_isp.r2k; - ret = v4l2_subdev_open(pipe); - if (ret < 0) - return ret; + pipe = v4l_isp.r2k; + ret = v4l2_subdev_open(pipe); + if (ret < 0) + return ret; - ret = ioctl(pipe->fd,VIDIOC_K510ISP_R2K_AE_STAT_REQ,&ae_stats); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_K510ISP_R2K_AE_STAT_REQ) failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(pipe); - return ret; - } - //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); - v4l2_subdev_close(pipe); - // - struct media_entity *sensor1 = v4l_isp.sensor1; - if( ae_stats.ae_wren == 1) - { - ret = v4l2_subdev_open(sensor1); - if (ret < 0) - return ret; + ret = ioctl(pipe->fd,VIDIOC_K510ISP_R2K_AE_STAT_REQ,&ae_stats); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_K510ISP_R2K_AE_STAT_REQ) failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(pipe); + return ret; + } + //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); + v4l2_subdev_close(pipe); + // + struct media_entity *sensor1 = v4l_isp.sensor1; + if( ae_stats.ae_wren == 1) + { + ret = v4l2_subdev_open(sensor1); + if (ret < 0) + return ret; + + struct v4l2_control control_s; + + if (ae_stats.ae_expl != ET_sensor1) + { + + control_s.id = V4L2_CID_EXPOSURE; + control_s.value = ae_stats.ae_expl; + ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor1); + return ret; + } + ET_sensor1 = control_s.value; + } - struct v4l2_control control_s; + if(ae_stats.ae_agco != Gain_sensor1) + { + control_s.id = V4L2_CID_GAIN; + control_s.value = ae_stats.ae_agco; + ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor1); + return ret; + } + Gain_sensor1 = control_s.value; + } + v4l2_subdev_close(sensor1); + } + } - if (ae_stats.ae_expl != ET_sensor1) - { - - control_s.id = V4L2_CID_EXPOSURE; - control_s.value = ae_stats.ae_expl; - ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor1); - return ret; - } - ET_sensor1 = control_s.value; - } - - if(ae_stats.ae_agco != Gain_sensor1) - { - control_s.id = V4L2_CID_GAIN; - control_s.value = ae_stats.ae_agco; - ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor1); - return ret; - } - Gain_sensor1 = control_s.value; - } - v4l2_subdev_close(sensor1); - } - } - - return 0; + return 0; } int mediactl_set_ae_sync(enum isp_pipeline_e pipeline) { - int ret; - struct k510isp_ae_stats ae_stats; - struct media_entity *pipe; - static unsigned int ET_current = 0; - static unsigned int Gain_current = 0; - - if(ISP_F2K_PIPELINE == pipeline) - { - pipe = v4l_isp.f2k; - ret = v4l2_subdev_open(pipe); - if (ret < 0) - return ret; + int ret; + struct k510isp_ae_stats ae_stats; + struct media_entity *pipe; + static unsigned int ET_current = 0; + static unsigned int Gain_current = 0; + + if(ISP_F2K_PIPELINE == pipeline) + { + pipe = v4l_isp.f2k; + ret = v4l2_subdev_open(pipe); + if (ret < 0) + return ret; + + ret = ioctl(pipe->fd,VIDIOC_K510ISP_F2K_AE_STAT_REQ,&ae_stats); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_K510ISP_F2K_AE_STAT_REQ) failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(pipe); + return ret; + } + //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); + v4l2_subdev_close(pipe); + // + if( ae_stats.ae_wren == 1) + { + //sensor0 + struct media_entity *sensor0 = v4l_isp.sensor0; + ret = v4l2_subdev_open(sensor0); + if (ret < 0) + return ret; + + //sensor1 + struct media_entity *sensor1 = v4l_isp.sensor1; + ret = v4l2_subdev_open(sensor1); + if (ret < 0) + return ret; + + struct v4l2_control control_s; + + //Set ET + if(ae_stats.ae_expl != ET_current) + { + control_s.id = V4L2_CID_EXPOSURE; + control_s.value = ae_stats.ae_expl; + ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor1); + return ret; + } + + ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor0); + return ret; + } + ET_current = control_s.value; + } + //Set gain + if(ae_stats.ae_agco != Gain_current) + { + control_s.id = V4L2_CID_GAIN; + control_s.value = ae_stats.ae_agco; + ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor1); + return ret; + } + ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); + if (ret < 0) + { + printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, + ret); + v4l2_subdev_close(sensor0); + return ret; + } + Gain_current = control_s.value; + } + v4l2_subdev_close(sensor1); + v4l2_subdev_close(sensor0); + } + } - ret = ioctl(pipe->fd,VIDIOC_K510ISP_F2K_AE_STAT_REQ,&ae_stats); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_K510ISP_F2K_AE_STAT_REQ) failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(pipe); - return ret; - } - //printf("%s:ae_wren(%d),ae_expl(%d),ae_agco(%d)\n",__func__,ae_stats.ae_wren,ae_stats.ae_expl,ae_stats.ae_agco); - v4l2_subdev_close(pipe); - // - if( ae_stats.ae_wren == 1) - { - //sensor0 - struct media_entity *sensor0 = v4l_isp.sensor0; - ret = v4l2_subdev_open(sensor0); - if (ret < 0) - return ret; - - //sensor1 - struct media_entity *sensor1 = v4l_isp.sensor1; - ret = v4l2_subdev_open(sensor1); - if (ret < 0) - return ret; - - struct v4l2_control control_s; - - //Set ET - if(ae_stats.ae_expl != ET_current) - { - control_s.id = V4L2_CID_EXPOSURE; - control_s.value = ae_stats.ae_expl; - ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor1); - return ret; - } - - ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_EXPOSURE)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor0); - return ret; - } - ET_current = control_s.value; - } - //Set gain - if(ae_stats.ae_agco != Gain_current) - { - control_s.id = V4L2_CID_GAIN; - control_s.value = ae_stats.ae_agco; - ret = ioctl(sensor1->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor1); - return ret; - } - ret = ioctl(sensor0->fd,VIDIOC_S_CTRL,&control_s); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_S_CTRL-V4L2_CID_GAIN)failed ret(%d)\n", __func__, - ret); - v4l2_subdev_close(sensor0); - return ret; - } - Gain_current = control_s.value; - } - v4l2_subdev_close(sensor1); - v4l2_subdev_close(sensor0); - } - } - - return 0; + return 0; } -int mediactl_set_awb_sync(enum isp_pipeline_e pipeline) -{ - int ret; - struct k510isp_awb_sync_info awb_sync_info; - static unsigned int awb_prev_frame_rgain = 0,awb_prev_frame_bgain = 0; - struct media_entity *pipe_f2k,*pipe_r2k; - pipe_f2k = v4l_isp.f2k; - pipe_r2k = v4l_isp.r2k; - - if(Awb_Sync_Init) - { - isp_awb_sync_init(); - Awb_Sync_Init = FALSE; - } - - if(ISP_F2K_PIPELINE == pipeline) - { - // get f2k awb ctl mode auto or handle - ret = v4l2_subdev_open(pipe_f2k); - if (ret < 0) - return ret; - - ret = v4l2_subdev_open(pipe_r2k); - if (ret < 0) - return ret; - - // get f2k AWB GAIN VALUE - ret = ioctl(pipe_f2k->fd,VIDIOC_K510ISP_F2K_AWB_VAL_GET,&awb_sync_info); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_K510ISP_F2K_AWB_VAL_GET) failed ret(%d)\n", __func__,ret); - v4l2_subdev_close(pipe_f2k); - return ret; - } - - // if value change set f2k AWB GAIN VALUE to r2k - if ((awb_sync_info.awb_ar != awb_prev_frame_rgain) || (awb_sync_info.awb_ab != awb_prev_frame_bgain)) - { - if (ret < 0) - return ret; - ret = ioctl(pipe_r2k->fd,VIDIOC_K510ISP_R2K_AWB_VAL_SET,&awb_sync_info); - if (ret < 0) - { - printf("%s: ioctl(VIDIOC_K510ISP_R2K_AWB_VAL_SET) failed ret(%d)\n", __func__,ret); - v4l2_subdev_close(pipe_r2k); - return ret; - } - } - awb_prev_frame_rgain = awb_sync_info.awb_ar; - awb_prev_frame_bgain = awb_sync_info.awb_ab; - v4l2_subdev_close(pipe_f2k); - v4l2_subdev_close(pipe_r2k); - } - return 0; -} /** - * @brief - * + * @brief + * */ void mediactl_exit(void) { @@ -1943,10 +2320,10 @@ void mediactl_exit(void) media_close(v4l_isp.mdev); } /* - pthread_kill(isp_f2k_ae, SIGALRM); + pthread_kill(isp_f2k_ae, SIGALRM); pthread_join(isp_f2k_ae, NULL); - pthread_kill(isp_r2k_ae, SIGALRM); + pthread_kill(isp_r2k_ae, SIGALRM); pthread_join(isp_r2k_ae, NULL); */ // @@ -1956,16 +2333,16 @@ void mediactl_exit(void) system("echo 3 > /proc/sys/vm/drop_caches"); } /** - * @brief - * - * @param addr - * @return unsigned int + * @brief + * + * @param addr + * @return unsigned int */ unsigned int ISPRegRead(unsigned int addr) { char result[64] = {0}; - char buf[64] = {0}; + char buf[64] = {0}; char cmd[64] = {0}; unsigned ret; FILE *fp = NULL; @@ -1991,7 +2368,7 @@ unsigned int ISPRegRead(unsigned int addr) unsigned int ISPRegWrite(unsigned int addr, unsigned int value) { char cmd[64] = {0}; - unsigned ret; + // unsigned ret = 0; FILE *fp = NULL; sprintf(cmd, "devmem 0x%08X 32 0x%08X\n", addr, value); @@ -2004,5 +2381,77 @@ unsigned int ISPRegWrite(unsigned int addr, unsigned int value) return 1; } +int ae_hist_mode_scl(enum isp_pipeline_e pipeline, enum ae_hist_mode_e ae_hist_mode, AE_HIST_WINDOW_T * hist_window) +{ + int ret = 0; + ADAPTIVE_ISP_AE_CTL_U ae_ctl_u; + struct k510isp_reg_val ae_ctl_reg[5] = + { + {ISP_CORE_AE_CTL, 0x0}, // ae ctl 0x450 + {ISP_CORE_AE_WIN_H_START, 0x0}, // hist mode h start 0x0454 + {ISP_CORE_AE_WIN_V_START, 0x0}, // hist mode v start 0x0458 + {ISP_CORE_AE_WIN_H_END, 0x0}, // hist mode h end 0x045c + {ISP_CORE_AE_WIN_V_END, 0x0}, // hist mode v end 0x0460 + }; + + switch (ae_hist_mode) + { + case AE_HIST_MODE_WHOLE_PICTURE: + case AE_HIST_MODE_CENTRAL_AERA: + ret = adaptive_select_moudel_get(pipeline, pipeline == ISP_F2K_PIPELINE ? v4l_isp.f2k : v4l_isp.r2k, 1, ae_hist_mode == AE_HIST_MODE_WHOLE_PICTURE ? 1 : 5, ae_ctl_reg); + if(ret != 0) + { + return -2; + } + ae_ctl_u.u32 = ae_ctl_reg[0].reg_value; + ae_ctl_u.bits.ae_win_sl = ae_hist_mode; + ae_ctl_reg[0].reg_value = ae_ctl_u.u32; + ae_ctl_reg[1].reg_value = hist_window == NULL ? 0 : hist_window->nHStart; + ae_ctl_reg[2].reg_value = hist_window == NULL ? 0 : hist_window->nVStart; + ae_ctl_reg[3].reg_value = hist_window == NULL ? 0 : hist_window->nHEnd; + ae_ctl_reg[4].reg_value = hist_window == NULL ? 0 : hist_window->nVEnd; + + ret = adaptive_select_moudel_apply(pipeline, pipeline == ISP_F2K_PIPELINE ? v4l_isp.f2k : v4l_isp.r2k, 1, ae_hist_mode == AE_HIST_MODE_WHOLE_PICTURE ? 1 : 5, ae_ctl_reg); + if(ret) + { + printf("%s, ae hist mode set failed!\n", __func__); + } + break; + default: + printf("%s, unknown ae hist mode %d, set failed!\n", __func__, ae_hist_mode); + return -1; + } + return 0; +} +int isp_module_callback_register(ISP_CB_T * icb) +{ + int ret = 0; + ret = adaptive_callback_register((ADAP_CB_T *)icb); + return ret; +} +int isp_module_callback_ctl_stat(enum isp_pipeline_e pipeline, enum isp_callback_id cbid) +{ + return adaptive_callback_ctl_stat(pipeline, cbid); +} + +int ir_cut_ev_get(enum isp_pipeline_e pipeline, enum ir_cut_mode_e ir_cut_mode) +{ + return adap_ir_cut_ev_get(pipeline, ir_cut_mode); +} + +int ir_cut_ev_set(enum isp_pipeline_e pipeline, enum ir_cut_mode_e ir_cut_mode, int level) +{ + return adap_ir_cut_ev_set(pipeline, ir_cut_mode, level); +} + +float ir_cut_hold_time_get(enum isp_pipeline_e pipeline, enum ir_cut_mode_e ir_cut_mode) +{ + return adap_ir_cut_hold_time_get(pipeline, ir_cut_mode); +} + +int ir_cut_hold_time_set(enum isp_pipeline_e pipeline, enum ir_cut_mode_e ir_cut_mode, float hold_time) +{ + return adap_ir_cut_hold_time_set(pipeline, ir_cut_mode, hold_time); +} \ No newline at end of file diff --git a/package/mediactl_lib/src/media_ctl.h b/package/mediactl_lib/src/media_ctl.h index 1a51e47..8197eb9 100644 --- a/package/mediactl_lib/src/media_ctl.h +++ b/package/mediactl_lib/src/media_ctl.h @@ -25,7 +25,7 @@ #ifndef __MEDIACTL_H__ #define __MEDIACTL_H__ -#ifdef __cplusplus +#ifdef __cplusplus extern "C"{ #endif @@ -78,15 +78,98 @@ struct video_info unsigned int video_out_format[4]; }; +enum ae_select_e +{ + AE_SELECT_SW_MODE, + AE_SELECT_HW_MODE, +}; + +enum adaptive_enable_select_e +{ + ADAPTIVE_SELECT_DISABLE, + ADAPTIVE_SELECT_ENABLE, +}; + +enum ae_hist_mode_e +{ + AE_HIST_MODE_WHOLE_PICTURE, + AE_HIST_MODE_CENTRAL_AERA, +}; + +typedef struct __AE_HIST_WINDOW_T +{ + int nHStart; + int nVStart; + int nHEnd; + int nVEnd; +} AE_HIST_WINDOW_T; + +enum isp_callback_id +{ + ISP_CALLBACK_ID_START = -1, // -1 + ISP_CALLBACK_ID_BLC, // 0 + ISP_CALLBACK_ID_LSC, // 1 + ISP_CALLBACK_ID_SHARPNESS, // 2 + ISP_CALLBACK_ID_LTM, // 3 + ISP_CALLBACK_ID_2DNR, // 4 + ISP_CALLBACK_ID_3DNR, // 5 + ISP_CALLBACK_ID_WDR, // 6 + ISP_CALLBACK_ID_CCM, // 7 + ISP_CALLBACK_ID_AWB, // 8 + ISP_CALLBACK_ID_GAMMA, // 9 + ISP_CALLBACK_ID_IRCUT, // 10 + ISP_CALLBACK_ID_SATURATION, // 11 + ISP_CALLBACK_ID_COLOR2BW, // 12 + ISP_CALLBACK_ID_ADA, // 13 + ISP_CALLBACK_ID_END, // 14 +}; + +enum ir_cut_mode_e { + USER_IR_CUT_NIGHT, + USER_IR_CUT_DAY, +}; + +/* user callback function */ +typedef int (* __IspCallBack)(void *); + +/* callback struct */ +typedef struct __ISP_CB_T +{ + __IspCallBack pIspfunc; // callback function + int nSize; // such as sizeof(CB_IR_CUT_T), depth copy need + enum isp_callback_id nIcbId; // callback moudel id, adap need know which use it +} ISP_CB_T; + int mediactl_init(char *video_cfg_file,struct video_info *dev_info); void mediactl_exit(void); +void mediactl_disable_ae(enum isp_pipeline_e pipeline); +int mediactl_rect(enum isp_pipeline_e pipeline, unsigned layer, unsigned area, unsigned x, unsigned y, unsigned width, unsigned height, unsigned line_width, unsigned color, unsigned border_mask); int mediactl_set_ae(enum isp_pipeline_e pipeline); int mediactl_set_ae_single(enum isp_pipeline_e pipeline); int mediactl_set_ae_sync(enum isp_pipeline_e pipeline); int mediactl_set_awb_sync(enum isp_pipeline_e pipeline); +int mediactl_sw_set_ae(enum isp_pipeline_e pipeline); +int mediactl_hw_set_ae(enum isp_pipeline_e pipeline); +int adaptive_enable(int scl); +int ae_select_init(int scl); +int anti_flicker_init(int scl); +int ae_enable_set(enum isp_pipeline_e pipeline, void * pipe); +/* AE HIST MODE API */ +int ae_hist_mode_scl(enum isp_pipeline_e pipeline, enum ae_hist_mode_e ae_hist_mode, AE_HIST_WINDOW_T * hist_window); +/* attr page API */ +int attr_page_params_setting(enum isp_pipeline_e pipeline, void * attr_page); +int attr_page_get_written_stat(enum isp_pipeline_e pipeline); +int isp_module_callback_register(ISP_CB_T * icb); +int isp_module_callback_ctl_stat(enum isp_pipeline_e pipeline, enum isp_callback_id cbid); unsigned int mediactl_get_isp_modules(enum isp_pipeline_e pipeline,enum isp_modules module); +/* ir cut API */ +int ir_cut_ev_get(enum isp_pipeline_e pipeline, enum ir_cut_mode_e ir_cut_mode); +int ir_cut_ev_set(enum isp_pipeline_e pipeline, enum ir_cut_mode_e ir_cut_mode, int level); +float ir_cut_hold_time_get(enum isp_pipeline_e pipeline, enum ir_cut_mode_e ir_cut_mode); +int ir_cut_hold_time_set(enum isp_pipeline_e pipeline, enum ir_cut_mode_e ir_cut_mode, float hold_time); + #ifdef __cplusplus -} +} #endif #endif /*__MEDIACTL_H__*/ diff --git a/package/mediactl_lib/src/v4l2_demo/Makefile b/package/mediactl_lib/src/v4l2_demo/Makefile index a3e6c7d..c623880 100644 --- a/package/mediactl_lib/src/v4l2_demo/Makefile +++ b/package/mediactl_lib/src/v4l2_demo/Makefile @@ -8,7 +8,7 @@ OBJS = v4l2-demo.c v4l2.c TARGET = v4l2-demo all: - ${CC} ${OBJS} -I../ -L../ -lpthread -lmediactl -lstdc++ -o ${TARGET} + ${CC} ${OBJS} -I../ -L../ -lpthread -lmediactl -ladaptive -l3actl -lstdc++ -o ${TARGET} @echo "Compile done." clean: @rm -f *o ${TARGET} diff --git a/package/mediactl_lib/src/v4l2_demo/media_ctl.h b/package/mediactl_lib/src/v4l2_demo/media_ctl.h index 3e7c69c..8721305 100644 --- a/package/mediactl_lib/src/v4l2_demo/media_ctl.h +++ b/package/mediactl_lib/src/v4l2_demo/media_ctl.h @@ -1,31 +1,31 @@ -/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __MEDIACTL_H__ #define __MEDIACTL_H__ -#ifdef __cplusplus +#ifdef __cplusplus extern "C"{ #endif @@ -78,9 +78,11 @@ struct video_info int mediactl_init(char *video_cfg_file,struct video_info *dev_info); void mediactl_exit(void); +int anti_flicker_init(int scl); +int ae_select_init(int scl); int mediactl_set_ae(enum isp_pipeline_e pipeline); unsigned int mediactl_get_isp_modules(enum isp_pipeline_e pipeline,enum isp_modules module); #ifdef __cplusplus -} +} #endif #endif /*__MEDIACTL_H__*/ diff --git a/package/mediactl_lib/src/v4l2_demo/v4l2-demo.c b/package/mediactl_lib/src/v4l2_demo/v4l2-demo.c index 8b9ff23..2216814 100644 --- a/package/mediactl_lib/src/v4l2_demo/v4l2-demo.c +++ b/package/mediactl_lib/src/v4l2_demo/v4l2-demo.c @@ -1,26 +1,26 @@ -/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include @@ -50,11 +50,11 @@ #include "media_ctl.h" #include "v4l2.h" -#define TOTAL_WIDTH 3448 //0x0d78 +#define TOTAL_WIDTH 3448 //0x0d78 #define TOTAL_HEIGHT 2200 //0x0898 -#define ACTIVE_WIDTH 1920 //1080 +#define ACTIVE_WIDTH 1920 //1080 #define ACTIVE_HEIGHT 1080 //1920 -#define VIDEO_WIDTH 1920 //1080 +#define VIDEO_WIDTH 1920 //1080 #define VIDEO_HEIGHT 1080 //1920 #define BUFFERS_COUNT 4 @@ -73,10 +73,10 @@ static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; * *************************************************************************/ /** - * @brief - * - * @param vdev - * @return int + * @brief + * + * @param vdev + * @return int */ static int video_setup(struct v4l2_device *vdev,struct v4l2_pix_format *format) { @@ -109,10 +109,10 @@ static int video_setup(struct v4l2_device *vdev,struct v4l2_pix_format *format) return 0; } /** - * @brief - * - * @param vdev - * @return int + * @brief + * + * @param vdev + * @return int */ static int video_start(struct v4l2_device *vdev) { @@ -128,7 +128,7 @@ static int video_start(struct v4l2_device *vdev) if (ret < 0) { printf("error: unable to queue buffer %u\n", i); return -errno; - } + } } /* Start video streaming. */ @@ -142,10 +142,10 @@ static int video_start(struct v4l2_device *vdev) return 0; } /** - * @brief - * - * @param vdev - * @return int + * @brief + * + * @param vdev + * @return int */ static int video_stop(struct v4l2_device *vdev) { @@ -162,9 +162,9 @@ static int video_stop(struct v4l2_device *vdev) return 0; } /** - * @brief - * - * @param vdev + * @brief + * + * @param vdev */ static void video_cleanup(struct v4l2_device *vdev) { @@ -183,12 +183,12 @@ static void sigint_handler(int signal __attribute__((__unused__))) { /* Set the done flag to true when the user presses CTRL-C to interrupt * the main loop. - */ + */ done = true; } /** - * @brief - * + * @brief + * */ int img_cnt[8] = {0}; static int process_yuv_image(struct v4l2_device *vdev,char *video_name,struct v4l2_pix_format *format,unsigned int video_num) @@ -210,12 +210,12 @@ static int process_yuv_image(struct v4l2_device *vdev,char *video_name,struct v4 printf("warning: error in dequeued buffer, skipping\n"); return 0; } - + if(img_cnt[video_num] < 20) - { + { sprintf(filename,"./%s_%dx%d_nv12_%d.yuv",&video_name[5],((width+15)/16*16),height,img_cnt[video_num]); printf("%s:%s\n",__func__,filename); - FILE *fd = fopen(filename, "wb"); + FILE *fd = fopen(filename, "wb"); if(fd == NULL) { printf("open %s failure, errno %d\n",filename,errno); @@ -242,13 +242,13 @@ static int process_yuv_image(struct v4l2_device *vdev,char *video_name,struct v4 return 0; } /** - * @brief - * - * @param vdev - * @param video_name - * @param format - * @param video_num - * @return int + * @brief + * + * @param vdev + * @param video_name + * @param format + * @param video_num + * @return int */ static int process_rgb_image(struct v4l2_device *vdev,char *video_name,struct v4l2_pix_format *format,unsigned int video_num) { @@ -280,7 +280,7 @@ static int process_rgb_image(struct v4l2_device *vdev,char *video_name,struct v4 { sprintf(filename,"./%s_%dx%d_%d.argb",&video_name[5],((width+15)/16*16),height,img_cnt[video_num]); printf("%s:%s\n",__func__,filename); - fd = fopen(filename, "wb"); + fd = fopen(filename, "wb"); if(fd == NULL) { printf("open %s failure, errno %d\n",filename,errno); @@ -299,7 +299,7 @@ static int process_rgb_image(struct v4l2_device *vdev,char *video_name,struct v4 { sprintf(filename,"./%s_%dx%d_%d.rgb",&video_name[5],((width+15)/16*16),height,img_cnt[video_num]); printf("%s:%s\n",__func__,filename); - fd = fopen(filename, "wb"); + fd = fopen(filename, "wb"); if(fd == NULL) { printf("open %s failure, errno %d\n",filename,errno); @@ -314,7 +314,7 @@ static int process_rgb_image(struct v4l2_device *vdev,char *video_name,struct v4 return ret; } fclose(fd); - } + } } img_cnt[video_num]++; @@ -329,7 +329,7 @@ static int process_rgb_image(struct v4l2_device *vdev,char *video_name,struct v4 return 0; } /***************************************************************************** - * + * *****************************************************************************/ static char *video_cfg_file = NULL; static int verbose = 0; @@ -343,23 +343,29 @@ static void usage(FILE *fp, int argc, char **argv) "-h | --help Print this message\n" "-f | --video_cfg_file video_cfg_filename [%s]\n" "-v | --verbose Verbose output\n" + "-a | --anti-clicker-enable (0: all disable | 1: f 2k enable | 2: r 2k enable | 3: f&r 2k enable)\n" + "-x | --ae sw/hw select (default 0: sw ae | 1: hw ae)\n" + "-l | --adaptive enable (0: disable | 1: enable, default: enable)\n" "", argv[0],video_cfg_file); } -static const char short_options[] = "hf:v";// 短选项 :表示带参数 +static const char short_options[] = "hf:va:x:l:";// 短选项 :表示带参数 static const struct option //长选项 long_options[] = { { "video_cfg_file", required_argument, NULL, 'f' }, { "help", no_argument, NULL, 'h' }, { "verbose", no_argument, NULL, 'v' }, + { "anfi-flicker-enable", required_argument, NULL, 'a' }, + { "ae-select", required_argument, NULL, 'x' }, + { "adaptive", required_argument, NULL, 'l' }, { 0, 0, 0, 0 } }; /** - * @brief - * - * @param s + * @brief + * + * @param s */ static void errno_exit(const char *s) { @@ -367,22 +373,22 @@ static void errno_exit(const char *s) exit(EXIT_FAILURE); } /** - * @brief - * - * @param signo + * @brief + * + * @param signo */ -void sighand(int signo) -{ - pthread_t tid = pthread_self(); - - printf("Thread %lu in signal handler/n", tid); - return; +void sighand(int signo) +{ + pthread_t tid = pthread_self(); + + printf("Thread %lu in signal handler/n", tid); + return; } /** - * @brief - * - * @param info - * @return void* + * @brief + * + * @param info + * @return void* */ void *run_f2k_video(void *info) { @@ -406,7 +412,7 @@ void *run_f2k_video(void *info) if(dev_info->enable[i] == 1) { pthread_mutex_lock(&mutex); - vdev[i] = v4l2_open(dev_info->video_name[i]); + vdev[i] = v4l2_open(dev_info->video_name[i]); if (vdev[i] == NULL) { printf("error: unable to open video capture device %s\n", dev_info->video_name[i]); @@ -416,7 +422,7 @@ void *run_f2k_video(void *info) printf("%s:vdev->fd %d\n",__func__,vdev[i]->fd); memset(&format[i], 0, sizeof(struct v4l2_pix_format)); format[i].width = dev_info->video_width[i];//width; - format[i].height = dev_info->video_height[i];//height; + format[i].height = dev_info->video_height[i];//height; // if(dev_info->video_out_format[i] == 1) { @@ -455,7 +461,7 @@ void *run_f2k_video(void *info) */ FD_SET(vdev[i]->fd, &fds); if(vdev[i]->fd > maxfd ) maxfd = vdev[i]->fd; - printf("%s:maxfd(%d)vdev[i]->fd(%d)\n",__func__,maxfd,vdev[i]->fd); + printf("%s:maxfd(%d)vdev[i]->fd(%d)\n",__func__,maxfd,vdev[i]->fd); } } // @@ -515,7 +521,7 @@ void *run_f2k_video(void *info) pthread_mutex_lock(&mutex); process_rgb_image(vdev[3],dev_info->video_name[3],&format[3],3); pthread_mutex_unlock(&mutex); - } + } } count++; @@ -555,10 +561,10 @@ void *run_f2k_video(void *info) } } /** - * @brief - * - * @param info - * @return void* + * @brief + * + * @param info + * @return void* */ void *run_r2k_video(void *info) { @@ -582,18 +588,18 @@ void *run_r2k_video(void *info) if(dev_info->enable[i] == 1) { pthread_mutex_lock(&mutex); - vdev[i] = v4l2_open(dev_info->video_name[i]); + vdev[i] = v4l2_open(dev_info->video_name[i]); if (vdev[i] == NULL) { printf("error: unable to open video capture device %s\n", dev_info->video_name[i]); - pthread_mutex_unlock(&mutex); + pthread_mutex_unlock(&mutex); goto cleanup_r2k; } printf("%s:vdev->fd %d\n",__func__,vdev[i]->fd); //c = getchar(); memset(&format[i], 0, sizeof(struct v4l2_pix_format)); format[i].width = dev_info->video_width[i];//width; - format[i].height = dev_info->video_height[i];//height; + format[i].height = dev_info->video_height[i];//height; // if(dev_info->video_out_format[i] == 1) { @@ -632,7 +638,7 @@ void *run_r2k_video(void *info) * set, to be used by select() in the main loop. */ FD_SET(vdev[i]->fd, &fds); - if(vdev[i]->fd > maxfd ) maxfd = vdev[i]->fd; + if(vdev[i]->fd > maxfd ) maxfd = vdev[i]->fd; } } // @@ -691,7 +697,7 @@ void *run_r2k_video(void *info) pthread_mutex_lock(&mutex); process_rgb_image(vdev[3],dev_info->video_name[3],&format[3],7); pthread_mutex_unlock(&mutex); - } + } } count++; } @@ -732,11 +738,11 @@ void *run_r2k_video(void *info) } } /** - * @brief - * - * @param argc - * @param argv - * @return int + * @brief + * + * @param argc + * @param argv + * @return int */ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) { @@ -766,7 +772,15 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu case 'v': verbose = 1; break; - + case 'a': + anti_flicker_init(atoi(optarg)); + break; + case 'x': + ae_select_init(atoi(optarg)); + break; + case 'l': + adaptive_enable(atoi(optarg)); + break; default: usage(stderr, argc, argv); exit(EXIT_FAILURE); @@ -781,15 +795,15 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu mediactl_init(video_cfg_file,&dev_info[0]); // - memset(&actions, 0, sizeof(actions)); - sigemptyset(&actions.sa_mask); /* 将参数set信号集初始化并清空 */ - actions.sa_flags = 0; - actions.sa_handler = sighand; - /* 设置SIGALRM的处理函数 */ - sigaction(SIGALRM,&actions,NULL); + memset(&actions, 0, sizeof(actions)); + sigemptyset(&actions.sa_mask); /* 将参数set信号集初始化并清空 */ + actions.sa_flags = 0; + actions.sa_handler = sighand; + /* 设置SIGALRM的处理函数 */ + sigaction(SIGALRM,&actions,NULL); if(dev_info[0].video_used == 1) - { + { pthread_create(&f2k_pid,NULL,run_f2k_video,(void *)&dev_info[0]); } @@ -809,11 +823,11 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu pthread_kill(r2k_pid, SIGALRM); } - printf("Wait for masked and unmasked threads to complete\n"); + printf("Wait for masked and unmasked threads to complete\n"); if( dev_info[0].video_used == 1) { pthread_join(f2k_pid, NULL); - } + } if( dev_info[1].video_used == 1) { @@ -822,4 +836,4 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu mediactl_exit(); printf("Main completed/n"); return exit_code; -} \ No newline at end of file +} diff --git a/package/mediactl_lib/src/v4l2_drm/Makefile b/package/mediactl_lib/src/v4l2_drm/Makefile index 48f1fde..569c408 100644 --- a/package/mediactl_lib/src/v4l2_drm/Makefile +++ b/package/mediactl_lib/src/v4l2_drm/Makefile @@ -5,7 +5,7 @@ TARGET = v4l2_drm.out OBJS = v4l2_drm.cc drm/k510_drm.c all: - ${CC} ${OBJS} -I. -L. -L../ -fpermissive -Idrm -ldrm -lmediactl -lpthread -lstdc++ -g -o ${TARGET} + ${CC} ${OBJS} -I. -I../ -L. -L../ -fpermissive -Idrm -ldrm -lmediactl -ladaptive -l3actl -lpthread -lstdc++ -g -o ${TARGET} @echo "Compile done." clean: @rm -f *.o ${TARGET} diff --git a/package/mediactl_lib/src/v4l2_drm/media_ctl.h b/package/mediactl_lib/src/v4l2_drm/media_ctl.h deleted file mode 100644 index 96257c5..0000000 --- a/package/mediactl_lib/src/v4l2_drm/media_ctl.h +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __MEDIACTL_H__ -#define __MEDIACTL_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -enum isp_pipeline_e -{ - ISP_F2K_PIPELINE, - ISP_R2K_PIPELINE, - ISP_TOF_PIPELINE -}; - -enum isp_modules -{ - ISP_TPG, - ISP_BLC, - ISP_LSC, - ISP_AE, - ISP_AWB, - ISP_AWB_D65, - ISP_AWB_CCM, - ISP_WDR, - ISP_RGB_GAMMA, - ISP_YUV_GAMMA, - ISP_ADA, - ISP_ADA_SBZ, - ISP_ADA_CCR, - ISP_RGBIR, - ISP_RAW_2DNR, - ISP_YUV_Y_2DNR, - ISP_YUV_UV_2DNR, - ISP_3DNR, - ISP_LTM, - ISP_SHARP, - ISP_CC, - ISP_CTRST, - ISP_LUMA, - ISP_SATURATION, - ISP_LDC, - ISP_AF, -}; - -struct video_info -{ - unsigned int video_used; - char *video_name[4]; - unsigned int enable[4]; - unsigned int video_width[4]; - unsigned int video_height[4]; - unsigned int video_out_format[4]; -}; - -int mediactl_init(char *video_cfg_file,struct video_info *dev_info); -void mediactl_exit(void); -int mediactl_set_ae(enum isp_pipeline_e pipeline); -unsigned int mediactl_get_isp_modules(enum isp_pipeline_e pipeline,enum isp_modules module); -#ifdef __cplusplus -} -#endif -#endif /*__MEDIACTL_H__*/ diff --git a/package/mediactl_lib/src/v4l2_drm/sequeue.c b/package/mediactl_lib/src/v4l2_drm/sequeue.c deleted file mode 100644 index e8a6f0a..0000000 --- a/package/mediactl_lib/src/v4l2_drm/sequeue.c +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "sequeue.h" - -sequeue_t *CreateEmptySequeue(void) -{ - sequeue_t *queue; - queue = (sequeue_t *)malloc(sizeof(sequeue_t)); - if (NULL == queue) return NULL; - - queue->front = queue->rear = 0; - - return queue; -} - -void DestroySequeue(sequeue_t *queue) -{ - if (NULL != queue) - { - free(queue); - } -} - -int EmptySequeue(sequeue_t *queue) -{ - if (NULL == queue) - return -1; - - return (queue->front == queue->rear ? 1 : 0); -} - -int FullSequeue(sequeue_t *queue) -{ - if (NULL == queue) return -1; - - return ((queue->rear + 1) % N == queue->front ? 1 : 0); -} - -void ClearSequeue(sequeue_t *queue) -{ - if (NULL == queue) return; - - queue->front = queue->rear = 0; - - return; -} - -int EnQueue(sequeue_t *queue, data_t x) -{ - if (NULL == queue) return - 1; - - if (1 == FullSequeue(queue)) return -1; /* full */ - - queue->rear = (queue->rear + 1) % N; - queue->data[queue->rear] = x; - - return 0; -} - -int DeQueue(sequeue_t *queue, data_t *x) -{ - if (NULL == queue) return -1; - - if (1 == EmptySequeue(queue)) return -1; /* empty */ - - queue->front = (queue->front + 1) % N; - - if (NULL != x) { - *x = queue->data[queue->front]; - } - - return 0; -} \ No newline at end of file diff --git a/package/mediactl_lib/src/v4l2_drm/sequeue.h b/package/mediactl_lib/src/v4l2_drm/sequeue.h deleted file mode 100644 index 086879c..0000000 --- a/package/mediactl_lib/src/v4l2_drm/sequeue.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __SEQUEUE_H__ -#define __SEQUEUE_H__ - -#include "stdio.h" - -#define N 64 -typedef unsigned int data_t; - -typedef struct{ - data_t data[N]; - int front,rear; -}sequeue_t; -// -sequeue_t *CreateEmptySequeue(void); -void DestroySequeue(sequeue_t *queue); -int EmptySequeue(sequeue_t *queue); -int FullSequeue(sequeue_t *queue); -void ClearSequeue(sequeue_t *queue); -int EnQueue(sequeue_t *queue, data_t x); -int DeQueue(sequeue_t *queue, data_t *x); -#endif \ No newline at end of file diff --git a/package/mediactl_lib/src/v4l2_drm/v4l2_drm.cc b/package/mediactl_lib/src/v4l2_drm/v4l2_drm.cc index d1e25f9..200f90f 100644 --- a/package/mediactl_lib/src/v4l2_drm/v4l2_drm.cc +++ b/package/mediactl_lib/src/v4l2_drm/v4l2_drm.cc @@ -24,7 +24,7 @@ */ /* v4l2_test */ -#include +#include #include #include #include @@ -34,6 +34,7 @@ #include /* getopt_long() */ #include /* low-level i/o */ +#include #include #include #include @@ -71,6 +72,7 @@ static int verbose = 0; static int isp_ae_status = 0; //static int r_2k_status = 0; + static uint32_t screen_width, screen_height; #define VIDEO_INPUT_0_ENABLE 1 #define VIDEO_INPUT_1_ENABLE 2 @@ -156,9 +158,9 @@ int readframe(int fd, struct v4l2_buffer* vbuf) { } /** - * @brief - * - * @param camera + * @brief + * + * @param camera */ static int stop_capturing(struct camera_info *camera) { @@ -169,23 +171,23 @@ static int stop_capturing(struct camera_info *camera) pthread_mutex_lock(&mutex); if(fd) { - type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (-1 == xioctl(fd, VIDIOC_STREAMOFF, &type)) { pthread_mutex_unlock(&mutex); // errno_exit("VIDIOC_STREAMOFF"); printf("%s:VIDIOC_STREAMOFF failed!\n",__func__); return -1; - } + } } pthread_mutex_unlock(&mutex); printf("%s: end!\n", __func__); return 0; } /** - * @brief - * - * @param camera + * @brief + * + * @param camera */ static int start_capturing(struct camera_info *camera) { @@ -200,7 +202,7 @@ static int start_capturing(struct camera_info *camera) pr_debug("\tn_buffers: %d\n", n_buffers); - for (i = 0; i < n_buffers; ++i) { + for (i = 0; i < n_buffers; ++i) { struct v4l2_buffer buf; pr_debug("\ti: %d\n", i); @@ -211,7 +213,7 @@ static int start_capturing(struct camera_info *camera) buf.m.fd = buffers[i].dbuf_fd; //drm buf.length = buffers[i].length; - pr_debug("\tbuf.index: %d\n", buf.index); + pr_debug("\tbuf.index: %d, length: %u\n", buf.index, buf.length); //printf("\tbuf.index: %d,buf.m.fd %d,buf.length %d\n",buf.index,buf.m.fd,buf.length); // err == xioctl(fd, VIDIOC_QBUF, &buf); err = ioctl(fd, VIDIOC_QBUF, &buf); @@ -228,15 +230,15 @@ static int start_capturing(struct camera_info *camera) { //errno_exit("VIDIOC_STREAMON"); return -1; - } + } pr_debug("After STREAMON\n"); return 0; } /** - * @brief - * - * @param camera - * @param drm_bufs + * @brief + * + * @param camera + * @param drm_bufs */ static void uninit_device(struct camera_info *camera,struct drm_buffer *drm_bufs) { @@ -252,16 +254,16 @@ static void uninit_device(struct camera_info *camera,struct drm_buffer *drm_bufs pthread_mutex_unlock(&mutex); } /** - * @brief - * - * @param camera + * @brief + * + * @param camera */ static int init_mmap(struct camera_info *camera,struct drm_buffer *drm_bufs) //(3) { struct v4l2_requestbuffers req; int fd = camera->fd; - struct buffer *buffers; - unsigned int n_buffers; + struct buffer *buffers; + unsigned int n_buffers; char dev_name[50]; pr_debug("%s: called!\n", __func__); sprintf(&dev_name[0],"%s",&camera->video_name[0]); @@ -317,10 +319,10 @@ static int init_mmap(struct camera_info *camera,struct drm_buffer *drm_bufs) // return ret; } /** - * @brief - * - * @param camera - * @param drm_bufs + * @brief + * + * @param camera + * @param drm_bufs */ static int init_device(struct camera_info *camera,struct drm_buffer *drm_bufs) //static表示次函数只能在本文件中调用 { @@ -389,8 +391,8 @@ static int init_device(struct camera_info *camera,struct drm_buffer *drm_bufs) / if (-1 == xioctl(fd, VIDIOC_S_FMT, &fmt)) { //errno_exit("VIDIOC_S_FMT"); - return -errno; - } + return -errno; + } /* Note VIDIOC_S_FMT may change width and height. */ /* Buggy driver paranoia. */ @@ -406,9 +408,9 @@ static int init_device(struct camera_info *camera,struct drm_buffer *drm_bufs) / return ret; } /** - * @brief - * - * @param camera + * @brief + * + * @param camera */ static void close_device(struct camera_info *camera) { @@ -421,32 +423,32 @@ static void close_device(struct camera_info *camera) { pthread_mutex_unlock(&mutex); errno_exit("close"); - } - camera->fd = -1; + } + camera->fd = -1; } #if 0 if(drm_dev.fd &&(drm_dev.camera_num == 1) ) { - drm_exit(); - } + drm_exit(); + } else { drm_dev.camera_num--; - } + } #endif - pthread_mutex_unlock(&mutex); + pthread_mutex_unlock(&mutex); } /** - * @brief - * - * @param camera + * @brief + * + * @param camera */ static void open_device(struct camera_info *camera)// { struct stat st; int fd; char dev_name[50]; - sprintf(&dev_name[0],"%s",&camera->video_name[0]); + sprintf(&dev_name[0],"%s",&camera->video_name[0]); printf("%s: dev_name %s called!\n", __func__,&dev_name[0]);//_func_表示此时在那个函数里面 if (-1 == stat(dev_name, &st)) {//获取文件信息 @@ -471,11 +473,11 @@ static void open_device(struct camera_info *camera)// printf("%s:fd (%d) open\n",__func__,fd); } /** - * @brief - * - * @param fp - * @param argc - * @param argv + * @brief + * + * @param fp + * @param argc + * @param argv */ static void usage(FILE *fp, int argc, char **argv) { @@ -484,47 +486,62 @@ static void usage(FILE *fp, int argc, char **argv) "Version 1.3\n" "Options:\n" "-f | --device cfg name Video device cfg name [%s]\n" + "-e | --ae value AE enable\n" + "-t | --tuning value isp tuningd enable\n" "-h | --help Print this message\n" "-v | --verbose Verbose output\n" "-s | --single[(0|1),[,width*height[,x*y]]] display sensor (0|1)\n" "-d | --double[width*height,x*y,width*height,x*y] display double sensor\n" + "-a | --anti-clicker-enable (0: all disable | 1: f 2k enable | 2: r 2k enable | 3: f&r 2k enable)\n" + "-x | --ae-select sw/hw select (default 0: sw ae | 1: hw ae)\n" + "-l | --adaptive enable (0: disable | 1: enable, default: enable)\n" + "-r | --rect x,y,width,height,line_width,color,border_master\n" "", argv[0], video_cfg_file); } -static const char short_options[] = "f:e:hvs::d::";// 短选项 :表示带参数 +static const char short_options[] = "f:e:hvs::d::s:a:x:l:t:r:";// 短选项 :表示带参数 static const struct option //长选项 long_options[] = { { "device_cfg name", required_argument, NULL, 'f' }, { "ae config", required_argument, NULL, 'e' }, + { "tuning isp", required_argument, NULL, 't' }, + { "rect", required_argument, NULL, 'r' }, { "help", no_argument, NULL, 'h' }, { "verbose", no_argument, NULL, 'v' }, { "single", optional_argument, NULL, 's' }, { "double", optional_argument, NULL, 'd' }, + { "anfi-flicker-enable", required_argument, NULL, 'a' }, + { "ae-select", required_argument, NULL, 'x' }, + { "adaptive", required_argument, NULL, 'l' }, { 0, 0, 0, 0 } }; +pid_t isp_tuningd_pid = -1; /* end */ static void sigint_handler(int signal __attribute__((__unused__))) { /* Set the done flag to true when the user presses CTRL-C to interrupt * the main loop. */ + if (isp_tuningd_pid >= 0) { + kill(isp_tuningd_pid, SIGINT); + } done = true; } /** - * @brief - * - * @param signo + * @brief + * + * @param signo */ -void sighand(int signo) -{ - pthread_t tid = pthread_self(); - - printf("Thread %lu in signal handler/n", tid); - return; +void sighand(int signo) +{ + pthread_t tid = pthread_self(); + + printf("Thread %lu in signal handler/n", tid); + return; } int init_isp(struct camera_info *camera) { @@ -551,8 +568,8 @@ void deinit_isp(struct camera_info *camera) { close_device(camera); } /** - * @brief - * + * @brief + * */ static void cfg_noc_prior(void) { @@ -597,6 +614,9 @@ int video_resolution_adaptation(void) uint32_t sensor_total_height[2]; uint32_t sensor_active_width[2]; uint32_t sensor_active_height[2]; + uint32_t main_width[2]; + uint32_t main_height[2]; + uint32_t video_width[2]; uint32_t video_height[2]; int32_t video_offset_x[2] = {0, 0}; @@ -606,16 +626,20 @@ int video_resolution_adaptation(void) do {\ sensor_total_width[x] = 3476;\ sensor_total_height[x] = 1166;\ - sensor_active_width[x] = 1920;\ - sensor_active_height[x] = 1080;\ + sensor_active_width[x] = 1936;\ + sensor_active_height[x] = 1088;\ + main_width[x] = 1920; \ + main_height[x] = 1080; \ } while(0) #define SENSOR_1080x1920_TIMING(x) \ do {\ sensor_total_width[x] = 3453;\ sensor_total_height[x] = 1979;\ - sensor_active_width[x] = 1080;\ - sensor_active_height[x] = 1920;\ + sensor_active_width[x] = 1088;\ + sensor_active_height[x] = 1928;\ + main_width[x] = 1080; \ + main_height[x] = 1920; \ } while(0) if (screen_width == 1920 && screen_height == 1080) { @@ -740,8 +764,8 @@ int video_resolution_adaptation(void) Pointer("/sensor0/sensor0_total_size/sensor0_total_height").Set(root, sensor_total_height[0]); Pointer("/sensor0/sensor0_active_size/sensor0_active_width").Set(root, sensor_active_width[0]); Pointer("/sensor0/sensor0_active_size/sensor0_active_height").Set(root, sensor_active_height[0]); - Pointer("/sensor0/~1dev~1video2/video2_width").Set(root, sensor_active_width[0]); - Pointer("/sensor0/~1dev~1video2/video2_height").Set(root, sensor_active_height[0]); + Pointer("/sensor0/~1dev~1video2/video2_width").Set(root, main_width[0]); + Pointer("/sensor0/~1dev~1video2/video2_height").Set(root, main_height[0]); Pointer("/sensor0/~1dev~1video2/video2_out_format").Set(root, 1); Pointer("/sensor0/~1dev~1video3/video3_used").Set(root, 1); Pointer("/sensor0/~1dev~1video3/video3_width").Set(root, video_width[0]); @@ -760,8 +784,8 @@ int video_resolution_adaptation(void) Pointer("/sensor1/sensor1_total_size/sensor1_total_height").Set(root, sensor_total_height[1]); Pointer("/sensor1/sensor1_active_size/sensor1_active_width").Set(root, sensor_active_width[1]); Pointer("/sensor1/sensor1_active_size/sensor1_active_height").Set(root, sensor_active_height[1]); - Pointer("/sensor1/~1dev~1video6/video6_width").Set(root, sensor_active_width[1]); - Pointer("/sensor1/~1dev~1video6/video6_height").Set(root, sensor_active_height[1]); + Pointer("/sensor1/~1dev~1video6/video6_width").Set(root, main_width[1]); + Pointer("/sensor1/~1dev~1video6/video6_height").Set(root, main_height[1]); Pointer("/sensor1/~1dev~1video6/video6_out_format").Set(root, 1); Pointer("/sensor1/~1dev~1video7/video7_used").Set(root, 1); Pointer("/sensor1/~1dev~1video7/video7_width").Set(root, video_width[1]); @@ -785,11 +809,45 @@ int video_resolution_adaptation(void) } /** - * @brief - * - * @param __attribute__ - * @param __attribute__ - * @return int + * @brief Spawn isp-tuningd + * + * @return int pid of child process + */ +static pid_t spawn_isp_tuningd (unsigned width, unsigned height, int* pipe_fd_ptr) { + // create pipe + int pipe_fd[2]; + assert(pipe(pipe_fd) == 0); + pid_t pid = fork(); + char width_str[20], height_str[20]; + sprintf(width_str, "%u", width); + sprintf(height_str, "%u", height); + if (pid == 0) { + // child process + // close write pipe + close(pipe_fd[1]); + // dup to stdin + dup2(pipe_fd[0], 0); + // exec isp-tuningd + if(execl("/app/mediactl_lib/isp-tuningd", "/app/mediactl_lib/isp-tuningd", "-j", "-w", width_str, "-h", height_str, NULL) < 0) { + exit(-1); + } + return 0; + } else { + // master process + // close read pipe + close(pipe_fd[0]); + // assert(setnonblock(pipe_fd[1]) == 0); + *pipe_fd_ptr = pipe_fd[1]; + return pid; + } +} + +/** + * @brief + * + * @param __attribute__ + * @param __attribute__ + * @return int */ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) { @@ -801,6 +859,10 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu pthread_t f2k_pid,r2k_pid,drm_pid; uint32_t sensor_index = 0; int parse_count; + unsigned tuning_isp = 0; + unsigned rect_enable = 0, rect_ptr = 0; + unsigned rects[32][7]; + bzero(rects, sizeof(rects)); for (;;) { int idx; @@ -815,10 +877,34 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu switch (c) { case 0: /* getopt_long() flag */ break; - case 'e': + case 'e': isp_ae_status = atol(optarg);//dev_name = ; break; + case 't': + tuning_isp = atoi(optarg); + if (!(tuning_isp >= 0 && tuning_isp <= 2)) { + fprintf(stderr, "tuning argument must be 0 or 1 or 2\n"); + exit(EXIT_FAILURE); + } + break; + + case 'r': + rect_enable = 1; + sscanf( + optarg, + "%u,%u,%u,%u,%u,%u,%u", + &rects[rect_ptr][0], + &rects[rect_ptr][1], + &rects[rect_ptr][2], + &rects[rect_ptr][3], + &rects[rect_ptr][4], + &rects[rect_ptr][5], + &rects[rect_ptr][6] + ); + rect_ptr++; + break; + case 'f': video_cfg_file = optarg;//dev_name = optarg; break; @@ -866,26 +952,42 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu video_in_cfg[1].force |= OFFSET_FORCE; } break; - + case 'a': + anti_flicker_init(atoi(optarg)); + break; + case 'x': + ae_select_init(atoi(optarg)); + break; + case 'l': + adaptive_enable(atoi(optarg)); + break; default: usage(stderr, argc, argv); exit(EXIT_FAILURE); } } + if ((isp_ae_status & 1) == 0) { + mediactl_disable_ae(ISP_F2K_PIPELINE); + } + if ((isp_ae_status & 2) == 0) { + mediactl_disable_ae(ISP_R2K_PIPELINE); + } + /* Register a signal handler for SIGINT, received when the user presses * CTRL-C. This will allow the main loop to be interrupted, and resources * to be freed cleanly. */ signal(SIGINT, sigint_handler); signal(SIGTERM, sigint_handler); + signal(SIGPIPE, SIG_IGN); // - memset(&actions, 0, sizeof(actions)); - sigemptyset(&actions.sa_mask); /* 将参数set信号集初始化并清空 */ - actions.sa_flags = 0; - actions.sa_handler = sighand; - /* 设置SIGALRM的处理函数 */ - sigaction(SIGALRM,&actions,NULL); + memset(&actions, 0, sizeof(actions)); + sigemptyset(&actions.sa_mask); /* 将参数set信号集初始化并清空 */ + actions.sa_flags = 0; + actions.sa_handler = sighand; + /* 设置SIGALRM的处理函数 */ + sigaction(SIGALRM,&actions,NULL); // cfg_noc_prior(); // get screen resolution @@ -916,8 +1018,13 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu camera[0].size.height = dev_info[0].video_height[i]; camera[0].buffer_start = 0; camera_num++; + + // rect + for (unsigned j = 0; j < rect_ptr; j++) { + mediactl_rect(ISP_F2K_PIPELINE, i, j, rects[j][0], rects[j][1], rects[j][2], rects[j][3], rects[j][4], rects[j][5], rects[j][6]); + } } - } + } } // printf("%s:dev_info[1].video_used(%d)\n",__func__,dev_info[1].video_used); @@ -932,8 +1039,13 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu camera[1].size.height = dev_info[1].video_height[i]; camera[1].buffer_start = BUFFERS_COUNT; camera_num++; + + // rect + for (unsigned j = 0; j < rect_ptr; j++) { + mediactl_rect(ISP_F2K_PIPELINE, i, j, rects[j][0], rects[j][1], rects[j][2], rects[j][3], rects[j][4], rects[j][5], rects[j][6]); + } } - } + } } printf("%s:size[0].width is %d size[0].height is %d,size[1].width is %d size[1].height is %d,camera_num(%d)\n",__func__,camera[0].size.width,camera[0].size.height,camera[1].size.width,camera[1].size.height,camera_num); @@ -954,7 +1066,7 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu size[0].src_offset_w = 0; size[0].src_offset_h = 0; size[0].crtc_offset_w = 0; - size[0].crtc_offset_h = 200; + size[0].crtc_offset_h = 200; size[1].src_offset_w = 0; size[1].src_offset_h = 0; size[1].crtc_offset_w = 0; @@ -992,19 +1104,23 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu } drm_dev.camera_num = camera_num; - struct camera_info* used_cam; + int isp_tuningd_pipe_fd = -1; if(dev_info[0].video_used) { if (init_isp(&camera[0]) < 0) { goto cleanup; } - used_cam = &camera[0]; + if (tuning_isp == 1) { + isp_tuningd_pid = spawn_isp_tuningd(camera[0].size.width, camera[0].size.height, &isp_tuningd_pipe_fd); + } } if(dev_info[1].video_used) { if (init_isp(&camera[1]) < 0) { goto cleanup; } - used_cam = &camera[1]; + if (tuning_isp == 2) { + isp_tuningd_pid = spawn_isp_tuningd(camera[1].size.width, camera[1].size.height, &isp_tuningd_pipe_fd); + } } struct drm_buffer *fbuf1 = &drm_dev.drm_bufs[0]; @@ -1133,8 +1249,8 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu printf("Flush fail\n"); goto cleanup; } - } - else if(dev_info[0].video_used) { + } + else if(dev_info[0].video_used) { if (drm_dmabuf_set_plane(&drm_dev.drm_bufs[vbuf[1][0].index])) { printf("Flush fail\n"); goto cleanup; @@ -1263,8 +1379,8 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu printf("Flush fail\n"); break; } - } - else if(dev_info[0].video_used) { + } + else if(dev_info[0].video_used) { if (drm_dmabuf_set_plane(&drm_dev.drm_bufs[vbuf[vbuf_ptr[0]][0].index])) { printf("Flush fail\n"); break; @@ -1276,6 +1392,17 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu } } + // isp-tuningd + static unsigned frame_counter_for_isp_tuningd = frame_counter; + if (frame_counter - frame_counter_for_isp_tuningd >= 30) { + frame_counter_for_isp_tuningd = frame_counter; + if(dev_info[0].video_used && tuning_isp == 1) { + write(isp_tuningd_pipe_fd, drm_dev.drm_bufs[vbuf[vbuf_ptr[0]][0].index].map, drm_dev.drm_bufs[vbuf[vbuf_ptr[0]][0].index].size); + } else if (dev_info[1].video_used && tuning_isp == 2) { + write(isp_tuningd_pipe_fd, drm_dev.drm_bufs[vbuf[vbuf_ptr[1]][1].index + BUFFERS_COUNT].map, drm_dev.drm_bufs[vbuf[vbuf_ptr[1]][1].index + BUFFERS_COUNT].size); + } + } + // FIXME: always flip for (unsigned i = 0; i < 2; i++) { vbuf_ptr[i] ^= 1; @@ -1284,7 +1411,7 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu cleanup: if(drm_dev.fd) { fprintf(stderr, "drm_exit\n"); - drm_exit(); + drm_exit(); } if(dev_info[0].video_used) { deinit_isp(&camera[0]); diff --git a/package/mediactl_lib/src/v4l2_drm_isptool/Makefile b/package/mediactl_lib/src/v4l2_drm_isptool/Makefile deleted file mode 100644 index 3d2a1b5..0000000 --- a/package/mediactl_lib/src/v4l2_drm_isptool/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -CROSS_COMPILE = riscv64-linux- -CC=$(CROSS_COMPILE)gcc - -TARGET = v4l2_drm_isptool.out -OBJS = v4l2_drm_isptool.c ../v4l2_drm/drm/k510_drm.c ../v4l2_drm/sequeue.c - -all: - ${CC} ${OBJS} -I../v4l2_drm/ -L. -L../ -I../v4l2_drm/drm -ldrm -lmediactl -lpthread -lstdc++ -o ${TARGET} - @echo "Compile done." -clean: - @rm -f *.o ${TARGET} - @echo "Clean done." diff --git a/package/mediactl_lib/src/v4l2_drm_isptool/v4l2_drm_isptool.c b/package/mediactl_lib/src/v4l2_drm_isptool/v4l2_drm_isptool.c deleted file mode 100644 index a23aa3a..0000000 --- a/package/mediactl_lib/src/v4l2_drm_isptool/v4l2_drm_isptool.c +++ /dev/null @@ -1,1213 +0,0 @@ -/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* v4l2_test */ -#include -#include -#include -#include -#include - -#include /* getopt_long() */ - -#include /* low-level i/o */ -#include -#include -#include -#include -#include -#include -#include -#include -//#include - -#include - -#include "media_ctl.h" -#include "k510_drm.h" -#include "sequeue.h" - -static bool done = false; -static char *video_cfg_file = "video_drm_1080x1920.conf"; - -#define FORCED_WIDTH 1080//1920 -#define FORCED_HEIGHT 1920//1080 -#define FORCED_FORMAT V4L2_PIX_FMT_YUV420 //V4L2_PIX_FMT_NV12 // -#define FORCED_FIELD V4L2_FIELD_ANY -#define VIDEO_NAME "/dev/video3" -static int verbose = 0; - -static int isp_ae_status = 0; -//static int r_2k_status = 0; - -#define pr_debug(fmt, arg...) \ - if (verbose) fprintf(stderr, fmt, ##arg) - -#define CLEAR(x) memset(&(x), 0, sizeof(x)) //相当于CLEAR(x) =memset(&(x), 0, sizeof(x)) - -enum io_method { //枚举,即只能取其中的一个值。也是一种数据结构 - IO_METHOD_READ, - IO_METHOD_MMAP, - IO_METHOD_USERPTR, -}; - -struct buffer { - unsigned int index; - void *start; - size_t length; //size_t =unsigned int 用来表示sizeof的 - int dbuf_fd; //drm -}; - -//char dev_name[50]; //用来保存设备名 -//static int fd = -1; -//struct buffer *buffers; -//static unsigned int n_buffers; -//unsigned int width; -//unsigned int height; - -struct camera_info -{ - int fd; - char video_name[50]; - struct drm_size size; - struct buffer *buffers; - unsigned int n_buffers; - unsigned int buffer_start; -}; - -static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -unsigned int drm_vsync = 0; -sequeue_t *f2k_queue = NULL; -sequeue_t *r2k_queue = NULL; -int pipe_fd = -1, child_pid = -1; -/******************************************************************* -* -********************************************************************/ -static void errno_exit(const char *s) -{ - fprintf(stderr, "%s error %d, %s\n", s, errno, strerror(errno)); - exit(EXIT_FAILURE); -} - -static int xioctl(int fh, int request, void *arg) -{ - int r; - - do { - r = ioctl(fh, request, arg); - } while (-1 == r && EINTR == errno); - - return r; -} -/** - * @brief - * - * @param camera - * @return int - */ -static int read_frame(struct camera_info *camera,unsigned int camera_seq) -{ - struct v4l2_buffer buf; - unsigned int i; - int fd = camera->fd; - unsigned int n_buffers = camera->n_buffers; - - //printf("%s: called!\n", __func__); - CLEAR(buf); - buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - buf.memory = V4L2_MEMORY_DMABUF;//drm //V4L2_MEMORY_MMAP; - - pthread_mutex_lock(&mutex); - if (-1 == xioctl(fd, VIDIOC_DQBUF, &buf)) { - pthread_mutex_unlock(&mutex); - printf("%s: DQBUFERR!\n", __func__); - switch (errno) { - case EAGAIN: - { - printf("%s: DQBUFERR! EAGAIN ret(%d)\n", __func__,EAGAIN); - return 0; - } - case EIO: - printf("%s: DQBUFERR! EIO ret(%d)\n", __func__,EIO); - /* Could ignore EIO, see spec. */ - - /* fall through */ - - default: - //errno_exit("VIDIOC_DQBUF"); - printf("%s: DQBUFERR! errno ret(%d)\n", __func__,errno); - return -1; - } - } - pthread_mutex_unlock(&mutex); - //assert(buf.index < n_buffers); - - // process_image(&buffers[buf.index]); - //printf("%s:buf.index(%d)\n",__func__,buf.index); - EnQueue(f2k_queue,buf.index); - if(isp_ae_status == 1 || isp_ae_status == 3) - { - mediactl_set_ae(ISP_F2K_PIPELINE); - } - - - struct drm_buffer *fbuf; - static struct v4l2_buffer old_buffer; - static int screen_init_flag = 0; - - pr_debug("%s: show!\n", __func__); - - // FIXME: some better way - fbuf = &drm_dev.drm_bufs[buf.index]; - static int count = 0; - count += 1; - if (count >= 30) { - // write to isp-tuningd - write(pipe_fd, fbuf->map, fbuf->size); - count = 0; - } - - pthread_mutex_lock(&mutex); - if(screen_init_flag) // inited //drm - { - /* Requeue the buffer */ - if (-1 == xioctl(fd, VIDIOC_QBUF, &old_buffer)) - { - pthread_mutex_unlock(&mutex); - printf("%s:camera (%d) VIDIOC_QBUF failed!\n",__func__,camera_seq); - //errno_exit("VIDIOC_QBUF"); - return -1; - } - } - pthread_mutex_unlock(&mutex); - - old_buffer = buf; - - if(screen_init_flag == 0) // not init - { - screen_init_flag = 1; - } - - return 0; -} -/** - * @brief - * - * @param camera - * @return int - */ -static int read_frame1(struct camera_info *camera,unsigned int camera_seq) -{ - struct v4l2_buffer buf; - unsigned int i; - int fd = camera->fd; - unsigned int n_buffers = camera->n_buffers; - - //printf("%s: called!\n", __func__); - CLEAR(buf); - buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - buf.memory = V4L2_MEMORY_DMABUF;//drm //V4L2_MEMORY_MMAP; - //printf("%s:called 1! \n", __func__); - pthread_mutex_lock(&mutex); - if (-1 == xioctl(fd, VIDIOC_DQBUF, &buf)) { - pthread_mutex_unlock(&mutex); - printf("%s: DQBUFERR!\n", __func__); - switch (errno) { - case EAGAIN: - { - printf("%s: DQBUFERR! EAGAIN ret(%d)\n", __func__,EAGAIN); - return 0; - } - case EIO: - printf("%s: DQBUFERR! EIO ret(%d)\n", __func__,EIO); - /* Could ignore EIO, see spec. */ - - /* fall through */ - - default: - //errno_exit("VIDIOC_DQBUF"); - printf("%s: DQBUFERR! errno ret(%d)\n", __func__,errno); - return -1; - } - } - pthread_mutex_unlock(&mutex); - //assert(buf.index < n_buffers); - //printf("%s:called 2! \n", __func__); - // process_image(&buffers[buf.index]); - //printf("%s:buf.index1(%d)\n",__func__,buf.index); - EnQueue(r2k_queue,buf.index); - - if(isp_ae_status == 2 || isp_ae_status == 3) - { - mediactl_set_ae(ISP_R2K_PIPELINE); - } - - struct drm_buffer *fbuf; - static struct v4l2_buffer old_buffer; - static int screen_init_flag = 0; - - // FIXME: some better way - fbuf = &drm_dev.drm_bufs[buf.index]; - static int count = 0; - count += 1; - if (count >= 30) { - // write to isp-tuningd - write(pipe_fd, fbuf->map, fbuf->size); - count = 0; - } - - //printf("%s: show!\n", __func__); - pthread_mutex_lock(&mutex); - if(screen_init_flag) // inited //drm - { - /* Requeue the buffer */ - if (-1 == xioctl(fd, VIDIOC_QBUF, &old_buffer)) - { - pthread_mutex_unlock(&mutex); - printf("%s:camera (%d) VIDIOC_QBUF failed!\n",__func__,camera_seq); - //errno_exit("VIDIOC_QBUF"); - return -1; - } - } - pthread_mutex_unlock(&mutex); - - old_buffer = buf; - - if(screen_init_flag == 0) // not init - { - screen_init_flag = 1; - } - - return 0; -} -/** - * @brief - * - * @param camera - */ -static int mainloop(struct camera_info *camera,unsigned int camera_seq) -{ - int fd = camera->fd; - fd_set fds; - struct timeval tv; - int r; - int ret; - struct drm_buffer *fbuf = &drm_dev.drm_bufs[0]; - - printf("%s: camera %d fd(%d) mainloop called!\n", __func__,camera_seq,fd); - - for(int i= 0;i < BUFFERS_COUNT;i++) - { - fbuf[i].width = camera->size.width; - fbuf[i].height = camera->size.height; - } - - FD_ZERO(&fds); - FD_SET(fd, &fds); - while (!done) { - /* Timeout. */ - tv.tv_sec = 2; - tv.tv_usec = 0; - - r = select(fd + 1, &fds, NULL, NULL, &tv); - if (-1 == r) { - if (EINTR == errno) - continue; - //errno_exit("select"); - //done = true; - printf("error: camera%d select failed with %d\n", camera_seq,errno); - ret = -1; - break; - } - - if (0 == r) { - //done = true; - printf("%s:camera%d select timeout\n",__func__,camera_seq); - //exit(EXIT_FAILURE); - ret = -1; - break; - } - - //mediactl_set_ae(); - ret = read_frame(camera,camera_seq); - if (ret < 0 ) - { - printf("%s:camera%d read_frame failed\n",__func__,camera_seq); - //done = true; - break; - } - - /* EAGAIN - continue select loop. */ - } - //printf("%s: camera %d fd(%d) mainloop end ret(%d)!\n", __func__,camera_seq,fd,ret); - return ret; -} -/** - * @brief - * - * @param camera - */ -static int mainloop1(struct camera_info *camera,unsigned int camera_seq) -{ - int fd = camera->fd; - fd_set fds; - struct timeval tv; - int r; - int ret =0; - struct drm_buffer *fbuf = &drm_dev.drm_bufs[BUFFERS_COUNT]; - - printf("%s: camera %d fd(%d) mainloop1 called!\n", __func__,camera_seq,fd); - - for(int i= 0;i < BUFFERS_COUNT;i++) - { - fbuf[i].width = camera->size.width; - fbuf[i].height = camera->size.height; - } - - FD_ZERO(&fds); - FD_SET(fd, &fds); - while (!done) { - /* Timeout. */ - tv.tv_sec = 2; - tv.tv_usec = 0; - - r = select(fd + 1, &fds, NULL, NULL, &tv); - if (-1 == r) { - if (EINTR == errno) - continue; - //errno_exit("select"); - //done = true; - printf("error: camera%d select failed with %d\n", camera_seq,errno); - ret = -1; - break; - } - - if (0 == r) { - //done = true; - printf("%s:camera%d select timeout\n",__func__,camera_seq); - //exit(EXIT_FAILURE); - ret = -1; - break; - } - - //mediactl_set_ae(); - - ret = read_frame1(camera,camera_seq); - if (ret<0) - { - printf("%s:camera%d read_frame failed \n",__func__,camera_seq); - break; - } - - /* EAGAIN - continue select loop. */ - } - - printf("%s: camera %d fd(%d) mainloop1 end ret(%d)!\n", __func__,camera_seq,fd,ret); - return ret; -} -/** - * @brief - * - * @param camera - */ -static int stop_capturing(struct camera_info *camera) -{ - enum v4l2_buf_type type; - int fd = camera->fd; - - printf("%s: %d called!\n", __func__,fd); - pthread_mutex_lock(&mutex); - if(fd) - { - type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (-1 == xioctl(fd, VIDIOC_STREAMOFF, &type)) - { - pthread_mutex_unlock(&mutex); - // errno_exit("VIDIOC_STREAMOFF"); - printf("%s:VIDIOC_STREAMOFF failed!\n",__func__); - return -1; - } - } - pthread_mutex_unlock(&mutex); - printf("%s: end!\n", __func__); - return 0; -} -/** - * @brief - * - * @param camera - */ -static int start_capturing(struct camera_info *camera) -{ - unsigned int i; - enum v4l2_buf_type type; - int err; - int fd = camera->fd; - unsigned int n_buffers = camera->n_buffers; - struct buffer *buffers = camera->buffers; - - pr_debug("%s: called!\n", __func__); - - pr_debug("\tn_buffers: %d\n", n_buffers); - - for (i = 0; i < n_buffers; ++i) { - struct v4l2_buffer buf; - pr_debug("\ti: %d\n", i); - - CLEAR(buf); - buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - buf.memory = V4L2_MEMORY_DMABUF;//drm //V4L2_MEMORY_MMAP; - buf.index = i; - buf.m.fd = buffers[i].dbuf_fd; //drm - buf.length = buffers[i].length; - - pr_debug("\tbuf.index: %d\n", buf.index); - //printf("\tbuf.index: %d,buf.m.fd %d,buf.length %d\n",buf.index,buf.m.fd,buf.length); - // err == xioctl(fd, VIDIOC_QBUF, &buf); - err = ioctl(fd, VIDIOC_QBUF, &buf); - if (err < 0) { - //errno_exit(".\n"); - return err; - } - } - - pr_debug("\terr: %d\n", err); - pr_debug("Before STREAMON\n"); - type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (-1 == xioctl(fd, VIDIOC_STREAMON, &type)) - { - //errno_exit("VIDIOC_STREAMON"); - return -1; - } - pr_debug("After STREAMON\n"); - return 0; -} -/** - * @brief - * - * @param camera - * @param drm_bufs - */ -static void uninit_device(struct camera_info *camera,struct drm_buffer *drm_bufs) -{ - unsigned int i; - - pr_debug("%s: called!\n", __func__); - pthread_mutex_lock(&mutex); - - if(NULL != camera->buffers) - { - free(camera->buffers); - } - pthread_mutex_unlock(&mutex); -} -/** - * @brief - * - * @param camera - */ -static int init_mmap(struct camera_info *camera,struct drm_buffer *drm_bufs) //(3) -{ - struct v4l2_requestbuffers req; - int fd = camera->fd; - struct buffer *buffers; - unsigned int n_buffers; - char dev_name[50]; - pr_debug("%s: called!\n", __func__); - sprintf(&dev_name[0],"%s",&camera->video_name[0]); - int ret = 0; - CLEAR(req); - - req.count = BUFFERS_COUNT; - req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - req.memory = V4L2_MEMORY_DMABUF;//V4L2_MEMORY_MMAP; //drm - - if (-1 == xioctl(fd, VIDIOC_REQBUFS, &req)) { - if (EINVAL == errno) { - fprintf(stderr, "%s does not support " - "memory mapping\n", dev_name); - //exit(EXIT_FAILURE); - return -errno; - } else { - //errno_exit("VIDIOC_REQBUFS"); - return -1; - } - } - pr_debug("\treq.count: %d\n", req.count); - pr_debug("\treq.type: %d\n", req.type); - pr_debug("\treq.memory: %d\n", req.memory); - pr_debug("\n"); - - if (req.count < 2) { - fprintf(stderr, "Insufficient buffer memory on %s\n", - dev_name); - //exit(EXIT_FAILURE); - return -1; - } - - buffers = calloc(req.count, sizeof(*buffers)); - - if (!buffers) { - fprintf(stderr, "Out of memory\n"); - //exit(EXIT_FAILURE); - return -1; - } - - for(uint32_t i = 0; i < req.count; i++) - { - buffers[i].start = drm_bufs[i].map;// buf_drm[i].vaddr; - buffers[i].length = drm_bufs[i].size; - buffers[i].dbuf_fd = drm_bufs[i].dbuf_fd; - } - n_buffers = req.count; - // - camera->buffers = buffers; - camera->n_buffers = n_buffers; - printf("%s:n_buffers(%d),buffers(%p)\n",__func__,camera->n_buffers,camera->buffers); - return ret; -} -/** - * @brief - * - * @param camera - * @param drm_bufs - */ -static int init_device(struct camera_info *camera,struct drm_buffer *drm_bufs) //static表示次函数只能在本文件中调用 -{ - struct v4l2_capability cap; - struct v4l2_cropcap cropcap; - struct v4l2_crop crop; - struct v4l2_format fmt; - unsigned int min; - int fd = camera->fd; - char dev_name[50]; - unsigned int width = camera->size.width; - unsigned int height = camera->size.height; - int ret = 0; - - sprintf(&dev_name[0],"%s",&camera->video_name[0]); - - pr_debug("%s: called!\n", __func__); - printf("%s:width(%d),height(%d)\n",__func__,width,height); - if (-1 == xioctl(fd, VIDIOC_QUERYCAP, &cap)) { - pthread_mutex_unlock(&mutex); - if (EINVAL == errno) { - fprintf(stderr, "%s is no V4L2 device\n", - dev_name); - //exit(EXIT_FAILURE); - return -errno; - } else { - //errno_exit("VIDIOC_QUERYCAP"); - return -1; - } - } - - pr_debug("\tdriver: %s\n" - "\tcard: %s \n" - "\tbus_info: %s\n", - cap.driver, cap.card, cap.bus_info); - pr_debug("\tversion: %u.%u.%u\n", - (cap.version >> 16) & 0xFF, - (cap.version >> 8) & 0xFF, - cap.version & 0xFF); - pr_debug("\tcapabilities: 0x%08x\n", cap.capabilities); - - if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) { - fprintf(stderr, "%s is no video capture device\n", - dev_name); - //exit(EXIT_FAILURE); - return -1; - } - - CLEAR(fmt); - - fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - - fmt.fmt.pix.width = width;//FORCED_WIDTH; - fmt.fmt.pix.height = height;//FORCED_HEIGHT; - fmt.fmt.pix.pixelformat = FORCED_FORMAT; - fmt.fmt.pix.field = FORCED_FIELD; - - pr_debug("\tfmt.fmt.pix.pixelformat: %c,%c,%c,%c\n", - fmt.fmt.pix.pixelformat & 0xFF, - (fmt.fmt.pix.pixelformat >> 8) & 0xFF, - (fmt.fmt.pix.pixelformat >> 16) & 0xFF, - (fmt.fmt.pix.pixelformat >> 24) & 0xFF - ); - pr_debug("\n"); - - if (-1 == xioctl(fd, VIDIOC_S_FMT, &fmt)) - { - //errno_exit("VIDIOC_S_FMT"); - return -errno; - } - /* Note VIDIOC_S_FMT may change width and height. */ - - /* Buggy driver paranoia. */ - min = fmt.fmt.pix.width * 2; - if (fmt.fmt.pix.bytesperline < min) - fmt.fmt.pix.bytesperline = min; - min = fmt.fmt.pix.bytesperline * fmt.fmt.pix.height; - if (fmt.fmt.pix.sizeimage < min) - fmt.fmt.pix.sizeimage = min; - - ret = init_mmap(camera,drm_bufs); - - return ret; -} -/** - * @brief - * - * @param camera - */ -static void close_device(struct camera_info *camera) -{ - pr_debug("%s: called!\n", __func__); - - pthread_mutex_lock(&mutex); - if(camera->fd) - { - if (-1 == close(camera->fd)) - { - pthread_mutex_unlock(&mutex); - errno_exit("close"); - } - camera->fd = -1; - } -#if 0 - if(drm_dev.fd &&(drm_dev.camera_num == 1) ) - { - drm_exit(); - } - else - { - drm_dev.camera_num--; - } -#endif - pthread_mutex_unlock(&mutex); -} -/** - * @brief - * - * @param camera - */ -static void open_device(struct camera_info *camera)// -{ - struct stat st; - int fd; - char dev_name[50]; - sprintf(&dev_name[0],"%s",&camera->video_name[0]); - printf("%s: dev_name %s called!\n", __func__,&dev_name[0]);//_func_表示此时在那个函数里面 - - if (-1 == stat(dev_name, &st)) {//获取文件信息 - fprintf(stderr, "Cannot identify '%s': %d, %s\n", - dev_name, errno, strerror(errno)); - exit(EXIT_FAILURE);//非正常退出 EXIT_FAILURE=1, EXIT_SUCCSES=0 正常退出 - } - - if (!S_ISCHR(st.st_mode)) { - fprintf(stderr, "%s is no device\n", dev_name); - exit(EXIT_FAILURE); - } - - fd = open(dev_name, O_RDWR /* required */ | O_NONBLOCK, 0);//非阻塞模式打开文件 - - if (-1 == fd) { - fprintf(stderr, "Cannot open '%s': %d, %s\n", - dev_name, errno, strerror(errno)); - exit(EXIT_FAILURE); - } - camera->fd = fd; - printf("%s:fd (%d) open\n",__func__,fd); -} -/** - * @brief - * - * @param fp - * @param argc - * @param argv - */ -static void usage(FILE *fp, int argc, char **argv) -{ - fprintf(fp, - "Usage: %s [options]\n\n" - "Version 1.3\n" - "Options:\n" - "-f | --device cfg name Video device cfg name [%s]\n" - "-e | --ae config 0 close all, 1 open f-2k ae, 2 open r-2k ae, 3 open all\n" - "-h | --help Print this message\n" - "-v | --verbose Verbose output\n" - "", - argv[0], video_cfg_file); -} - -static const char short_options[] = "f:hv";// 短选项 :表示带参数 - -static const struct option //长选项 -long_options[] = { - { "device_cfg name", required_argument, NULL, 'f' }, - { "help", no_argument, NULL, 'h' }, - { "verbose", no_argument, NULL, 'v' }, - { 0, 0, 0, 0 } -}; - -/* end */ -static void sigint_handler(int signal __attribute__((__unused__))) -{ - /* Set the done flag to true when the user presses CTRL-C to interrupt - * the main loop. - */ - done = true; -} - -/** - * @brief - * - * @param signo - */ -void sighand(int signo) -{ - pthread_t tid = pthread_self(); - - printf("Thread %lu in signal handler/n", tid); - return; -} - -/** - * @brief - * - * @param info - * @return void* - */ -void *run_f2k_video(void *info) -{ - struct camera_info *camera = (struct camera_info *)info; - int ret = 0; - pthread_mutex_lock(&mutex); - open_device(camera); - - ret = init_device(camera,&drm_dev.drm_bufs[camera->buffer_start]); //0 - if(ret <0 ) - { - pthread_mutex_unlock(&mutex); - goto f2k_cleanup; - } - - ret= start_capturing(camera); - if(ret <0 ) - { - pthread_mutex_unlock(&mutex); - goto f2k_cleanup; - } - pthread_mutex_unlock(&mutex); -// - ret = mainloop(camera,0); - if(ret <0 ) - { - printf("%s:mainloop failed!\n",__func__); - goto f2k_cleanup; - } -// -f2k_cleanup: - stop_capturing(camera); - - uninit_device(camera,&drm_dev.drm_bufs[camera->buffer_start]); //0 - close_device(camera); - // -} - -/** - * @brief - * - * @param info - * @return void* - */ -void *run_r2k_video(void *info) -{ - struct camera_info *camera = (struct camera_info *)info; - int ret = 0; - pthread_mutex_lock(&mutex); - open_device(camera); - - ret = init_device(camera,&drm_dev.drm_bufs[camera->buffer_start]); //BUFFERS_COUNT - if(ret <0 ) - { - pthread_mutex_unlock(&mutex); - goto r2k_cleanup; - } - - ret= start_capturing(camera); - if(ret <0 ) - { - pthread_mutex_unlock(&mutex); - goto r2k_cleanup; - } - pthread_mutex_unlock(&mutex); -// - ret = mainloop1(camera,1); - if(ret <0 ) - { - printf("%s:mainloop1 failed!\n",__func__); - goto r2k_cleanup; - } -// -r2k_cleanup: - stop_capturing(camera); - - uninit_device(camera,&drm_dev.drm_bufs[camera->buffer_start]);//BUFFERS_COUNT - close_device(camera); -} -/** - * @brief - * - */ -static void cfg_noc_prior(void) -{ - system("devmem 0x970E00f4 32 0x00000000"); - system("devmem 0x970E00f8 32 0x00000000"); - system("devmem 0x970E00fc 32 0x0fffff00"); - system("devmem 0x970E0100 32 0x00000000"); - system("devmem 0x970E0104 32 0x00000000"); - - system("devmem 0x9990038c 32 0x00000000"); - system("devmem 0x9990048c 32 0x00000001"); - system("devmem 0x98000504 32 0x00010303"); -} - -/** - * @brief - * - * @return void* - */ -void *drm_show(void *info) -{ - struct video_info *dev_info = (struct video_info *)info; - struct drm_buffer *fbuf,*fbuf2; - unsigned int index = 0,index1 = 0; - printf("%s:start!\n",__func__); - while(!done) - { - /* drm show */ - if (drm_dev.req) - drm_wait_vsync(); - if((dev_info[0].video_used == 1)&& (dev_info[1].video_used == 1)) - { - while(!done) - { - if((EmptySequeue(f2k_queue) == 0)&&(EmptySequeue(r2k_queue)== 0)) - { - DeQueue(f2k_queue,&index); - DeQueue(r2k_queue,&index1); - //printf("%s:index(%d) index1(%d)\n",__func__,index,index1); - fbuf = &drm_dev.drm_bufs[index]; - fbuf2 = &drm_dev.drm_bufs[index1+BUFFERS_COUNT]; - if (drm_dmabuf_set_2plane(fbuf,fbuf2)) { - printf("Flush fail\n"); - break; - } - break; - } - } - - } - else if(dev_info[0].video_used == 1) - { - while(!done) - { - - if(EmptySequeue(f2k_queue) == 0) - { - DeQueue(f2k_queue,&index); - //printf("%s:index(%d)\n",__func__,index); - fbuf = &drm_dev.drm_bufs[index]; - if (drm_dmabuf_set_plane(fbuf)) { - printf("Flush fail\n"); - break; - } - break; - } - } - } - else if(dev_info[1].video_used == 1) - { - while(!done) - { - if(EmptySequeue(r2k_queue) == 0) - { - DeQueue(r2k_queue,&index); - //printf("%s:index(%d)\n",__func__,index); - fbuf = &drm_dev.drm_bufs[index]; - if (drm_dmabuf_set_plane(fbuf)) { - printf("Flush fail\n"); - break; - } - break; - } - } - } - } - // -#if 0 - if(drm_dev.fd) - { - printf("%s:drm_destory_dumb!\n",__func__); - for(int i = 0; i < BUFFERS_COUNT*BUFFERS_NUM; i++) { - drm_destory_dumb(&drm_dev.drm_bufs[i]); - } - } -#endif - // - printf("%s:DestroySequeue!\n",__func__); - if(dev_info[0].video_used == 1) - { - printf("%s:f2k_queue DestroySequeue!\n",__func__); - DestroySequeue(f2k_queue); - } - - if(dev_info[1].video_used == 1) - { - printf("%s:r2k_queue DestroySequeue!\n",__func__); - DestroySequeue(r2k_queue); - } -} -/** - * @brief Spawn isp-tuningd - * - * @return int pid of child process - */ -static pid_t spawn_isp_tuningd (int* pipe_fd_ptr) { - // create pipe - int pipe_fd[2]; - assert(pipe(pipe_fd) == 0); - pid_t pid = fork(); - if (pid == 0) { - // child process - // close write pipe - close(pipe_fd[1]); - // dup to stdin - dup2(pipe_fd[0], 0); - // exec isp-tuningd - if(execl("./isp-tuningd", "./isp-tuningd", "-j", NULL) < 0) { - exit(-1); - } - return 0; - } else { - // master process - // close read pipe - close(pipe_fd[0]); - // assert(setnonblock(pipe_fd[1]) == 0); - *pipe_fd_ptr = pipe_fd[1]; - return pid; - } -} -/** - * @brief - * - * @param __attribute__ - * @param __attribute__ - * @return int - */ -int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) -{ - struct video_info dev_info[2]; - struct camera_info camera[2]; - int i = 0; - int camera_num = 0; - struct sigaction actions; - pthread_t f2k_pid,r2k_pid,drm_pid; - - for (;;) { - int idx; - int c; - - c = getopt_long(argc, argv, - short_options, long_options, &idx); - - if (-1 == c) - break; - - switch (c) { - case 0: /* getopt_long() flag */ - break; - - case 'f': - video_cfg_file = optarg;//dev_name = optarg; - break; - - case 'h': - usage(stdout, argc, argv); - exit(EXIT_SUCCESS); - - case 'v': - verbose = 1; - break; - - default: - usage(stderr, argc, argv); - exit(EXIT_FAILURE); - } - } - /* Register a signal handler for SIGINT, received when the user presses - * CTRL-C. This will allow the main loop to be interrupted, and resources - * to be freed cleanly. - */ - signal(SIGINT,sigint_handler); - signal(SIGTERM,sigint_handler); - child_pid = spawn_isp_tuningd(&pipe_fd); - // - memset(&actions, 0, sizeof(actions)); - sigemptyset(&actions.sa_mask); /* 将参数set信号集初始化并清空 */ - actions.sa_flags = 0; - actions.sa_handler = sighand; - /* 设置SIGALRM的处理函数 */ - sigaction(SIGALRM,&actions,NULL); - // - cfg_noc_prior(); - //media - mediactl_init(video_cfg_file,&dev_info[0]); - //drm - printf("%s:dev_info[0].video_used(%d)\n",__func__,dev_info[0].video_used); - if( 1 == dev_info[0].video_used ) - { - for(i = 0;i < 3;i++) - { - if(1 == dev_info[0].enable[i]) - { - sprintf(&camera[0].video_name[0],"%s",dev_info[0].video_name[i]); - camera[0].size.width = dev_info[0].video_width[i]; - camera[0].size.height = dev_info[0].video_height[i]; - camera[0].buffer_start = 0; - camera_num++; - } - } - } - // - printf("%s:dev_info[1].video_used(%d)\n",__func__,dev_info[1].video_used); - if( 1 == dev_info[1].video_used ) - { - for(i = 0;i < 3;i++) - { - if(1 == dev_info[1].enable[i]) - { - sprintf(&camera[1].video_name[0],"%s",dev_info[1].video_name[i]); - camera[1].size.width = dev_info[1].video_width[i]; - camera[1].size.height = dev_info[1].video_height[i]; - camera[1].buffer_start = BUFFERS_COUNT; - camera_num++; - } - } - } - // - if(( 0 == dev_info[0].video_used ) && ( 1 == dev_info[1].video_used )) - { - camera[1].buffer_start = 0;//BUFFERS_COUNT; - } - - printf("%s:size[0].width is %d size[0].height is %d,size[1].width is %d size[1].height is %d,camera_num(%d)\n",__func__,camera[0].size.width,camera[0].size.height,camera[1].size.width,camera[1].size.height,camera_num); - struct drm_size size[2]; - - size[0].width = 1080; - size[0].height = 1920; - size[1].width = 1080; - size[1].height = 1920; - - if((1 == dev_info[0].video_used)&&(1 == dev_info[1].video_used)) - { - size[0].src_offset_w = 0; - size[0].src_offset_h = 200; - size[0].crtc_offset_w = 0; - size[0].crtc_offset_h = 200; - size[1].src_offset_w = 0; - size[1].src_offset_h = 1000; - size[1].crtc_offset_w = 0; - size[1].crtc_offset_h = 1000; - } - else - { - size[0].src_offset_w = 0; - size[0].src_offset_h = 0; - size[0].crtc_offset_w = 0; - size[0].crtc_offset_h = 0; - size[1].src_offset_w = 0; - size[1].src_offset_h = 0; - size[1].crtc_offset_w = 0; - size[1].crtc_offset_h = 0; - } - - drm_reset(); - drm_init(&size[0]); //drm init - - drm_dev.camera_num = camera_num; - // - f2k_queue = CreateEmptySequeue(); - r2k_queue = CreateEmptySequeue(); - // - if(dev_info[0].video_used == 1) - { - pthread_create(&f2k_pid,NULL,run_f2k_video,(void *)&camera[0]); - } - // - if( dev_info[1].video_used == 1) - { - pthread_create(&r2k_pid,NULL,run_r2k_video,(void *)&camera[1]); - } - - pthread_create(&drm_pid,NULL,drm_show,(void *)&dev_info[0]); - // - if( dev_info[0].video_used == 1) - { - pthread_kill(f2k_pid, SIGALRM); - } - - if( dev_info[1].video_used == 1) - { - pthread_kill(r2k_pid, SIGALRM); - } - pthread_kill(drm_pid, SIGALRM); - - printf("Wait for masked and unmasked threads to complete\n"); - if( dev_info[0].video_used == 1) - { - pthread_join(f2k_pid, NULL); - } - - if( dev_info[1].video_used == 1) - { - pthread_join(r2k_pid, NULL); - } - pthread_join(drm_pid, NULL); - - pthread_mutex_destroy(&mutex); - printf("Main completed/n"); - - if(drm_dev.fd) - { - printf("%s:drm_exit\n",__func__); - drm_exit(); - } - mediactl_exit(); - fprintf(stderr, "\n"); - return 0; -} \ No newline at end of file diff --git a/package/mediactl_lib/src/v4l2_test/Makefile b/package/mediactl_lib/src/v4l2_test/Makefile index e1badf7..fc00bec 100644 --- a/package/mediactl_lib/src/v4l2_test/Makefile +++ b/package/mediactl_lib/src/v4l2_test/Makefile @@ -5,7 +5,7 @@ TARGET = v4l2_test.out OBJS = v4l2_test.c all: - ${CC} ${OBJS} -I. -L../ -lmediactl -lpthread -lstdc++ -o ${TARGET} + ${CC} ${OBJS} -I. -L../ -lmediactl -lpthread -ladaptive -l3actl -lstdc++ -o ${TARGET} @echo "Compile done." clean: @rm -f *.o ${TARGET} diff --git a/package/mediactl_lib/src/v4l2_test/v4l2_test.c b/package/mediactl_lib/src/v4l2_test/v4l2_test.c index ff969ee..c55312e 100644 --- a/package/mediactl_lib/src/v4l2_test/v4l2_test.c +++ b/package/mediactl_lib/src/v4l2_test/v4l2_test.c @@ -1,26 +1,26 @@ -/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* v4l2_test */ #include @@ -621,11 +621,14 @@ static void usage(FILE *fp, int argc, char **argv) "-c | --count Number of frames to grab [%i]\n" "-v | --verbose Verbose output\n" "-O | --output file Output file full path[%s]\n" + "-a | --anti-clicker-enable (0: all disable | 1: f 2k enable | 2: r 2k enable | 3: f&r 2k enable)\n" + "-x | --ae sw/hw select (default 0: sw ae | 1: hw ae)\n" + "-l | --adaptive enable (0: disable | 1: enable, default: enable)\n" "", argv[0], dev_name, frame_count, video_name); } -static const char short_options[] = "d:hmruofc:vO:";// 短选项 :表示带参数 +static const char short_options[] = "d:hmruofc:vO:a:x:l:";// 短选项 :表示带参数 static const struct option //长选项 long_options[] = { @@ -639,6 +642,9 @@ long_options[] = { { "count", required_argument, NULL, 'c' }, { "verbose", no_argument, NULL, 'v' }, { "ouput file", required_argument, NULL, 'O' }, + { "anfi-flicker-enable", required_argument, NULL, 'a' }, + { "ae-select", required_argument, NULL, 'x' }, + { "adaptive", required_argument, NULL, 'l' }, { 0, 0, 0, 0 } }; @@ -659,7 +665,7 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu { dev_name = "/dev/video3"; unsigned int width = FORCED_WIDTH; - unsigned int height = FORCED_HEIGHT; + unsigned int height = FORCED_HEIGHT; struct video_info dev_info[2]; for (;;) { @@ -717,6 +723,12 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu case 'O': video_name = optarg; break; + case 'a': + anti_flicker_init(atoi(optarg)); + break; + case 'l': + adaptive_enable(atoi(optarg)); + break; default: usage(stderr, argc, argv); exit(EXIT_FAILURE); @@ -771,4 +783,4 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu mediactl_exit(); fprintf(stderr, "\n"); return 0; -} +} diff --git a/package/nncase_linux_runtime/nncase_linux_runtime.mk b/package/nncase_linux_runtime/nncase_linux_runtime.mk index e812eb5..526ecf7 100755 --- a/package/nncase_linux_runtime/nncase_linux_runtime.mk +++ b/package/nncase_linux_runtime/nncase_linux_runtime.mk @@ -12,13 +12,13 @@ NNCASE_PIP_K510_VD = 1.7.1.20220701 NNCASE_VSTR = v1.7.1 NNCASE_LINUX_RUNTIME_SOURCE = nncaseruntime-k510-v1.7.1.tgz -NNCASE_LINUX_RUNTIME_SITE = https://github.com/kendryte/nncase/releases/download/$(NNCASE_VSTR) -NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS = https://github.com/kendryte/nncase/releases/download/$(NNCASE_VSTR)/nncase-$(NNCASE_PIP_VD)-cp310-cp310-manylinux_2_24_x86_64.whl -NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS += https://github.com/kendryte/nncase/releases/download/$(NNCASE_VSTR)/nncase-$(NNCASE_PIP_VD)-cp36-cp36m-manylinux_2_24_x86_64.whl -NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS += https://github.com/kendryte/nncase/releases/download/$(NNCASE_VSTR)/nncase-$(NNCASE_PIP_VD)-cp37-cp37m-manylinux_2_24_x86_64.whl -NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS += https://github.com/kendryte/nncase/releases/download/$(NNCASE_VSTR)/nncase-$(NNCASE_PIP_VD)-cp38-cp38-manylinux_2_24_x86_64.whl -NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS += https://github.com/kendryte/nncase/releases/download/$(NNCASE_VSTR)/nncase-$(NNCASE_PIP_VD)-cp39-cp39-manylinux_2_24_x86_64.whl -NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS += https://github.com/kendryte/nncase/releases/download/$(NNCASE_VSTR)/nncase_k510-$(NNCASE_PIP_K510_VD)-py2.py3-none-manylinux_2_24_x86_64.whl +NNCASE_LINUX_RUNTIME_SITE = https://kendryte-download.canaan-creative.com/k510/nncase/release/$(NNCASE_VSTR) +NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS = $(NNCASE_LINUX_RUNTIME_SITE)/nncase-$(NNCASE_PIP_VD)-cp310-cp310-manylinux_2_24_x86_64.whl +NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS += $(NNCASE_LINUX_RUNTIME_SITE)/nncase-$(NNCASE_PIP_VD)-cp36-cp36m-manylinux_2_24_x86_64.whl +NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS += $(NNCASE_LINUX_RUNTIME_SITE)/nncase-$(NNCASE_PIP_VD)-cp37-cp37m-manylinux_2_24_x86_64.whl +NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS += $(NNCASE_LINUX_RUNTIME_SITE)/nncase-$(NNCASE_PIP_VD)-cp38-cp38-manylinux_2_24_x86_64.whl +NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS += $(NNCASE_LINUX_RUNTIME_SITE)/nncase-$(NNCASE_PIP_VD)-cp39-cp39-manylinux_2_24_x86_64.whl +NNCASE_LINUX_RUNTIME_EXTRA_DOWNLOADS += $(NNCASE_LINUX_RUNTIME_SITE)/nncase_k510-$(NNCASE_PIP_K510_VD)-py2.py3-none-manylinux_2_24_x86_64.whl define NNCASE_LINUX_RUNTIME_nncase_nncase_k510_pip3_install diff --git a/package/patches/linux/0023-enable-netlink-connector-protocol.patch b/package/patches/linux/0023-enable-netlink-connector-protocol.patch new file mode 100644 index 0000000..85d4913 --- /dev/null +++ b/package/patches/linux/0023-enable-netlink-connector-protocol.patch @@ -0,0 +1,27 @@ +From 2c87671e266454090d515d9963c2e78240410d90 Mon Sep 17 00:00:00 2001 +From: xubaikun +Date: Wed, 10 Aug 2022 10:52:03 +0800 +Subject: [PATCH] enable netlink connector protocol + +--- + arch/riscv/configs/k510_defconfig | 1 + + 1 file changed, 1 insertion(+) + mode change 100755 => 100644 arch/riscv/configs/k510_defconfig + +diff --git a/arch/riscv/configs/k510_defconfig b/arch/riscv/configs/k510_defconfig +old mode 100755 +new mode 100644 +index c3c549ed..42416469 +--- a/arch/riscv/configs/k510_defconfig ++++ b/arch/riscv/configs/k510_defconfig +@@ -56,6 +56,7 @@ CONFIG_RFKILL_GPIO=y + CONFIG_DEVTMPFS=y + CONFIG_DEVTMPFS_MOUNT=y + CONFIG_DMA_CMA=y ++CONFIG_CONNECTOR=y + CONFIG_MTD=y + CONFIG_MTD_BLOCK=y + CONFIG_FTL=y +-- +2.17.1 + diff --git a/package/patches/linux/0024-isp-drop-buf.patch b/package/patches/linux/0024-isp-drop-buf.patch new file mode 100755 index 0000000..55763c3 --- /dev/null +++ b/package/patches/linux/0024-isp-drop-buf.patch @@ -0,0 +1,184 @@ +From 31c99a47c62123c0fb02d0830b76d27b90e86a6f Mon Sep 17 00:00:00 2001 +From: longyiluo +Date: Thu, 18 Aug 2022 16:15:09 +0800 +Subject: [PATCH] isp-drop-buf + +--- + .../platform/canaan-isp/isp_2k/isp_f2k.c | 19 +++++++++++++------ + .../platform/canaan-isp/isp_2k/isp_r2k.c | 19 +++++++++++++------ + .../media/platform/canaan-isp/k510isp_com.h | 4 ++-- + 3 files changed, 28 insertions(+), 14 deletions(-) + +diff --git a/drivers/media/platform/canaan-isp/isp_2k/isp_f2k.c b/drivers/media/platform/canaan-isp/isp_2k/isp_f2k.c +index 87a7fdfe..f743cc6b 100755 +--- a/drivers/media/platform/canaan-isp/isp_2k/isp_f2k.c ++++ b/drivers/media/platform/canaan-isp/isp_2k/isp_f2k.c +@@ -2861,14 +2861,14 @@ static void video_buffer_next(struct isp_f2k_device *f2k, enum video_type dsNum) + + buf = list_first_entry(&video->dmaqueue, struct k510isp_buffer, irqlist); + +- if(dsNum == DS0_VIDEO && f2k->profile.drop_threshold > 0LL && f2k->profile.buf_set_time != 0) ++ if(f2k->profile.drop_threshold > 0LL && f2k->profile.buf_set_time[dsNum] != 0) + { + unsigned long long delta; +- delta = get_usec() - f2k->profile.buf_set_time; ++ delta = get_usec() - f2k->profile.buf_set_time[dsNum]; + if(delta > f2k->profile.drop_threshold) + { + drop = 1; +- f2k->profile.drop_cnt++; ++ f2k->profile.drop_cnt[dsNum]++; + } + } + +@@ -2982,6 +2982,7 @@ static void f2k_isr_main_buffer(struct isp_f2k_device *f2k) + + video_buffer_next(f2k, MAIN_VIDEO); + ++ f2k->profile.buf_set_time[MAIN_VIDEO] = get_usec(); + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; + + return buffer != NULL; +@@ -3006,7 +3007,7 @@ static void f2k_isr_out0_buffer(struct isp_f2k_device *f2k) + + video_buffer_next(f2k, DS0_VIDEO); + +- f2k->profile.buf_set_time = get_usec(); ++ f2k->profile.buf_set_time[DS0_VIDEO] = get_usec(); + + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; + +@@ -3031,6 +3032,7 @@ static void f2k_isr_out1_buffer(struct isp_f2k_device *f2k) + } + + video_buffer_next(f2k, DS1_VIDEO); ++ f2k->profile.buf_set_time[DS1_VIDEO] = get_usec(); + + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; + +@@ -3335,6 +3337,7 @@ static int f2k_set_stream(struct v4l2_subdev *sd, int enable) + struct k510_isp_device *isp = to_isp_device(f2k); + struct device *dev = to_device(f2k); + int ret; ++ int i; + dev_dbg(f2k->isp->dev,"%s:enable(0x%d)\n",__func__,enable); + + struct isp_cfg_info *isp_cfg = &f2k->isp_cfg; +@@ -3374,7 +3377,7 @@ static int f2k_set_stream(struct v4l2_subdev *sd, int enable) + + memset(&f2k->profile,0,sizeof(struct k510_isp_profile)); + if(isp_cfg->isp_ds_cfg.dsInSizeInfo.Width == 1920 && +- isp_cfg->isp_ds_cfg.dsInSizeInfo.Height == 1080) ++ isp_cfg->isp_ds_cfg.dsInSizeInfo.Height >= 1080) + { + f2k->profile.drop_threshold = 1000000LL/30 + DROP_THRESHOLD_GAP; + } +@@ -3405,7 +3408,11 @@ static int f2k_set_stream(struct v4l2_subdev *sd, int enable) + { + dev_info(f2k->isp->dev,"f2k interrupt: max duration %lld us, big_cnt %d\n", f2k->profile.max_int_duration, f2k->profile.big_dur_cnt); + dev_info(f2k->isp->dev,"f2k interrupt: max interval %lld us, big_cnt %d\n", f2k->profile.max_int_interval, f2k->profile.big_inter_cnt); +- dev_info(f2k->isp->dev,"f2k jump drop_cnt %d\n", f2k->profile.drop_cnt); ++ for(i=0; iprofile.drop_cnt[i] > 0) ++ dev_info(f2k->isp->dev,"f2k ds%d jump drop_cnt %d\n", i, f2k->profile.drop_cnt[i]); ++ } + } + dev_info(f2k->isp->dev,"f2k dmaErrCnt %d, no_buf_drop_cnt %d, total %d\n", f2k->profile.dmaErrCnt, f2k->profile.no_buf_drop_cnt, f2k->profile.pic_cnt); + break; +diff --git a/drivers/media/platform/canaan-isp/isp_2k/isp_r2k.c b/drivers/media/platform/canaan-isp/isp_2k/isp_r2k.c +index c7e73698..e878d5a8 100755 +--- a/drivers/media/platform/canaan-isp/isp_2k/isp_r2k.c ++++ b/drivers/media/platform/canaan-isp/isp_2k/isp_r2k.c +@@ -2479,14 +2479,14 @@ static void video_buffer_next(struct isp_r2k_device *r2k, enum video_type dsNum) + + buf = list_first_entry(&video->dmaqueue, struct k510isp_buffer, irqlist); + +- if(dsNum == DS0_VIDEO && r2k->profile.drop_threshold > 0LL && r2k->profile.buf_set_time != 0) ++ if(r2k->profile.drop_threshold > 0LL && r2k->profile.buf_set_time[dsNum] != 0) + { + unsigned long long delta; +- delta = get_usec() - r2k->profile.buf_set_time; ++ delta = get_usec() - r2k->profile.buf_set_time[dsNum]; + if(delta > r2k->profile.drop_threshold) + { + drop = 1; +- r2k->profile.drop_cnt++; ++ r2k->profile.drop_cnt[dsNum]++; + } + } + +@@ -2596,6 +2596,7 @@ static void r2k_isr_main_buffer(struct isp_r2k_device *r2k) + + video_buffer_next(r2k, MAIN_VIDEO); + ++ r2k->profile.buf_set_time[MAIN_VIDEO] = get_usec(); + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; + + return buffer != NULL; +@@ -2617,7 +2618,7 @@ static void r2k_isr_out0_buffer(struct isp_r2k_device *r2k) + + video_buffer_next(r2k, DS0_VIDEO); + +- r2k->profile.buf_set_time = r2k->profile.buf_set_time; ++ r2k->profile.buf_set_time[DS0_VIDEO] = get_usec(); + + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; + +@@ -2638,6 +2639,7 @@ static void r2k_isr_out1_buffer(struct isp_r2k_device *r2k) + } + + video_buffer_next(r2k, DS1_VIDEO); ++ r2k->profile.buf_set_time[DS1_VIDEO] = get_usec(); + + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; + +@@ -2934,6 +2936,7 @@ static int r2k_set_stream(struct v4l2_subdev *sd, int enable) + struct k510_isp_device *isp = to_isp_device(r2k); + struct device *dev = to_device(r2k); + int ret; ++ int i; + dev_dbg(r2k->isp->dev,"%s:enable(0x%d)\n",__func__,enable); + + struct isp_cfg_info *isp_cfg = &r2k->isp_cfg; +@@ -2975,7 +2978,7 @@ static int r2k_set_stream(struct v4l2_subdev *sd, int enable) + + memset(&r2k->profile,0,sizeof(struct k510_isp_profile)); + if(isp_cfg->isp_ds_cfg.dsInSizeInfo.Width == 1920 && +- isp_cfg->isp_ds_cfg.dsInSizeInfo.Height == 1080) ++ isp_cfg->isp_ds_cfg.dsInSizeInfo.Height >= 1080) + { + r2k->profile.drop_threshold = 1000000LL/30 + DROP_THRESHOLD_GAP; + } +@@ -3008,7 +3011,11 @@ static int r2k_set_stream(struct v4l2_subdev *sd, int enable) + { + dev_info(r2k->isp->dev,"r2k interrupt: max duration %lld us, big_cnt %d\n", r2k->profile.max_int_duration, r2k->profile.big_dur_cnt); + dev_info(r2k->isp->dev,"r2k interrupt: max interval %lld us, big_cnt %d\n", r2k->profile.max_int_interval, r2k->profile.big_inter_cnt); +- dev_info(r2k->isp->dev,"r2k jump drop_cnt %d\n", r2k->profile.drop_cnt); ++ for(i=0; iprofile.drop_cnt[i] > 0) ++ dev_info(r2k->isp->dev,"r2k ds%d jump drop_cnt %d\n", i, r2k->profile.drop_cnt[i]); ++ } + } + dev_info(r2k->isp->dev,"r2k dmaErrCnt %d, no_buf_drop_cnt %d, total %d\n", r2k->profile.dmaErrCnt, r2k->profile.no_buf_drop_cnt, r2k->profile.pic_cnt); + break; +diff --git a/drivers/media/platform/canaan-isp/k510isp_com.h b/drivers/media/platform/canaan-isp/k510isp_com.h +index 96eb1ad5..ec9648fa 100755 +--- a/drivers/media/platform/canaan-isp/k510isp_com.h ++++ b/drivers/media/platform/canaan-isp/k510isp_com.h +@@ -479,9 +479,9 @@ struct k510_isp_profile { + unsigned long long cur_int_interval; + int big_dur_cnt; + int big_inter_cnt; +- unsigned long long buf_set_time; ++ unsigned long long buf_set_time[4]; + unsigned long long drop_threshold; +- int drop_cnt; ++ int drop_cnt[4]; + int no_buf_drop_cnt; + }; + +-- +2.17.1 + diff --git a/package/patches/linux/0025-Add-get-phys-address-ioctl-to-dma-buf.patch b/package/patches/linux/0025-Add-get-phys-address-ioctl-to-dma-buf.patch new file mode 100644 index 0000000..7cfc749 --- /dev/null +++ b/package/patches/linux/0025-Add-get-phys-address-ioctl-to-dma-buf.patch @@ -0,0 +1,84 @@ +From 87fea9bd776a68f26e40024e9256d67e9885de67 Mon Sep 17 00:00:00 2001 +From: wycwyhwyq <5f20.6d9b@gmail.com> +Date: Wed, 24 Aug 2022 10:42:28 +0800 +Subject: [PATCH] Add get phys address ioctl to dma-buf + +--- + drivers/dma-buf/dma-buf.c | 31 +++++++++++++++++++++++++++++++ + include/uapi/linux/dma-buf.h | 5 +++++ + 2 files changed, 36 insertions(+) + +diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c +index d78d5fc1..4d4b58b4 100644 +--- a/drivers/dma-buf/dma-buf.c ++++ b/drivers/dma-buf/dma-buf.c +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #include + +@@ -287,6 +288,36 @@ static long dma_buf_ioctl(struct file *file, + dmabuf = file->private_data; + + switch (cmd) { ++ case DMA_BUF_IOCTL_PHYS: { ++ struct dma_buf_attachment *attachment = NULL; ++ struct sg_table *sgt = NULL; ++ unsigned long phys = 0; ++ struct device dev; ++ ++ if (!dmabuf || IS_ERR(dmabuf)) { ++ return -EFAULT; ++ } ++ memset(&dev, 0, sizeof(dev)); ++ device_initialize(&dev); ++ dev.coherent_dma_mask = DMA_BIT_MASK(64); ++ dev.dma_mask = &dev.coherent_dma_mask; ++ arch_setup_dma_ops(&dev, 0, 0, NULL, false); ++ attachment = dma_buf_attach(dmabuf, &dev); ++ if (!attachment || IS_ERR(attachment)) { ++ return -EFAULT; ++ } ++ ++ sgt = dma_buf_map_attachment(attachment, DMA_BIDIRECTIONAL); ++ if (sgt && !IS_ERR(sgt)) { ++ phys = sg_dma_address(sgt->sgl); ++ dma_buf_unmap_attachment(attachment, sgt, ++ DMA_BIDIRECTIONAL); ++ } ++ dma_buf_detach(dmabuf, attachment); ++ if (copy_to_user((void __user *) arg, &phys, sizeof(phys))) ++ return -EFAULT; ++ return 0; ++ } + case DMA_BUF_IOCTL_SYNC: + if (copy_from_user(&sync, (void __user *) arg, sizeof(sync))) + return -EFAULT; +diff --git a/include/uapi/linux/dma-buf.h b/include/uapi/linux/dma-buf.h +index d75df521..514beecd 100644 +--- a/include/uapi/linux/dma-buf.h ++++ b/include/uapi/linux/dma-buf.h +@@ -27,6 +27,10 @@ struct dma_buf_sync { + __u64 flags; + }; + ++struct dma_buf_phys { ++ unsigned long phys; ++}; ++ + #define DMA_BUF_SYNC_READ (1 << 0) + #define DMA_BUF_SYNC_WRITE (2 << 0) + #define DMA_BUF_SYNC_RW (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE) +@@ -37,5 +41,6 @@ struct dma_buf_sync { + + #define DMA_BUF_BASE 'b' + #define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync) ++#define DMA_BUF_IOCTL_PHYS _IOW(DMA_BUF_BASE, 1, struct dma_buf_phys) + + #endif +-- +2.17.1 + diff --git a/package/patches/linux/0025-add-ISP-Core-Reg-W-R-ioctl-imx219-mdelay2udelay.patch b/package/patches/linux/0025-add-ISP-Core-Reg-W-R-ioctl-imx219-mdelay2udelay.patch new file mode 100644 index 0000000..5159dbd --- /dev/null +++ b/package/patches/linux/0025-add-ISP-Core-Reg-W-R-ioctl-imx219-mdelay2udelay.patch @@ -0,0 +1,6009 @@ +From f12828fc6ee8bc3af4489d285b395705f70b772e Mon Sep 17 00:00:00 2001 +From: alex-guo +Date: Tue, 23 Aug 2022 23:26:38 +0800 +Subject: [PATCH] add ISP Core Reg W-R ioctl imx219 mdelay2udelay + +--- + .../canaan-isp/isp_2k/core/isp_core_drv.h | 471 +++---- + .../canaan-isp/isp_2k/core/isp_core_reg.h | 47 +- + .../canaan-isp/isp_2k/core/isp_f2k_core_drv.c | 152 ++- + .../canaan-isp/isp_2k/core/isp_r2k_core_drv.c | 120 +- + .../platform/canaan-isp/isp_2k/isp_f2k.c | 1115 +++++++++-------- + .../platform/canaan-isp/isp_2k/isp_r2k.c | 1071 ++++++++-------- + include/uapi/linux/k510isp.h | 16 +- + 7 files changed, 1565 insertions(+), 1427 deletions(-) + +diff --git a/drivers/media/platform/canaan-isp/isp_2k/core/isp_core_drv.h b/drivers/media/platform/canaan-isp/isp_2k/core/isp_core_drv.h +index 45dfc599..60a23d66 100755 +--- a/drivers/media/platform/canaan-isp/isp_2k/core/isp_core_drv.h ++++ b/drivers/media/platform/canaan-isp/isp_2k/core/isp_core_drv.h +@@ -12,146 +12,146 @@ + + typedef struct _ISP_CORE_ITC_CTL_S + { +- unsigned int hsync_pol; +- unsigned int vsync_pol; +- unsigned int hsync_input_timing; ++ unsigned int hsync_pol; ++ unsigned int vsync_pol; ++ unsigned int hsync_input_timing; + unsigned int vsync_input_timing; +- +- unsigned int mirror_ctl; +- unsigned int video_format_ctl; +- ++ ++ unsigned int mirror_ctl; ++ unsigned int video_format_ctl; ++ + } ISP_CORE_ITC_CTL_S; + + typedef struct _ISP_CORE_IMAGE_ATTR_S + { +- unsigned int image_height; +- unsigned int image_width; +- unsigned int image_v_start; +- unsigned int image_h_start; +- unsigned int image_active_width; +- unsigned int image_active_height; ++ unsigned int image_height; ++ unsigned int image_width; ++ unsigned int image_v_start; ++ unsigned int image_h_start; ++ unsigned int image_active_width; ++ unsigned int image_active_height; + } ISP_CORE_IMAGE_ATTR_S; + + typedef struct _ISP_CORE_TEST_CTL_S + { +- unsigned int bayer_mode_sel; +- unsigned int motion_mode_sel; ++ unsigned int bayer_mode_sel; ++ unsigned int motion_mode_sel; + unsigned int test_pattern_sel; + unsigned int test_pattern_en; +- +- unsigned int wdr_l_mul_data; +- unsigned int wdr_m_mul_data; +- unsigned int wdr_s_mul_data; +- ++ ++ unsigned int wdr_l_mul_data; ++ unsigned int wdr_m_mul_data; ++ unsigned int wdr_s_mul_data; ++ + } ISP_CORE_TEST_CTL_S; + + typedef struct _ISP_CORE_BLC_CTL_S + { +- unsigned int blc_en; +- unsigned int blc_offset; +- unsigned int blc_ratio; ++ unsigned int blc_en; ++ unsigned int blc_offset; ++ unsigned int blc_ratio; + } ISP_CORE_BLC_CTL_S; + + typedef struct _ISP_CORE_LSC_CTL_S + { +- unsigned int lsc_en; +- unsigned int lsc_h_center; +- unsigned int lsc_v_center; ++ unsigned int lsc_en; ++ unsigned int lsc_h_center; ++ unsigned int lsc_v_center; + unsigned int lsc_red_ratio; +- +- unsigned int lsc_green_ratio; +- unsigned int lsc_blue_ratio; +- unsigned int lsc_ir_ratio; ++ ++ unsigned int lsc_green_ratio; ++ unsigned int lsc_blue_ratio; ++ unsigned int lsc_ir_ratio; + } ISP_CORE_LSC_CTL_S; + + typedef struct _ISP_CORE_AE_CTL_S + { +- unsigned int ae_as_en; +- unsigned int ae_ag_en; +- unsigned int ae_airis_en; ++ unsigned int ae_as_en; ++ unsigned int ae_ag_en; ++ unsigned int ae_airis_en; + unsigned int ae_enter_ls_sel; +- +- unsigned int ae_exit_ls_sel; +- unsigned int ae_win_mode_sel; ++ ++ unsigned int ae_exit_ls_sel; ++ unsigned int ae_win_mode_sel; + unsigned int ae_back_light_mode_sel; +- unsigned int ae_day_change_en; +- unsigned int ae_day_change_sel; +- ++ unsigned int ae_day_change_en; ++ unsigned int ae_day_change_sel; ++ + unsigned int ae_win_h_start; + unsigned int ae_win_v_start; +- unsigned int ae_win_h_end; +- unsigned int ae_win_v_end; +- +- unsigned int ae_tar_bright; ++ unsigned int ae_win_h_end; ++ unsigned int ae_win_v_end; ++ ++ unsigned int ae_tar_bright; + unsigned int ae_tar_bright_range; +- ++ + unsigned int ae_l_ex_time; + unsigned int ae_m_ex_time; + unsigned int ae_s_ex_time; +- +- unsigned int ae_agc; ++ ++ unsigned int ae_agc; + unsigned int ae_ad_shuttle_freq; + unsigned int ae_ad_gain_freq; +- ++ + unsigned int ae_adjust_step_max; +- +- unsigned int ae_ex_value_max; +- unsigned int ae_ex_value_mid; +- unsigned int ae_ex_value_min; + +- unsigned int ae_gain_value_max; ++ unsigned int ae_ex_value_max; ++ unsigned int ae_ex_value_mid; ++ unsigned int ae_ex_value_min; ++ ++ unsigned int ae_gain_value_max; + unsigned int ae_gain_value_mid; + unsigned int ae_gain_value_min; +- ++ + unsigned int ae_dn_switch_ad_step_max; + unsigned int ae_dn_switch_wait_time; + unsigned int ape_max_diff; +- +- unsigned int ape_drv_signal_max; +- +- unsigned int ape_coeff_distance; +- unsigned int ape_coeff_speed; ++ ++ unsigned int ape_drv_signal_max; ++ ++ unsigned int ape_coeff_distance; ++ unsigned int ape_coeff_speed; + unsigned int ape_coeff_acceleration; +- +- unsigned int ape_drv_manual_value; +- unsigned int ape_damp_manual_value; ++ ++ unsigned int ape_drv_manual_value; ++ unsigned int ape_damp_manual_value; + } ISP_CORE_AE_CTL_S; + + typedef struct _ISP_CORE_AE_STS_S +-{ ++{ + unsigned int ae_value_ready; +- unsigned int ae_long_cur_ex; +- unsigned int ae_mid_cur_ex; +- unsigned int ae_short_cur_ex; +- unsigned int ae_digital_gain; +- +- unsigned int ave_brightness; ++ unsigned int ae_long_cur_ex; ++ unsigned int ae_mid_cur_ex; ++ unsigned int ae_short_cur_ex; ++ unsigned int ae_digital_gain; ++ ++ unsigned int ave_brightness; + unsigned int ae_day_night_status; +- unsigned int ae_ex_status; +- +- unsigned int ae_sum; ++ unsigned int ae_ex_status; ++ ++ unsigned int ae_sum; + unsigned int ae_pixel_sum; + } ISP_CORE_AE_STS_S; + + typedef struct _ISP_CORE_AWB_CTL_S + { +- unsigned int awb_d65_en; +- unsigned int awb_ccm_en; +- unsigned int awb_en; ++ unsigned int awb_d65_en; ++ unsigned int awb_ccm_en; ++ unsigned int awb_en; + unsigned int awb_mode_sel; +- ++ + unsigned int awb_hist_mode_sel; +- unsigned int awb_veri_en; ++ unsigned int awb_veri_en; + unsigned int awb_fb_en; + unsigned int awb_value_save_en; +- ++ + unsigned int awb_ccm_adp_adjust_en; +- unsigned int awb_stab_en; ++ unsigned int awb_stab_en; + unsigned int awb_d65_red_gain; +- ++ + unsigned int awb_d65_blue_gain; + unsigned int ccm_rr_coff; +- ++ + unsigned int ccm_rg_coff; + unsigned int ccm_rb_coff; + unsigned int ccm_gr_coff; +@@ -159,26 +159,26 @@ typedef struct _ISP_CORE_AWB_CTL_S + unsigned int ccm_gb_coff; + unsigned int ccm_br_coff; + unsigned int ccm_bg_coff; +- +- unsigned int ccm_bb_coff; ++ ++ unsigned int ccm_bb_coff; + unsigned int ccm_correct_coff; +- ++ + unsigned int awb_win_h_start; + unsigned int awb_win_v_start; +- unsigned int awb_win_h_end; +- unsigned int awb_win_v_end; +- +- unsigned int awb_correct_diff_th; ++ unsigned int awb_win_h_end; ++ unsigned int awb_win_v_end; ++ ++ unsigned int awb_correct_diff_th; + unsigned int awb_color_changeres_time; + unsigned int awb_historgram_th; +- +- unsigned int awb_red_gain_adjust; +- unsigned int awb_green_gain_adjust; +- unsigned int awb_blue_gain_adjust; ++ ++ unsigned int awb_red_gain_adjust; ++ unsigned int awb_green_gain_adjust; ++ unsigned int awb_blue_gain_adjust; + unsigned int awb_red_max_value; +- unsigned int awb_blue_max_value; +- unsigned int awb_red_min_value; +- ++ unsigned int awb_blue_max_value; ++ unsigned int awb_red_min_value; ++ + unsigned int awb_blue_min_value; + unsigned int awb_red_obj_value; + unsigned int awb_blue_obj_value; +@@ -188,50 +188,50 @@ typedef struct _ISP_CORE_AWB_STS_S + { + unsigned int awb_blue_hist_value; + unsigned int awb_blue_hist_pixel; +- +- unsigned int awb_red_hist_value; +- unsigned int awb_red_hist_pixel; ++ ++ unsigned int awb_red_hist_value; ++ unsigned int awb_red_hist_pixel; + unsigned int awb_bypass_blue_hist_value; +- ++ + unsigned int awb_bypass_blue_hist_pixel; +- unsigned int awb_bypass_red_hist_value; ++ unsigned int awb_bypass_red_hist_value; + unsigned int awb_bypass_red_hist_pixel; +- ++ + unsigned int awb_red_value; + unsigned int awb_green_value; +- +- unsigned int awb_blue_value; +- unsigned int awb_org_image_red_value; +- ++ ++ unsigned int awb_blue_value; ++ unsigned int awb_org_image_red_value; ++ + unsigned int awb_org_image_green_value; + unsigned int awb_org_image_blue_value; + } ISP_CORE_AWB_STS_S; + + typedef struct _ISP_CORE_WDR_CTL_S + { +- unsigned int wdr_fusion_en; +- unsigned int wdr_frame_sel; +- unsigned int wdr_adp_adjust_en; ++ unsigned int wdr_fusion_en; ++ unsigned int wdr_frame_sel; ++ unsigned int wdr_adp_adjust_en; + unsigned int wdr_stab_en; +- +- unsigned int wdr_en; +- unsigned int wdr_ghost_remove_en; ++ ++ unsigned int wdr_en; ++ unsigned int wdr_ghost_remove_en; + unsigned int wdr_3frame_out_mode; + unsigned int wdr_mode_sel; +- ++ + unsigned int wdr_2frame_ex_ratio; +- unsigned int wdr_3frame_ex_ratio; +- unsigned int wdr_stat_img_sel; ++ unsigned int wdr_3frame_ex_ratio; ++ unsigned int wdr_stat_img_sel; + unsigned int wdr_ltm_data_sel; +- ++ + unsigned int wdr_tz_data_sel; + unsigned int wdr_remove_purple_en; + unsigned int wdr_over_ex_ratio_th1; +- ++ + unsigned int wdr_over_ex_ratio_th2; + unsigned int wdr_fusion_ratio_th; +- +- unsigned int wdr_fusion_value1; ++ ++ unsigned int wdr_fusion_value1; + unsigned int wdr_fusion_value2; + }ISP_CORE_WDR_CTL_S; + +@@ -250,57 +250,57 @@ typedef struct _ISP_CORE_CSC_CTL_S + + typedef struct _ISP_CORE_ADA_CTL_S + { +- unsigned int ada_rgb_gamma_en; +- unsigned int ada_yuv_gamma_en; +- unsigned int ada_adjust_en; ++ unsigned int ada_rgb_gamma_en; ++ unsigned int ada_yuv_gamma_en; ++ unsigned int ada_adjust_en; + unsigned int ada_img_stab_en; +- +- unsigned int ada_ccr_en; +- unsigned int ada_adp_en; +- unsigned int ada_adp_ccr_en; ++ ++ unsigned int ada_ccr_en; ++ unsigned int ada_adp_en; ++ unsigned int ada_adp_ccr_en; + unsigned int ada_stat_mode_sel; +- ++ + unsigned int ada_enh_mode_sel; +- unsigned int ada_stat_max_value; ++ unsigned int ada_stat_max_value; + unsigned int ada_ad_stren_max_value; +- ++ + unsigned int ada_win_h_start; + unsigned int ada_win_v_start; +- unsigned int ada_win_h_end; +- unsigned int ada_win_v_end; ++ unsigned int ada_win_h_end; ++ unsigned int ada_win_v_end; + + } ISP_CORE_ADA_CTL_S; + + typedef struct _ISP_CORE_RGBIR_CTL_S + { +- unsigned int rgbir_en; +- unsigned int rgbir_rtf_en; +- unsigned int rgbir_rpc_en; ++ unsigned int rgbir_en; ++ unsigned int rgbir_rtf_en; ++ unsigned int rgbir_rpc_en; + unsigned int rgbir_fusion_en; +- ++ + unsigned int rgbir_output_sel; +- +- unsigned int rgbir_rpc_max_value; ++ ++ unsigned int rgbir_rpc_max_value; + unsigned int rgbir_rpc_color_coff; +- unsigned int rgbir_rpc_luma_coff; +- +- unsigned int rgbir_rpc_th; +- unsigned int rgbir_rpc_th1; ++ unsigned int rgbir_rpc_luma_coff; ++ ++ unsigned int rgbir_rpc_th; ++ unsigned int rgbir_rpc_th1; + } ISP_CORE_RGBIR_CTL_S; + + typedef struct _ISP_CORE_2DNR_CTL_S + { +- unsigned int core_2dnr_pcf_en; +- unsigned int core_2dnr_raw_en; +- unsigned int core_2dnr_edge_en; +- unsigned int core_2dnr_bap_en; +- +- unsigned int core_2dnr_luma_en; +- unsigned int core_2dnr_chroma_en; +- unsigned int core_2dnr_pcf_adp_en; +- unsigned int core_2dnr_raw_adp_en; +- +- unsigned int core_2dnr_luma_adp_en; ++ unsigned int core_2dnr_pcf_en; ++ unsigned int core_2dnr_raw_en; ++ unsigned int core_2dnr_edge_en; ++ unsigned int core_2dnr_bap_en; ++ ++ unsigned int core_2dnr_luma_en; ++ unsigned int core_2dnr_chroma_en; ++ unsigned int core_2dnr_pcf_adp_en; ++ unsigned int core_2dnr_raw_adp_en; ++ ++ unsigned int core_2dnr_luma_adp_en; + unsigned int core_2dnr_chroma_adp_en; + unsigned int core_2dnr_raw_intensity; + unsigned int core_2dnr_bap_intensity; +@@ -312,67 +312,67 @@ typedef struct _ISP_CORE_2DNR_CTL_S + + typedef struct _ISP_CORE_3DNR_CTL_S + { +- unsigned int core_3dnr_en; +- unsigned int core_3dnr_pre_luma_en; +- unsigned int core_3dnr_pre_chroma_en; ++ unsigned int core_3dnr_en; ++ unsigned int core_3dnr_pre_luma_en; ++ unsigned int core_3dnr_pre_chroma_en; + unsigned int core_3dnr_main_luma_en; +- ++ + unsigned int core_3dnr_main_chroma_en; +- unsigned int core_3dnr_post_luma_en; ++ unsigned int core_3dnr_post_luma_en; + unsigned int core_3dnr_post_chroma_en; + unsigned int core_3dnr_2d_luma_en; +- +- unsigned int core_3dnr_2d_chroma_en; +- unsigned int core_3dnr_wb_en; ++ ++ unsigned int core_3dnr_2d_chroma_en; ++ unsigned int core_3dnr_wb_en; + unsigned int core_3dnr_wb_sel; + unsigned int core_3dnr_adp_luma_en; +- ++ + unsigned int core_3dnr_adp_chroma_en; +- unsigned int core_3dnr_pre_luma_th; +- unsigned int core_3dnr_pre_luma_intensity; ++ unsigned int core_3dnr_pre_luma_th; ++ unsigned int core_3dnr_pre_luma_intensity; + unsigned int core_3dnr_pre_chroma_intensity; +- ++ + unsigned int core_3dnr_mid_filter_th; +- unsigned int core_3dnr_pre_mid_filter_th; +- unsigned int core_3dnr_cur_mid_filter_th; ++ unsigned int core_3dnr_pre_mid_filter_th; ++ unsigned int core_3dnr_cur_mid_filter_th; + unsigned int core_3dnr_low_pass_filter_th; +- unsigned int core_3dnr_luma_th; ++ unsigned int core_3dnr_luma_th; + unsigned int core_3dnr_min_value; + unsigned int core_3dnr_luma_intensity; +- +- unsigned int core_3dnr_chroma_intensity; +- unsigned int core_3dnr_post_edge_th; +- unsigned int core_3dnr_post_luma_intensity; ++ ++ unsigned int core_3dnr_chroma_intensity; ++ unsigned int core_3dnr_post_edge_th; ++ unsigned int core_3dnr_post_luma_intensity; + unsigned int core_3dnr_post_chroma_intensity; + + } ISP_CORE_3DNR_CTL_S; + + typedef struct _ISP_CORE_ENH_CTL_S + { +- unsigned int enh_ltm_en; +- unsigned int enh_sharp_en; +- unsigned int enh_cc_en; ++ unsigned int enh_ltm_en; ++ unsigned int enh_sharp_en; ++ unsigned int enh_cc_en; + unsigned int enh_adp_ltm_en; +- +- unsigned int enh_adp_sharp_en; +- unsigned int enh_adp_cc_en; +- unsigned int ltm_gain; +- unsigned int ltm_th; +- +- unsigned int enh_nr_th; ++ ++ unsigned int enh_adp_sharp_en; ++ unsigned int enh_adp_cc_en; ++ unsigned int ltm_gain; ++ unsigned int ltm_th; ++ ++ unsigned int enh_nr_th; + unsigned int enh_th1; + unsigned int enh_th2; +- unsigned int sharp_gain; ++ unsigned int sharp_gain; + } ISP_CORE_ENH_CTL_S; + + typedef struct _ISP_CORE_POST_CTL_S +-{ +- unsigned int post_cont_ad_en; +- unsigned int post_luma_ad_en; +- unsigned int post_satu_ad_en; +-// unsigned int post_otc_en; ++{ ++ unsigned int post_cont_ad_en; ++ unsigned int post_luma_ad_en; ++ unsigned int post_satu_ad_en; ++// unsigned int post_otc_en; + unsigned int cont_ad_intensity; +- ++ + unsigned int luma_ad_intensity; + unsigned int satu_ad_intensity; + +@@ -380,50 +380,50 @@ typedef struct _ISP_CORE_POST_CTL_S + + typedef struct _ISP_CORE_OTC_CTL_S + { +- unsigned int post_otc_en; +- unsigned int otc_yc_sel; +- unsigned int otc_uv_format_sel; +- unsigned int otc_hsync_pol_sel; ++ unsigned int post_otc_en; ++ unsigned int otc_yc_sel; ++ unsigned int otc_uv_format_sel; ++ unsigned int otc_hsync_pol_sel; + unsigned int otc_vsync_pol_sel; +- +- unsigned int otc_stt_vr; +- unsigned int otc_stt_hr; +- unsigned int otc_height; +- unsigned int otc_width; ++ ++ unsigned int otc_stt_vr; ++ unsigned int otc_stt_hr; ++ unsigned int otc_height; ++ unsigned int otc_width; + } ISP_CORE_OTC_CTL_S; + + typedef struct _ISP_CORE_LDC_CTL_S + { +- unsigned int ldc_en; +- unsigned int ldc_arith_en; +- unsigned int ldc_req_freq; +- ++ unsigned int ldc_en; ++ unsigned int ldc_arith_en; ++ unsigned int ldc_req_freq; ++ + unsigned int ldc_stt_ln; + unsigned int ldc_h_center_pos; +- ++ + unsigned int ldc_v_center_pos; +- unsigned int ldc_rectify_cr; +- +- unsigned int ldc_rectify_cz; ++ unsigned int ldc_rectify_cr; ++ ++ unsigned int ldc_rectify_cz; + } ISP_CORE_LDC_CTL_S; + + typedef struct _ISP_CORE_AF_CTL_S + { +- unsigned int af_stat_en; +- unsigned int af_stat_mode_sel; ++ unsigned int af_stat_en; ++ unsigned int af_stat_mode_sel; + +- unsigned int af_stat_win_h_start; +- unsigned int af_stat_win_v_start; +- unsigned int af_stat_win_h_end; +- unsigned int af_stat_win_v_end; ++ unsigned int af_stat_win_h_start; ++ unsigned int af_stat_win_v_start; ++ unsigned int af_stat_win_h_end; ++ unsigned int af_stat_win_v_end; + + } ISP_CORE_AF_CTL_S; + + typedef struct _ISP_CORE_AF_STS_S +-{ +- unsigned int af_mid_frq_data; +- unsigned int af_high_frq_data; +- unsigned int af_stat_pixel_num; ++{ ++ unsigned int af_mid_frq_data; ++ unsigned int af_high_frq_data; ++ unsigned int af_stat_pixel_num; + } ISP_CORE_AF_STS_S; + + typedef struct _ISP_CORE_RAM_WR_STATUS_S +@@ -431,29 +431,29 @@ typedef struct _ISP_CORE_RAM_WR_STATUS_S + unsigned int gamma_grb_table_cfg; + unsigned int gamma_yuv_table_cfg; + +- unsigned int wdr_l3_table_cfg; +- unsigned int wdr_m3_table_cfg; +- unsigned int wdr_s3_table_cfg; ++ unsigned int wdr_l3_table_cfg; ++ unsigned int wdr_m3_table_cfg; ++ unsigned int wdr_s3_table_cfg; ++ ++ unsigned int wdr_l2_table_cfg; ++ unsigned int wdr_s2_table_cfg; + +- unsigned int wdr_l2_table_cfg; +- unsigned int wdr_s2_table_cfg; +- + } ISP_CORE_RAM_WR_STATUS_S; + + typedef struct _ISP_CORE_RAM_RD_STATUS_S + { +- unsigned int gamma_grb_table; +- unsigned int gamma_yuv_table; +- unsigned int wdr_l3_table; ++ unsigned int gamma_grb_table; ++ unsigned int gamma_yuv_table; ++ unsigned int wdr_l3_table; + unsigned int wdr_m3_table; +- +- unsigned int wdr_s3_table; +- unsigned int wdr_l2_table; +- unsigned int wdr_s2_table; ++ ++ unsigned int wdr_s3_table; ++ unsigned int wdr_l2_table; ++ unsigned int wdr_s2_table; + unsigned int ram_ready_status; +- ++ + unsigned int hist_ready_status; +- unsigned int ram_ready_lock; ++ unsigned int ram_ready_lock; + } ISP_CORE_RAM_RD_STATUS_S; + + typedef struct _ISP_CORE_ATRR_S +@@ -475,13 +475,20 @@ typedef struct _ISP_CORE_ATRR_S + ISP_CORE_3DNR_CTL_S st3dnrCtl; + ISP_CORE_ENH_CTL_S stEnhCtl; + ISP_CORE_POST_CTL_S stPostCtl; +- ISP_CORE_OTC_CTL_S stOtcCtl; ++ ISP_CORE_OTC_CTL_S stOtcCtl; + ISP_CORE_LDC_CTL_S stLdcCtl; + ISP_CORE_RAM_WR_STATUS_S stRamWrStatus; + ISP_CORE_RAM_RD_STATUS_S stRamRdStatus; + ISP_CORE_AF_CTL_S stAfCtl; + ISP_CORE_AF_STS_S stAfSts; + } ISP_CORE_ATRR_S; ++ ++typedef struct _ISP_CORE_REG_VAL_S ++{ ++ unsigned int reg_addr; ++ unsigned int reg_value; ++}ISP_CORE_REG_VAL_S; ++ + /* + *F2K + */ +@@ -508,11 +515,13 @@ int Isp_Drv_F2k_Core_SetOtcCtl(struct k510_isp_device *isp,ISP_CORE_OTC_CTL_S *p + int Isp_Drv_F2k_Core_SetLdcCtl(struct k510_isp_device *isp,ISP_CORE_LDC_CTL_S *pstLdcCtl); + int Isp_Drv_F2k_Core_SetAfCtl(struct k510_isp_device *isp,ISP_CORE_AF_CTL_S *pstAfCtl); + int Isp_Drv_F2k_Core_SetRamWrStatus(struct k510_isp_device *isp,unsigned int data); ++int Isp_Drv_F2k_Core_SetReg(struct k510_isp_device *isp,ISP_CORE_REG_VAL_S *pRegVal); + // + int Isp_Drv_F2k_Core_GetAeSts(struct k510_isp_device *isp,ISP_CORE_AE_STS_S *pAeSts); + int Isp_Drv_F2k_Core_GetAwbSts(struct k510_isp_device *isp,ISP_CORE_AWB_STS_S *pAwbSts); + int Isp_Drv_F2k_Core_GetAfSts(struct k510_isp_device *isp,ISP_CORE_AF_STS_S *pgtAfSts); + int Isp_Drv_F2k_Core_GetRamRdStatus(struct k510_isp_device *isp); ++int Isp_Drv_F2k_Core_GetReg(struct k510_isp_device *isp,ISP_CORE_REG_VAL_S *pRegVal); + /* + *R2K + */ +@@ -537,10 +546,12 @@ int Isp_Drv_R2k_Core_SetOtcCtl(struct k510_isp_device *isp,ISP_CORE_OTC_CTL_S *p + int Isp_Drv_R2k_Core_SetLdcCtl(struct k510_isp_device *isp,ISP_CORE_LDC_CTL_S *pstLdcCtl); + int Isp_Drv_R2k_Core_SetAfCtl(struct k510_isp_device *isp,ISP_CORE_AF_CTL_S *pstAfCtl); + int Isp_Drv_R2k_Core_SetRamWrStatus(struct k510_isp_device *isp,unsigned int data); ++int Isp_Drv_R2k_Core_SetReg(struct k510_isp_device *isp,ISP_CORE_REG_VAL_S *pRegVal); + // + int Isp_Drv_R2k_Core_GetAeSts(struct k510_isp_device *isp,ISP_CORE_AE_STS_S *pAeSts); + int Isp_Drv_R2k_Core_GetAwbSts(struct k510_isp_device *isp,ISP_CORE_AWB_STS_S *pAwbSts); + int Isp_Drv_R2k_Core_GetAfSts(struct k510_isp_device *isp,ISP_CORE_AF_STS_S *pgtAfSts); + int Isp_Drv_R2k_Core_GetRamRdStatus(struct k510_isp_device *isp); ++int Isp_Drv_R2k_Core_GetReg(struct k510_isp_device *isp,ISP_CORE_REG_VAL_S *pRegVal); + +-#endif /*_ISP_CORE_DRV_H_*/ +\ No newline at end of file ++#endif /*_ISP_CORE_DRV_H_*/ +diff --git a/drivers/media/platform/canaan-isp/isp_2k/core/isp_core_reg.h b/drivers/media/platform/canaan-isp/isp_2k/core/isp_core_reg.h +index b70d20af..d536c981 100755 +--- a/drivers/media/platform/canaan-isp/isp_2k/core/isp_core_reg.h ++++ b/drivers/media/platform/canaan-isp/isp_2k/core/isp_core_reg.h +@@ -100,7 +100,7 @@ union U_ISP_CORE_IMAGE_ACTIVE_HEIGHT + } ; + /* + * Test Pattern Control +-*/ ++*/ + union U_ISP_CORE_TEST_CTL + { + /* Define the struct bits */ +@@ -158,7 +158,7 @@ union U_ISP_CORE_BLC_RATIO + unsigned int u32; + } ; + /* +-* Lens Shading Correction ++* Lens Shading Correction + */ + union U_ISP_CORE_LSC_CTL + { +@@ -244,7 +244,7 @@ union U_ISP_CORE_LSC_IR_RATIO + unsigned int u32; + } ; + /* +-*AUTO Exposure/Gain ++*AUTO Exposure/Gain + */ + union U_ISP_CORE_AE_CTL + { +@@ -1438,7 +1438,7 @@ union U_ISP_CORE_CSC_R2Y_22 + } ; + /* + *ADA +-*/ ++*/ + union U_ISP_CORE_ADA_CTL + { + /* Define the struct bits */ +@@ -1692,7 +1692,7 @@ union U_ISP_CORE_2DNR_CHROMA_INTENSITY + unsigned int u32; + } ; + /* +-* 3D Noise Reduction ++* 3D Noise Reduction + */ + union U_ISP_CORE_3DNR_CTL + { +@@ -2083,7 +2083,7 @@ union U_ISP_CORE_OTC_WIDTH + unsigned int u32; + } ; + /* +-* LDC Control ++* LDC Control + */ + union U_ISP_CORE_LDC_CTL + { +@@ -2159,7 +2159,7 @@ union U_ISP_CORE_LDC_RECTIFY_CZ + unsigned int u32; + } ; + /* +-* ISP Table Control ++* ISP Table Control + */ + union U_ISP_CORE_RAM_WR_STATUS + { +@@ -2310,6 +2310,28 @@ union U_ISP_CORE_AF_STAT_PIXEL_NUM + unsigned int u32; + } ; + ++union U_ISP_CORE_REG_CFG_ADDR ++{ ++ /* Define the struct bits */ ++ struct ++ { ++ unsigned int reg_value : 32 ; /* [31 ..0 ] */ ++ } bits; /* Define an unsigned member */ ++ ++ unsigned int u32; ++} ; ++ ++union U_ISP_CORE_REG_CFG_VALUE ++{ ++ /* Define the struct bits */ ++ struct ++ { ++ unsigned int reg_value : 32 ; /* [31 ..0 ] */ ++ } bits; /* Define an unsigned member */ ++ ++ unsigned int u32; ++} ; ++ + //itc + #define ISP_CORE_ITC_CTL (0x0000) + #define ISP_CORE_IMAGE_HEIGHT (0x0004) +@@ -2318,13 +2340,13 @@ union U_ISP_CORE_AF_STAT_PIXEL_NUM + #define ISP_CORE_IMAGE_H_START (0x0010) + #define ISP_CORE_IMAGE_ACTIVE_WIDTH (0x0014) + #define ISP_CORE_IMAGE_ACTIVE_HEIGHT (0x0018) +-//tpg ++//tpg + #define ISP_CORE_TEST_CTL (0x001C) +-//blc ++//blc + #define ISP_CORE_BLC_CTL (0x0020) + #define ISP_CORE_BLC_OFFSET (0x0024) + #define ISP_CORE_BLC_RATIO (0x0028) +-//lsc ++//lsc + #define ISP_CORE_LSC_CTL (0x002C) + #define ISP_CORE_LSC_H_CENTER (0x0030) + #define ISP_CORE_LSC_V_CENTER (0x0034) +@@ -2332,7 +2354,7 @@ union U_ISP_CORE_AF_STAT_PIXEL_NUM + #define ISP_CORE_LSC_G_RATIO (0x003C) + #define ISP_CORE_LSC_B_RATIO (0x0040) + #define ISP_CORE_LSC_IR_RATIO (0x0044) +-//ae ++//ae + #define ISP_CORE_AE_CTL (0x0050) + #define ISP_CORE_AE_WIN_H_START (0x0054) + #define ISP_CORE_AE_WIN_V_START (0x0058) +@@ -2485,7 +2507,7 @@ union U_ISP_CORE_AF_STAT_PIXEL_NUM + #define ISP_CORE_CONT_GAIN (0x02E8) + #define ISP_CORE_LUMA_GAIN (0x02EC) + #define ISP_CORE_SATU_GAIN (0x02F0) +-//otc ++//otc + #define ISP_CORE_OTC_STT_VR (0x02F4) + #define ISP_CORE_OTC_STT_HR (0x02F8) + #define ISP_CORE_OTC_HEIGHT (0x02FC) +@@ -2512,4 +2534,3 @@ union U_ISP_CORE_AF_STAT_PIXEL_NUM + #define ISP_CORE_AF_STAT_PIXEL_NUM (0x0364) + + #endif /*_ISP_CORE_REG_H_*/ +- +diff --git a/drivers/media/platform/canaan-isp/isp_2k/core/isp_f2k_core_drv.c b/drivers/media/platform/canaan-isp/isp_2k/core/isp_f2k_core_drv.c +index 8e351db0..1d11f161 100755 +--- a/drivers/media/platform/canaan-isp/isp_2k/core/isp_f2k_core_drv.c ++++ b/drivers/media/platform/canaan-isp/isp_2k/core/isp_f2k_core_drv.c +@@ -9,7 +9,7 @@ + #include "isp_core_drv.h" + #include "isp_core_reg.h" + /* +-* Image Timing Control ++* Image Timing Control + */ + int Isp_Drv_F2k_Core_SetItcCtl(struct k510_isp_device *isp,ISP_CORE_ITC_CTL_S *pstItcCtl) + { +@@ -22,7 +22,7 @@ int Isp_Drv_F2k_Core_SetItcCtl(struct k510_isp_device *isp,ISP_CORE_ITC_CTL_S *p + stData.bits.vsync_input_timing = pstItcCtl->vsync_input_timing; + stData.bits.mirror_ctl = pstItcCtl->mirror_ctl; + stData.bits.video_format_ctl = pstItcCtl->video_format_ctl; +- ++ + isp_reg_writel(isp,stData.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_ITC_CTL); + return 0; + } +@@ -31,7 +31,7 @@ int Isp_Drv_F2k_Core_SetItcCtl(struct k510_isp_device *isp,ISP_CORE_ITC_CTL_S *p + */ + int Isp_Drv_F2k_Core_SetImageAttr(struct k510_isp_device *isp,ISP_CORE_IMAGE_ATTR_S *pstImgAttr) + { +- ++ + + union U_ISP_CORE_IMAGE_HEIGHT stHeight; + stHeight.u32 = 0; +@@ -69,7 +69,7 @@ int Isp_Drv_F2k_Core_SetImageAttr(struct k510_isp_device *isp,ISP_CORE_IMAGE_ATT + */ + int Isp_Drv_F2k_Core_SetTestCtl(struct k510_isp_device *isp,ISP_CORE_TEST_CTL_S *pstTestCtl) + { +- ++ + union U_ISP_CORE_TEST_CTL stData; + stData.u32 = 0; + stData.bits.bayer_mode_sel = pstTestCtl->bayer_mode_sel; +@@ -86,8 +86,8 @@ int Isp_Drv_F2k_Core_SetTestCtl(struct k510_isp_device *isp,ISP_CORE_TEST_CTL_S + *Black Level Correction + */ + int Isp_Drv_F2k_Core_SetBlcCtl(struct k510_isp_device *isp,ISP_CORE_BLC_CTL_S *pstBlcCtl) +-{ +- ++{ ++ + union U_ISP_CORE_BLC_CTL stBlcCtl; + stBlcCtl.u32 = 0; + stBlcCtl.bits.blc_en = pstBlcCtl->blc_en; +@@ -109,7 +109,7 @@ int Isp_Drv_F2k_Core_SetBlcCtl(struct k510_isp_device *isp,ISP_CORE_BLC_CTL_S *p + */ + int Isp_Drv_F2k_Core_SetLscCtl(struct k510_isp_device *isp,ISP_CORE_LSC_CTL_S *pstLscCtl) + { +- ++ + union U_ISP_CORE_LSC_CTL stlscCtl; + stlscCtl.u32 = 0; + stlscCtl.bits.lsc_en = pstLscCtl->lsc_en; +@@ -148,11 +148,11 @@ int Isp_Drv_F2k_Core_SetLscCtl(struct k510_isp_device *isp,ISP_CORE_LSC_CTL_S *p + return 0; + } + /* +-*AUTO Exposure/Gain ++*AUTO Exposure/Gain + */ + int Isp_Drv_F2k_Core_SetAeCtl(struct k510_isp_device *isp,ISP_CORE_AE_CTL_S *pstAeCtl) +-{ +- ++{ ++ + union U_ISP_CORE_AE_CTL stAeCtl; + stAeCtl.u32 = 0; + stAeCtl.bits.ae_as_en = pstAeCtl->ae_as_en; +@@ -266,7 +266,7 @@ int Isp_Drv_F2k_Core_SetAeCtl(struct k510_isp_device *isp,ISP_CORE_AE_CTL_S *pst + stDnWaitTime.u32 = 0; + stDnWaitTime.bits.ae_dn_switch_wait_time = pstAeCtl->ae_dn_switch_wait_time; + isp_reg_writel(isp,stDnWaitTime.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_AE_DN_SWITCH_WAIT_TIME); +- ++ + union U_ISP_CORE_APE_DIFF_MAX stApeDiffMax; + stApeDiffMax.u32 = 0; + stApeDiffMax.bits.ape_max_diff = pstAeCtl->ape_max_diff; +@@ -300,42 +300,42 @@ int Isp_Drv_F2k_Core_SetAeCtl(struct k510_isp_device *isp,ISP_CORE_AE_CTL_S *pst + union U_ISP_CORE_APE_DAMP_MANUAL_VALUE stDampManValue; + stDampManValue.u32 = 0; + stDampManValue.bits.ape_damp_manual_value = pstAeCtl->ape_damp_manual_value; +- isp_reg_writel(isp,stDampManValue.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_APE_DAMP_MANUAL_VALUE); ++ isp_reg_writel(isp,stDampManValue.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_APE_DAMP_MANUAL_VALUE); + return 0; + } + /** +- * @brief +- * +- * @return int ++ * @brief ++ * ++ * @return int + */ + int Isp_Drv_F2k_Core_GetAeLongCurEx(struct k510_isp_device *isp) + { + int data; +- ++ + + data = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_AE_LONG_CUR_EX); + + return data; + } + /** +- * @brief +- * +- * @return int ++ * @brief ++ * ++ * @return int + */ + int Isp_Drv_F2k_Core_GetAeCurDigitalGain(struct k510_isp_device *isp) + { + int data; +- ++ + + data = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_AE_CUR_DIGITAL_GAIN); + + return data; + } + /** +- * @brief +- * +- * @param pAeSts +- * @return int ++ * @brief ++ * ++ * @param pAeSts ++ * @return int + */ + int Isp_Drv_F2k_Core_GetAeSts(struct k510_isp_device *isp,ISP_CORE_AE_STS_S *pAeSts) + { +@@ -379,15 +379,15 @@ int Isp_Drv_F2k_Core_GetAeSts(struct k510_isp_device *isp,ISP_CORE_AE_STS_S *pAe + union U_ISP_CORE_AE_PIXEL_SUM gtAePixelSum; + gtAePixelSum.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_AE_PIXEL_SUM); + pAeSts->ae_mid_cur_ex = gtAePixelSum.u32; +- ++ + return 0; +-} ++} + /* + *AWB + */ + int Isp_Drv_F2k_Core_SetAwbCtl(struct k510_isp_device *isp,ISP_CORE_AWB_CTL_S *pstAwbCtl) + { +- ++ + union U_ISP_CORE_AWB_CTL stAwbCtl; + stAwbCtl.u32 = 0; + stAwbCtl.bits.awb_d65_en = pstAwbCtl->awb_d65_en; +@@ -411,7 +411,7 @@ int Isp_Drv_F2k_Core_SetAwbCtl(struct k510_isp_device *isp,ISP_CORE_AWB_CTL_S *p + stD65BlueGain.u32 = 0; + stD65BlueGain.bits.awb_d65_blue_gain = pstAwbCtl->awb_d65_blue_gain; + isp_reg_writel(isp,stD65BlueGain.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_AWB_D65_BLUE_GAIN); +- ++ + union U_ISP_CORE_CCM_RR_COFF stRrCoff; + stRrCoff.u32 = 0; + stRrCoff.bits.ccm_rr_coff = pstAwbCtl->ccm_rr_coff; +@@ -456,7 +456,7 @@ int Isp_Drv_F2k_Core_SetAwbCtl(struct k510_isp_device *isp,ISP_CORE_AWB_CTL_S *p + stBbCoff.u32 = 0; + stBbCoff.bits.ccm_bb_coff = pstAwbCtl->ccm_bb_coff; + isp_reg_writel(isp,stBbCoff.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_CCM_BB_COFF); +- ++ + union U_ISP_CORE_CCM_CORRECT_COFF stCorrCoff; + stCorrCoff.u32 = 0; + stCorrCoff.bits.ccm_correct_coff = pstAwbCtl->ccm_correct_coff; +@@ -491,7 +491,7 @@ int Isp_Drv_F2k_Core_SetAwbCtl(struct k510_isp_device *isp,ISP_CORE_AWB_CTL_S *p + stResTime.u32 = 0; + stResTime.bits.awb_color_changeres_time = pstAwbCtl->awb_color_changeres_time; + isp_reg_writel(isp, stResTime.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_AWB_RES_TIME); +- ++ + union U_ISP_CORE_AWB_HIST_TH stHistTh; + stHistTh.u32 = 0; + stHistTh.bits.awb_historgram_th = pstAwbCtl->awb_historgram_th; +@@ -530,7 +530,7 @@ int Isp_Drv_F2k_Core_SetAwbCtl(struct k510_isp_device *isp,ISP_CORE_AWB_CTL_S *p + union U_ISP_CORE_AWB_BLUE_MIN_VALUE stBlueMinValue; + stBlueMinValue.u32 = 0; + stBlueMinValue.bits.awb_blue_min_value = pstAwbCtl->awb_blue_min_value; +- isp_reg_writel(isp, stBlueMinValue.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_AWB_BLUE_MIN_VALUE); ++ isp_reg_writel(isp, stBlueMinValue.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_AWB_BLUE_MIN_VALUE); + + union U_ISP_CORE_AWB_RED_OBJ_VALUE stRedObjValue; + stRedObjValue.u32 = 0; +@@ -547,7 +547,7 @@ int Isp_Drv_F2k_Core_SetAwbCtl(struct k510_isp_device *isp,ISP_CORE_AWB_CTL_S *p + + int Isp_Drv_F2k_Core_GetAwbSts(struct k510_isp_device *isp,ISP_CORE_AWB_STS_S *pAwbSts) + { +- ++ + union U_ISP_CORE_AWB_BLUE_HIST_VALUE gtAwbBHistVal; + gtAwbBHistVal.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_AWB_BLUE_HIST_VALUE); + pAwbSts->awb_blue_hist_value = gtAwbBHistVal.u32; +@@ -611,7 +611,7 @@ int Isp_Drv_F2k_Core_GetAwbSts(struct k510_isp_device *isp,ISP_CORE_AWB_STS_S *p + */ + int Isp_Drv_F2k_Core_SetCscCtl(struct k510_isp_device *isp,ISP_CORE_CSC_CTL_S *pstCscCtl) + { +- ++ + union U_ISP_CORE_CSC_R2Y_00 st00; + st00.u32 = 0; + st00.bits.csc_r2y_00 = pstCscCtl->csc_r2y_00; +@@ -663,7 +663,7 @@ int Isp_Drv_F2k_Core_SetCscCtl(struct k510_isp_device *isp,ISP_CORE_CSC_CTL_S *p + */ + int Isp_Drv_F2k_Core_SetWdrCtl(struct k510_isp_device *isp,ISP_CORE_WDR_CTL_S *pstWdrCtl) + { +- ++ + union U_ISP_CORE_WDR_CTL stWdrCtl; + stWdrCtl.u32 = 0; + stWdrCtl.bits.wdr_fusion_en = pstWdrCtl->wdr_fusion_en; +@@ -705,15 +705,15 @@ int Isp_Drv_F2k_Core_SetWdrCtl(struct k510_isp_device *isp,ISP_CORE_WDR_CTL_S *p + union U_ISP_CORE_WDR_FUSION_VALUE2 stFusionValue2; + stFusionValue2.u32 = 0; + stFusionValue2.bits.wdr_fusion_value2 = pstWdrCtl->wdr_fusion_value2; +- isp_reg_writel(isp,stFusionValue2.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_WDR_FUSION_VALUE2); ++ isp_reg_writel(isp,stFusionValue2.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_WDR_FUSION_VALUE2); + return 0; + } + /* + *ADA + */ + int Isp_Drv_F2k_Core_SetAdaCtl(struct k510_isp_device *isp,ISP_CORE_ADA_CTL_S *pstAdaCtl) +-{ +- ++{ ++ + union U_ISP_CORE_ADA_CTL stCtl; + stCtl.u32 = 0; + stCtl.bits.ada_rgb_gamma_en = pstAdaCtl->ada_rgb_gamma_en; +@@ -762,8 +762,8 @@ int Isp_Drv_F2k_Core_SetAdaCtl(struct k510_isp_device *isp,ISP_CORE_ADA_CTL_S *p + *rgbir + */ + int Isp_Drv_F2k_Core_SetRgbIrCtl(struct k510_isp_device *isp,ISP_CORE_RGBIR_CTL_S *pstRgbIrCtl) +-{ +- ++{ ++ + union U_ISP_CORE_RGBIR_CTL stCtl; + stCtl.u32 = 0; + stCtl.bits.rgbir_en = pstRgbIrCtl->rgbir_en; +@@ -801,11 +801,11 @@ int Isp_Drv_F2k_Core_SetRgbIrCtl(struct k510_isp_device *isp,ISP_CORE_RGBIR_CTL_ + return 0; + } + /* +-* 2D Noise Reduction ++* 2D Noise Reduction + */ + int Isp_Drv_F2k_Core_Set2DnrCtl(struct k510_isp_device *isp,ISP_CORE_2DNR_CTL_S *pst2DnrCtl) + { +- ++ + union U_ISP_CORE_2DNR_CTL stCtl; + stCtl.u32 = 0; + stCtl.bits.core_2dnr_pcf_en = pst2DnrCtl->core_2dnr_pcf_en; +@@ -848,11 +848,11 @@ int Isp_Drv_F2k_Core_Set2DnrCtl(struct k510_isp_device *isp,ISP_CORE_2DNR_CTL_S + return 0; + } + /* +-* 3D Noise Reduction ++* 3D Noise Reduction + */ + int Isp_Drv_F2k_Core_Set3DnrCtl(struct k510_isp_device *isp,ISP_CORE_3DNR_CTL_S *pst3DnrCtl) +-{ +- ++{ ++ + union U_ISP_CORE_3DNR_CTL stCtl; + stCtl.u32 = 0; + stCtl.bits.core_3dnr_en = pst3DnrCtl->core_3dnr_en; +@@ -947,7 +947,7 @@ int Isp_Drv_F2k_Core_Set3DnrCtl(struct k510_isp_device *isp,ISP_CORE_3DNR_CTL_S + */ + int Isp_Drv_F2k_Core_SetEnhLtmCtl(struct k510_isp_device *isp,ISP_CORE_ENH_CTL_S *pstEnhCtl) + { +- ++ + union U_ISP_CORE_ENH_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_ENH_CTL); + stCtl.bits.enh_ltm_en = pstEnhCtl->enh_ltm_en; +@@ -968,7 +968,7 @@ int Isp_Drv_F2k_Core_SetEnhLtmCtl(struct k510_isp_device *isp,ISP_CORE_ENH_CTL_S + + int Isp_Drv_F2k_Core_SetEnhCCCtl(struct k510_isp_device *isp,ISP_CORE_ENH_CTL_S *pstEnhCtl) + { +- ++ + + union U_ISP_CORE_ENH_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_ENH_CTL); +@@ -996,7 +996,7 @@ int Isp_Drv_F2k_Core_SetEnhCCCtl(struct k510_isp_device *isp,ISP_CORE_ENH_CTL_S + int Isp_Drv_F2k_Core_SetEnhSharpenCtl(struct k510_isp_device *isp,ISP_CORE_ENH_CTL_S *pstEnhCtl) + { + +- ++ + union U_ISP_CORE_ENH_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_ENH_CTL); + stCtl.bits.enh_sharp_en = pstEnhCtl->enh_sharp_en; +@@ -1010,12 +1010,12 @@ int Isp_Drv_F2k_Core_SetEnhSharpenCtl(struct k510_isp_device *isp,ISP_CORE_ENH_C + return 0; + } + /* +-* POST Control ++* POST Control + */ + int Isp_Drv_F2k_Core_SetPostContCtl(struct k510_isp_device *isp,ISP_CORE_POST_CTL_S *pstPostCtl) + { + +- ++ + union U_ISP_CORE_POST_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_POST_CTL); + stCtl.bits.post_cont_ad_en = pstPostCtl->post_cont_ad_en; +@@ -1030,7 +1030,7 @@ int Isp_Drv_F2k_Core_SetPostContCtl(struct k510_isp_device *isp,ISP_CORE_POST_CT + + int Isp_Drv_F2k_Core_SetPostLumaCtl(struct k510_isp_device *isp,ISP_CORE_POST_CTL_S *pstPostCtl) + { +- ++ + union U_ISP_CORE_POST_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_POST_CTL); + stCtl.bits.post_luma_ad_en = pstPostCtl->post_luma_ad_en; +@@ -1045,7 +1045,7 @@ int Isp_Drv_F2k_Core_SetPostLumaCtl(struct k510_isp_device *isp,ISP_CORE_POST_CT + + int Isp_Drv_F2k_Core_SetPostSatuCtl(struct k510_isp_device *isp,ISP_CORE_POST_CTL_S *pstPostCtl) + { +- ++ + union U_ISP_CORE_POST_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_POST_CTL); + stCtl.bits.post_satu_ad_en = pstPostCtl->post_satu_ad_en; +@@ -1058,14 +1058,14 @@ int Isp_Drv_F2k_Core_SetPostSatuCtl(struct k510_isp_device *isp,ISP_CORE_POST_CT + return 0; + } + /* +-* OTC ++* OTC + */ + int Isp_Drv_F2k_Core_SetOtcCtl(struct k510_isp_device *isp,ISP_CORE_OTC_CTL_S *pstOtcCtl) + { +- ++ + union U_ISP_CORE_POST_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_POST_CTL); +- stCtl.bits.post_otc_en = pstOtcCtl->post_otc_en; ++ stCtl.bits.post_otc_en = pstOtcCtl->post_otc_en; + stCtl.bits.otc_yc_sel = pstOtcCtl->otc_yc_sel; + stCtl.bits.otc_uv_format_sel = pstOtcCtl->otc_uv_format_sel; + stCtl.bits.otc_hsync_pol_sel = pstOtcCtl->otc_hsync_pol_sel; +@@ -1098,7 +1098,7 @@ int Isp_Drv_F2k_Core_SetOtcCtl(struct k510_isp_device *isp,ISP_CORE_OTC_CTL_S *p + */ + int Isp_Drv_F2k_Core_SetLdcCtl(struct k510_isp_device *isp,ISP_CORE_LDC_CTL_S *pstLdcCtl) + { +- ++ + union U_ISP_CORE_LDC_CTL stCtl; + stCtl.u32 = 0; + stCtl.bits.ldc_en = pstLdcCtl->ldc_en; +@@ -1137,7 +1137,7 @@ int Isp_Drv_F2k_Core_SetLdcCtl(struct k510_isp_device *isp,ISP_CORE_LDC_CTL_S *p + */ + int Isp_Drv_F2k_Core_SetAfCtl(struct k510_isp_device *isp,ISP_CORE_AF_CTL_S *pstAfCtl) + { +- ++ + union U_ISP_CORE_AF_CTL stAfCtl; + stAfCtl.u32 = 0; + stAfCtl.bits.af_stat_en = pstAfCtl->af_stat_en; +@@ -1156,16 +1156,16 @@ int Isp_Drv_F2k_Core_SetAfCtl(struct k510_isp_device *isp,ISP_CORE_AF_CTL_S *pst + + union U_ISP_CORE_AF_STAT_WIN_H_END stAfWinHEnd; + stAfWinHEnd.u32 = 0; +- stAfWinHEnd.bits.af_stat_win_h_end = pstAfCtl->af_stat_win_h_end; ++ stAfWinHEnd.bits.af_stat_win_h_end = pstAfCtl->af_stat_win_h_end; + isp_reg_writel(isp,stAfWinHEnd.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_AF_STAT_WIN_H_END); + + union U_ISP_CORE_AF_STAT_WIN_V_END stAfWinVEnd; + stAfWinVEnd.u32 = 0; +- stAfWinVEnd.bits.af_stat_win_v_end = pstAfCtl->af_stat_win_v_end; ++ stAfWinVEnd.bits.af_stat_win_v_end = pstAfCtl->af_stat_win_v_end; + isp_reg_writel(isp,stAfWinVEnd.u32,ISP_IOMEM_F2K_CORE,ISP_CORE_AF_STAT_WIN_V_END); + + return 0; +-} ++} + + int Isp_Drv_F2k_Core_GetAfSts(struct k510_isp_device *isp,ISP_CORE_AF_STS_S *pgtAfSts) + { +@@ -1180,15 +1180,15 @@ int Isp_Drv_F2k_Core_GetAfSts(struct k510_isp_device *isp,ISP_CORE_AF_STS_S *pgt + pgtAfSts->af_high_frq_data = gtAfHighFrqData.u32; + + union U_ISP_CORE_AF_STAT_PIXEL_NUM gtAfStatPixelNum; +- gtAfStatPixelNum.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_AF_STAT_PIXEL_NUM); ++ gtAfStatPixelNum.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_AF_STAT_PIXEL_NUM); + pgtAfSts->af_stat_pixel_num = gtAfStatPixelNum.u32; + return 0; + } + + int Isp_Drv_F2k_Core_SetRamWrStatus(struct k510_isp_device *isp,unsigned int data) + { +- +- ++ ++ + isp_reg_writel(isp,data,ISP_IOMEM_F2K_CORE,ISP_CORE_RAM_WR_STATUS); + + return 0; +@@ -1196,9 +1196,33 @@ int Isp_Drv_F2k_Core_SetRamWrStatus(struct k510_isp_device *isp,unsigned int dat + + int Isp_Drv_F2k_Core_GetRamRdStatus(struct k510_isp_device *isp) + { +- +- ++ ++ + int isp_ram_ready = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,ISP_CORE_RAM_RD_STATUS); + + return isp_ram_ready; ++} ++ ++/* ++*F2K Reg Opt ++*/ ++ ++int Isp_Drv_F2k_Core_SetReg(struct k510_isp_device *isp,ISP_CORE_REG_VAL_S *pRegVal) ++{ ++ union U_ISP_CORE_REG_CFG_ADDR stRegAddr; ++ union U_ISP_CORE_REG_CFG_VALUE stRegVal; ++ stRegAddr.u32 = pRegVal->reg_addr; ++ stRegVal.u32 = pRegVal->reg_value; ++ isp_reg_writel(isp,stRegVal.u32,ISP_IOMEM_F2K_CORE,stRegAddr.u32); ++ return 0; ++} ++ ++int Isp_Drv_F2k_Core_GetReg(struct k510_isp_device *isp,ISP_CORE_REG_VAL_S *pRegVal) ++{ ++ union U_ISP_CORE_REG_CFG_ADDR gtRegAddr; ++ union U_ISP_CORE_REG_CFG_VALUE gtRegVal; ++ gtRegAddr.u32 = pRegVal->reg_addr; ++ gtRegVal.u32 = isp_reg_readl(isp,ISP_IOMEM_F2K_CORE,gtRegAddr.u32); ++ pRegVal->reg_value = gtRegVal.u32; ++ return 0; + } +\ No newline at end of file +diff --git a/drivers/media/platform/canaan-isp/isp_2k/core/isp_r2k_core_drv.c b/drivers/media/platform/canaan-isp/isp_2k/core/isp_r2k_core_drv.c +index b98649f5..0d47e3a6 100755 +--- a/drivers/media/platform/canaan-isp/isp_2k/core/isp_r2k_core_drv.c ++++ b/drivers/media/platform/canaan-isp/isp_2k/core/isp_r2k_core_drv.c +@@ -8,7 +8,7 @@ + #include "isp_core_drv.h" + #include "isp_core_reg.h" + /* +-* Image Timing Control ++* Image Timing Control + */ + int Isp_Drv_R2k_Core_SetItcCtl(struct k510_isp_device *isp,ISP_CORE_ITC_CTL_S *pstItcCtl) + { +@@ -21,7 +21,7 @@ int Isp_Drv_R2k_Core_SetItcCtl(struct k510_isp_device *isp,ISP_CORE_ITC_CTL_S *p + stData.bits.vsync_input_timing = pstItcCtl->vsync_input_timing; + stData.bits.mirror_ctl = pstItcCtl->mirror_ctl; + stData.bits.video_format_ctl = pstItcCtl->video_format_ctl; +- ++ + isp_reg_writel(isp,stData.u32,ISP_IOMEM_R2K_CORE,ISP_CORE_ITC_CTL); + return 0; + } +@@ -30,7 +30,7 @@ int Isp_Drv_R2k_Core_SetItcCtl(struct k510_isp_device *isp,ISP_CORE_ITC_CTL_S *p + */ + int Isp_Drv_R2k_Core_SetImageAttr(struct k510_isp_device *isp,ISP_CORE_IMAGE_ATTR_S *pstImgAttr) + { +- ++ + union U_ISP_CORE_IMAGE_HEIGHT stHeight; + stHeight.u32 = 0; + stHeight.bits.image_height = pstImgAttr->image_height; +@@ -67,7 +67,7 @@ int Isp_Drv_R2k_Core_SetImageAttr(struct k510_isp_device *isp,ISP_CORE_IMAGE_ATT + */ + int Isp_Drv_R2k_Core_SetTestCtl(struct k510_isp_device *isp,ISP_CORE_TEST_CTL_S *pstTestCtl) + { +- ++ + union U_ISP_CORE_TEST_CTL stData; + stData.u32 = 0; + stData.bits.bayer_mode_sel = pstTestCtl->bayer_mode_sel; +@@ -84,8 +84,8 @@ int Isp_Drv_R2k_Core_SetTestCtl(struct k510_isp_device *isp,ISP_CORE_TEST_CTL_S + *Black Level Correction + */ + int Isp_Drv_R2k_Core_SetBlcCtl(struct k510_isp_device *isp,ISP_CORE_BLC_CTL_S *pstBlcCtl) +-{ +- ++{ ++ + union U_ISP_CORE_BLC_CTL stBlcCtl; + stBlcCtl.u32 = 0; + stBlcCtl.bits.blc_en = pstBlcCtl->blc_en; +@@ -107,7 +107,7 @@ int Isp_Drv_R2k_Core_SetBlcCtl(struct k510_isp_device *isp,ISP_CORE_BLC_CTL_S *p + */ + int Isp_Drv_R2k_Core_SetLscCtl(struct k510_isp_device *isp,ISP_CORE_LSC_CTL_S *pstLscCtl) + { +- ++ + union U_ISP_CORE_LSC_CTL stlscCtl; + stlscCtl.u32 = 0; + stlscCtl.bits.lsc_en = pstLscCtl->lsc_en; +@@ -146,11 +146,11 @@ int Isp_Drv_R2k_Core_SetLscCtl(struct k510_isp_device *isp,ISP_CORE_LSC_CTL_S *p + return 0; + } + /* +-*AUTO Exposure/Gain ++*AUTO Exposure/Gain + */ + int Isp_Drv_R2k_Core_SetAeCtl(struct k510_isp_device *isp,ISP_CORE_AE_CTL_S *pstAeCtl) +-{ +- ++{ ++ + union U_ISP_CORE_AE_CTL stAeCtl; + stAeCtl.u32 = 0; + stAeCtl.bits.ae_as_en = pstAeCtl->ae_as_en; +@@ -264,7 +264,7 @@ int Isp_Drv_R2k_Core_SetAeCtl(struct k510_isp_device *isp,ISP_CORE_AE_CTL_S *pst + stDnWaitTime.u32 = 0; + stDnWaitTime.bits.ae_dn_switch_wait_time = pstAeCtl->ae_dn_switch_wait_time; + isp_reg_writel(isp,stDnWaitTime.u32,ISP_IOMEM_R2K_CORE,ISP_CORE_AE_DN_SWITCH_WAIT_TIME); +- ++ + union U_ISP_CORE_APE_DIFF_MAX stApeDiffMax; + stApeDiffMax.u32 = 0; + stApeDiffMax.bits.ape_max_diff = pstAeCtl->ape_max_diff; +@@ -298,13 +298,13 @@ int Isp_Drv_R2k_Core_SetAeCtl(struct k510_isp_device *isp,ISP_CORE_AE_CTL_S *pst + union U_ISP_CORE_APE_DAMP_MANUAL_VALUE stDampManValue; + stDampManValue.u32 = 0; + stDampManValue.bits.ape_damp_manual_value = pstAeCtl->ape_damp_manual_value; +- isp_reg_writel(isp,stDampManValue.u32,ISP_IOMEM_R2K_CORE,ISP_CORE_APE_DAMP_MANUAL_VALUE); ++ isp_reg_writel(isp,stDampManValue.u32,ISP_IOMEM_R2K_CORE,ISP_CORE_APE_DAMP_MANUAL_VALUE); + return 0; + } + /** +- * @brief +- * +- * @return int ++ * @brief ++ * ++ * @return int + */ + int Isp_Drv_R2k_Core_GetAeLongCurEx(struct k510_isp_device *isp) + { +@@ -314,9 +314,9 @@ int Isp_Drv_R2k_Core_GetAeLongCurEx(struct k510_isp_device *isp) + return data; + } + /** +- * @brief +- * +- * @return int ++ * @brief ++ * ++ * @return int + */ + int Isp_Drv_R2k_Core_GetAeCurDigitalGain(struct k510_isp_device *isp) + { +@@ -326,10 +326,10 @@ int Isp_Drv_R2k_Core_GetAeCurDigitalGain(struct k510_isp_device *isp) + return data; + } + /** +- * @brief +- * +- * @param pAeSts +- * @return int ++ * @brief ++ * ++ * @param pAeSts ++ * @return int + */ + int Isp_Drv_R2k_Core_GetAeSts(struct k510_isp_device *isp,ISP_CORE_AE_STS_S *pAeSts) + { +@@ -373,9 +373,9 @@ int Isp_Drv_R2k_Core_GetAeSts(struct k510_isp_device *isp,ISP_CORE_AE_STS_S *pAe + union U_ISP_CORE_AE_PIXEL_SUM gtAePixelSum; + gtAePixelSum.u32 = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,ISP_CORE_AE_PIXEL_SUM); + pAeSts->ae_mid_cur_ex = gtAePixelSum.u32; +- ++ + return 0; +-} ++} + /* + *AWB + */ +@@ -406,7 +406,7 @@ int Isp_Drv_R2k_Core_SetAwbCtl(struct k510_isp_device *isp,ISP_CORE_AWB_CTL_S *p + stD65BlueGain.u32 = 0; + stD65BlueGain.bits.awb_d65_blue_gain = pstAwbCtl->awb_d65_blue_gain; + isp_reg_writel(isp,stD65BlueGain.u32,ISP_IOMEM_R2K_CORE,ISP_CORE_AWB_D65_BLUE_GAIN); +- ++ + union U_ISP_CORE_CCM_RR_COFF stRrCoff; + stRrCoff.u32 = 0; + stRrCoff.bits.ccm_rr_coff = pstAwbCtl->ccm_rr_coff; +@@ -451,7 +451,7 @@ int Isp_Drv_R2k_Core_SetAwbCtl(struct k510_isp_device *isp,ISP_CORE_AWB_CTL_S *p + stBbCoff.u32 = 0; + stBbCoff.bits.ccm_bb_coff = pstAwbCtl->ccm_bb_coff; + isp_reg_writel(isp,stBbCoff.u32,ISP_IOMEM_R2K_CORE,ISP_CORE_CCM_BB_COFF); +- ++ + union U_ISP_CORE_CCM_CORRECT_COFF stCorrCoff; + stCorrCoff.u32 = 0; + stCorrCoff.bits.ccm_correct_coff = pstAwbCtl->ccm_correct_coff; +@@ -486,7 +486,7 @@ int Isp_Drv_R2k_Core_SetAwbCtl(struct k510_isp_device *isp,ISP_CORE_AWB_CTL_S *p + stResTime.u32 = 0; + stResTime.bits.awb_color_changeres_time = pstAwbCtl->awb_color_changeres_time; + isp_reg_writel(isp, stResTime.u32,ISP_IOMEM_R2K_CORE,ISP_CORE_AWB_RES_TIME); +- ++ + union U_ISP_CORE_AWB_HIST_TH stHistTh; + stHistTh.u32 = 0; + stHistTh.bits.awb_historgram_th = pstAwbCtl->awb_historgram_th; +@@ -525,7 +525,7 @@ int Isp_Drv_R2k_Core_SetAwbCtl(struct k510_isp_device *isp,ISP_CORE_AWB_CTL_S *p + union U_ISP_CORE_AWB_BLUE_MIN_VALUE stBlueMinValue; + stBlueMinValue.u32 = 0; + stBlueMinValue.bits.awb_blue_min_value = pstAwbCtl->awb_blue_min_value; +- isp_reg_writel(isp, stBlueMinValue.u32,ISP_IOMEM_R2K_CORE,ISP_CORE_AWB_BLUE_MIN_VALUE); ++ isp_reg_writel(isp, stBlueMinValue.u32,ISP_IOMEM_R2K_CORE,ISP_CORE_AWB_BLUE_MIN_VALUE); + + union U_ISP_CORE_AWB_RED_OBJ_VALUE stRedObjValue; + stRedObjValue.u32 = 0; +@@ -542,7 +542,7 @@ int Isp_Drv_R2k_Core_SetAwbCtl(struct k510_isp_device *isp,ISP_CORE_AWB_CTL_S *p + + int Isp_Drv_R2k_Core_GetAwbSts(struct k510_isp_device *isp,ISP_CORE_AWB_STS_S *pAwbSts) + { +- ++ + union U_ISP_CORE_AWB_BLUE_HIST_VALUE gtAwbBHistVal; + gtAwbBHistVal.u32 = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,ISP_CORE_AWB_BLUE_HIST_VALUE); + pAwbSts->awb_blue_hist_value = gtAwbBHistVal.u32; +@@ -657,7 +657,7 @@ int Isp_Drv_R2k_Core_SetCscCtl(struct k510_isp_device *isp,ISP_CORE_CSC_CTL_S *p + *ADA + */ + int Isp_Drv_R2k_Core_SetAdaCtl(struct k510_isp_device *isp,ISP_CORE_ADA_CTL_S *pstAdaCtl) +-{ ++{ + + union U_ISP_CORE_ADA_CTL stCtl; + stCtl.u32 = 0; +@@ -707,8 +707,8 @@ int Isp_Drv_R2k_Core_SetAdaCtl(struct k510_isp_device *isp,ISP_CORE_ADA_CTL_S *p + *rgbir + */ + int Isp_Drv_R2k_Core_SetRgbIrCtl(struct k510_isp_device *isp,ISP_CORE_RGBIR_CTL_S *pstRgbIrCtl) +-{ +- ++{ ++ + union U_ISP_CORE_RGBIR_CTL stCtl; + stCtl.u32 = 0; + stCtl.bits.rgbir_en = pstRgbIrCtl->rgbir_en; +@@ -746,11 +746,11 @@ int Isp_Drv_R2k_Core_SetRgbIrCtl(struct k510_isp_device *isp,ISP_CORE_RGBIR_CTL_ + return 0; + } + /* +-* 2D Noise Reduction ++* 2D Noise Reduction + */ + int Isp_Drv_R2k_Core_Set2DnrCtl(struct k510_isp_device *isp,ISP_CORE_2DNR_CTL_S *pst2DnrCtl) + { +- ++ + union U_ISP_CORE_2DNR_CTL stCtl; + stCtl.u32 = 0; + stCtl.bits.core_2dnr_pcf_en = pst2DnrCtl->core_2dnr_pcf_en; +@@ -797,7 +797,7 @@ int Isp_Drv_R2k_Core_Set2DnrCtl(struct k510_isp_device *isp,ISP_CORE_2DNR_CTL_S + */ + int Isp_Drv_R2k_Core_SetEnhLtmCtl(struct k510_isp_device *isp,ISP_CORE_ENH_CTL_S *pstEnhCtl) + { +- ++ + union U_ISP_CORE_ENH_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,ISP_CORE_ENH_CTL); + stCtl.bits.enh_ltm_en = pstEnhCtl->enh_ltm_en; +@@ -818,7 +818,7 @@ int Isp_Drv_R2k_Core_SetEnhLtmCtl(struct k510_isp_device *isp,ISP_CORE_ENH_CTL_S + + int Isp_Drv_R2k_Core_SetEnhCCCtl(struct k510_isp_device *isp,ISP_CORE_ENH_CTL_S *pstEnhCtl) + { +- ++ + union U_ISP_CORE_ENH_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,ISP_CORE_ENH_CTL); + stCtl.bits.enh_cc_en = pstEnhCtl->enh_cc_en; +@@ -844,7 +844,7 @@ int Isp_Drv_R2k_Core_SetEnhCCCtl(struct k510_isp_device *isp,ISP_CORE_ENH_CTL_S + + int Isp_Drv_R2k_Core_SetEnhSharpenCtl(struct k510_isp_device *isp,ISP_CORE_ENH_CTL_S *pstEnhCtl) + { +- ++ + union U_ISP_CORE_ENH_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,ISP_CORE_ENH_CTL); + stCtl.bits.enh_sharp_en = pstEnhCtl->enh_sharp_en; +@@ -858,11 +858,11 @@ int Isp_Drv_R2k_Core_SetEnhSharpenCtl(struct k510_isp_device *isp,ISP_CORE_ENH_C + return 0; + } + /* +-* POST Control ++* POST Control + */ + int Isp_Drv_R2k_Core_SetPostContCtl(struct k510_isp_device *isp,ISP_CORE_POST_CTL_S *pstPostCtl) + { +- ++ + union U_ISP_CORE_POST_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,ISP_CORE_POST_CTL); + stCtl.bits.post_cont_ad_en = pstPostCtl->post_cont_ad_en; +@@ -877,7 +877,7 @@ int Isp_Drv_R2k_Core_SetPostContCtl(struct k510_isp_device *isp,ISP_CORE_POST_CT + + int Isp_Drv_R2k_Core_SetPostLumaCtl(struct k510_isp_device *isp,ISP_CORE_POST_CTL_S *pstPostCtl) + { +- ++ + union U_ISP_CORE_POST_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,ISP_CORE_POST_CTL); + stCtl.bits.post_luma_ad_en = pstPostCtl->post_luma_ad_en; +@@ -905,14 +905,14 @@ int Isp_Drv_R2k_Core_SetPostSatuCtl(struct k510_isp_device *isp,ISP_CORE_POST_CT + return 0; + } + /* +-* OTC ++* OTC + */ + int Isp_Drv_R2k_Core_SetOtcCtl(struct k510_isp_device *isp,ISP_CORE_OTC_CTL_S *pstOtcCtl) + { + + union U_ISP_CORE_POST_CTL stCtl; + stCtl.u32 = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,ISP_CORE_POST_CTL); +- stCtl.bits.post_otc_en = pstOtcCtl->post_otc_en; ++ stCtl.bits.post_otc_en = pstOtcCtl->post_otc_en; + stCtl.bits.otc_yc_sel = pstOtcCtl->otc_yc_sel; + stCtl.bits.otc_uv_format_sel = pstOtcCtl->otc_uv_format_sel; + stCtl.bits.otc_hsync_pol_sel = pstOtcCtl->otc_hsync_pol_sel; +@@ -1003,16 +1003,16 @@ int Isp_Drv_R2k_Core_SetAfCtl(struct k510_isp_device *isp,ISP_CORE_AF_CTL_S *pst + + union U_ISP_CORE_AF_STAT_WIN_H_END stAfWinHEnd; + stAfWinHEnd.u32 = 0; +- stAfWinHEnd.bits.af_stat_win_h_end = pstAfCtl->af_stat_win_h_end; ++ stAfWinHEnd.bits.af_stat_win_h_end = pstAfCtl->af_stat_win_h_end; + isp_reg_writel(isp,stAfWinHEnd.u32,ISP_IOMEM_R2K_CORE,ISP_CORE_AF_STAT_WIN_H_END); + + union U_ISP_CORE_AF_STAT_WIN_V_END stAfWinVEnd; + stAfWinVEnd.u32 = 0; +- stAfWinVEnd.bits.af_stat_win_v_end = pstAfCtl->af_stat_win_v_end; ++ stAfWinVEnd.bits.af_stat_win_v_end = pstAfCtl->af_stat_win_v_end; + isp_reg_writel(isp,stAfWinVEnd.u32,ISP_IOMEM_R2K_CORE,ISP_CORE_AF_STAT_WIN_V_END); + + return 0; +-} ++} + + int Isp_Drv_R2k_Core_GetAfSts(struct k510_isp_device *isp,ISP_CORE_AF_STS_S *pgtAfSts) + { +@@ -1026,7 +1026,7 @@ int Isp_Drv_R2k_Core_GetAfSts(struct k510_isp_device *isp,ISP_CORE_AF_STS_S *pgt + pgtAfSts->af_high_frq_data = gtAfHighFrqData.u32; + + union U_ISP_CORE_AF_STAT_PIXEL_NUM gtAfStatPixelNum; +- gtAfStatPixelNum.u32 = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,ISP_CORE_AF_STAT_PIXEL_NUM); ++ gtAfStatPixelNum.u32 = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,ISP_CORE_AF_STAT_PIXEL_NUM); + pgtAfSts->af_stat_pixel_num = gtAfStatPixelNum.u32; + return 0; + } +@@ -1034,7 +1034,7 @@ int Isp_Drv_R2k_Core_GetAfSts(struct k510_isp_device *isp,ISP_CORE_AF_STS_S *pgt + int Isp_Drv_R2k_Core_SetRamWrStatus(struct k510_isp_device *isp,unsigned int data) + { + +- ++ + isp_reg_writel(isp,data,ISP_IOMEM_R2K_CORE,ISP_CORE_RAM_WR_STATUS); + + return 0; +@@ -1043,8 +1043,32 @@ int Isp_Drv_R2k_Core_SetRamWrStatus(struct k510_isp_device *isp,unsigned int dat + int Isp_Drv_R2k_Core_GetRamRdStatus(struct k510_isp_device *isp) + { + +- ++ + int isp_ram_ready = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,ISP_CORE_RAM_RD_STATUS); + + return isp_ram_ready; ++} ++ ++/* ++*R2K Reg Opt ++*/ ++ ++int Isp_Drv_R2k_Core_SetReg(struct k510_isp_device *isp,ISP_CORE_REG_VAL_S *pRegVal) ++{ ++ union U_ISP_CORE_REG_CFG_ADDR stRegAddr; ++ union U_ISP_CORE_REG_CFG_VALUE stRegVal; ++ stRegAddr.u32 = pRegVal->reg_addr; ++ stRegVal.u32 = pRegVal->reg_value; ++ isp_reg_writel(isp,stRegVal.u32,ISP_IOMEM_R2K_CORE,stRegAddr.u32); ++ return 0; ++} ++ ++int Isp_Drv_R2k_Core_GetReg(struct k510_isp_device *isp,ISP_CORE_REG_VAL_S *pRegVal) ++{ ++ union U_ISP_CORE_REG_CFG_ADDR gtRegAddr; ++ union U_ISP_CORE_REG_CFG_VALUE gtRegVal; ++ gtRegAddr.u32 = pRegVal->reg_addr; ++ gtRegVal.u32 = isp_reg_readl(isp,ISP_IOMEM_R2K_CORE,gtRegAddr.u32); ++ pRegVal->reg_value = gtRegVal.u32; ++ return 0; + } +\ No newline at end of file +diff --git a/drivers/media/platform/canaan-isp/isp_2k/isp_f2k.c b/drivers/media/platform/canaan-isp/isp_2k/isp_f2k.c +index f743cc6b..41be41e5 100755 +--- a/drivers/media/platform/canaan-isp/isp_2k/isp_f2k.c ++++ b/drivers/media/platform/canaan-isp/isp_2k/isp_f2k.c +@@ -46,69 +46,69 @@ static unsigned long long get_usec(void) + *****************************************************************************/ + // + void isp_f2k_wrap_SetComRst(struct k510_isp_device *isp) +-{ ++{ + ISP_WRAP_RST_CTL_S stRstCtl; +- stRstCtl.sw_3dnr_rst = 1; ++ stRstCtl.sw_3dnr_rst = 1; + stRstCtl.wdr_2_frame_rst = 1; + stRstCtl.wdr_3_frame_rst =1; +- stRstCtl.ldc_rst = 1; +- stRstCtl.main_out_rst = 1; +- stRstCtl.ds0_out_rst = 1; +- stRstCtl.ds1_out_rst = 1; +- stRstCtl.ds2_out_rst = 1; +- stRstCtl.wrap_com_rst = 1; +- stRstCtl.wrap_cfg_rst = 1; +- stRstCtl.core_com_rst = 1; +- stRstCtl.core_cfg_rst = 1; +- stRstCtl.axi_wr_ch_rst = 1; +- stRstCtl.axi_rd_ch_rst = 1; ++ stRstCtl.ldc_rst = 1; ++ stRstCtl.main_out_rst = 1; ++ stRstCtl.ds0_out_rst = 1; ++ stRstCtl.ds1_out_rst = 1; ++ stRstCtl.ds2_out_rst = 1; ++ stRstCtl.wrap_com_rst = 1; ++ stRstCtl.wrap_cfg_rst = 1; ++ stRstCtl.core_com_rst = 1; ++ stRstCtl.core_cfg_rst = 1; ++ stRstCtl.axi_wr_ch_rst = 1; ++ stRstCtl.axi_rd_ch_rst = 1; + Isp_Drv_F2k_Wrap_SetPipeReset(isp,&stRstCtl); + } + // + void isp_f2k_wrap_SetDmaRst(struct k510_isp_device *isp) + { +- ++ + ISP_WRAP_DMA_RST_CTL_S stDmaRstCtl; +- stDmaRstCtl.y_3dnr_wr_ch_rst = 1; +- stDmaRstCtl.uv_3dnr_wr_ch_rst = 1; +- stDmaRstCtl.ldc_y_wr_ch_rst = 1; +- stDmaRstCtl.ldc_uv_wr_ch_rst = 1; +- stDmaRstCtl.wdr_raw_wr_ch_rst = 1; +- stDmaRstCtl.main_out_y_wr_ch_rst = 1; ++ stDmaRstCtl.y_3dnr_wr_ch_rst = 1; ++ stDmaRstCtl.uv_3dnr_wr_ch_rst = 1; ++ stDmaRstCtl.ldc_y_wr_ch_rst = 1; ++ stDmaRstCtl.ldc_uv_wr_ch_rst = 1; ++ stDmaRstCtl.wdr_raw_wr_ch_rst = 1; ++ stDmaRstCtl.main_out_y_wr_ch_rst = 1; + stDmaRstCtl.main_out_uv_wr_ch_rst = 1; +- stDmaRstCtl.y_3dnr_rd_ch_rst = 1; +- stDmaRstCtl.uv_3dnr_rd_ch_rst = 1; +- stDmaRstCtl.ldc_y_rd_ch_rst = 1; +- stDmaRstCtl.ldc_uv_rd_ch_rst = 1; +- stDmaRstCtl.wdr_raw_rd_ch_rst = 1; +- stDmaRstCtl.ds0_out_y_wr_ch_rst = 1; +- stDmaRstCtl.ds0_out_uv_wr_ch_rst = 1; +- stDmaRstCtl.ds1_out_y_wr_ch_rst = 1; +- stDmaRstCtl.ds1_out_uv_wr_ch_rst = 1; +- stDmaRstCtl.ds2_out_r_wr_ch_rst = 1; +- stDmaRstCtl.ds2_out_g_wr_ch_rst = 1; +- stDmaRstCtl.ds2_out_b_wr_ch_rst = 1; +- stDmaRstCtl.ds0_osd0_rd_ch_rst = 1; +- stDmaRstCtl.ds0_osd1_rd_ch_rst = 1; +- stDmaRstCtl.ds1_osd0_rd_ch_rst = 1; +- stDmaRstCtl.ds1_osd1_rd_ch_rst = 1; +- stDmaRstCtl.ds2_osd0_rd_ch_rst = 1; +- stDmaRstCtl.ds2_osd1_rd_ch_rst = 1; +- stDmaRstCtl.ds1_osd2_rd_ch_rst = 1; +- stDmaRstCtl.ds2_osd2_rd_ch_rst = 1; ++ stDmaRstCtl.y_3dnr_rd_ch_rst = 1; ++ stDmaRstCtl.uv_3dnr_rd_ch_rst = 1; ++ stDmaRstCtl.ldc_y_rd_ch_rst = 1; ++ stDmaRstCtl.ldc_uv_rd_ch_rst = 1; ++ stDmaRstCtl.wdr_raw_rd_ch_rst = 1; ++ stDmaRstCtl.ds0_out_y_wr_ch_rst = 1; ++ stDmaRstCtl.ds0_out_uv_wr_ch_rst = 1; ++ stDmaRstCtl.ds1_out_y_wr_ch_rst = 1; ++ stDmaRstCtl.ds1_out_uv_wr_ch_rst = 1; ++ stDmaRstCtl.ds2_out_r_wr_ch_rst = 1; ++ stDmaRstCtl.ds2_out_g_wr_ch_rst = 1; ++ stDmaRstCtl.ds2_out_b_wr_ch_rst = 1; ++ stDmaRstCtl.ds0_osd0_rd_ch_rst = 1; ++ stDmaRstCtl.ds0_osd1_rd_ch_rst = 1; ++ stDmaRstCtl.ds1_osd0_rd_ch_rst = 1; ++ stDmaRstCtl.ds1_osd1_rd_ch_rst = 1; ++ stDmaRstCtl.ds2_osd0_rd_ch_rst = 1; ++ stDmaRstCtl.ds2_osd1_rd_ch_rst = 1; ++ stDmaRstCtl.ds1_osd2_rd_ch_rst = 1; ++ stDmaRstCtl.ds2_osd2_rd_ch_rst = 1; + Isp_Drv_F2k_Wrap_SetDmaReset(isp,&stDmaRstCtl); + } + // + void isp_f2k_wrap_SetPipeClkCtl(struct k510_isp_device *isp) + { +- ++ + ISP_WRAP_PIPE_CLK_CTL_S pstPipeClkCtl; + pstPipeClkCtl.wrap_com_clk_en = 1; + pstPipeClkCtl.wrap_cfg_clk_en = 1; + pstPipeClkCtl.core_com_clk_en = 1; + pstPipeClkCtl.core_cfg_clk_en = 1; +- pstPipeClkCtl.axi_wr_ch_en = 1; +- pstPipeClkCtl.axi_rd_ch_en = 1; ++ pstPipeClkCtl.axi_wr_ch_en = 1; ++ pstPipeClkCtl.axi_rd_ch_en = 1; + Isp_Drv_F2k_Wrap_SetComClkCtl(isp,&pstPipeClkCtl); + } + // +@@ -152,7 +152,7 @@ void isp_f2k_wrap_SetWdr(struct k510_isp_device *isp,struct isp_wrap_wdr_info *w + stWdrModeCtl->wdr_long_l2_buf_depth = 0; + stWdrModeCtl->wdr_long_ch_mode = 0; + stWdrModeCtl->wdr_long_l2_buf_en = 0; +- stWdrModeCtl->wdr_short_s1_buf_en = 0; ++ stWdrModeCtl->wdr_short_s1_buf_en = 0; + } + ISP_WRAP_WDR_PIXEL_FORMAT_CTL_S *stWdrPixelFormat = &pstWdrAttr.stWdrPixelFormat; + stWdrPixelFormat->wdr_long_img_format = ISP_RGBRAW_DATA; +@@ -164,13 +164,13 @@ void isp_f2k_wrap_SetWdr(struct k510_isp_device *isp,struct isp_wrap_wdr_info *w + stWdrBuf->wdr_buf_base = 0x0; + stWdrBuf->wdr_buf_size = 0x0; + stWdrBuf->wdr_line_stride = 0x0; +- Isp_Drv_F2k_Wrap_SetWdr(isp,&pstWdrAttr); ++ Isp_Drv_F2k_Wrap_SetWdr(isp,&pstWdrAttr); + } + // + void isp_f2k_wrap_Set3dnr(struct k510_isp_device *isp,struct isp_wrap_3dnr_info *nr3dInfo) + { + ISP_WRAP_3DNR_ATTR_S pst3dnrAttr; +- if( 1 == nr3dInfo->nr3d_en) ++ if( 1 == nr3dInfo->nr3d_en) + { + pst3dnrAttr.clk_3dnr_en = 1; + pst3dnrAttr.pipe_3dnr_dma_en = 1; +@@ -223,7 +223,7 @@ void isp_f2k_wrap_SetLdc(struct k510_isp_device *isp,struct isp_wrap_ldc_info *l + { + pstLdcAttr.ldc_clk_en = 0; + pstLdcAttr.ldc_dma_en = 0; +- } ++ } + ISP_WRAP_LDC_BUF_S *stLdcBuf = &pstLdcAttr.stLdcBuf; + stLdcBuf->ldc_y_buf_base = ldcInfo->ldc_y_buf_base;//ISP_BUF_LDC_Y; + stLdcBuf->ldc_uv_buf_base = ldcInfo->ldc_uv_buf_base;//ISP_BUF_LDC_UV; +@@ -313,9 +313,9 @@ void isp_f2k_wrap_SetDs0Out(struct k510_isp_device *isp,struct isp_wrap_ds0_info + stDs0ClkCtl->ds_out0_osd0_ch_clk_en = 0; + stDs0ClkCtl->ds_out0_osd1_ch_clk_en = 0; + stDs0ClkCtl->ds_out0_osd2_ch_clk_en = 0; +- stDs0DmaEn->ds_out0_dma_en = 0; ++ stDs0DmaEn->ds_out0_dma_en = 0; + stDs0DmaEn->ds_out0_y_ch_dma_en =0; +- stDs0DmaEn->ds_out0_uv_ch_dma_en = 0; ++ stDs0DmaEn->ds_out0_uv_ch_dma_en = 0; + stDs0DmaEn->ds0_osd0_ch_dma_en =0; + stDs0DmaEn->ds0_osd1_ch_dma_en = 0; + stDs0DmaEn->ds0_osd2_ch_dma_en = 0; +@@ -334,7 +334,7 @@ void isp_f2k_wrap_SetDs0Out(struct k510_isp_device *isp,struct isp_wrap_ds0_info + stDs0Buf->ds0_y_buf0_base = ds0Info->ds0_y_buf0_base;//ISP_BUF_DS0_Y; + stDs0Buf->ds0_y_buf1_base = ds0Info->ds0_y_buf1_base;//ISP_BUF_DS0_Y; + stDs0Buf->ds0_y_line_stride = ds0Info->ds0_line_stride;//(Width + 15)/16*16;//ISP_BUF_DS0_Y_STRIDE; +- stDs0Buf->ds0_uv_line_stride = ds0Info->ds0_line_stride;//(Width + 15)/16*16;//ISP_BUF_DS0_UV_STRIDE; ++ stDs0Buf->ds0_uv_line_stride = ds0Info->ds0_line_stride;//(Width + 15)/16*16;//ISP_BUF_DS0_UV_STRIDE; + stDs0Buf->ds0_uv_buf0_base = ds0Info->ds0_uv_buf0_base;//ISP_BUF_DS0_Y + stDs0Buf->ds0_y_line_stride * Height;//ISP_BUF_DS0_UV; + stDs0Buf->ds0_uv_buf1_base = ds0Info->ds0_uv_buf1_base;//ISP_BUF_DS0_Y + stDs0Buf->ds0_y_line_stride * Height;//ISP_BUF_DS0_UV; + Isp_Drv_F2k_Wrap_SetDs0Out(isp,&pstDs0OutAttr); +@@ -351,7 +351,7 @@ void isp_f2k_wrap_SetDs1Out(struct k510_isp_device *isp,struct isp_wrap_ds1_info + stDs1ClkCtl->ds1_out_clk_en = 1; + stDs1ClkCtl->ds1_out_y_ch_clk_en = 1; + stDs1ClkCtl->ds1_out_uv_ch_clk_en = 1; +- ++ + if( 1 == ds1Info->ds1_out_en) { + + stDs1ClkCtl->ds_out1_osd0_ch_clk_en = 0; +@@ -408,7 +408,7 @@ void isp_f2k_wrap_SetDs1Out(struct k510_isp_device *isp,struct isp_wrap_ds1_info + stDs1Buf->ds1_y_buf0_base = ds1Info->ds1_y_buf0_base;//ISP_BUF_DS1_Y; + stDs1Buf->ds1_y_buf1_base = ds1Info->ds1_y_buf1_base;//ISP_BUF_DS1_Y; + stDs1Buf->ds1_y_line_stride = ds1Info->ds1_line_stride;//(Width +15)/16*16;//ISP_BUF_DS1_Y_STRIDE; +- stDs1Buf->ds1_uv_line_stride = ds1Info->ds1_line_stride;//(Width +15)/16*16;//ISP_BUF_DS1_Y_STRIDE; ++ stDs1Buf->ds1_uv_line_stride = ds1Info->ds1_line_stride;//(Width +15)/16*16;//ISP_BUF_DS1_Y_STRIDE; + stDs1Buf->ds1_uv_buf0_base = ds1Info->ds1_uv_buf0_base;//ISP_BUF_DS1_Y + stDs1Buf->ds1_y_line_stride *Height;//ISP_BUF_DS1_UV; + stDs1Buf->ds1_uv_buf1_base = ds1Info->ds1_uv_buf1_base;//ISP_BUF_DS1_Y + stDs1Buf->ds1_y_line_stride *Height;//ISP_BUF_DS1_UV; + Isp_Drv_F2k_Wrap_SetDs1Out(isp,&pstDs1OutAttr); +@@ -465,7 +465,7 @@ void isp_f2k_wrap_SetDs2Out(struct k510_isp_device *isp,struct isp_wrap_ds2_info + } + ISP_WRAP_DS2_PIXEL_FORMAT_CTL_S *stDs2PixelFormat = &pstDs2OutAttr.stDs2PixelFormat; + stDs2PixelFormat->ds2_out_img_format = ds2Info->ds2_out_img_format;//ISP_RGBRAW_DATA; +- stDs2PixelFormat->ds2_out_img_out_format = ds2Info->ds2_out_img_out_format;//OUT_ARGB; ++ stDs2PixelFormat->ds2_out_img_out_format = ds2Info->ds2_out_img_out_format;//OUT_ARGB; + stDs2PixelFormat->ds2_out_pixel_width = ds2Info->ds2_out_pxl_width;//PIXEL_8; + stDs2PixelFormat->ds2_out_yuv422_pxl_order = ds2Info->ds2_out_yuv422_pxl_order;//YUYV; //not need + stDs2PixelFormat->ds2_out_yuv_in_format = ds2Info->ds2_out_yuv_in_format;//IN_YUV422; //not need +@@ -482,12 +482,12 @@ void isp_f2k_wrap_SetDs2Out(struct k510_isp_device *isp,struct isp_wrap_ds2_info + stDs2Buf->ds2_r_line_stride = ds2Info->ds2_line_stride; + stDs2Buf->ds2_g_line_stride = ds2Info->ds2_line_stride; + stDs2Buf->ds2_b_line_stride = ds2Info->ds2_line_stride; +- Isp_Drv_F2k_Wrap_SetDs2Out(isp,&pstDs2OutAttr); ++ Isp_Drv_F2k_Wrap_SetDs2Out(isp,&pstDs2OutAttr); + } + // + void isp_f2k_wrap_SetDmaConfig(struct k510_isp_device *isp) + { +- ++ + ISP_WRAP_DMA_ATTR_S pstDmaAttr; + unsigned int DmaChIndex = 0; + ISP_WRAP_DMA_MODE_S *stDmaChMode = &pstDmaAttr.stDmaChMode; +@@ -583,107 +583,107 @@ int isp_f2k_wrap_SetAxiCtl(struct k510_isp_device *isp) + */ + int isp_f2k_wrap_SetIntMask(struct k510_isp_device *isp) + { +- ++ + ISP_WRAP_CORE_INT_CTL_S stCoreIntCtl; +- stCoreIntCtl.int_raw_in_mask= 1 ; +- stCoreIntCtl.int_3a_mask= 1 ; +- stCoreIntCtl.raw_int_mask= 1 ; +- stCoreIntCtl.rgb_int_mask= 1 ; +- stCoreIntCtl.yuv_int_mask= 1 ; +- stCoreIntCtl.ldc_int_mask= 1 ; ++ stCoreIntCtl.int_raw_in_mask= 1 ; ++ stCoreIntCtl.int_3a_mask= 1 ; ++ stCoreIntCtl.raw_int_mask= 1 ; ++ stCoreIntCtl.rgb_int_mask= 1 ; ++ stCoreIntCtl.yuv_int_mask= 1 ; ++ stCoreIntCtl.ldc_int_mask= 1 ; + stCoreIntCtl.main_out_int_mask= 1 ; +- stCoreIntCtl.isp_awb_int_mask= 1 ; +- stCoreIntCtl.isp_ae_int_mask= 1 ; +- stCoreIntCtl.isp_af_int_mask= 1 ; ++ stCoreIntCtl.isp_awb_int_mask= 1 ; ++ stCoreIntCtl.isp_ae_int_mask= 1 ; ++ stCoreIntCtl.isp_af_int_mask= 1 ; + Isp_Drv_F2k_Wrap_SetCoreIntCtlMask(isp,&stCoreIntCtl); + + ISP_WRAP_DMA_WR_INT_MASK0_S stDmaWRMask0; +- stDmaWRMask0.wr_3dnr_y_frm_end_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_y_line_base_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_y_frm_end_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_y_line_base_int_mask= 1 ; + stDmaWRMask0.wr_3dnr_y_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_y_err_immediate_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_uv_frm_end_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_uv_line_base_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_uv_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_uv_err_immediate_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_y_frm_end_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_y_line_base_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_y_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_y_err_immediate_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_uv_frm_end_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_uv_line_base_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_y_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_uv_frm_end_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_uv_line_base_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_uv_err_frm_end_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_uv_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_y_frm_end_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_y_line_base_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_y_err_frm_end_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_y_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_uv_frm_end_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_uv_line_base_int_mask= 1 ; + stDmaWRMask0.ldc_wr_uv_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_uv_err_immediate_int_mask= 1 ; +- stDmaWRMask0.wdr_wr_raw_frm_end_int_mask= 1 ; +- stDmaWRMask0.wdr_wr_raw_line_base_int_mask= 1 ; +- stDmaWRMask0.wdr_wr_raw_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.wdr_wr_raw_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_uv_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.wdr_wr_raw_frm_end_int_mask= 1 ; ++ stDmaWRMask0.wdr_wr_raw_line_base_int_mask= 1 ; ++ stDmaWRMask0.wdr_wr_raw_err_frm_end_int_mask= 1 ; ++ stDmaWRMask0.wdr_wr_raw_err_immediate_int_mask= 1 ; + stDmaWRMask0.main_out_wr_y_frm_end_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_y_line_base_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_y_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_y_err_immediate_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_uv_frm_end_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_uv_line_base_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_uv_err_frm_end_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_y_line_base_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_y_err_frm_end_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_y_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_uv_frm_end_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_uv_line_base_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_uv_err_frm_end_int_mask= 1 ; + stDmaWRMask0.main_out_wr_uv_err_immediate_int_mask= 1 ; + Isp_Drv_F2k_Wrap_SetDmaWRIntMask0(isp,&stDmaWRMask0); + ISP_WRAP_DMA_WR_INT_MASK1_S stDmaWRMask1; +- stDmaWRMask1.ds0_out_wr_y_frm_end_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_y_line_base_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_y_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_y_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_y_frm_end_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_y_line_base_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_y_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_y_err_immediate_mask= 1 ; + stDmaWRMask1.ds0_out_wr_uv_frm_end_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_uv_line_base_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_uv_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_uv_err_immediate_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_y_frm_end_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_y_line_base_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_y_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_y_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_uv_line_base_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_uv_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_uv_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_y_frm_end_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_y_line_base_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_y_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_y_err_immediate_mask= 1 ; + stDmaWRMask1.ds1_out_wr_uv_frm_end_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_uv_line_base_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_uv_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_uv_err_immediate_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_r_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_r_line_base_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_r_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_r_err_immediate_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_g_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_g_line_base_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_g_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_g_err_immediate_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_b_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_b_line_base_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_b_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_b_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_uv_line_base_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_uv_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_uv_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_r_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_r_line_base_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_r_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_r_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_g_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_g_line_base_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_g_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_g_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_b_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_b_line_base_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_b_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_b_err_immediate_mask= 1 ; + Isp_Drv_F2k_Wrap_SetDmaWRIntMask1(isp,&stDmaWRMask1); + ISP_WRAP_DMA_RD_INT_MASK0_S stDmaRDMask0; + stDmaRDMask0.rd_3dnr_y_frm_end_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_y_line_base_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_y_err_frm_end_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_y_err_immediate_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_uv_frm_end_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_uv_line_base_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_uv_err_frm_end_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_y_line_base_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_y_err_frm_end_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_y_err_immediate_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_uv_frm_end_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_uv_line_base_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_uv_err_frm_end_int_mask= 1 ; + stDmaRDMask0.rd_3dnr_uv_err_immediate_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_y_frm_end_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_y_line_base_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_y_err_frm_end_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_y_err_immediate_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_y_frm_end_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_y_line_base_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_y_err_frm_end_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_y_err_immediate_int_mask= 1 ; + stDmaRDMask0.ldc_rd_uv_frm_end_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_uv_line_base_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_uv_err_frm_end_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_uv_err_immediate_int_mask= 1 ; +- stDmaRDMask0.wdr_rd_raw_frm_end_int_mask= 1 ; +- stDmaRDMask0.wdr_rd_raw_line_base_int_mask= 1 ; +- stDmaRDMask0.wdr_rd_raw_err_frm_end_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_uv_line_base_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_uv_err_frm_end_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_uv_err_immediate_int_mask= 1 ; ++ stDmaRDMask0.wdr_rd_raw_frm_end_int_mask= 1 ; ++ stDmaRDMask0.wdr_rd_raw_line_base_int_mask= 1 ; ++ stDmaRDMask0.wdr_rd_raw_err_frm_end_int_mask= 1 ; + stDmaRDMask0.wdr_rd_raw_err_immediate_int_mask= 1 ; +- Isp_Drv_F2k_Wrap_SetDmaRDIntMask0(isp,&stDmaRDMask0); ++ Isp_Drv_F2k_Wrap_SetDmaRDIntMask0(isp,&stDmaRDMask0); + } + // + int isp_f2k_wrap_SetConfigDone(struct k510_isp_device *isp,unsigned int wp_en) + { +- ++ + ISP_WRAP_CONFIG_DONE_S pstConfigDone; + pstConfigDone.int_polarity = 1; + pstConfigDone.sen_reg_pro_en = wp_en;//0; +@@ -703,7 +703,7 @@ int isp_f2k_wrap_reset(struct k510_isp_device *isp) + { + unsigned int stData; + union U_ISP_WRAP_AXI_CTL axi_ctl; +- ++ + isp_f2k_wrap_SetConfigDone(isp,1); + // + stData = 0; +@@ -712,9 +712,9 @@ int isp_f2k_wrap_reset(struct k510_isp_device *isp) + msleep(50); + + axi_ctl.u32 = 0; +- axi_ctl.bits.axi_wr_ch_rst_req = 1; +- axi_ctl.bits.axi_rd_ch_rst_req = 1; +- isp_reg_writel(isp, axi_ctl.u32, ISP_IOMEM_F2K_WRAP, ISP_WRAP_AXI_CTL); ++ axi_ctl.bits.axi_wr_ch_rst_req = 1; ++ axi_ctl.bits.axi_rd_ch_rst_req = 1; ++ isp_reg_writel(isp, axi_ctl.u32, ISP_IOMEM_F2K_WRAP, ISP_WRAP_AXI_CTL); + axi_ctl.u32 = 0; + axi_ctl = (union U_ISP_WRAP_AXI_CTL)isp_reg_readl(isp, ISP_IOMEM_F2K_WRAP, ISP_WRAP_AXI_CTL); + printk("%s>AXI_CTL = 0x%x\n", __func__, axi_ctl); +@@ -726,10 +726,10 @@ int isp_f2k_wrap_reset(struct k510_isp_device *isp) + } + + isp_f2k_wrap_SetConfigDone(isp,1); +- ++ + stData = 0; + isp_reg_writel(isp,stData,ISP_IOMEM_F2K_WRAP,ISP_WRAP_PIPE_CLK_CTL); +- ++ + // + stData = 0xffffffff; + isp_reg_writel(isp,stData,ISP_IOMEM_F2K_WRAP,ISP_WRAP_SWRST_CTL); +@@ -743,7 +743,7 @@ static int isp_f2k_wrap_config(struct isp_f2k_device *f2k,struct isp_wrap_cfg_in + { + struct k510_isp_device *isp = to_isp_device(f2k); + //struct isp_wrap_cfg_info *isp_wrap_cfg =&isp_cfg->isp_wrap_cfg; +- isp_f2k_wrap_SetConfigDone(isp,1); ++ isp_f2k_wrap_SetConfigDone(isp,1); + // + isp_f2k_wrap_SetComRst(isp); + // +@@ -785,24 +785,24 @@ static int isp_f2k_wrap_config(struct isp_f2k_device *f2k,struct isp_wrap_cfg_in + // + isp_f2k_wrap_SetIntMask(isp); + // +- isp_f2k_wrap_SetConfigDone(isp,0); ++ isp_f2k_wrap_SetConfigDone(isp,0); + +- return 0; ++ return 0; + } + //wrap int + static int isp_f2k_wrap_setIntCore(struct k510_isp_device *isp,struct isp_wrap_intcore_info *intCoreEn) + { + ISP_WRAP_CORE_INT_CTL_S coreIntMask; +- coreIntMask.int_raw_in_mask = ~intCoreEn->int_raw_in_en; +- coreIntMask.int_3a_mask = ~intCoreEn->int_3a_en; +- coreIntMask.raw_int_mask = ~intCoreEn->raw_int_en; +- coreIntMask.rgb_int_mask = ~intCoreEn->rgb_int_en; +- coreIntMask.yuv_int_mask = ~intCoreEn->yuv_int_en; +- coreIntMask.ldc_int_mask = ~intCoreEn->ldc_int_en; ++ coreIntMask.int_raw_in_mask = ~intCoreEn->int_raw_in_en; ++ coreIntMask.int_3a_mask = ~intCoreEn->int_3a_en; ++ coreIntMask.raw_int_mask = ~intCoreEn->raw_int_en; ++ coreIntMask.rgb_int_mask = ~intCoreEn->rgb_int_en; ++ coreIntMask.yuv_int_mask = ~intCoreEn->yuv_int_en; ++ coreIntMask.ldc_int_mask = ~intCoreEn->ldc_int_en; + coreIntMask.main_out_int_mask = ~intCoreEn->main_out_int_en; +- coreIntMask.isp_awb_int_mask = ~intCoreEn->isp_awb_int_en; +- coreIntMask.isp_ae_int_mask = ~intCoreEn->isp_ae_int_en; +- coreIntMask.isp_af_int_mask = ~intCoreEn->isp_af_int_en; ++ coreIntMask.isp_awb_int_mask = ~intCoreEn->isp_awb_int_en; ++ coreIntMask.isp_ae_int_mask = ~intCoreEn->isp_ae_int_en; ++ coreIntMask.isp_af_int_mask = ~intCoreEn->isp_af_int_en; + Isp_Drv_F2k_Wrap_SetCoreIntCtlMask(isp,&coreIntMask); + return 0; + }; +@@ -810,33 +810,33 @@ static int isp_f2k_wrap_setIntCore(struct k510_isp_device *isp,struct isp_wrap_i + static int isp_f2k_wrap_setIntWr0(struct k510_isp_device *isp,struct isp_wrap_intwr0_info *intWr0En) + { + ISP_WRAP_DMA_WR_INT_MASK0_S wrIntMask0; +- wrIntMask0.wr_3dnr_y_frm_end_int_mask = ~intWr0En->wr_3dnr_y_frm_end_int_en; +- wrIntMask0.wr_3dnr_y_line_base_int_mask = 1; ++ wrIntMask0.wr_3dnr_y_frm_end_int_mask = ~intWr0En->wr_3dnr_y_frm_end_int_en; ++ wrIntMask0.wr_3dnr_y_line_base_int_mask = 1; + wrIntMask0.wr_3dnr_y_err_frm_end_int_mask = 1; +- wrIntMask0.wr_3dnr_y_err_immediate_int_mask = 1; +- wrIntMask0.wr_3dnr_uv_frm_end_int_mask = ~intWr0En->wr_3dnr_uv_frm_end_int_en; +- wrIntMask0.wr_3dnr_uv_line_base_int_mask = 1; +- wrIntMask0.wr_3dnr_uv_err_frm_end_int_mask = 1; +- wrIntMask0.wr_3dnr_uv_err_immediate_int_mask = 1; +- wrIntMask0.ldc_wr_y_frm_end_int_mask = ~intWr0En->ldc_wr_y_frm_end_int_en; +- wrIntMask0.ldc_wr_y_line_base_int_mask = 1; +- wrIntMask0.ldc_wr_y_err_frm_end_int_mask = 1; +- wrIntMask0.ldc_wr_y_err_immediate_int_mask = 1; +- wrIntMask0.ldc_wr_uv_frm_end_int_mask = ~intWr0En->ldc_wr_uv_frm_end_int_en; +- wrIntMask0.ldc_wr_uv_line_base_int_mask = 1; ++ wrIntMask0.wr_3dnr_y_err_immediate_int_mask = 1; ++ wrIntMask0.wr_3dnr_uv_frm_end_int_mask = ~intWr0En->wr_3dnr_uv_frm_end_int_en; ++ wrIntMask0.wr_3dnr_uv_line_base_int_mask = 1; ++ wrIntMask0.wr_3dnr_uv_err_frm_end_int_mask = 1; ++ wrIntMask0.wr_3dnr_uv_err_immediate_int_mask = 1; ++ wrIntMask0.ldc_wr_y_frm_end_int_mask = ~intWr0En->ldc_wr_y_frm_end_int_en; ++ wrIntMask0.ldc_wr_y_line_base_int_mask = 1; ++ wrIntMask0.ldc_wr_y_err_frm_end_int_mask = 1; ++ wrIntMask0.ldc_wr_y_err_immediate_int_mask = 1; ++ wrIntMask0.ldc_wr_uv_frm_end_int_mask = ~intWr0En->ldc_wr_uv_frm_end_int_en; ++ wrIntMask0.ldc_wr_uv_line_base_int_mask = 1; + wrIntMask0.ldc_wr_uv_err_frm_end_int_mask = 1; +- wrIntMask0.ldc_wr_uv_err_immediate_int_mask = 1; +- wrIntMask0.wdr_wr_raw_frm_end_int_mask = ~intWr0En->wdr_wr_raw_frm_end_int_en; +- wrIntMask0.wdr_wr_raw_line_base_int_mask = 1; +- wrIntMask0.wdr_wr_raw_err_frm_end_int_mask = 1; +- wrIntMask0.wdr_wr_raw_err_immediate_int_mask = 1; ++ wrIntMask0.ldc_wr_uv_err_immediate_int_mask = 1; ++ wrIntMask0.wdr_wr_raw_frm_end_int_mask = ~intWr0En->wdr_wr_raw_frm_end_int_en; ++ wrIntMask0.wdr_wr_raw_line_base_int_mask = 1; ++ wrIntMask0.wdr_wr_raw_err_frm_end_int_mask = 1; ++ wrIntMask0.wdr_wr_raw_err_immediate_int_mask = 1; + wrIntMask0.main_out_wr_y_frm_end_int_mask = ~intWr0En->main_out_wr_y_frm_end_int_en; +- wrIntMask0.main_out_wr_y_line_base_int_mask = 1; +- wrIntMask0.main_out_wr_y_err_frm_end_int_mask = 1; +- wrIntMask0.main_out_wr_y_err_immediate_int_mask = 1; +- wrIntMask0.main_out_wr_uv_frm_end_int_mask = ~intWr0En->main_out_wr_uv_frm_end_int_en; +- wrIntMask0.main_out_wr_uv_line_base_int_mask = 1; +- wrIntMask0.main_out_wr_uv_err_frm_end_int_mask = 1; ++ wrIntMask0.main_out_wr_y_line_base_int_mask = 1; ++ wrIntMask0.main_out_wr_y_err_frm_end_int_mask = 1; ++ wrIntMask0.main_out_wr_y_err_immediate_int_mask = 1; ++ wrIntMask0.main_out_wr_uv_frm_end_int_mask = ~intWr0En->main_out_wr_uv_frm_end_int_en; ++ wrIntMask0.main_out_wr_uv_line_base_int_mask = 1; ++ wrIntMask0.main_out_wr_uv_err_frm_end_int_mask = 1; + wrIntMask0.main_out_wr_uv_err_immediate_int_mask = 1; + Isp_Drv_F2k_Wrap_SetDmaWRIntMask0(isp,&wrIntMask0); + return 0; +@@ -846,33 +846,33 @@ static int isp_f2k_wrap_setIntWr1(struct k510_isp_device *isp,struct isp_wrap_in + { + ISP_WRAP_DMA_WR_INT_MASK1_S wrIntMask1; + wrIntMask1.ds0_out_wr_y_frm_end_mask = ~intWr1En->ds0_out_wr_y_frm_end_en; +- wrIntMask1.ds0_out_wr_y_line_base_mask = 1; +- wrIntMask1.ds0_out_wr_y_err_frm_end_mask = 1; +- wrIntMask1.ds0_out_wr_y_err_immediate_mask = 1; +- wrIntMask1.ds0_out_wr_uv_frm_end_mask = ~intWr1En->ds0_out_wr_uv_frm_end_en; +- wrIntMask1.ds0_out_wr_uv_line_base_mask = 1; +- wrIntMask1.ds0_out_wr_uv_err_frm_end_mask = 1; ++ wrIntMask1.ds0_out_wr_y_line_base_mask = 1; ++ wrIntMask1.ds0_out_wr_y_err_frm_end_mask = 1; ++ wrIntMask1.ds0_out_wr_y_err_immediate_mask = 1; ++ wrIntMask1.ds0_out_wr_uv_frm_end_mask = ~intWr1En->ds0_out_wr_uv_frm_end_en; ++ wrIntMask1.ds0_out_wr_uv_line_base_mask = 1; ++ wrIntMask1.ds0_out_wr_uv_err_frm_end_mask = 1; + wrIntMask1.ds0_out_wr_uv_err_immediate_mask = 1; + wrIntMask1.ds1_out_wr_y_frm_end_mask = ~intWr1En->ds1_out_wr_y_frm_end_en; +- wrIntMask1.ds1_out_wr_y_line_base_mask = 1; +- wrIntMask1.ds1_out_wr_y_err_frm_end_mask = 1; +- wrIntMask1.ds1_out_wr_y_err_immediate_mask = 1; +- wrIntMask1.ds1_out_wr_uv_frm_end_mask = ~intWr1En->ds1_out_wr_uv_frm_end_en; +- wrIntMask1.ds1_out_wr_uv_line_base_mask = 1; +- wrIntMask1.ds1_out_wr_uv_err_frm_end_mask = 1; ++ wrIntMask1.ds1_out_wr_y_line_base_mask = 1; ++ wrIntMask1.ds1_out_wr_y_err_frm_end_mask = 1; ++ wrIntMask1.ds1_out_wr_y_err_immediate_mask = 1; ++ wrIntMask1.ds1_out_wr_uv_frm_end_mask = ~intWr1En->ds1_out_wr_uv_frm_end_en; ++ wrIntMask1.ds1_out_wr_uv_line_base_mask = 1; ++ wrIntMask1.ds1_out_wr_uv_err_frm_end_mask = 1; + wrIntMask1.ds1_out_wr_uv_err_immediate_mask = 1; + wrIntMask1.ds2_out_wr_r_frm_end_mask = ~intWr1En->ds2_out_wr_r_frm_end_en; +- wrIntMask1.ds2_out_wr_r_line_base_mask = 1; +- wrIntMask1.ds2_out_wr_r_err_frm_end_mask = 1; +- wrIntMask1.ds2_out_wr_r_err_immediate_mask = 1; ++ wrIntMask1.ds2_out_wr_r_line_base_mask = 1; ++ wrIntMask1.ds2_out_wr_r_err_frm_end_mask = 1; ++ wrIntMask1.ds2_out_wr_r_err_immediate_mask = 1; + wrIntMask1.ds2_out_wr_g_frm_end_mask = ~intWr1En->ds2_out_wr_g_frm_end_en; +- wrIntMask1.ds2_out_wr_g_line_base_mask = 1; +- wrIntMask1.ds2_out_wr_g_err_frm_end_mask = 1; +- wrIntMask1.ds2_out_wr_g_err_immediate_mask = 1; +- wrIntMask1.ds2_out_wr_b_frm_end_mask = ~intWr1En->ds2_out_wr_b_frm_end_en; +- wrIntMask1.ds2_out_wr_b_line_base_mask = 1; +- wrIntMask1.ds2_out_wr_b_err_frm_end_mask = 1; +- wrIntMask1.ds2_out_wr_b_err_immediate_mask = 1; ++ wrIntMask1.ds2_out_wr_g_line_base_mask = 1; ++ wrIntMask1.ds2_out_wr_g_err_frm_end_mask = 1; ++ wrIntMask1.ds2_out_wr_g_err_immediate_mask = 1; ++ wrIntMask1.ds2_out_wr_b_frm_end_mask = ~intWr1En->ds2_out_wr_b_frm_end_en; ++ wrIntMask1.ds2_out_wr_b_line_base_mask = 1; ++ wrIntMask1.ds2_out_wr_b_err_frm_end_mask = 1; ++ wrIntMask1.ds2_out_wr_b_err_immediate_mask = 1; + Isp_Drv_F2k_Wrap_SetDmaWRIntMask1(isp,&wrIntMask1); + return 0; + } +@@ -881,64 +881,64 @@ static int isp_f2k_wrap_setIntRd0(struct k510_isp_device *isp,struct isp_wrap_in + { + ISP_WRAP_DMA_RD_INT_MASK0_S rdIntMask0; + rdIntMask0.rd_3dnr_y_frm_end_int_mask = ~intRd0En->rd_3dnr_y_frm_end_int_en; +- rdIntMask0.rd_3dnr_y_line_base_int_mask = 1; +- rdIntMask0.rd_3dnr_y_err_frm_end_int_mask = 1; +- rdIntMask0.rd_3dnr_y_err_immediate_int_mask = 1; +- rdIntMask0.rd_3dnr_uv_frm_end_int_mask = ~intRd0En->rd_3dnr_uv_frm_end_int_en; +- rdIntMask0.rd_3dnr_uv_line_base_int_mask = 1; +- rdIntMask0.rd_3dnr_uv_err_frm_end_int_mask = 1; ++ rdIntMask0.rd_3dnr_y_line_base_int_mask = 1; ++ rdIntMask0.rd_3dnr_y_err_frm_end_int_mask = 1; ++ rdIntMask0.rd_3dnr_y_err_immediate_int_mask = 1; ++ rdIntMask0.rd_3dnr_uv_frm_end_int_mask = ~intRd0En->rd_3dnr_uv_frm_end_int_en; ++ rdIntMask0.rd_3dnr_uv_line_base_int_mask = 1; ++ rdIntMask0.rd_3dnr_uv_err_frm_end_int_mask = 1; + rdIntMask0.rd_3dnr_uv_err_immediate_int_mask = 1; +- rdIntMask0.ldc_rd_y_frm_end_int_mask = ~intRd0En->ldc_rd_y_frm_end_int_en; +- rdIntMask0.ldc_rd_y_line_base_int_mask = 1; +- rdIntMask0.ldc_rd_y_err_frm_end_int_mask = 1; +- rdIntMask0.ldc_rd_y_err_immediate_int_mask = 1; ++ rdIntMask0.ldc_rd_y_frm_end_int_mask = ~intRd0En->ldc_rd_y_frm_end_int_en; ++ rdIntMask0.ldc_rd_y_line_base_int_mask = 1; ++ rdIntMask0.ldc_rd_y_err_frm_end_int_mask = 1; ++ rdIntMask0.ldc_rd_y_err_immediate_int_mask = 1; + rdIntMask0.ldc_rd_uv_frm_end_int_mask = ~intRd0En->ldc_rd_uv_frm_end_int_en; +- rdIntMask0.ldc_rd_uv_line_base_int_mask = 1; +- rdIntMask0.ldc_rd_uv_err_frm_end_int_mask = 1; +- rdIntMask0.ldc_rd_uv_err_immediate_int_mask = 1; +- rdIntMask0.wdr_rd_raw_frm_end_int_mask = ~intRd0En->wdr_rd_raw_frm_end_int_en; +- rdIntMask0.wdr_rd_raw_line_base_int_mask = 1; +- rdIntMask0.wdr_rd_raw_err_frm_end_int_mask = 1; ++ rdIntMask0.ldc_rd_uv_line_base_int_mask = 1; ++ rdIntMask0.ldc_rd_uv_err_frm_end_int_mask = 1; ++ rdIntMask0.ldc_rd_uv_err_immediate_int_mask = 1; ++ rdIntMask0.wdr_rd_raw_frm_end_int_mask = ~intRd0En->wdr_rd_raw_frm_end_int_en; ++ rdIntMask0.wdr_rd_raw_line_base_int_mask = 1; ++ rdIntMask0.wdr_rd_raw_err_frm_end_int_mask = 1; + rdIntMask0.wdr_rd_raw_err_immediate_int_mask = 1; + Isp_Drv_F2k_Wrap_SetDmaRDIntMask0(isp,&rdIntMask0); + return 0; + } + +-void k510isp_f2k_irq_enable(struct k510_isp_device *isp,struct isp_irq_info *irq_info) ++void k510isp_f2k_irq_enable(struct k510_isp_device *isp,struct isp_irq_info *irq_info) + { + dev_dbg(isp->dev,"%s:start\n",__func__); + struct isp_wrap_intcore_info intCoreEn; + intCoreEn.int_raw_in_en = irq_info->raw_en; + if((1 ==irq_info->awb_en)||(1 ==irq_info->ae_en)||(1 ==irq_info->af_en)) + { +- intCoreEn.int_3a_en = 1; ++ intCoreEn.int_3a_en = 1; + } +- else +- intCoreEn.int_3a_en = 0; +- intCoreEn.raw_int_en = irq_info->raw_en; +- intCoreEn.rgb_int_en = irq_info->rgb_en; +- intCoreEn.yuv_int_en = irq_info->yuv_en; +- intCoreEn.ldc_int_en = irq_info->ldc_core_en; ++ else ++ intCoreEn.int_3a_en = 0; ++ intCoreEn.raw_int_en = irq_info->raw_en; ++ intCoreEn.rgb_int_en = irq_info->rgb_en; ++ intCoreEn.yuv_int_en = irq_info->yuv_en; ++ intCoreEn.ldc_int_en = irq_info->ldc_core_en; + intCoreEn.main_out_int_en = irq_info->main_core_en; + + #if 0 +- intCoreEn.isp_awb_int_en = irq_info->awb_en; +- intCoreEn.isp_ae_int_en = irq_info->ae_en; +- intCoreEn.isp_af_int_en = irq_info->af_en; ++ intCoreEn.isp_awb_int_en = irq_info->awb_en; ++ intCoreEn.isp_ae_int_en = irq_info->ae_en; ++ intCoreEn.isp_af_int_en = irq_info->af_en; + #else +- intCoreEn.isp_awb_int_en = 0; +- intCoreEn.isp_ae_int_en = 0; +- intCoreEn.isp_af_int_en = 0; ++ intCoreEn.isp_awb_int_en = 0; ++ intCoreEn.isp_ae_int_en = 0; ++ intCoreEn.isp_af_int_en = 0; + #endif + isp_f2k_wrap_setIntCore(isp,&intCoreEn); + + struct isp_wrap_intwr0_info intWr0En; +- intWr0En.wr_3dnr_y_frm_end_int_en = irq_info->nr3d_w_en; ++ intWr0En.wr_3dnr_y_frm_end_int_en = irq_info->nr3d_w_en; + intWr0En.wr_3dnr_uv_frm_end_int_en = irq_info->nr3d_w_en; + intWr0En.ldc_wr_y_frm_end_int_en = irq_info->ldc_w_en; + intWr0En.ldc_wr_uv_frm_end_int_en = irq_info->ldc_w_en; + intWr0En.wdr_wr_raw_frm_end_int_en = irq_info->wdr_w_en; +- intWr0En.main_out_wr_y_frm_end_int_en = irq_info->main_dma_en; ++ intWr0En.main_out_wr_y_frm_end_int_en = irq_info->main_dma_en; + intWr0En.main_out_wr_uv_frm_end_int_en = irq_info->main_dma_en; + isp_f2k_wrap_setIntWr0(isp,&intWr0En); + +@@ -955,7 +955,7 @@ void k510isp_f2k_irq_enable(struct k510_isp_device *isp,struct isp_irq_info *irq + struct isp_wrap_intrd0_info intRd0En; + intRd0En.rd_3dnr_y_frm_end_int_en = irq_info->nr3d_r_en; + intRd0En.rd_3dnr_uv_frm_end_int_en = irq_info->nr3d_r_en; +- intRd0En.ldc_rd_y_frm_end_int_en = irq_info->ldc_r_en; ++ intRd0En.ldc_rd_y_frm_end_int_en = irq_info->ldc_r_en; + intRd0En.ldc_rd_uv_frm_end_int_en = irq_info->ldc_r_en; + intRd0En.wdr_rd_raw_frm_end_int_en = irq_info->wdr_r_en; + isp_f2k_wrap_setIntRd0(isp,&intRd0En); +@@ -967,12 +967,12 @@ void k510isp_f2k_irq_enable(struct k510_isp_device *isp,struct isp_irq_info *irq + static int isp_f2k_core_SetItc(struct k510_isp_device *isp,ITC_INFO_S *itcInfo) + { + ISP_CORE_ITC_CTL_S stItcCtl; +- stItcCtl.hsync_pol = itcInfo->hsync_pol; +- stItcCtl.vsync_pol = itcInfo->vsync_pol; +- stItcCtl.hsync_input_timing = itcInfo->hsync_input_timing; ++ stItcCtl.hsync_pol = itcInfo->hsync_pol; ++ stItcCtl.vsync_pol = itcInfo->vsync_pol; ++ stItcCtl.hsync_input_timing = itcInfo->hsync_input_timing; + stItcCtl.vsync_input_timing = itcInfo->vsync_input_timing; +- stItcCtl.mirror_ctl = itcInfo->flip_ctl; +- stItcCtl.video_format_ctl = itcInfo->video_fmt_sel; ++ stItcCtl.mirror_ctl = itcInfo->flip_ctl; ++ stItcCtl.video_format_ctl = itcInfo->video_fmt_sel; + Isp_Drv_F2k_Core_SetItcCtl(isp,&stItcCtl); + return 0; + } +@@ -982,10 +982,10 @@ static int isp_f2k_core_SetImage(struct k510_isp_device *isp,ITC_INFO_S *itcInfo + + ISP_CORE_IMAGE_ATTR_S stImgAttr; + stImgAttr.image_height = itcInfo->total_size.Height - 1; +- stImgAttr.image_width = itcInfo->total_size.Width - 1; +- stImgAttr.image_v_start = itcInfo->itc_size.Height_st; +- stImgAttr.image_h_start = itcInfo->itc_size.Width_st; +- stImgAttr.image_active_width = itcInfo->itc_size.Width; ++ stImgAttr.image_width = itcInfo->total_size.Width - 1; ++ stImgAttr.image_v_start = itcInfo->itc_size.Height_st; ++ stImgAttr.image_h_start = itcInfo->itc_size.Width_st; ++ stImgAttr.image_active_width = itcInfo->itc_size.Width; + stImgAttr.image_active_height = itcInfo->itc_size.Height; + Isp_Drv_F2k_Core_SetImageAttr(isp,&stImgAttr); + return 0; +@@ -1000,7 +1000,7 @@ static int isp_f2k_core_SetTpgCtl(struct k510_isp_device *isp,TPG_INFO_S *tpgInf + stTestCtl.test_pattern_sel = tpgInfo->tpg_sel; + stTestCtl.wdr_l_mul_data = tpgInfo->wdr_l_mul_data; + stTestCtl.wdr_m_mul_data = tpgInfo->wdr_m_mul_data; +- stTestCtl.wdr_s_mul_data = tpgInfo->wdr_s_mul_data; ++ stTestCtl.wdr_s_mul_data = tpgInfo->wdr_s_mul_data; + Isp_Drv_F2k_Core_SetTestCtl(isp,&stTestCtl); + return 0; + } +@@ -1020,13 +1020,13 @@ static int isp_f2k_core_SetLscCtl(struct k510_isp_device *isp,LSC_INFO_S *lscInf + { + + ISP_CORE_LSC_CTL_S stLscCtl; +- stLscCtl.lsc_en = lscInfo->lsc_en; +- stLscCtl.lsc_h_center = lscInfo->lsc_h_center; ++ stLscCtl.lsc_en = lscInfo->lsc_en; ++ stLscCtl.lsc_h_center = lscInfo->lsc_h_center; + stLscCtl.lsc_v_center = lscInfo->lsc_v_center; + stLscCtl.lsc_red_ratio = lscInfo->lsc_r_ratio; +- stLscCtl.lsc_green_ratio = lscInfo->lsc_g_ratio; +- stLscCtl.lsc_blue_ratio = lscInfo->lsc_b_ratio; +- stLscCtl.lsc_ir_ratio = lscInfo->lsc_ir_ratio; ++ stLscCtl.lsc_green_ratio = lscInfo->lsc_g_ratio; ++ stLscCtl.lsc_blue_ratio = lscInfo->lsc_b_ratio; ++ stLscCtl.lsc_ir_ratio = lscInfo->lsc_ir_ratio; + Isp_Drv_F2k_Core_SetLscCtl(isp,&stLscCtl); + return 0; + } +@@ -1035,42 +1035,42 @@ static int isp_f2k_core_SetAeCtl(struct k510_isp_device *isp,AE_INFO_S *aeInfo) + { + + ISP_CORE_AE_CTL_S stAeCtl; +- stAeCtl.ae_as_en = aeInfo->ae_as_en; +- stAeCtl.ae_ag_en = aeInfo->ae_ag_en; +- stAeCtl.ae_airis_en = aeInfo->ae_airis_en; ++ stAeCtl.ae_as_en = aeInfo->ae_as_en; ++ stAeCtl.ae_ag_en = aeInfo->ae_ag_en; ++ stAeCtl.ae_airis_en = aeInfo->ae_airis_en; + stAeCtl.ae_enter_ls_sel = aeInfo->ae_enter_ls_sel; +- stAeCtl.ae_exit_ls_sel = aeInfo->ae_exit_ls_sel; ++ stAeCtl.ae_exit_ls_sel = aeInfo->ae_exit_ls_sel; + stAeCtl.ae_win_mode_sel = aeInfo->ae_win_mode_sel; + stAeCtl.ae_back_light_mode_sel = aeInfo->ae_back_light_mode_sel; +- stAeCtl.ae_day_change_en = aeInfo->ae_day_change_en; +- stAeCtl.ae_day_change_sel = aeInfo->ae_day_change_sel; ++ stAeCtl.ae_day_change_en = aeInfo->ae_day_change_en; ++ stAeCtl.ae_day_change_sel = aeInfo->ae_day_change_sel; + stAeCtl.ae_win_h_start = aeInfo->ae_win_size.h_start; + stAeCtl.ae_win_v_start = aeInfo->ae_win_size.v_start; +- stAeCtl.ae_win_h_end = aeInfo->ae_win_size.h_end; +- stAeCtl.ae_win_v_end = aeInfo->ae_win_size.v_end; +- stAeCtl.ae_tar_bright = aeInfo->ae_tar_bright; ++ stAeCtl.ae_win_h_end = aeInfo->ae_win_size.h_end; ++ stAeCtl.ae_win_v_end = aeInfo->ae_win_size.v_end; ++ stAeCtl.ae_tar_bright = aeInfo->ae_tar_bright; + stAeCtl.ae_tar_bright_range = aeInfo->ae_tar_bright_range; + stAeCtl.ae_l_ex_time = aeInfo->ae_l_ex_time; + stAeCtl.ae_m_ex_time = aeInfo->ae_m_ex_time; + stAeCtl.ae_s_ex_time = aeInfo->ae_s_ex_time; +- stAeCtl.ae_agc = aeInfo->ae_agc; ++ stAeCtl.ae_agc = aeInfo->ae_agc; + stAeCtl.ae_ad_shuttle_freq = aeInfo->ae_ad_shuttle_freq; + stAeCtl.ae_ad_gain_freq = aeInfo->ae_ad_gain_freq; + stAeCtl.ae_adjust_step_max = aeInfo->ae_adjust_step_max; +- stAeCtl.ae_ex_value_max = aeInfo->ae_ex_value_max; +- stAeCtl.ae_ex_value_mid = aeInfo->ae_ex_value_mid; +- stAeCtl.ae_ex_value_min = aeInfo->ae_ex_value_min; +- stAeCtl.ae_gain_value_max = aeInfo->ae_gain_value_max; ++ stAeCtl.ae_ex_value_max = aeInfo->ae_ex_value_max; ++ stAeCtl.ae_ex_value_mid = aeInfo->ae_ex_value_mid; ++ stAeCtl.ae_ex_value_min = aeInfo->ae_ex_value_min; ++ stAeCtl.ae_gain_value_max = aeInfo->ae_gain_value_max; + stAeCtl.ae_gain_value_mid = aeInfo->ae_gain_value_mid; + stAeCtl.ae_gain_value_min = aeInfo->ae_gain_value_min; + stAeCtl.ae_dn_switch_ad_step_max = aeInfo->ae_dn_switch_ad_step_max; + stAeCtl.ae_dn_switch_wait_time = aeInfo->ae_dn_switch_wait_time; + stAeCtl.ape_max_diff = aeInfo->ape_max_diff; +- stAeCtl.ape_drv_signal_max = aeInfo->ape_drv_signal_max; +- stAeCtl.ape_coeff_distance = aeInfo->ape_coeff_distance; ++ stAeCtl.ape_drv_signal_max = aeInfo->ape_drv_signal_max; ++ stAeCtl.ape_coeff_distance = aeInfo->ape_coeff_distance; + stAeCtl.ape_coeff_speed = aeInfo->ape_coeff_speed; + stAeCtl.ape_coeff_acceleration = aeInfo->ape_coeff_acceleration; +- stAeCtl.ape_drv_manual_value = aeInfo->ape_drv_manual_value; ++ stAeCtl.ape_drv_manual_value = aeInfo->ape_drv_manual_value; + stAeCtl.ape_damp_manual_value = aeInfo->ape_damp_manual_value; + Isp_Drv_F2k_Core_SetAeCtl(isp,&stAeCtl); + return 0; +@@ -1096,16 +1096,16 @@ static int isp_f2k_core_GetAeSts(struct k510_isp_device *isp,struct k510isp_ae_s + static int isp_f2k_core_SetAwbCtl(struct k510_isp_device *isp,AWB_INFO_S *awbInfo) + { + ISP_CORE_AWB_CTL_S stAwbCtl; +- stAwbCtl.awb_d65_en = awbInfo->awb_d65_en; +- stAwbCtl.awb_ccm_en = awbInfo->awb_ccm_en; +- stAwbCtl.awb_en = awbInfo->awb_en; ++ stAwbCtl.awb_d65_en = awbInfo->awb_d65_en; ++ stAwbCtl.awb_ccm_en = awbInfo->awb_ccm_en; ++ stAwbCtl.awb_en = awbInfo->awb_en; + stAwbCtl.awb_mode_sel = awbInfo->awb_mode_sel; + stAwbCtl.awb_hist_mode_sel = awbInfo->awb_hist_mode_sel; +- stAwbCtl.awb_veri_en = awbInfo->awb_veri_en; +- stAwbCtl.awb_mode_sel = awbInfo->awb_mode_sel; ++ stAwbCtl.awb_veri_en = awbInfo->awb_veri_en; ++ stAwbCtl.awb_mode_sel = awbInfo->awb_mode_sel; + stAwbCtl.awb_value_save_en = awbInfo->awb_value_save_en; + stAwbCtl.awb_ccm_adp_adjust_en = awbInfo->awb_ccm_adp_adjust_en; +- stAwbCtl.awb_stab_en = awbInfo->awb_stab_en; ++ stAwbCtl.awb_stab_en = awbInfo->awb_stab_en; + stAwbCtl.awb_d65_red_gain = awbInfo->awb_d65_red_gain; + stAwbCtl.awb_d65_blue_gain = awbInfo->awb_d65_blue_gain; + stAwbCtl.ccm_rr_coff = awbInfo->ccm_coff[0][0]; +@@ -1120,16 +1120,16 @@ static int isp_f2k_core_SetAwbCtl(struct k510_isp_device *isp,AWB_INFO_S *awbInf + stAwbCtl.ccm_correct_coff = awbInfo->ccm_correct_coff; + stAwbCtl.awb_win_h_start = awbInfo->awb_win_size.h_start; + stAwbCtl.awb_win_v_start = awbInfo->awb_win_size.v_start; +- stAwbCtl.awb_win_h_end = awbInfo->awb_win_size.h_end; +- stAwbCtl.awb_win_v_end = awbInfo->awb_win_size.v_end; +- stAwbCtl.awb_correct_diff_th = awbInfo->awb_correct_diff_th; ++ stAwbCtl.awb_win_h_end = awbInfo->awb_win_size.h_end; ++ stAwbCtl.awb_win_v_end = awbInfo->awb_win_size.v_end; ++ stAwbCtl.awb_correct_diff_th = awbInfo->awb_correct_diff_th; + stAwbCtl.awb_color_changeres_time = awbInfo->awb_color_changeres_time; + stAwbCtl.awb_historgram_th = awbInfo->awb_historgram_th; +- stAwbCtl.awb_red_gain_adjust = awbInfo->awb_red_gain_adjust; +- stAwbCtl.awb_green_gain_adjust = awbInfo->awb_green_gain_adjust; ++ stAwbCtl.awb_red_gain_adjust = awbInfo->awb_red_gain_adjust; ++ stAwbCtl.awb_green_gain_adjust = awbInfo->awb_green_gain_adjust; + stAwbCtl.awb_blue_gain_adjust = awbInfo->awb_blue_gain_adjust; + stAwbCtl.awb_red_max_value = awbInfo->awb_red_max_value; +- stAwbCtl.awb_blue_max_value = awbInfo->awb_blue_max_value; ++ stAwbCtl.awb_blue_max_value = awbInfo->awb_blue_max_value; + stAwbCtl.awb_red_min_value = awbInfo->awb_red_min_value; + stAwbCtl.awb_blue_min_value = awbInfo->awb_blue_min_value; + stAwbCtl.awb_red_obj_value = awbInfo->awb_red_obj_value; +@@ -1137,29 +1137,50 @@ static int isp_f2k_core_SetAwbCtl(struct k510_isp_device *isp,AWB_INFO_S *awbInf + Isp_Drv_F2k_Core_SetAwbCtl(isp,&stAwbCtl); + return 0; + } ++ ++// reg opt ++ ++static int isp_f2k_core_RegSet(struct k510_isp_device *isp,struct k510isp_reg_val *reg_val) ++{ ++ ISP_CORE_REG_VAL_S stRegVal; ++ stRegVal.reg_addr = reg_val->reg_addr; ++ stRegVal.reg_value = reg_val->reg_value; ++ Isp_Drv_F2k_Core_SetReg(isp,&stRegVal); ++ return 0; ++} ++ ++static int isp_f2k_core_RegGet(struct k510_isp_device *isp,struct k510isp_reg_val *reg_val) ++{ ++ ISP_CORE_REG_VAL_S gtRegVal; ++ gtRegVal.reg_addr = reg_val->reg_addr; ++ Isp_Drv_F2k_Core_GetReg(isp,>RegVal); ++ reg_val->reg_value = gtRegVal.reg_value; ++ return 0; ++} ++ + //WDR + static int isp_f2k_core_SetWdrCtl(struct k510_isp_device *isp,struct isp_core_wdr_Info *wdrInfo) + { + + ISP_CORE_WDR_CTL_S stWdrCtl; +- stWdrCtl.wdr_fusion_en = wdrInfo->wdr_fusion_en; +- stWdrCtl.wdr_frame_sel = wdrInfo->wdr_frame_sel; +- stWdrCtl.wdr_adp_adjust_en = wdrInfo->wdr_adp_adjust_en; ++ stWdrCtl.wdr_fusion_en = wdrInfo->wdr_fusion_en; ++ stWdrCtl.wdr_frame_sel = wdrInfo->wdr_frame_sel; ++ stWdrCtl.wdr_adp_adjust_en = wdrInfo->wdr_adp_adjust_en; + stWdrCtl.wdr_stab_en = wdrInfo->wdr_stab_en; +- stWdrCtl.wdr_en = wdrInfo->wdr_en; +- stWdrCtl.wdr_ghost_remove_en = wdrInfo->wdr_ghost_remove_en; ++ stWdrCtl.wdr_en = wdrInfo->wdr_en; ++ stWdrCtl.wdr_ghost_remove_en = wdrInfo->wdr_ghost_remove_en; + stWdrCtl.wdr_3frame_out_mode = wdrInfo->wdr_3frame_out_mode; + stWdrCtl.wdr_mode_sel = wdrInfo->wdr_mode_sel; + stWdrCtl.wdr_2frame_ex_ratio = wdrInfo->wdr_2frame_ex_ratio; +- stWdrCtl.wdr_3frame_ex_ratio = wdrInfo->wdr_3frame_ex_ratio; +- stWdrCtl.wdr_stat_img_sel = wdrInfo->wdr_stat_img_sel; ++ stWdrCtl.wdr_3frame_ex_ratio = wdrInfo->wdr_3frame_ex_ratio; ++ stWdrCtl.wdr_stat_img_sel = wdrInfo->wdr_stat_img_sel; + stWdrCtl.wdr_ltm_data_sel = wdrInfo->wdr_ltm_data_sel; + stWdrCtl.wdr_tz_data_sel = wdrInfo->wdr_tz_data_sel; + stWdrCtl.wdr_remove_purple_en = wdrInfo->wdr_remove_purple_en; + stWdrCtl.wdr_over_ex_ratio_th1 = wdrInfo->wdr_over_ex_ratio_th1; + stWdrCtl.wdr_over_ex_ratio_th2 = wdrInfo->wdr_over_ex_ratio_th2; + stWdrCtl.wdr_fusion_ratio_th = wdrInfo->wdr_fusion_ratio_th; +- stWdrCtl.wdr_fusion_value1 = wdrInfo->wdr_fusion_value1; ++ stWdrCtl.wdr_fusion_value1 = wdrInfo->wdr_fusion_value1; + stWdrCtl.wdr_fusion_value2 = wdrInfo->wdr_fusion_value2; + Isp_Drv_F2k_Core_SetWdrCtl(isp,&stWdrCtl); + return 0; +@@ -1185,21 +1206,21 @@ static int isp_f2k_core_SetCscCtl(struct k510_isp_device *isp,CSC_INFO_S *cscInf + static int isp_f2k_core_SetAdaCtl(struct k510_isp_device *isp,ADA_INFO_S *adaInfo) + { + ISP_CORE_ADA_CTL_S stAdaCtl; +- stAdaCtl.ada_rgb_gamma_en = adaInfo->ada_rgb_gamma_en; +- stAdaCtl.ada_yuv_gamma_en = adaInfo->ada_yuv_gamma_en; +- stAdaCtl.ada_adjust_en = adaInfo->ada_adjust_en; ++ stAdaCtl.ada_rgb_gamma_en = adaInfo->ada_rgb_gamma_en; ++ stAdaCtl.ada_yuv_gamma_en = adaInfo->ada_yuv_gamma_en; ++ stAdaCtl.ada_adjust_en = adaInfo->ada_adjust_en; + stAdaCtl.ada_img_stab_en = adaInfo->ada_img_stab_en; + stAdaCtl.ada_ccr_en = adaInfo->ada_ccr_en; + stAdaCtl.ada_adp_en = adaInfo->ada_adp_en; +- stAdaCtl.ada_adp_ccr_en = adaInfo->ada_adp_ccr_en; ++ stAdaCtl.ada_adp_ccr_en = adaInfo->ada_adp_ccr_en; + stAdaCtl.ada_stat_mode_sel = adaInfo->ada_stat_mode_sel; + stAdaCtl.ada_enh_mode_sel = adaInfo->ada_enh_mode_sel; +- stAdaCtl.ada_stat_max_value = adaInfo->ada_stat_max_value; ++ stAdaCtl.ada_stat_max_value = adaInfo->ada_stat_max_value; + stAdaCtl.ada_ad_stren_max_value = adaInfo->ada_ad_stren_max_value; + stAdaCtl.ada_win_h_start = adaInfo->ada_win_size.h_start; + stAdaCtl.ada_win_v_start = adaInfo->ada_win_size.v_start; +- stAdaCtl.ada_win_h_end = adaInfo->ada_win_size.h_end; +- stAdaCtl.ada_win_v_end = adaInfo->ada_win_size.v_end; ++ stAdaCtl.ada_win_h_end = adaInfo->ada_win_size.h_end; ++ stAdaCtl.ada_win_v_end = adaInfo->ada_win_size.v_end; + Isp_Drv_F2k_Core_SetAdaCtl(isp,&stAdaCtl); + return 0; + } +@@ -1207,16 +1228,16 @@ static int isp_f2k_core_SetAdaCtl(struct k510_isp_device *isp,ADA_INFO_S *adaInf + static int isp_f2k_core_SetRgbirCtl(struct k510_isp_device *isp,RGBIR_INFO_S *rgbirInfo) + { + ISP_CORE_RGBIR_CTL_S stRgbirCtl; +- stRgbirCtl.rgbir_en = rgbirInfo->rgbir_en; +- stRgbirCtl.rgbir_rtf_en = rgbirInfo->rgbir_rtf_en; +- stRgbirCtl.rgbir_rpc_en = rgbirInfo->rgbir_rpc_en; ++ stRgbirCtl.rgbir_en = rgbirInfo->rgbir_en; ++ stRgbirCtl.rgbir_rtf_en = rgbirInfo->rgbir_rtf_en; ++ stRgbirCtl.rgbir_rpc_en = rgbirInfo->rgbir_rpc_en; + stRgbirCtl.rgbir_fusion_en = rgbirInfo->rgbir_fusion_en; + stRgbirCtl.rgbir_output_sel = rgbirInfo->rgbir_output_sel; +- stRgbirCtl.rgbir_rpc_max_value = rgbirInfo->rgbir_rpc_max_value; ++ stRgbirCtl.rgbir_rpc_max_value = rgbirInfo->rgbir_rpc_max_value; + stRgbirCtl.rgbir_rpc_color_coff = rgbirInfo->rgbir_rpc_color_coff; +- stRgbirCtl.rgbir_rpc_luma_coff = rgbirInfo->rgbir_rpc_luma_coff; ++ stRgbirCtl.rgbir_rpc_luma_coff = rgbirInfo->rgbir_rpc_luma_coff; + stRgbirCtl.rgbir_rpc_th = rgbirInfo->rgbir_rpc_th; +- stRgbirCtl.rgbir_rpc_th1 = rgbirInfo->rgbir_rpc_th1; ++ stRgbirCtl.rgbir_rpc_th1 = rgbirInfo->rgbir_rpc_th1; + Isp_Drv_F2k_Core_SetRgbIrCtl(isp,&stRgbirCtl); + return 0; + } +@@ -1226,13 +1247,13 @@ static int isp_f2k_core_Set2dnrCtl(struct k510_isp_device *isp,NR2D_INFO_S *nr2d + ISP_CORE_2DNR_CTL_S st2dnrCtl; + st2dnrCtl.core_2dnr_pcf_en = nr2dInfo->d2nr_pcf_en; + st2dnrCtl.core_2dnr_raw_en = nr2dInfo->d2nr_raw_en; +- st2dnrCtl.core_2dnr_edge_en = nr2dInfo->d2nr_edge_en; ++ st2dnrCtl.core_2dnr_edge_en = nr2dInfo->d2nr_edge_en; + st2dnrCtl.core_2dnr_bap_en = nr2dInfo->d2nr_bap_en; +- st2dnrCtl.core_2dnr_luma_en = nr2dInfo->d2nr_luma_en; +- st2dnrCtl.core_2dnr_chroma_en = nr2dInfo->d2nr_chroma_en; +- st2dnrCtl.core_2dnr_pcf_adp_en = nr2dInfo->d2nr_pcf_adp_en; +- st2dnrCtl.core_2dnr_raw_adp_en = nr2dInfo->d2nr_raw_adp_en; +- st2dnrCtl.core_2dnr_luma_adp_en = nr2dInfo->d2nr_luma_adp_en; ++ st2dnrCtl.core_2dnr_luma_en = nr2dInfo->d2nr_luma_en; ++ st2dnrCtl.core_2dnr_chroma_en = nr2dInfo->d2nr_chroma_en; ++ st2dnrCtl.core_2dnr_pcf_adp_en = nr2dInfo->d2nr_pcf_adp_en; ++ st2dnrCtl.core_2dnr_raw_adp_en = nr2dInfo->d2nr_raw_adp_en; ++ st2dnrCtl.core_2dnr_luma_adp_en = nr2dInfo->d2nr_luma_adp_en; + st2dnrCtl.core_2dnr_chroma_adp_en = nr2dInfo->d2nr_chroma_adp_en; + st2dnrCtl.core_2dnr_raw_intensity = nr2dInfo->d2nr_raw_intensity; + st2dnrCtl.core_2dnr_bap_intensity = nr2dInfo->d2nr_bap_intensity; +@@ -1246,32 +1267,32 @@ static int isp_f2k_core_Set2dnrCtl(struct k510_isp_device *isp,NR2D_INFO_S *nr2d + static int isp_f2k_core_Set3dnrCtl(struct k510_isp_device *isp,NR3D_INFO_S *nr3dInfo) + { + ISP_CORE_3DNR_CTL_S st3dnrCtl; +- st3dnrCtl.core_3dnr_en = nr3dInfo->d3nr_en; +- st3dnrCtl.core_3dnr_pre_luma_en = nr3dInfo->d3nr_pre_luma_en; +- st3dnrCtl.core_3dnr_pre_chroma_en = nr3dInfo->d3nr_pre_chroma_en; ++ st3dnrCtl.core_3dnr_en = nr3dInfo->d3nr_en; ++ st3dnrCtl.core_3dnr_pre_luma_en = nr3dInfo->d3nr_pre_luma_en; ++ st3dnrCtl.core_3dnr_pre_chroma_en = nr3dInfo->d3nr_pre_chroma_en; + st3dnrCtl.core_3dnr_main_luma_en = nr3dInfo->d3nr_main_luma_en; + st3dnrCtl.core_3dnr_main_chroma_en = nr3dInfo->d3nr_main_chroma_en; +- st3dnrCtl.core_3dnr_post_luma_en = nr3dInfo->d3nr_post_luma_en; ++ st3dnrCtl.core_3dnr_post_luma_en = nr3dInfo->d3nr_post_luma_en; + st3dnrCtl.core_3dnr_post_chroma_en = nr3dInfo->d3nr_post_chroma_en; + st3dnrCtl.core_3dnr_2d_luma_en = nr3dInfo->d3nr_2d_luma_en; + st3dnrCtl.core_3dnr_2d_chroma_en = nr3dInfo->d3nr_2d_luma_en; +- st3dnrCtl.core_3dnr_wb_en = nr3dInfo->d3nr_wb_en; ++ st3dnrCtl.core_3dnr_wb_en = nr3dInfo->d3nr_wb_en; + st3dnrCtl.core_3dnr_wb_sel = nr3dInfo->d3nr_wb_sel; + st3dnrCtl.core_3dnr_adp_luma_en = nr3dInfo->d3nr_adp_luma_en; + st3dnrCtl.core_3dnr_adp_chroma_en = nr3dInfo->d3nr_adp_chroma_en; +- st3dnrCtl.core_3dnr_pre_luma_th = nr3dInfo->d3nr_pre_luma_th; +- st3dnrCtl.core_3dnr_pre_luma_intensity = nr3dInfo->d3nr_pre_luma_intensity; ++ st3dnrCtl.core_3dnr_pre_luma_th = nr3dInfo->d3nr_pre_luma_th; ++ st3dnrCtl.core_3dnr_pre_luma_intensity = nr3dInfo->d3nr_pre_luma_intensity; + st3dnrCtl.core_3dnr_pre_chroma_intensity = nr3dInfo->d3nr_pre_chroma_intensity; + st3dnrCtl.core_3dnr_mid_filter_th = nr3dInfo->d3nr_mid_filter_th; +- st3dnrCtl.core_3dnr_pre_mid_filter_th = nr3dInfo->d3nr_pre_mid_filter_th; +- st3dnrCtl.core_3dnr_cur_mid_filter_th = nr3dInfo->d3nr_cur_mid_filter_th; ++ st3dnrCtl.core_3dnr_pre_mid_filter_th = nr3dInfo->d3nr_pre_mid_filter_th; ++ st3dnrCtl.core_3dnr_cur_mid_filter_th = nr3dInfo->d3nr_cur_mid_filter_th; + st3dnrCtl.core_3dnr_low_pass_filter_th = nr3dInfo->d3nr_low_pass_filter_th; +- st3dnrCtl.core_3dnr_luma_th = nr3dInfo->d3nr_luma_th; ++ st3dnrCtl.core_3dnr_luma_th = nr3dInfo->d3nr_luma_th; + st3dnrCtl.core_3dnr_min_value = nr3dInfo->d3nr_min_value; + st3dnrCtl.core_3dnr_luma_intensity = nr3dInfo->d3nr_luma_intensity; +- st3dnrCtl.core_3dnr_chroma_intensity = nr3dInfo->d3nr_chroma_intensity; +- st3dnrCtl.core_3dnr_post_edge_th = nr3dInfo->d3nr_post_edge_th; +- st3dnrCtl.core_3dnr_post_luma_intensity = nr3dInfo->d3nr_post_luma_intensity; ++ st3dnrCtl.core_3dnr_chroma_intensity = nr3dInfo->d3nr_chroma_intensity; ++ st3dnrCtl.core_3dnr_post_edge_th = nr3dInfo->d3nr_post_edge_th; ++ st3dnrCtl.core_3dnr_post_luma_intensity = nr3dInfo->d3nr_post_luma_intensity; + st3dnrCtl.core_3dnr_post_chroma_intensity = nr3dInfo->d3nr_post_chroma_intensity; + Isp_Drv_F2k_Core_Set3DnrCtl(isp,&st3dnrCtl); + return 0; +@@ -1281,17 +1302,17 @@ static int isp_f2k_core_SetEnhCtl(struct k510_isp_device *isp,ENH_INFO_S *enhInf + { + ISP_CORE_ENH_CTL_S stEnhCtl; + stEnhCtl.enh_ltm_en = enhInfo->enh_ltm_en; +- stEnhCtl.enh_sharp_en = enhInfo->enh_sharp_en; +- stEnhCtl.enh_cc_en = enhInfo->enh_cc_en; +- stEnhCtl.enh_adp_ltm_en = enhInfo->enh_adp_ltm_en; +- stEnhCtl.enh_adp_sharp_en = enhInfo->enh_adp_sharp_en; +- stEnhCtl.enh_adp_cc_en = enhInfo->enh_adp_cc_en; +- stEnhCtl.ltm_gain = enhInfo->ltm_gain; +- stEnhCtl.ltm_th = enhInfo->ltm_th; +- stEnhCtl.enh_nr_th = enhInfo->enh_nr_th; ++ stEnhCtl.enh_sharp_en = enhInfo->enh_sharp_en; ++ stEnhCtl.enh_cc_en = enhInfo->enh_cc_en; ++ stEnhCtl.enh_adp_ltm_en = enhInfo->enh_adp_ltm_en; ++ stEnhCtl.enh_adp_sharp_en = enhInfo->enh_adp_sharp_en; ++ stEnhCtl.enh_adp_cc_en = enhInfo->enh_adp_cc_en; ++ stEnhCtl.ltm_gain = enhInfo->ltm_gain; ++ stEnhCtl.ltm_th = enhInfo->ltm_th; ++ stEnhCtl.enh_nr_th = enhInfo->enh_nr_th; + stEnhCtl.enh_th1 = enhInfo->enh_th1; + stEnhCtl.enh_th2 = enhInfo->enh_th2; +- stEnhCtl.sharp_gain = enhInfo->sharp_gain; ++ stEnhCtl.sharp_gain = enhInfo->sharp_gain; + Isp_Drv_F2k_Core_SetEnhLtmCtl(isp,&stEnhCtl); + Isp_Drv_F2k_Core_SetEnhCCCtl(isp,&stEnhCtl); + Isp_Drv_F2k_Core_SetEnhSharpenCtl(isp,&stEnhCtl); +@@ -1301,10 +1322,10 @@ static int isp_f2k_core_SetEnhCtl(struct k510_isp_device *isp,ENH_INFO_S *enhInf + static int isp_f2k_core_SetPostCtl(struct k510_isp_device *isp,POST_INFO_S *postInfo) + { + ISP_CORE_POST_CTL_S stPostCtl; +- stPostCtl.post_cont_ad_en = postInfo->post_cont_ad_en; +- stPostCtl.post_luma_ad_en = postInfo->post_luma_ad_en; ++ stPostCtl.post_cont_ad_en = postInfo->post_cont_ad_en; ++ stPostCtl.post_luma_ad_en = postInfo->post_luma_ad_en; + stPostCtl.post_satu_ad_en = postInfo->post_satu_ad_en; +- stPostCtl.cont_ad_intensity = postInfo->cont_ad_intensity; ++ stPostCtl.cont_ad_intensity = postInfo->cont_ad_intensity; + stPostCtl.luma_ad_intensity = postInfo->luma_ad_intensity; + stPostCtl.satu_ad_intensity = postInfo->satu_ad_intensity; + Isp_Drv_F2k_Core_SetPostContCtl(isp,&stPostCtl); +@@ -1317,14 +1338,14 @@ static int isp_f2k_core_SetOtcCtl(struct k510_isp_device *isp,OTC_INFO_S *otcInf + { + ISP_CORE_OTC_CTL_S stOtcCtl; + stOtcCtl.post_otc_en = otcInfo->post_otc_en; +- stOtcCtl.otc_yc_sel = otcInfo->otc_yc_sel; +- stOtcCtl.otc_uv_format_sel = otcInfo->otc_uv_format_sel; +- stOtcCtl.otc_hsync_pol_sel = otcInfo->otc_hsync_pol_sel; +- stOtcCtl.otc_vsync_pol_sel = otcInfo->otc_vsync_pol_sel; +- stOtcCtl.otc_stt_vr = otcInfo->otc_out_size.Width_st; +- stOtcCtl.otc_stt_hr = otcInfo->otc_out_size.Height_st; +- stOtcCtl.otc_height = otcInfo->otc_out_size.Height; +- stOtcCtl.otc_width = otcInfo->otc_out_size.Width; ++ stOtcCtl.otc_yc_sel = otcInfo->otc_yc_sel; ++ stOtcCtl.otc_uv_format_sel = otcInfo->otc_uv_format_sel; ++ stOtcCtl.otc_hsync_pol_sel = otcInfo->otc_hsync_pol_sel; ++ stOtcCtl.otc_vsync_pol_sel = otcInfo->otc_vsync_pol_sel; ++ stOtcCtl.otc_stt_vr = otcInfo->otc_out_size.Width_st; ++ stOtcCtl.otc_stt_hr = otcInfo->otc_out_size.Height_st; ++ stOtcCtl.otc_height = otcInfo->otc_out_size.Height; ++ stOtcCtl.otc_width = otcInfo->otc_out_size.Width; + Isp_Drv_F2k_Core_SetOtcCtl(isp,&stOtcCtl); + return 0; + } +@@ -1332,14 +1353,14 @@ static int isp_f2k_core_SetOtcCtl(struct k510_isp_device *isp,OTC_INFO_S *otcInf + static int isp_f2k_core_SetLdcCtl(struct k510_isp_device *isp,LDC_INFO_S *ldcInfo) + { + ISP_CORE_LDC_CTL_S stLdcCtl; +- stLdcCtl.ldc_en = ldcInfo->ldc_en; +- stLdcCtl.ldc_arith_en = ldcInfo->ldc_arith_en; ++ stLdcCtl.ldc_en = ldcInfo->ldc_en; ++ stLdcCtl.ldc_arith_en = ldcInfo->ldc_arith_en; + stLdcCtl.ldc_req_freq = ldcInfo->ldc_req_freq; + stLdcCtl.ldc_stt_ln = ldcInfo->ldc_stt_ln; + stLdcCtl.ldc_h_center_pos = ldcInfo->ldc_h_center_pos; + stLdcCtl.ldc_v_center_pos = ldcInfo->ldc_v_center_pos; + stLdcCtl.ldc_rectify_cr = ldcInfo->ldc_rectify_cr; +- stLdcCtl.ldc_rectify_cz = ldcInfo->ldc_rectify_cz; ++ stLdcCtl.ldc_rectify_cz = ldcInfo->ldc_rectify_cz; + Isp_Drv_F2k_Core_SetLdcCtl(isp,&stLdcCtl); + return 0; + } +@@ -1347,11 +1368,11 @@ static int isp_f2k_core_SetLdcCtl(struct k510_isp_device *isp,LDC_INFO_S *ldcInf + static int isp_f2k_core_SetAfCtl(struct k510_isp_device *isp,AF_INFO_S *afInfo) + { + ISP_CORE_AF_CTL_S stAfCtl; +- stAfCtl.af_stat_en = afInfo->af_stat_en; +- stAfCtl.af_stat_mode_sel= afInfo->af_stat_mode_sel; +- stAfCtl.af_stat_win_h_start= afInfo->af_win_size.h_start; +- stAfCtl.af_stat_win_v_start= afInfo->af_win_size.v_start; +- stAfCtl.af_stat_win_h_end= afInfo->af_win_size.h_end; ++ stAfCtl.af_stat_en = afInfo->af_stat_en; ++ stAfCtl.af_stat_mode_sel= afInfo->af_stat_mode_sel; ++ stAfCtl.af_stat_win_h_start= afInfo->af_win_size.h_start; ++ stAfCtl.af_stat_win_v_start= afInfo->af_win_size.v_start; ++ stAfCtl.af_stat_win_h_end= afInfo->af_win_size.h_end; + stAfCtl.af_stat_win_v_end= afInfo->af_win_size.v_end; + Isp_Drv_F2k_Core_SetAfCtl(isp,&stAfCtl); + return 0; +@@ -1421,7 +1442,7 @@ static int isp_f2k_core_SetFbd(struct k510_isp_device *isp,FBD_INFO_S *fbdInfo) + FBCD_BUF_S *yDataBufInfo = &fbdInfo->yDataBufInfo; + stIspFbdYBuf->fbd_y_data_buf_base0 = yDataBufInfo->data_buf_base0; + stIspFbdYBuf->fbd_y_data_buf_base0 = yDataBufInfo->data_buf_base1; +- stIspFbdYBuf->fbd_y_data_stride = yDataBufInfo->data_stride; ++ stIspFbdYBuf->fbd_y_data_stride = yDataBufInfo->data_stride; + FBCD_BUF_S *yHeadBufInfo = &fbdInfo->yHeadBufInfo; + stIspFbdYBuf->fbd_y_head_buf_base0 = yHeadBufInfo->data_buf_base0; + stIspFbdYBuf->fbd_y_head_buf_base1 = yHeadBufInfo->data_buf_base1; +@@ -1435,7 +1456,7 @@ static int isp_f2k_core_SetFbd(struct k510_isp_device *isp,FBD_INFO_S *fbdInfo) + stIspFbdYLBuf->fbd_yl_head_buf_base0 = ylHeadBufInfo->data_buf_base0; + stIspFbdYLBuf->fbd_yl_head_buf_base1 = ylHeadBufInfo->data_buf_base1; + stIspFbdYLBuf->fbd_yl_head_stride = ylHeadBufInfo->data_stride; +- ISP_FBD_UV_BUF_S *stIspFbdUVBuf = &stIspFbdBuf->stIspFbdUVBuf; ++ ISP_FBD_UV_BUF_S *stIspFbdUVBuf = &stIspFbdBuf->stIspFbdUVBuf; + FBCD_BUF_S *uvDataBufInfo = &fbdInfo->uvDataBufInfo; + stIspFbdUVBuf->fbd_uv_data_buf_base0 = uvDataBufInfo->data_buf_base0; + stIspFbdUVBuf->fbd_uv_data_buf_base1 = uvDataBufInfo->data_buf_base1; +@@ -1541,7 +1562,7 @@ void isp_f2k_ds_SetInputSize(struct k510_isp_device *isp,IMAGE_SIZE *dsInSizeInf + } + // + void isp_f2k_ds_SetRgb2YuvCoff(struct k510_isp_device *isp) +-{ ++{ + unsigned int osd_rgb2yuv_coeff[3][4]; + osd_rgb2yuv_coeff[0][0]= 0x00000132; + osd_rgb2yuv_coeff[0][1]= 0x00000259; +@@ -1559,7 +1580,7 @@ void isp_f2k_ds_SetRgb2YuvCoff(struct k510_isp_device *isp) + } + // + void isp_f2k_ds_SetYuv2RgbCoff(struct k510_isp_device *isp) +-{ ++{ + unsigned int osd_yuv2rgb_coeff[3][4]; + osd_yuv2rgb_coeff[0][0] = 0x00000400; + osd_yuv2rgb_coeff[0][1] = 0x00000000; +@@ -1626,15 +1647,15 @@ void isp_f2k_ds_SetSingleDS(struct k510_isp_device *isp,unsigned int u8Index,str + stDsFormat->out_rgb_mode = dsInfo->out_rgb_mode; + stDsFormat->out_yuv_mode = dsInfo->out_yuv_mode; + stDsFormat->out_uv_swap = dsInfo->out_uv_swap; +- unsigned int osdIndex = 0; ++ unsigned int osdIndex = 0; + ISP_DS_OSD_ATTR_S *stDsOsdAttr = &stDsAttr.DsOsdAttr[osdIndex]; + ISP_OSD_INFO_S *osdInfo = &dsInfo->osdInfo[osdIndex]; + isp_f2k_ds_SetOSD(stDsOsdAttr,osdInfo); +- osdIndex = 1; ++ osdIndex = 1; + stDsOsdAttr = &stDsAttr.DsOsdAttr[osdIndex]; + osdInfo = &dsInfo->osdInfo[osdIndex]; + isp_f2k_ds_SetOSD(stDsOsdAttr,osdInfo); +- osdIndex = 2; ++ osdIndex = 2; + stDsOsdAttr = &stDsAttr.DsOsdAttr[osdIndex]; + osdInfo = &dsInfo->osdInfo[osdIndex]; + isp_f2k_ds_SetOSD(stDsOsdAttr,osdInfo); +@@ -1685,7 +1706,7 @@ void isp_f2k_config(struct k510_isp_device *isp,struct isp_cfg_info *isp_cfg) + GFP_KERNEL); + if (nr3d_dma_new.addr == NULL) + return -ENOMEM; +- ++ + nr3d_dma_old = isp->isp_f2k.nr3d_dma; + isp->isp_f2k.nr3d_dma = nr3d_dma_new; + +@@ -1696,7 +1717,7 @@ void isp_f2k_config(struct k510_isp_device *isp,struct isp_cfg_info *isp_cfg) + isp_wrap_cfg->nr3dInfo.nr3d_y_line_stride = (isp_core_cfg->itcInfo.itc_size.Width + 15)/16*16*12/8;//0xb40; + isp_wrap_cfg->nr3dInfo.nr3d_uv_line_stride = (isp_core_cfg->itcInfo.itc_size.Width + 15)/16*16;//0x780; + isp_wrap_cfg->nr3dInfo.nr3d_y_buf_base = nr3d_dma_new.dma; +- isp_wrap_cfg->nr3dInfo.nr3d_uv_buf_base = nr3d_dma_new.dma + isp_wrap_cfg->nr3dInfo.nr3d_y_line_stride * isp_core_cfg->itcInfo.itc_size.Height; ++ isp_wrap_cfg->nr3dInfo.nr3d_uv_buf_base = nr3d_dma_new.dma + isp_wrap_cfg->nr3dInfo.nr3d_y_line_stride * isp_core_cfg->itcInfo.itc_size.Height; + } + // + isp_f2k_core_config(f2k,isp_core_cfg); +@@ -1727,7 +1748,7 @@ static void isp_f2k_set_fbc_outaddr(struct isp_f2k_device *f2k, u32 addr) + addr = addr+1920*1080; + isp_reg_writel(isp,addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_MAIN_UV_BUF0_BASE); + isp_reg_writel(isp,addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_MAIN_UV_BUF1_BASE); +- isp_reg_writel(isp,0x30001,ISP_IOMEM_F2K_WRAP,ISP_WRAP_CONFIG_DONE); ++ isp_reg_writel(isp,0x30001,ISP_IOMEM_F2K_WRAP,ISP_WRAP_CONFIG_DONE); + } + + /* +@@ -1749,7 +1770,7 @@ static void isp_f2k_set_main_outaddr(struct isp_f2k_device *f2k, u32 addr) + __func__,main_info->main_line_stride,main_info->main_size.Width,main_info->main_size.Height); + addr = addr + main_info->main_line_stride*main_info->main_size.Height;//1920*1080; + isp_reg_writel(isp,addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_MAIN_UV_BUF0_BASE); +- isp_reg_writel(isp,addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_MAIN_UV_BUF1_BASE); ++ isp_reg_writel(isp,addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_MAIN_UV_BUF1_BASE); + isp_reg_writel(isp,0x30001,ISP_IOMEM_F2K_WRAP,ISP_WRAP_CONFIG_DONE); + } + +@@ -1765,7 +1786,7 @@ static void isp_f2k_set_out0_outaddr(struct isp_f2k_device *f2k, u32 addr) + struct k510_isp_device *isp = to_isp_device(f2k); + struct isp_wrap_cfg_info *isp_wrap_cfg = &f2k->isp_cfg.isp_wrap_cfg; + struct isp_wrap_ds0_info *ds0_info = &isp_wrap_cfg->ds0Info; +- ++ + #ifdef SET_DIFF_BUFF + if((f2k->pingpong[DS0_VIDEO]%2) == 0) + { +@@ -1777,7 +1798,7 @@ static void isp_f2k_set_out0_outaddr(struct isp_f2k_device *f2k, u32 addr) + { + isp_reg_writel(isp,addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_DS0_Y_BUF1_BASE); + addr = addr + ds0_info->ds0_line_stride*ds0_info->ds0_size.Height;//1920*1080; +- isp_reg_writel(isp,addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_DS0_UV_BUF1_BASE); ++ isp_reg_writel(isp,addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_DS0_UV_BUF1_BASE); + } + f2k->pingpong[DS0_VIDEO]++; + isp_reg_writel(isp,0x30001,ISP_IOMEM_F2K_WRAP,ISP_WRAP_CONFIG_DONE); //fix split screen +@@ -1812,7 +1833,7 @@ static void isp_f2k_set_out1_outaddr(struct isp_f2k_device *f2k, u32 addr) + addr = addr + ds1_info->ds1_line_stride*ds1_info->ds1_size.Height;//1920*1080; + isp_reg_writel(isp,addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_DS1_UV_BUF0_BASE); + isp_reg_writel(isp,addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_DS1_UV_BUF1_BASE); +- isp_reg_writel(isp,0x30001,ISP_IOMEM_F2K_WRAP,ISP_WRAP_CONFIG_DONE); ++ isp_reg_writel(isp,0x30001,ISP_IOMEM_F2K_WRAP,ISP_WRAP_CONFIG_DONE); + } + + /* +@@ -1832,20 +1853,20 @@ static void isp_f2k_set_out2_outaddr(struct isp_f2k_device *f2k, u32 addr) + // + //dev_dbg(f2k->isp->dev,"%s:line_stride (%d),Width(%d),Height(%d) addr(0x%x)\n",\ + __func__,ds2_info->ds2_line_stride,ds2_info->ds2_size.Width,height,addr); +- r_addr = addr; ++ r_addr = addr; + isp_reg_writel(isp,r_addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_DS2_R_BUF0_BASE); + isp_reg_writel(isp,r_addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_DS2_R_BUF1_BASE); + + if( DS2_S_RGB == ds2_info->ds2_out_img_out_format) + g_addr = r_addr + ds2_info->ds2_line_stride * height; +- else ++ else + g_addr = r_addr + ds2_info->ds2_line_stride/4*2; + isp_reg_writel(isp,g_addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_DS2_G_BUF0_BASE); + isp_reg_writel(isp,g_addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_DS2_G_BUF1_BASE); + // + if( DS2_S_RGB == ds2_info->ds2_out_img_out_format) + b_addr = g_addr + ds2_info->ds2_line_stride * height; +- else ++ else + b_addr = g_addr + ds2_info->ds2_line_stride/4*3; + isp_reg_writel(isp,b_addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_DS2_B_BUF0_BASE); + isp_reg_writel(isp,b_addr,ISP_IOMEM_F2K_WRAP,ISP_WRAP_DS2_B_BUF1_BASE); +@@ -2024,13 +2045,13 @@ static void isp_f2k_core_print_status(struct isp_f2k_device *f2k) + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_IMAGE_H_START ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_IMAGE_ACTIVE_WIDTH ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_IMAGE_ACTIVE_HEIGHT ); +- //tpg ++ //tpg + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_TEST_CTL ); +- //blc ++ //blc + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_BLC_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_BLC_OFFSET ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_BLC_RATIO ); +- //lsc ++ //lsc + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_H_CENTER ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_V_CENTER ); +@@ -2038,7 +2059,7 @@ static void isp_f2k_core_print_status(struct isp_f2k_device *f2k) + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_G_RATIO ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_B_RATIO ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_IR_RATIO ); +- //ae ++ //ae + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_WIN_H_START ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_WIN_V_START ); +@@ -2060,7 +2081,7 @@ static void isp_f2k_core_print_status(struct isp_f2k_device *f2k) + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_GAIN_MIN ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_DN_SWITCH_ADJUST_STEP_MAX); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_DN_SWITCH_WAIT_TIME ); +- ++ + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_DIFF_MAX ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_DRV_SIGNAL_MAX ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_COEFF_DIS ); +@@ -2068,7 +2089,7 @@ static void isp_f2k_core_print_status(struct isp_f2k_device *f2k) + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_COEFF_ACCE ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_DRV_MANUAL_VALUE ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_DAMP_MANUAL_VALUE ); +- ++ + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_VALUE_READY ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_LONG_CUR_EX ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_MID_CUR_EX ); +@@ -2079,7 +2100,7 @@ static void isp_f2k_core_print_status(struct isp_f2k_device *f2k) + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_EX_STATUS ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_SUM ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_PIXEL_SUM ); +- //awb ++ //awb + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_D65_RED_GAIN ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_D65_BLUE_GAIN ); +@@ -2123,14 +2144,14 @@ static void isp_f2k_core_print_status(struct isp_f2k_device *f2k) + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_ORG_RED_VALUE ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_ORG_GREEN_VALUE ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_ORG_BLUE_VALUE ); +- //wdr ++ //wdr + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_WDR_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_WDR_OVER_EX_RATIO_TH1 ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_WDR_OVER_EX_RATIO_TH2 ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_WDR_FUSION_RATIO_TH ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_WDR_FUSION_VALUE1 ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_WDR_FUSION_VALUE2 ); +- //csc ++ //csc + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_00 ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_01 ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_02 ); +@@ -2140,7 +2161,7 @@ static void isp_f2k_core_print_status(struct isp_f2k_device *f2k) + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_20 ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_21 ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_22 ); +- //ada ++ //ada + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_STAT_MAX_VALUE ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_AD_STREN_MAX_VALUE ); +@@ -2148,21 +2169,21 @@ static void isp_f2k_core_print_status(struct isp_f2k_device *f2k) + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_WIN_V_START ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_WIN_H_END ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_WIN_V_END ); +- //rgbir ++ //rgbir + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_RPC_MAX_VALUE ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_RPC_COLOR_COFF ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_RPC_LUMA_COFF ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_RPC_TH ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_RPC_TH1 ); +- //2dnr ++ //2dnr + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_RAW_INTENSITY ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_BAP_INTENSITY ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_EDGE_INTENSITY ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_LUMA_INTENSITY ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_CHROMA_INTENSITY ); +- //3dnr ++ //3dnr + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_3DNR_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_3DNR_PRE_LUMA_TH ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_3DNR_PRE_LUMA_INTENSITY ); +@@ -2178,7 +2199,7 @@ static void isp_f2k_core_print_status(struct isp_f2k_device *f2k) + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_3DNR_POST_EDGE_TH ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_3DNR_POST_LUMA_INTENSITY ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_3DNR_POST_CHROMA_INTENSITY ); +- //enh ++ //enh + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ENH_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LTM_GAIN ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LTM_TH ); +@@ -2186,28 +2207,28 @@ static void isp_f2k_core_print_status(struct isp_f2k_device *f2k) + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ENH_TH1 ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ENH_TH2 ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_SHARP_GAIN ); +- //post ++ //post + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_POST_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CONT_GAIN ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LUMA_GAIN ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_SATU_GAIN ); +- //otc ++ //otc + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_OTC_STT_VR ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_OTC_STT_HR ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_OTC_HEIGHT ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_OTC_WIDTH ); +- //ldc ++ //ldc + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_REQ_FREQ ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_H_CENTER_POS ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_V_CENTER_POS ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_RECTIFY_CR ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_RECTIFY_CZ ); +- //ram table ++ //ram table + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RAM_WR_STATUS ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RAM_RD_STATUS ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RAM_READ_LOCK ); +- //af ++ //af + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AF_CTL ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AF_STAT_WIN_H_START ); + ISP_F2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AF_STAT_WIN_V_START ); +@@ -2398,32 +2419,32 @@ static void isp_3dnr_mfbc_print_status(struct isp_f2k_device *f2k) + dev_dbg(isp->dev, "-------------ISP 3DNR MFBC Register dump start----------\n"); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_INPUT_SIZE ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_OUT_FORMAT ); +- ++ + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_Y_DATA_BUF_BASE0 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_Y_DATA_BUF_BASE1 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_Y_DATA_LINE_STRIDE ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_Y_DATA_WR_BLEN ); +- ++ + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_Y_HEAD_BUF_BASE0 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_Y_HEAD_BUF_BASE1 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_Y_HEAD_LINE_STRIDE ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_Y_HEAD_WR_BLEN ); +- ++ + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_UV_DATA_BUF_BASE0 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_UV_DATA_BUF_BASE1 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_UV_DATA_LINE_STRIDE ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_UV_DATA_WR_BLEN ); +- ++ + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_UV_HEAD_BUF_BASE0 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_UV_HEAD_BUF_BASE1 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_UV_HEAD_LINE_STRIDE ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_UV_HEAD_WR_BLEN ); +- ++ + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_YL_DATA_BUF_BASE0 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_YL_DATA_BUF_BASE1 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_YL_DATA_LINE_STRIDE ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_YL_DATA_WR_BLEN ); +- ++ + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_YL_HEAD_BUF_BASE0 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_YL_HEAD_BUF_BASE1 ); + ISP_3DNR_MFBC_PRINT_REGISTER(isp,ISP_FBC_YL_HEAD_LINE_STRIDE ); +@@ -2588,39 +2609,39 @@ static void isp_f2k_remap_print_status(struct isp_f2k_device *f2k) + ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_30_1_CTRL); + ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_0_CTRL); + ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_1_CTRL); +- +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); ++ ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); + ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_19_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); +- ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); ++ ISP_F2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); + dev_dbg(isp->dev, "-------------ISP F2K MAIN REMAP Register dump end----------\n"); + // + dev_dbg(isp->dev, "-------------ISP F2K OUT0 REMAP Register dump start----------\n"); +@@ -2688,39 +2709,39 @@ static void isp_f2k_remap_print_status(struct isp_f2k_device *f2k) + ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_30_1_CTRL); + ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_0_CTRL); + ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_1_CTRL); +- +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); ++ ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); + ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_19_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); +- ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); ++ ISP_F2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); + dev_dbg(isp->dev, "-------------ISP F2K OUT0 REMAP Register dump end----------\n"); + // + dev_dbg(isp->dev, "-------------ISP F2K OUT1 REMAP Register dump start----------\n"); +@@ -2788,39 +2809,39 @@ static void isp_f2k_remap_print_status(struct isp_f2k_device *f2k) + ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_30_1_CTRL); + ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_0_CTRL); + ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_1_CTRL); +- +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); ++ ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); + ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_19_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); +- ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); ++ ISP_F2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); + dev_dbg(isp->dev, "-------------ISP F2K OUT1 REMAP Register dump end----------\n"); + } + /* ----------------------------------------------------------------------------- +@@ -2835,7 +2856,7 @@ static void video_buffer_next(struct isp_f2k_device *f2k, enum video_type dsNum) + unsigned long flags; + int drop=0; + struct isp_cfg_info *isp_cfg = &f2k->isp_cfg; +- ++ + dev_dbg(video->isp->dev,"%s:start\n",__func__); + spin_lock_irqsave(&video->irqlock, flags); + if (WARN_ON(list_empty(&video->dmaqueue))) { +@@ -2844,7 +2865,7 @@ static void video_buffer_next(struct isp_f2k_device *f2k, enum video_type dsNum) + if(isp_cfg->isp_wrap_cfg.ds0Info.ds0_out_en == 0 && dsNum == DS0_VIDEO) + { + return; +- } ++ } + f2k->profile.no_buf_drop_cnt++; + return; + } +@@ -2854,15 +2875,15 @@ static void video_buffer_next(struct isp_f2k_device *f2k, enum video_type dsNum) + if(isp_cfg->isp_wrap_cfg.ds0Info.ds0_out_en == 0 && dsNum == DS0_VIDEO) + { + return; +- } ++ } + f2k->profile.no_buf_drop_cnt++; + return; + } + +- buf = list_first_entry(&video->dmaqueue, struct k510isp_buffer, irqlist); ++ buf = list_first_entry(&video->dmaqueue, struct k510isp_buffer, irqlist); + + if(f2k->profile.drop_threshold > 0LL && f2k->profile.buf_set_time[dsNum] != 0) +- { ++ { + unsigned long long delta; + delta = get_usec() - f2k->profile.buf_set_time[dsNum]; + if(delta > f2k->profile.drop_threshold) +@@ -2881,7 +2902,7 @@ static void video_buffer_next(struct isp_f2k_device *f2k, enum video_type dsNum) + list_del(&buf->irqlist); + next_buf = list_first_entry(&video->dmaqueue, struct k510isp_buffer, irqlist); + } +- ++ + if(next_buf != NULL) + { + if(dsNum == MAIN_VIDEO) +@@ -2893,7 +2914,7 @@ static void video_buffer_next(struct isp_f2k_device *f2k, enum video_type dsNum) + else if(dsNum == DS2_VIDEO) + isp_f2k_set_out2_outaddr(f2k, next_buf->dma); + } +- ++ + spin_unlock_irqrestore(&video->irqlock, flags); + + if(!drop) +@@ -2956,7 +2977,7 @@ static void video_buffer_next(struct isp_f2k_device *f2k, enum video_type dsNum) + pipe->state &= ~ISP_PIPELINE_STREAM; + spin_unlock(&pipe->lock); + } +- ++ + spin_unlock_irqrestore(&video->irqlock, flags); + + return; +@@ -2972,7 +2993,7 @@ static void f2k_isr_main_buffer(struct isp_f2k_device *f2k) + { + //dev_err(f2k->isp->dev,"%s:list_empty\n",__func__); + return 0; +- } ++ } + + if (f2k->state == ISP_PIPELINE_STREAM_CONTINUOUS && f2k->underrun) { + dev_err(f2k->isp->dev,"%s:f2k->state(0x%x)\n",__func__,f2k->state); +@@ -2980,7 +3001,7 @@ static void f2k_isr_main_buffer(struct isp_f2k_device *f2k) + return 1; + } + +- video_buffer_next(f2k, MAIN_VIDEO); ++ video_buffer_next(f2k, MAIN_VIDEO); + + f2k->profile.buf_set_time[MAIN_VIDEO] = get_usec(); + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; +@@ -2998,7 +3019,7 @@ static void f2k_isr_out0_buffer(struct isp_f2k_device *f2k) + { + //dev_dbg(f2k->isp->dev,"%s:list_empty\n",__func__); + return 0; +- } ++ } + + if (f2k->state == ISP_PIPELINE_STREAM_CONTINUOUS && f2k->underrun) { + f2k->underrun = 0; +@@ -3009,7 +3030,7 @@ static void f2k_isr_out0_buffer(struct isp_f2k_device *f2k) + + f2k->profile.buf_set_time[DS0_VIDEO] = get_usec(); + +- pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; ++ pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; + + return buffer != NULL; + } +@@ -3024,14 +3045,14 @@ static void f2k_isr_out1_buffer(struct isp_f2k_device *f2k) + { + //dev_dbg(f2k->isp->dev,"%s:list_empty\n",__func__); + return 0; +- } ++ } + + if (f2k->state == ISP_PIPELINE_STREAM_CONTINUOUS && f2k->underrun) { + f2k->underrun = 0; + return 1; + } + +- video_buffer_next(f2k, DS1_VIDEO); ++ video_buffer_next(f2k, DS1_VIDEO); + f2k->profile.buf_set_time[DS1_VIDEO] = get_usec(); + + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; +@@ -3049,14 +3070,14 @@ static void f2k_isr_out2_buffer(struct isp_f2k_device *f2k) + { + //dev_dbg(f2k->isp->dev,"%s:list_empty\n",__func__); + return 0; +- } ++ } + + if (f2k->state == ISP_PIPELINE_STREAM_CONTINUOUS && f2k->underrun) { + f2k->underrun = 0; + return 1; + } + +- video_buffer_next(f2k, DS2_VIDEO); ++ video_buffer_next(f2k, DS2_VIDEO); + + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; + +@@ -3082,7 +3103,7 @@ int k510isp_f2k_main_isr(struct isp_f2k_device *f2k,u32 events) + } + + int k510isp_f2k_ds0_isr(struct isp_f2k_device *f2k,u32 events) +-{ ++{ + dev_dbg(f2k->isp->dev,"%s:events(0x%x)start\n",__func__,events); + if (f2k->state == ISP_PIPELINE_STREAM_STOPPED) + return 0; +@@ -3090,7 +3111,7 @@ int k510isp_f2k_ds0_isr(struct isp_f2k_device *f2k,u32 events) + /* Handle queued buffers on frame end interrupts */ + //if(events & (IRQW1_STS_OUT0_Y_FRAME_IRQ|IRQW1_STS_OUT0_UV_FRAME_IRQ)) + f2k_isr_out0_buffer(f2k); +- ++ + return 0; + } + +@@ -3103,7 +3124,7 @@ int k510isp_f2k_ds1_isr(struct isp_f2k_device *f2k,u32 events) + /* Handle queued buffers on frame end interrupts */ + //if(events & (IRQW1_STS_OUT1_Y_FRAME_IRQ|IRQW1_STS_OUT1_UV_FRAME_IRQ)) + f2k_isr_out1_buffer(f2k); +- ++ + return 0; + } + +@@ -3116,7 +3137,7 @@ int k510isp_f2k_ds2_isr(struct isp_f2k_device *f2k,u32 events) + /* Handle queued buffers on frame end interrupts */ + //if(events & (IRQW1_STS_OUT2_R_FRAME_IRQ|IRQW1_STS_OUT2_G_FRAME_IRQ|IRQW1_STS_OUT2_B_FRAME_IRQ)) + f2k_isr_out2_buffer(f2k); +- ++ + return 0; + } + /* ----------------------------------------------------------------------------- +@@ -3157,14 +3178,14 @@ static int f2k_video_queue(struct k510isp_video *video, struct k510isp_buffer *b + if (f2k->output & ISP_F2K_OUTPUT_DS1_MEM) + { + f2k->pingpong[DS1_VIDEO] = 0; +- isp_f2k_set_out1_outaddr(f2k, buffer->dma); ++ isp_f2k_set_out1_outaddr(f2k, buffer->dma); + } + if (f2k->output & ISP_F2K_OUTPUT_DS2_MEM) + { + f2k->pingpong[DS2_VIDEO] = 0; + isp_f2k_set_out2_outaddr(f2k, buffer->dma); + } +- ++ + #ifdef SET_DIFF_BUFF + buffer++; + if (f2k->output & ISP_F2K_OUTPUT_FBC) +@@ -3218,7 +3239,7 @@ int k510isp_f2k_reset(struct k510_isp_device *isp) + { + isp_f2k_wrap_reset(isp); + reset_control_reset(isp->reset[FBC_RST]); +- reset_control_reset(isp->reset[ISP_F2K_RST]); ++ reset_control_reset(isp->reset[ISP_F2K_RST]); + return 0; + } + /* +@@ -3232,7 +3253,7 @@ int k510isp_f2k_reset(struct k510_isp_device *isp) + static long f2k_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) + { + struct isp_f2k_device *f2k = v4l2_get_subdevdata(sd); +- int ret; ++ int ret; + dev_dbg(f2k->isp->dev,"%s:cmd(0x%x)\n",__func__,cmd); + struct isp_wrap_cfg_info *isp_wrap_cfg = &f2k->isp_cfg.isp_wrap_cfg; + struct isp_core_cfg_info *isp_core_cfg = &f2k->isp_cfg.isp_core_cfg; +@@ -3273,7 +3294,7 @@ static long f2k_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) + mutex_lock(&f2k->ioctl_lock); + ret = isp_f2k_remap_out1_config(f2k, arg); + mutex_unlock(&f2k->ioctl_lock); +- break; ++ break; + case VIDIOC_K510ISP_F2K_AE_STAT_REQ: + mutex_lock(&f2k->ioctl_lock); + isp_f2k_core_GetAeSts(f2k->isp,arg); +@@ -3286,13 +3307,23 @@ static long f2k_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) + break; + case VIDIOC_K510ISP_F2K_CORE_CFG_GET: + mutex_lock(&f2k->ioctl_lock); +- ++ + mutex_unlock(&f2k->ioctl_lock); + break; + case VIDIOC_K510ISP_SYSCTL_RST_F2K: + mutex_lock(&f2k->ioctl_lock); + reset_control_reset(f2k->isp->reset[ISP_F2K_RST]); +- reset_control_reset(f2k->isp->reset[FBC_RST]); ++ reset_control_reset(f2k->isp->reset[FBC_RST]); ++ mutex_unlock(&f2k->ioctl_lock); ++ break; ++ case VIDIOC_K510ISP_F2K_CORE_REG_SET: ++ mutex_lock(&f2k->ioctl_lock); ++ isp_f2k_core_RegSet(f2k->isp,arg); ++ mutex_unlock(&f2k->ioctl_lock); ++ break; ++ case VIDIOC_K510ISP_F2K_CORE_REG_GET: ++ mutex_lock(&f2k->ioctl_lock); ++ isp_f2k_core_RegGet(f2k->isp,arg); + mutex_unlock(&f2k->ioctl_lock); + break; + default: +@@ -3341,7 +3372,7 @@ static int f2k_set_stream(struct v4l2_subdev *sd, int enable) + dev_dbg(f2k->isp->dev,"%s:enable(0x%d)\n",__func__,enable); + + struct isp_cfg_info *isp_cfg = &f2k->isp_cfg; +- struct isp_irq_info irq_info; ++ struct isp_irq_info irq_info; + + if (f2k->state == ISP_PIPELINE_STREAM_STOPPED) { + if (enable == ISP_PIPELINE_STREAM_STOPPED) +@@ -3352,7 +3383,7 @@ static int f2k_set_stream(struct v4l2_subdev *sd, int enable) + k510isp_f2k_reset(isp); + mutex_unlock(&f2k->ioctl_lock); + return 0; +- } ++ } + atomic_set(&f2k->stopping, 0); + } + +@@ -3413,7 +3444,7 @@ static int f2k_set_stream(struct v4l2_subdev *sd, int enable) + if(f2k->profile.drop_cnt[i] > 0) + dev_info(f2k->isp->dev,"f2k ds%d jump drop_cnt %d\n", i, f2k->profile.drop_cnt[i]); + } +- } ++ } + dev_info(f2k->isp->dev,"f2k dmaErrCnt %d, no_buf_drop_cnt %d, total %d\n", f2k->profile.dmaErrCnt, f2k->profile.no_buf_drop_cnt, f2k->profile.pic_cnt); + break; + } +@@ -3543,7 +3574,7 @@ f2k_try_format(struct isp_f2k_device *f2k, struct v4l2_subdev_pad_config *cfg, + else if (fmt->code == MEDIA_BUS_FMT_UYVY8_2X8) + fmt->code = MEDIA_BUS_FMT_UYVY8_1X16; + } +- ++ + /* Hardcode the output size to the crop rectangle size. */ + crop = __f2k_get_crop(f2k, cfg, which); + fmt->width = crop->width; +@@ -3630,7 +3661,7 @@ static int f2k_enum_mbus_code(struct v4l2_subdev *sd, + case ISP_F2K_PAD_SINK: + if (code->index >= ARRAY_SIZE(f2k_fmts)) + { +- dev_err(f2k->isp->dev,"%s:code->index %d\n",__func__,code->index); ++ dev_err(f2k->isp->dev,"%s:code->index %d\n",__func__,code->index); + return -EINVAL; + } + code->code = f2k_fmts[code->index]; +@@ -3652,7 +3683,7 @@ static int f2k_enum_mbus_code(struct v4l2_subdev *sd, + code->code = MEDIA_BUS_FMT_UYVY8_1X16; + else + { +- dev_err(f2k->isp->dev,"%s:code->index1 %d\n",__func__,code->index); ++ dev_err(f2k->isp->dev,"%s:code->index1 %d\n",__func__,code->index); + return -EINVAL; + } + } else { +@@ -3663,7 +3694,7 @@ static int f2k_enum_mbus_code(struct v4l2_subdev *sd, + code->code = format->code; + else + { +- dev_err(f2k->isp->dev,"%s:code->index2 %d\n",__func__,code->index); ++ dev_err(f2k->isp->dev,"%s:code->index2 %d\n",__func__,code->index); + return -EINVAL; + } + } +@@ -3688,7 +3719,7 @@ static int f2k_enum_frame_size(struct v4l2_subdev *sd, + { + dev_err(f2k->isp->dev,"%s:fse->index%d\n",__func__,fse->index); + return -EINVAL; +- } ++ } + + format.code = fse->code; + format.width = 1; +@@ -3697,11 +3728,11 @@ static int f2k_enum_frame_size(struct v4l2_subdev *sd, + fse->min_width = format.width; + fse->min_height = format.height; + +- if (format.code != fse->code) ++ if (format.code != fse->code) + { + dev_err(f2k->isp->dev,"%s:format.code,fse->code %d\n",__func__,fse->code); + return -EINVAL; +- } ++ } + + format.code = fse->code; + format.width = -1; +@@ -3736,7 +3767,7 @@ static int f2k_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_pad_conf + { + dev_err(f2k->isp->dev,"%s:no pad\n",__func__); + return -EINVAL; +- } ++ } + + switch (sel->target) { + case V4L2_SEL_TGT_CROP_BOUNDS: +@@ -3786,14 +3817,14 @@ static int f2k_set_selection(struct v4l2_subdev *sd, struct v4l2_subdev_pad_conf + { + dev_err(f2k->isp->dev,"%s:pad == NULL\n",__func__); + return -EINVAL; +- } ++ } + + /* The crop rectangle can't be changed while streaming. */ + if (f2k->state != ISP_PIPELINE_STREAM_STOPPED) + { + dev_err(f2k->isp->dev,"%s:ISP_PIPELINE_STREAM_RUNNING\n",__func__); + return -EBUSY; +- } ++ } + + /* Modifying the crop rectangle always changes the format on the source + * pad. If the KEEP_CONFIG flag is set, just return the current crop +@@ -3891,7 +3922,7 @@ static int f2k_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config + dev_warn(f2k->isp->dev, "%s:pad error!\n",__func__); + return -EINVAL; + } +- ++ + if (fmt->pad == ISP_F2K_PAD_SINK) { + /* Reset the crop rectangle. */ + crop = &f2k->crop_in; +@@ -3899,7 +3930,7 @@ static int f2k_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config + crop->top = 0; + crop->width = fmt->format.width; + crop->height = fmt->format.height; +- // ++ // + format = &fmt->format; + f2k->formats[ISP_F2K_PAD_SINK].width = format->width; + f2k->formats[ISP_F2K_PAD_SINK].height = format->height; +@@ -3921,7 +3952,7 @@ static int f2k_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config + f2k->formats[ISP_F2K_PAD_MAIN_SOURCE].height = format->height; + f2k->formats[ISP_F2K_PAD_MAIN_SOURCE].field = V4L2_FIELD_NONE; + f2k->formats[ISP_F2K_PAD_MAIN_SOURCE].colorspace =V4L2_COLORSPACE_SRGB; +- f2k->formats[ISP_F2K_PAD_MAIN_SOURCE].code = format->code; ++ f2k->formats[ISP_F2K_PAD_MAIN_SOURCE].code = format->code; + } + + if (fmt->pad == ISP_F2K_PAD_DS0_SOURCE) { +@@ -3971,7 +4002,7 @@ static int f2k_link_validate(struct v4l2_subdev *sd, + { + dev_err(f2k->isp->dev,"%s:format error\n",__func__); + return -EPIPE; +- } ++ } + + return 0; + } +@@ -3998,7 +4029,7 @@ static int f2k_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) + format.format.code = f2k->formats[pad].code;//MEDIA_BUS_FMT_SRGGB10_1X10;//MEDIA_BUS_FMT_SGRBG10_1X10; + format.format.width = f2k->formats[pad].width;//1920;//4096; + format.format.height = f2k->formats[pad].height;//1080;//4096; +- f2k_set_format(sd, fh ? fh->pad : NULL, &format); ++ f2k_set_format(sd, fh ? fh->pad : NULL, &format); + } + + return 0; +@@ -4074,7 +4105,7 @@ static int f2k_link_setup(struct media_entity *entity, + { + dev_err(f2k->isp->dev,"%s:!ISP_F2K_INPUT_NONE\n",__func__); + return -EBUSY; +- } ++ } + + if (remote->entity == &f2k->subdev.entity) + f2k->input = ISP_F2K_INPUT_VI; +@@ -4089,21 +4120,21 @@ static int f2k_link_setup(struct media_entity *entity, + { + dev_err(f2k->isp->dev,"%s:!ISP_F2K_PAD_MAIN_SOURCE\n",__func__); + return -EBUSY; +- } ++ } + f2k->output |= ISP_F2K_OUTPUT_MAIN_MEM; + } else { + f2k->output &= ~ISP_F2K_OUTPUT_MAIN_MEM; + } + break; + case ISP_F2K_PAD_DS0_SOURCE: +- case ISP_F2K_PAD_DS0_SOURCE | 2 << 16: ++ case ISP_F2K_PAD_DS0_SOURCE | 2 << 16: + /* Write to memory */ + if (flags & MEDIA_LNK_FL_ENABLED) { + if (f2k->output & ISP_F2K_OUTPUT_DS0_MEM) + { + dev_err(f2k->isp->dev,"%s:!ISP_F2K_PAD_DS0_SOURCE\n",__func__); + return -EBUSY; +- } ++ } + f2k->output |= ISP_F2K_OUTPUT_DS0_MEM; + } else { + f2k->output &= ~ISP_F2K_OUTPUT_DS0_MEM; +@@ -4117,7 +4148,7 @@ static int f2k_link_setup(struct media_entity *entity, + { + dev_err(f2k->isp->dev,"%s:!ISP_F2K_PAD_DS1_SOURCE\n",__func__); + return -EBUSY; +- } ++ } + f2k->output |= ISP_F2K_OUTPUT_DS1_MEM; + } else { + f2k->output &= ~ISP_F2K_OUTPUT_DS1_MEM; +@@ -4131,7 +4162,7 @@ static int f2k_link_setup(struct media_entity *entity, + { + dev_err(f2k->isp->dev,"%s:!ISP_F2K_PAD_DS2_SOURCE\n",__func__); + return -EBUSY; +- } ++ } + f2k->output |= ISP_F2K_OUTPUT_DS2_MEM; + } else { + f2k->output &= ~ISP_F2K_OUTPUT_DS2_MEM; +@@ -4139,7 +4170,7 @@ static int f2k_link_setup(struct media_entity *entity, + break; + default: + dev_dbg(f2k->isp->dev,"%s:!no index\n",__func__); +- return -EINVAL; ++ return -EINVAL; + } + + dev_dbg(f2k->isp->dev,"%s:end\n",__func__); +@@ -4182,7 +4213,7 @@ int k510isp_f2k_register_entities(struct isp_f2k_device *f2k, + dev_err(f2k->isp->dev, "%s: v4l2_device_register_subdev failed (%d)\n", + __func__, ret); + goto error; +- } ++ } + + ret = k510isp_video_register(&f2k->video_out[MAIN_VIDEO], vdev); + if (ret < 0) +@@ -4222,7 +4253,7 @@ int k510isp_f2k_register_entities(struct isp_f2k_device *f2k, + k510isp_video_unregister(&f2k->video_out[DS1_VIDEO]); + error_ds0: + k510isp_video_unregister(&f2k->video_out[DS0_VIDEO]); +-error_main: ++error_main: + k510isp_video_unregister(&f2k->video_out[MAIN_VIDEO]); + error: + k510isp_f2k_unregister_entities(f2k); +@@ -4269,7 +4300,7 @@ static int k510isp_f2k_init_entities(struct isp_f2k_device *f2k) + { + dev_err(isp->dev,"%s:media_entity_pads_init ret:%d\n",__func__,ret); + return ret; +- } ++ } + dev_dbg(isp->dev,"%s:media_entity_pads_init end\n",__func__); + f2k_init_formats(sd, NULL); + // +@@ -4279,14 +4310,14 @@ static int k510isp_f2k_init_entities(struct isp_f2k_device *f2k) + f2k->video_out[MAIN_VIDEO].capture_mem = PAGE_ALIGN(4096 * 4096) * 3; + f2k->video_out[MAIN_VIDEO].bpl_alignment = 32; //16 + f2k->video_out[MAIN_VIDEO].bpl_max = 0xffffffe0;//0xfffffff0; //0xffffffe0 +- //f2k->output |= ISP_F2K_OUTPUT_MAIN_MEM; +- ++ //f2k->output |= ISP_F2K_OUTPUT_MAIN_MEM; ++ + ret = k510isp_video_init(&f2k->video_out[MAIN_VIDEO], "F2K"); + if (ret < 0) + { + dev_err(isp->dev,"%s:k510isp_video_init ret:%d\n",__func__,ret); + goto error_video; +- } ++ } + // + f2k->video_out[DS0_VIDEO].type = V4L2_BUF_TYPE_VIDEO_CAPTURE;//V4L2_BUF_TYPE_VIDEO_CAPTURE;//V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;//V4L2_BUF_TYPE_VIDEO_OUTPUT; + f2k->video_out[DS0_VIDEO].ops = &f2k_video_ops; +@@ -4338,13 +4369,13 @@ static int k510isp_f2k_init_entities(struct isp_f2k_device *f2k) + return 0; + + error_ds1_video: +- k510isp_video_cleanup(&f2k->video_out[DS1_VIDEO]); ++ k510isp_video_cleanup(&f2k->video_out[DS1_VIDEO]); + error_ds0_video: + k510isp_video_cleanup(&f2k->video_out[DS0_VIDEO]); + error_main_video: + k510isp_video_cleanup(&f2k->video_out[MAIN_VIDEO]); + error_video: +- media_entity_cleanup(&f2k->subdev.entity); ++ media_entity_cleanup(&f2k->subdev.entity); + return ret; + } + /* +@@ -4380,7 +4411,7 @@ int k510isp_f2k_init(struct k510_isp_device *isp) + dev_err(isp->dev,"%s:k510isp_f2k_init_entities\n",__func__); + mutex_destroy(&f2k->ioctl_lock); + return ret; +- } ++ } + dev_dbg(isp->dev,"%s:end\n",__func__); + return 0; + } +@@ -4403,5 +4434,5 @@ void k510isp_f2k_cleanup(struct k510_isp_device *isp) + dma_free_coherent(isp->dev, f2k->nr3d_dma.dma_size, f2k->nr3d_dma.addr, + f2k->nr3d_dma.dma); + // +- mutex_destroy(&f2k->ioctl_lock); ++ mutex_destroy(&f2k->ioctl_lock); + } +diff --git a/drivers/media/platform/canaan-isp/isp_2k/isp_r2k.c b/drivers/media/platform/canaan-isp/isp_2k/isp_r2k.c +index e878d5a8..54349efa 100755 +--- a/drivers/media/platform/canaan-isp/isp_2k/isp_r2k.c ++++ b/drivers/media/platform/canaan-isp/isp_2k/isp_r2k.c +@@ -43,69 +43,69 @@ static unsigned long long get_usec(void) + // + void isp_r2k_wrap_SetComRst(struct k510_isp_device *isp) + { +- ++ + ISP_WRAP_RST_CTL_S stRstCtl; +- stRstCtl.sw_3dnr_rst = 1; ++ stRstCtl.sw_3dnr_rst = 1; + stRstCtl.wdr_2_frame_rst = 1; + stRstCtl.wdr_3_frame_rst =1; +- stRstCtl.ldc_rst = 1; +- stRstCtl.main_out_rst = 1; +- stRstCtl.ds0_out_rst = 1; +- stRstCtl.ds1_out_rst = 1; +- stRstCtl.ds2_out_rst = 1; +- stRstCtl.wrap_com_rst = 1; +- stRstCtl.wrap_cfg_rst = 1; +- stRstCtl.core_com_rst = 1; +- stRstCtl.core_cfg_rst = 1; +- stRstCtl.axi_wr_ch_rst = 1; +- stRstCtl.axi_rd_ch_rst = 1; ++ stRstCtl.ldc_rst = 1; ++ stRstCtl.main_out_rst = 1; ++ stRstCtl.ds0_out_rst = 1; ++ stRstCtl.ds1_out_rst = 1; ++ stRstCtl.ds2_out_rst = 1; ++ stRstCtl.wrap_com_rst = 1; ++ stRstCtl.wrap_cfg_rst = 1; ++ stRstCtl.core_com_rst = 1; ++ stRstCtl.core_cfg_rst = 1; ++ stRstCtl.axi_wr_ch_rst = 1; ++ stRstCtl.axi_rd_ch_rst = 1; + Isp_Drv_R2k_Wrap_SetPipeReset(isp,&stRstCtl); + } + // + void isp_r2k_wrap_SetDmaRst(struct k510_isp_device *isp) + { +- ++ + ISP_WRAP_DMA_RST_CTL_S stDmaRstCtl; +- stDmaRstCtl.y_3dnr_wr_ch_rst = 1; +- stDmaRstCtl.uv_3dnr_wr_ch_rst = 1; +- stDmaRstCtl.ldc_y_wr_ch_rst = 1; +- stDmaRstCtl.ldc_uv_wr_ch_rst = 1; +- stDmaRstCtl.wdr_raw_wr_ch_rst = 1; +- stDmaRstCtl.main_out_y_wr_ch_rst = 1; ++ stDmaRstCtl.y_3dnr_wr_ch_rst = 1; ++ stDmaRstCtl.uv_3dnr_wr_ch_rst = 1; ++ stDmaRstCtl.ldc_y_wr_ch_rst = 1; ++ stDmaRstCtl.ldc_uv_wr_ch_rst = 1; ++ stDmaRstCtl.wdr_raw_wr_ch_rst = 1; ++ stDmaRstCtl.main_out_y_wr_ch_rst = 1; + stDmaRstCtl.main_out_uv_wr_ch_rst = 1; +- stDmaRstCtl.y_3dnr_rd_ch_rst = 1; +- stDmaRstCtl.uv_3dnr_rd_ch_rst = 1; +- stDmaRstCtl.ldc_y_rd_ch_rst = 1; +- stDmaRstCtl.ldc_uv_rd_ch_rst = 1; +- stDmaRstCtl.wdr_raw_rd_ch_rst = 1; +- stDmaRstCtl.ds0_out_y_wr_ch_rst = 1; +- stDmaRstCtl.ds0_out_uv_wr_ch_rst = 1; +- stDmaRstCtl.ds1_out_y_wr_ch_rst = 1; +- stDmaRstCtl.ds1_out_uv_wr_ch_rst = 1; +- stDmaRstCtl.ds2_out_r_wr_ch_rst = 1; +- stDmaRstCtl.ds2_out_g_wr_ch_rst = 1; +- stDmaRstCtl.ds2_out_b_wr_ch_rst = 1; +- stDmaRstCtl.ds0_osd0_rd_ch_rst = 1; +- stDmaRstCtl.ds0_osd1_rd_ch_rst = 1; +- stDmaRstCtl.ds1_osd0_rd_ch_rst = 1; +- stDmaRstCtl.ds1_osd1_rd_ch_rst = 1; +- stDmaRstCtl.ds2_osd0_rd_ch_rst = 1; +- stDmaRstCtl.ds2_osd1_rd_ch_rst = 1; +- stDmaRstCtl.ds1_osd2_rd_ch_rst = 1; +- stDmaRstCtl.ds2_osd2_rd_ch_rst = 1; ++ stDmaRstCtl.y_3dnr_rd_ch_rst = 1; ++ stDmaRstCtl.uv_3dnr_rd_ch_rst = 1; ++ stDmaRstCtl.ldc_y_rd_ch_rst = 1; ++ stDmaRstCtl.ldc_uv_rd_ch_rst = 1; ++ stDmaRstCtl.wdr_raw_rd_ch_rst = 1; ++ stDmaRstCtl.ds0_out_y_wr_ch_rst = 1; ++ stDmaRstCtl.ds0_out_uv_wr_ch_rst = 1; ++ stDmaRstCtl.ds1_out_y_wr_ch_rst = 1; ++ stDmaRstCtl.ds1_out_uv_wr_ch_rst = 1; ++ stDmaRstCtl.ds2_out_r_wr_ch_rst = 1; ++ stDmaRstCtl.ds2_out_g_wr_ch_rst = 1; ++ stDmaRstCtl.ds2_out_b_wr_ch_rst = 1; ++ stDmaRstCtl.ds0_osd0_rd_ch_rst = 1; ++ stDmaRstCtl.ds0_osd1_rd_ch_rst = 1; ++ stDmaRstCtl.ds1_osd0_rd_ch_rst = 1; ++ stDmaRstCtl.ds1_osd1_rd_ch_rst = 1; ++ stDmaRstCtl.ds2_osd0_rd_ch_rst = 1; ++ stDmaRstCtl.ds2_osd1_rd_ch_rst = 1; ++ stDmaRstCtl.ds1_osd2_rd_ch_rst = 1; ++ stDmaRstCtl.ds2_osd2_rd_ch_rst = 1; + Isp_Drv_R2k_Wrap_SetDmaReset(isp,&stDmaRstCtl); + } + // + void isp_r2k_wrap_SetPipeClkCtl(struct k510_isp_device *isp) + { +- ++ + ISP_WRAP_PIPE_CLK_CTL_S pstPipeClkCtl; + pstPipeClkCtl.wrap_com_clk_en = 1; + pstPipeClkCtl.wrap_cfg_clk_en = 1; + pstPipeClkCtl.core_com_clk_en = 1; + pstPipeClkCtl.core_cfg_clk_en = 1; +- pstPipeClkCtl.axi_wr_ch_en = 1; +- pstPipeClkCtl.axi_rd_ch_en = 1; ++ pstPipeClkCtl.axi_wr_ch_en = 1; ++ pstPipeClkCtl.axi_rd_ch_en = 1; + Isp_Drv_R2k_Wrap_SetComClkCtl(isp,&pstPipeClkCtl); + } + // +@@ -122,7 +122,7 @@ void isp_r2k_wrap_SetLdc(struct k510_isp_device *isp,struct isp_wrap_ldc_info *l + { + pstLdcAttr.ldc_clk_en = 0; + pstLdcAttr.ldc_dma_en = 0; +- } ++ } + ISP_WRAP_LDC_BUF_S *stLdcBuf = &pstLdcAttr.stLdcBuf; + stLdcBuf->ldc_y_buf_base = ldcInfo->ldc_y_buf_base;//ISP_BUF_LDC_Y; + stLdcBuf->ldc_uv_buf_base = ldcInfo->ldc_uv_buf_base;//ISP_BUF_LDC_UV; +@@ -133,7 +133,7 @@ void isp_r2k_wrap_SetLdc(struct k510_isp_device *isp,struct isp_wrap_ldc_info *l + // + void isp_r2k_wrap_SetMainOut(struct k510_isp_device *isp,struct isp_wrap_main_info *mainInfo) + { +- ++ + ISP_WRAP_MAINOUT_ATTR_S pstMainOutAttr; + pstMainOutAttr.main_out_clk_en = 1; + if( 1 == mainInfo->main_out_en) +@@ -213,9 +213,9 @@ void isp_r2k_wrap_SetDs0Out(struct k510_isp_device *isp,struct isp_wrap_ds0_info + stDs0ClkCtl->ds_out0_osd0_ch_clk_en = 0; + stDs0ClkCtl->ds_out0_osd1_ch_clk_en = 0; + stDs0ClkCtl->ds_out0_osd2_ch_clk_en = 0; +- stDs0DmaEn->ds_out0_dma_en = 0; ++ stDs0DmaEn->ds_out0_dma_en = 0; + stDs0DmaEn->ds_out0_y_ch_dma_en =0; +- stDs0DmaEn->ds_out0_uv_ch_dma_en = 0; ++ stDs0DmaEn->ds_out0_uv_ch_dma_en = 0; + stDs0DmaEn->ds0_osd0_ch_dma_en =0; + stDs0DmaEn->ds0_osd1_ch_dma_en = 0; + stDs0DmaEn->ds0_osd2_ch_dma_en = 0; +@@ -234,7 +234,7 @@ void isp_r2k_wrap_SetDs0Out(struct k510_isp_device *isp,struct isp_wrap_ds0_info + stDs0Buf->ds0_y_buf0_base = ds0Info->ds0_y_buf0_base;//ISP_BUF_DS0_Y; + stDs0Buf->ds0_y_buf1_base = ds0Info->ds0_y_buf1_base;//ISP_BUF_DS0_Y; + stDs0Buf->ds0_y_line_stride = ds0Info->ds0_line_stride;//(Width + 15)/16*16;//ISP_BUF_DS0_Y_STRIDE; +- stDs0Buf->ds0_uv_line_stride = ds0Info->ds0_line_stride;//(Width + 15)/16*16;//ISP_BUF_DS0_UV_STRIDE; ++ stDs0Buf->ds0_uv_line_stride = ds0Info->ds0_line_stride;//(Width + 15)/16*16;//ISP_BUF_DS0_UV_STRIDE; + stDs0Buf->ds0_uv_buf0_base = ds0Info->ds0_uv_buf0_base;//ISP_BUF_DS0_Y + stDs0Buf->ds0_y_line_stride * Height;//ISP_BUF_DS0_UV; + stDs0Buf->ds0_uv_buf1_base = ds0Info->ds0_uv_buf1_base;//ISP_BUF_DS0_Y + stDs0Buf->ds0_y_line_stride * Height;//ISP_BUF_DS0_UV; + Isp_Drv_R2k_Wrap_SetDs0Out(isp,&pstDs0OutAttr); +@@ -252,7 +252,7 @@ void isp_r2k_wrap_SetDs1Out(struct k510_isp_device *isp,struct isp_wrap_ds1_info + stDs1ClkCtl->ds1_out_clk_en = 1; + stDs1ClkCtl->ds1_out_y_ch_clk_en = 1; + stDs1ClkCtl->ds1_out_uv_ch_clk_en = 1; +- ++ + if( 1 == ds1Info->ds1_out_en) { + + stDs1ClkCtl->ds_out1_osd0_ch_clk_en = 0; +@@ -309,7 +309,7 @@ void isp_r2k_wrap_SetDs1Out(struct k510_isp_device *isp,struct isp_wrap_ds1_info + stDs1Buf->ds1_y_buf0_base = ds1Info->ds1_y_buf0_base;//ISP_BUF_DS1_Y; + stDs1Buf->ds1_y_buf1_base = ds1Info->ds1_y_buf1_base;//ISP_BUF_DS1_Y; + stDs1Buf->ds1_y_line_stride = ds1Info->ds1_line_stride;//(Width +15)/16*16;//ISP_BUF_DS1_Y_STRIDE; +- stDs1Buf->ds1_uv_line_stride = ds1Info->ds1_line_stride;//(Width +15)/16*16;//ISP_BUF_DS1_Y_STRIDE; ++ stDs1Buf->ds1_uv_line_stride = ds1Info->ds1_line_stride;//(Width +15)/16*16;//ISP_BUF_DS1_Y_STRIDE; + stDs1Buf->ds1_uv_buf0_base = ds1Info->ds1_uv_buf0_base;//ISP_BUF_DS1_Y + stDs1Buf->ds1_y_line_stride *Height;//ISP_BUF_DS1_UV; + stDs1Buf->ds1_uv_buf1_base = ds1Info->ds1_uv_buf1_base;//ISP_BUF_DS1_Y + stDs1Buf->ds1_y_line_stride *Height;//ISP_BUF_DS1_UV; + Isp_Drv_R2k_Wrap_SetDs1Out(isp,&pstDs1OutAttr); +@@ -317,7 +317,7 @@ void isp_r2k_wrap_SetDs1Out(struct k510_isp_device *isp,struct isp_wrap_ds1_info + // + void isp_r2k_wrap_SetDs2Out(struct k510_isp_device *isp,struct isp_wrap_ds2_info *ds2Info) + { +- ++ + unsigned int Width = ds2Info->ds2_size.Width; + unsigned int Height = ds2Info->ds2_size.Height; + ISP_WRAP_DS2OUT_ATTR_S pstDs2OutAttr; +@@ -367,7 +367,7 @@ void isp_r2k_wrap_SetDs2Out(struct k510_isp_device *isp,struct isp_wrap_ds2_info + } + ISP_WRAP_DS2_PIXEL_FORMAT_CTL_S *stDs2PixelFormat = &pstDs2OutAttr.stDs2PixelFormat; + stDs2PixelFormat->ds2_out_img_format = ds2Info->ds2_out_img_format;//ISP_RGBRAW_DATA; +- stDs2PixelFormat->ds2_out_img_out_format = ds2Info->ds2_out_img_out_format;//OUT_ARGB; ++ stDs2PixelFormat->ds2_out_img_out_format = ds2Info->ds2_out_img_out_format;//OUT_ARGB; + stDs2PixelFormat->ds2_out_pixel_width = ds2Info->ds2_out_pxl_width;//PIXEL_8; + stDs2PixelFormat->ds2_out_yuv422_pxl_order = ds2Info->ds2_out_yuv422_pxl_order;//YUYV; //not need + stDs2PixelFormat->ds2_out_yuv_in_format = ds2Info->ds2_out_yuv_in_format;//IN_YUV422; //not need +@@ -384,12 +384,12 @@ void isp_r2k_wrap_SetDs2Out(struct k510_isp_device *isp,struct isp_wrap_ds2_info + stDs2Buf->ds2_r_line_stride = ds2Info->ds2_line_stride; + stDs2Buf->ds2_g_line_stride = ds2Info->ds2_line_stride; + stDs2Buf->ds2_b_line_stride = ds2Info->ds2_line_stride; +- Isp_Drv_R2k_Wrap_SetDs2Out(isp,&pstDs2OutAttr); ++ Isp_Drv_R2k_Wrap_SetDs2Out(isp,&pstDs2OutAttr); + } + // + void isp_r2k_wrap_SetDmaConfig(struct k510_isp_device *isp) + { +- ++ + ISP_WRAP_DMA_ATTR_S pstDmaAttr; + unsigned int DmaChIndex = 0; + ISP_WRAP_DMA_MODE_S *stDmaChMode = &pstDmaAttr.stDmaChMode; +@@ -485,106 +485,106 @@ int isp_r2k_wrap_SetAxiCtl(struct k510_isp_device *isp) + */ + int isp_r2k_wrap_SetIntMask(struct k510_isp_device *isp) + { +- ++ + ISP_WRAP_CORE_INT_CTL_S stCoreIntCtl; +- stCoreIntCtl.int_raw_in_mask= 1 ; +- stCoreIntCtl.int_3a_mask= 1 ; +- stCoreIntCtl.raw_int_mask= 1 ; +- stCoreIntCtl.rgb_int_mask= 1 ; +- stCoreIntCtl.yuv_int_mask= 1 ; +- stCoreIntCtl.ldc_int_mask= 1 ; ++ stCoreIntCtl.int_raw_in_mask= 1 ; ++ stCoreIntCtl.int_3a_mask= 1 ; ++ stCoreIntCtl.raw_int_mask= 1 ; ++ stCoreIntCtl.rgb_int_mask= 1 ; ++ stCoreIntCtl.yuv_int_mask= 1 ; ++ stCoreIntCtl.ldc_int_mask= 1 ; + stCoreIntCtl.main_out_int_mask= 1 ; +- stCoreIntCtl.isp_awb_int_mask= 1 ; +- stCoreIntCtl.isp_ae_int_mask= 1 ; +- stCoreIntCtl.isp_af_int_mask= 1 ; ++ stCoreIntCtl.isp_awb_int_mask= 1 ; ++ stCoreIntCtl.isp_ae_int_mask= 1 ; ++ stCoreIntCtl.isp_af_int_mask= 1 ; + Isp_Drv_R2k_Wrap_SetCoreIntCtlMask(isp,&stCoreIntCtl); + ISP_WRAP_DMA_WR_INT_MASK0_S stDmaWRMask0; +- stDmaWRMask0.wr_3dnr_y_frm_end_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_y_line_base_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_y_frm_end_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_y_line_base_int_mask= 1 ; + stDmaWRMask0.wr_3dnr_y_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_y_err_immediate_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_uv_frm_end_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_uv_line_base_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_uv_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.wr_3dnr_uv_err_immediate_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_y_frm_end_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_y_line_base_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_y_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_y_err_immediate_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_uv_frm_end_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_uv_line_base_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_y_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_uv_frm_end_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_uv_line_base_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_uv_err_frm_end_int_mask= 1 ; ++ stDmaWRMask0.wr_3dnr_uv_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_y_frm_end_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_y_line_base_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_y_err_frm_end_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_y_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_uv_frm_end_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_uv_line_base_int_mask= 1 ; + stDmaWRMask0.ldc_wr_uv_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.ldc_wr_uv_err_immediate_int_mask= 1 ; +- stDmaWRMask0.wdr_wr_raw_frm_end_int_mask= 1 ; +- stDmaWRMask0.wdr_wr_raw_line_base_int_mask= 1 ; +- stDmaWRMask0.wdr_wr_raw_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.wdr_wr_raw_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.ldc_wr_uv_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.wdr_wr_raw_frm_end_int_mask= 1 ; ++ stDmaWRMask0.wdr_wr_raw_line_base_int_mask= 1 ; ++ stDmaWRMask0.wdr_wr_raw_err_frm_end_int_mask= 1 ; ++ stDmaWRMask0.wdr_wr_raw_err_immediate_int_mask= 1 ; + stDmaWRMask0.main_out_wr_y_frm_end_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_y_line_base_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_y_err_frm_end_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_y_err_immediate_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_uv_frm_end_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_uv_line_base_int_mask= 1 ; +- stDmaWRMask0.main_out_wr_uv_err_frm_end_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_y_line_base_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_y_err_frm_end_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_y_err_immediate_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_uv_frm_end_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_uv_line_base_int_mask= 1 ; ++ stDmaWRMask0.main_out_wr_uv_err_frm_end_int_mask= 1 ; + stDmaWRMask0.main_out_wr_uv_err_immediate_int_mask= 1 ; + Isp_Drv_R2k_Wrap_SetDmaWRIntMask0(isp,&stDmaWRMask0); + ISP_WRAP_DMA_WR_INT_MASK1_S stDmaWRMask1; +- stDmaWRMask1.ds0_out_wr_y_frm_end_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_y_line_base_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_y_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_y_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_y_frm_end_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_y_line_base_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_y_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_y_err_immediate_mask= 1 ; + stDmaWRMask1.ds0_out_wr_uv_frm_end_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_uv_line_base_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_uv_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds0_out_wr_uv_err_immediate_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_y_frm_end_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_y_line_base_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_y_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_y_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_uv_line_base_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_uv_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds0_out_wr_uv_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_y_frm_end_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_y_line_base_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_y_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_y_err_immediate_mask= 1 ; + stDmaWRMask1.ds1_out_wr_uv_frm_end_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_uv_line_base_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_uv_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds1_out_wr_uv_err_immediate_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_r_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_r_line_base_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_r_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_r_err_immediate_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_g_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_g_line_base_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_g_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_g_err_immediate_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_b_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_b_line_base_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_b_err_frm_end_mask= 1 ; +- stDmaWRMask1.ds2_out_wr_b_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_uv_line_base_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_uv_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds1_out_wr_uv_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_r_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_r_line_base_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_r_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_r_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_g_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_g_line_base_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_g_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_g_err_immediate_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_b_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_b_line_base_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_b_err_frm_end_mask= 1 ; ++ stDmaWRMask1.ds2_out_wr_b_err_immediate_mask= 1 ; + Isp_Drv_R2k_Wrap_SetDmaWRIntMask1(isp,&stDmaWRMask1); + ISP_WRAP_DMA_RD_INT_MASK0_S stDmaRDMask0; + stDmaRDMask0.rd_3dnr_y_frm_end_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_y_line_base_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_y_err_frm_end_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_y_err_immediate_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_uv_frm_end_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_uv_line_base_int_mask= 1 ; +- stDmaRDMask0.rd_3dnr_uv_err_frm_end_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_y_line_base_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_y_err_frm_end_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_y_err_immediate_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_uv_frm_end_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_uv_line_base_int_mask= 1 ; ++ stDmaRDMask0.rd_3dnr_uv_err_frm_end_int_mask= 1 ; + stDmaRDMask0.rd_3dnr_uv_err_immediate_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_y_frm_end_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_y_line_base_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_y_err_frm_end_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_y_err_immediate_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_y_frm_end_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_y_line_base_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_y_err_frm_end_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_y_err_immediate_int_mask= 1 ; + stDmaRDMask0.ldc_rd_uv_frm_end_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_uv_line_base_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_uv_err_frm_end_int_mask= 1 ; +- stDmaRDMask0.ldc_rd_uv_err_immediate_int_mask= 1 ; +- stDmaRDMask0.wdr_rd_raw_frm_end_int_mask= 1 ; +- stDmaRDMask0.wdr_rd_raw_line_base_int_mask= 1 ; +- stDmaRDMask0.wdr_rd_raw_err_frm_end_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_uv_line_base_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_uv_err_frm_end_int_mask= 1 ; ++ stDmaRDMask0.ldc_rd_uv_err_immediate_int_mask= 1 ; ++ stDmaRDMask0.wdr_rd_raw_frm_end_int_mask= 1 ; ++ stDmaRDMask0.wdr_rd_raw_line_base_int_mask= 1 ; ++ stDmaRDMask0.wdr_rd_raw_err_frm_end_int_mask= 1 ; + stDmaRDMask0.wdr_rd_raw_err_immediate_int_mask= 1 ; +- Isp_Drv_R2k_Wrap_SetDmaRDIntMask0(isp,&stDmaRDMask0); ++ Isp_Drv_R2k_Wrap_SetDmaRDIntMask0(isp,&stDmaRDMask0); + } + // + int isp_r2k_wrap_SetConfigDone(struct k510_isp_device *isp,unsigned int wp_en) + { +- ++ + ISP_WRAP_CONFIG_DONE_S pstConfigDone; + pstConfigDone.int_polarity = 1; + pstConfigDone.sen_reg_pro_en = wp_en;//0; +@@ -595,7 +595,7 @@ int isp_r2k_wrap_SetConfigDone(struct k510_isp_device *isp,unsigned int wp_en) + else + { + pstConfigDone.wrap_config_done_en = 1; +- } ++ } + Isp_Drv_R2k_Wrap_SetConfigdoneCtl(isp,&pstConfigDone); + return 0; + } +@@ -604,7 +604,7 @@ int isp_r2k_wrap_reset(struct k510_isp_device *isp) + { + unsigned int stData; + union U_ISP_WRAP_AXI_CTL axi_ctl; +- ++ + isp_r2k_wrap_SetConfigDone(isp,1); + // + stData = 0; +@@ -613,9 +613,9 @@ int isp_r2k_wrap_reset(struct k510_isp_device *isp) + msleep(50); + + axi_ctl.u32 = 0; +- axi_ctl.bits.axi_wr_ch_rst_req = 1; +- axi_ctl.bits.axi_rd_ch_rst_req = 1; +- isp_reg_writel(isp, axi_ctl.u32, ISP_IOMEM_R2K_WRAP, ISP_WRAP_AXI_CTL); ++ axi_ctl.bits.axi_wr_ch_rst_req = 1; ++ axi_ctl.bits.axi_rd_ch_rst_req = 1; ++ isp_reg_writel(isp, axi_ctl.u32, ISP_IOMEM_R2K_WRAP, ISP_WRAP_AXI_CTL); + axi_ctl.u32 = 0; + axi_ctl = (union U_ISP_WRAP_AXI_CTL)isp_reg_readl(isp, ISP_IOMEM_R2K_WRAP, ISP_WRAP_AXI_CTL); + printk("%s>AXI_CTL = 0x%x\n", __func__, axi_ctl); +@@ -627,10 +627,10 @@ int isp_r2k_wrap_reset(struct k510_isp_device *isp) + } + + isp_r2k_wrap_SetConfigDone(isp,1); +- ++ + stData = 0; + isp_reg_writel(isp,stData,ISP_IOMEM_R2K_WRAP,ISP_WRAP_PIPE_CLK_CTL); +- ++ + // + stData = 0xffffffff; + isp_reg_writel(isp,stData,ISP_IOMEM_R2K_WRAP,ISP_WRAP_SWRST_CTL); +@@ -680,9 +680,9 @@ static int isp_r2k_wrap_config(struct isp_r2k_device *r2k,struct isp_wrap_cfg_in + // + isp_r2k_wrap_SetIntMask(isp); + // +- isp_r2k_wrap_SetConfigDone(isp,0); ++ isp_r2k_wrap_SetConfigDone(isp,0); + +- return 0; ++ return 0; + } + /**************************************************************************** + *wrap int +@@ -690,16 +690,16 @@ static int isp_r2k_wrap_config(struct isp_r2k_device *r2k,struct isp_wrap_cfg_in + int isp_r2k_wrap_setIntCore(struct k510_isp_device *isp,struct isp_wrap_intcore_info *intCoreEn) + { + ISP_WRAP_CORE_INT_CTL_S coreIntMask; +- coreIntMask.int_raw_in_mask = ~intCoreEn->int_raw_in_en; +- coreIntMask.int_3a_mask = ~intCoreEn->int_3a_en; +- coreIntMask.raw_int_mask = ~intCoreEn->raw_int_en; +- coreIntMask.rgb_int_mask = ~intCoreEn->rgb_int_en; +- coreIntMask.yuv_int_mask = ~intCoreEn->yuv_int_en; +- coreIntMask.ldc_int_mask = ~intCoreEn->ldc_int_en; ++ coreIntMask.int_raw_in_mask = ~intCoreEn->int_raw_in_en; ++ coreIntMask.int_3a_mask = ~intCoreEn->int_3a_en; ++ coreIntMask.raw_int_mask = ~intCoreEn->raw_int_en; ++ coreIntMask.rgb_int_mask = ~intCoreEn->rgb_int_en; ++ coreIntMask.yuv_int_mask = ~intCoreEn->yuv_int_en; ++ coreIntMask.ldc_int_mask = ~intCoreEn->ldc_int_en; + coreIntMask.main_out_int_mask = ~intCoreEn->main_out_int_en; +- coreIntMask.isp_awb_int_mask = ~intCoreEn->isp_awb_int_en; +- coreIntMask.isp_ae_int_mask = ~intCoreEn->isp_ae_int_en; +- coreIntMask.isp_af_int_mask = ~intCoreEn->isp_af_int_en; ++ coreIntMask.isp_awb_int_mask = ~intCoreEn->isp_awb_int_en; ++ coreIntMask.isp_ae_int_mask = ~intCoreEn->isp_ae_int_en; ++ coreIntMask.isp_af_int_mask = ~intCoreEn->isp_af_int_en; + Isp_Drv_R2k_Wrap_SetCoreIntCtlMask(isp,&coreIntMask); + return 0; + }; +@@ -708,33 +708,33 @@ int isp_r2k_wrap_setIntWr0(struct k510_isp_device *isp,struct isp_wrap_intwr0_in + { + + ISP_WRAP_DMA_WR_INT_MASK0_S wrIntMask0; +- wrIntMask0.wr_3dnr_y_frm_end_int_mask = ~intWr0En->wr_3dnr_y_frm_end_int_en; +- wrIntMask0.wr_3dnr_y_line_base_int_mask = ~intWr0En->wr_3dnr_y_line_base_int_en; ++ wrIntMask0.wr_3dnr_y_frm_end_int_mask = ~intWr0En->wr_3dnr_y_frm_end_int_en; ++ wrIntMask0.wr_3dnr_y_line_base_int_mask = ~intWr0En->wr_3dnr_y_line_base_int_en; + wrIntMask0.wr_3dnr_y_err_frm_end_int_mask = ~intWr0En->wr_3dnr_y_err_frm_end_int_en; +- wrIntMask0.wr_3dnr_y_err_immediate_int_mask = ~intWr0En->wr_3dnr_y_err_immediate_int_en; +- wrIntMask0.wr_3dnr_uv_frm_end_int_mask = ~intWr0En->wr_3dnr_uv_frm_end_int_en; +- wrIntMask0.wr_3dnr_uv_line_base_int_mask = ~intWr0En->wr_3dnr_uv_line_base_int_en; +- wrIntMask0.wr_3dnr_uv_err_frm_end_int_mask = ~intWr0En->wr_3dnr_uv_err_frm_end_int_en; +- wrIntMask0.wr_3dnr_uv_err_immediate_int_mask = ~intWr0En->wr_3dnr_uv_err_immediate_int_en; +- wrIntMask0.ldc_wr_y_frm_end_int_mask = ~intWr0En->ldc_wr_y_frm_end_int_en; +- wrIntMask0.ldc_wr_y_line_base_int_mask = ~intWr0En->ldc_wr_y_line_base_int_en; +- wrIntMask0.ldc_wr_y_err_frm_end_int_mask = ~intWr0En->ldc_wr_y_err_frm_end_int_en; +- wrIntMask0.ldc_wr_y_err_immediate_int_mask = ~intWr0En->ldc_wr_y_err_immediate_int_en; +- wrIntMask0.ldc_wr_uv_frm_end_int_mask = ~intWr0En->ldc_wr_uv_frm_end_int_en; +- wrIntMask0.ldc_wr_uv_line_base_int_mask = ~intWr0En->ldc_wr_uv_line_base_int_en; ++ wrIntMask0.wr_3dnr_y_err_immediate_int_mask = ~intWr0En->wr_3dnr_y_err_immediate_int_en; ++ wrIntMask0.wr_3dnr_uv_frm_end_int_mask = ~intWr0En->wr_3dnr_uv_frm_end_int_en; ++ wrIntMask0.wr_3dnr_uv_line_base_int_mask = ~intWr0En->wr_3dnr_uv_line_base_int_en; ++ wrIntMask0.wr_3dnr_uv_err_frm_end_int_mask = ~intWr0En->wr_3dnr_uv_err_frm_end_int_en; ++ wrIntMask0.wr_3dnr_uv_err_immediate_int_mask = ~intWr0En->wr_3dnr_uv_err_immediate_int_en; ++ wrIntMask0.ldc_wr_y_frm_end_int_mask = ~intWr0En->ldc_wr_y_frm_end_int_en; ++ wrIntMask0.ldc_wr_y_line_base_int_mask = ~intWr0En->ldc_wr_y_line_base_int_en; ++ wrIntMask0.ldc_wr_y_err_frm_end_int_mask = ~intWr0En->ldc_wr_y_err_frm_end_int_en; ++ wrIntMask0.ldc_wr_y_err_immediate_int_mask = ~intWr0En->ldc_wr_y_err_immediate_int_en; ++ wrIntMask0.ldc_wr_uv_frm_end_int_mask = ~intWr0En->ldc_wr_uv_frm_end_int_en; ++ wrIntMask0.ldc_wr_uv_line_base_int_mask = ~intWr0En->ldc_wr_uv_line_base_int_en; + wrIntMask0.ldc_wr_uv_err_frm_end_int_mask = ~intWr0En->ldc_wr_uv_err_frm_end_int_en; +- wrIntMask0.ldc_wr_uv_err_immediate_int_mask = ~intWr0En->ldc_wr_uv_err_immediate_int_en; +- wrIntMask0.wdr_wr_raw_frm_end_int_mask = ~intWr0En->wdr_wr_raw_frm_end_int_en; +- wrIntMask0.wdr_wr_raw_line_base_int_mask = ~intWr0En->wdr_wr_raw_line_base_int_en; +- wrIntMask0.wdr_wr_raw_err_frm_end_int_mask = ~intWr0En->wdr_wr_raw_err_frm_end_int_en; +- wrIntMask0.wdr_wr_raw_err_immediate_int_mask = ~intWr0En->wdr_wr_raw_err_immediate_int_en; ++ wrIntMask0.ldc_wr_uv_err_immediate_int_mask = ~intWr0En->ldc_wr_uv_err_immediate_int_en; ++ wrIntMask0.wdr_wr_raw_frm_end_int_mask = ~intWr0En->wdr_wr_raw_frm_end_int_en; ++ wrIntMask0.wdr_wr_raw_line_base_int_mask = ~intWr0En->wdr_wr_raw_line_base_int_en; ++ wrIntMask0.wdr_wr_raw_err_frm_end_int_mask = ~intWr0En->wdr_wr_raw_err_frm_end_int_en; ++ wrIntMask0.wdr_wr_raw_err_immediate_int_mask = ~intWr0En->wdr_wr_raw_err_immediate_int_en; + wrIntMask0.main_out_wr_y_frm_end_int_mask = ~intWr0En->main_out_wr_y_frm_end_int_en; +- wrIntMask0.main_out_wr_y_line_base_int_mask = ~intWr0En->main_out_wr_y_line_base_int_en; +- wrIntMask0.main_out_wr_y_err_frm_end_int_mask = ~intWr0En->main_out_wr_y_err_frm_end_int_en; +- wrIntMask0.main_out_wr_y_err_immediate_int_mask = ~intWr0En->main_out_wr_y_err_immediate_int_en; +- wrIntMask0.main_out_wr_uv_frm_end_int_mask = ~intWr0En->main_out_wr_uv_frm_end_int_en; +- wrIntMask0.main_out_wr_uv_line_base_int_mask = ~intWr0En->main_out_wr_uv_line_base_int_en; +- wrIntMask0.main_out_wr_uv_err_frm_end_int_mask = ~intWr0En->main_out_wr_uv_err_frm_end_int_en; ++ wrIntMask0.main_out_wr_y_line_base_int_mask = ~intWr0En->main_out_wr_y_line_base_int_en; ++ wrIntMask0.main_out_wr_y_err_frm_end_int_mask = ~intWr0En->main_out_wr_y_err_frm_end_int_en; ++ wrIntMask0.main_out_wr_y_err_immediate_int_mask = ~intWr0En->main_out_wr_y_err_immediate_int_en; ++ wrIntMask0.main_out_wr_uv_frm_end_int_mask = ~intWr0En->main_out_wr_uv_frm_end_int_en; ++ wrIntMask0.main_out_wr_uv_line_base_int_mask = ~intWr0En->main_out_wr_uv_line_base_int_en; ++ wrIntMask0.main_out_wr_uv_err_frm_end_int_mask = ~intWr0En->main_out_wr_uv_err_frm_end_int_en; + wrIntMask0.main_out_wr_uv_err_immediate_int_mask = ~intWr0En->main_out_wr_uv_err_immediate_int_en; + dev_dbg(isp->dev,"%s:wrIntMask0(0x%x)\n",__func__,wrIntMask0); + Isp_Drv_R2k_Wrap_SetDmaWRIntMask0(isp,&wrIntMask0); +@@ -745,102 +745,102 @@ int isp_r2k_wrap_setIntWr1(struct k510_isp_device *isp,struct isp_wrap_intwr1_in + { + ISP_WRAP_DMA_WR_INT_MASK1_S wrIntMask1; + wrIntMask1.ds0_out_wr_y_frm_end_mask = ~intWr1En->ds0_out_wr_y_frm_end_en; +- wrIntMask1.ds0_out_wr_y_line_base_mask = ~intWr1En->ds0_out_wr_y_line_base_en; +- wrIntMask1.ds0_out_wr_y_err_frm_end_mask = ~intWr1En->ds0_out_wr_y_err_frm_end_en; +- wrIntMask1.ds0_out_wr_y_err_immediate_mask = ~intWr1En->ds0_out_wr_y_err_immediate_en; +- wrIntMask1.ds0_out_wr_uv_frm_end_mask = ~intWr1En->ds0_out_wr_uv_frm_end_en; +- wrIntMask1.ds0_out_wr_uv_line_base_mask = ~intWr1En->ds0_out_wr_uv_line_base_en; +- wrIntMask1.ds0_out_wr_uv_err_frm_end_mask = ~intWr1En->ds0_out_wr_uv_err_frm_end_en; ++ wrIntMask1.ds0_out_wr_y_line_base_mask = ~intWr1En->ds0_out_wr_y_line_base_en; ++ wrIntMask1.ds0_out_wr_y_err_frm_end_mask = ~intWr1En->ds0_out_wr_y_err_frm_end_en; ++ wrIntMask1.ds0_out_wr_y_err_immediate_mask = ~intWr1En->ds0_out_wr_y_err_immediate_en; ++ wrIntMask1.ds0_out_wr_uv_frm_end_mask = ~intWr1En->ds0_out_wr_uv_frm_end_en; ++ wrIntMask1.ds0_out_wr_uv_line_base_mask = ~intWr1En->ds0_out_wr_uv_line_base_en; ++ wrIntMask1.ds0_out_wr_uv_err_frm_end_mask = ~intWr1En->ds0_out_wr_uv_err_frm_end_en; + wrIntMask1.ds0_out_wr_uv_err_immediate_mask = ~intWr1En->ds0_out_wr_uv_err_immediate_en; + wrIntMask1.ds1_out_wr_y_frm_end_mask = ~intWr1En->ds1_out_wr_y_frm_end_en; +- wrIntMask1.ds1_out_wr_y_line_base_mask = ~intWr1En->ds1_out_wr_y_line_base_en; +- wrIntMask1.ds1_out_wr_y_err_frm_end_mask = ~intWr1En->ds1_out_wr_y_err_frm_end_en; +- wrIntMask1.ds1_out_wr_y_err_immediate_mask = ~intWr1En->ds1_out_wr_y_err_immediate_en; +- wrIntMask1.ds1_out_wr_uv_frm_end_mask = ~intWr1En->ds1_out_wr_uv_frm_end_en; +- wrIntMask1.ds1_out_wr_uv_line_base_mask = ~intWr1En->ds1_out_wr_uv_line_base_en; +- wrIntMask1.ds1_out_wr_uv_err_frm_end_mask = ~intWr1En->ds1_out_wr_uv_err_frm_end_en; ++ wrIntMask1.ds1_out_wr_y_line_base_mask = ~intWr1En->ds1_out_wr_y_line_base_en; ++ wrIntMask1.ds1_out_wr_y_err_frm_end_mask = ~intWr1En->ds1_out_wr_y_err_frm_end_en; ++ wrIntMask1.ds1_out_wr_y_err_immediate_mask = ~intWr1En->ds1_out_wr_y_err_immediate_en; ++ wrIntMask1.ds1_out_wr_uv_frm_end_mask = ~intWr1En->ds1_out_wr_uv_frm_end_en; ++ wrIntMask1.ds1_out_wr_uv_line_base_mask = ~intWr1En->ds1_out_wr_uv_line_base_en; ++ wrIntMask1.ds1_out_wr_uv_err_frm_end_mask = ~intWr1En->ds1_out_wr_uv_err_frm_end_en; + wrIntMask1.ds1_out_wr_uv_err_immediate_mask = ~intWr1En->ds1_out_wr_uv_err_immediate_en; + wrIntMask1.ds2_out_wr_r_frm_end_mask = ~intWr1En->ds2_out_wr_r_frm_end_en; +- wrIntMask1.ds2_out_wr_r_line_base_mask = ~intWr1En->ds2_out_wr_r_line_base_en; +- wrIntMask1.ds2_out_wr_r_err_frm_end_mask = ~intWr1En->ds2_out_wr_r_err_frm_end_en; +- wrIntMask1.ds2_out_wr_r_err_immediate_mask = ~intWr1En->ds2_out_wr_r_err_immediate_en; ++ wrIntMask1.ds2_out_wr_r_line_base_mask = ~intWr1En->ds2_out_wr_r_line_base_en; ++ wrIntMask1.ds2_out_wr_r_err_frm_end_mask = ~intWr1En->ds2_out_wr_r_err_frm_end_en; ++ wrIntMask1.ds2_out_wr_r_err_immediate_mask = ~intWr1En->ds2_out_wr_r_err_immediate_en; + wrIntMask1.ds2_out_wr_g_frm_end_mask = ~intWr1En->ds2_out_wr_g_frm_end_en; +- wrIntMask1.ds2_out_wr_g_line_base_mask = ~intWr1En->ds2_out_wr_g_line_base_en; +- wrIntMask1.ds2_out_wr_g_err_frm_end_mask = ~intWr1En->ds2_out_wr_g_err_frm_end_en; +- wrIntMask1.ds2_out_wr_g_err_immediate_mask = ~intWr1En->ds2_out_wr_g_err_immediate_en; ++ wrIntMask1.ds2_out_wr_g_line_base_mask = ~intWr1En->ds2_out_wr_g_line_base_en; ++ wrIntMask1.ds2_out_wr_g_err_frm_end_mask = ~intWr1En->ds2_out_wr_g_err_frm_end_en; ++ wrIntMask1.ds2_out_wr_g_err_immediate_mask = ~intWr1En->ds2_out_wr_g_err_immediate_en; + wrIntMask1.ds2_out_wr_b_frm_end_mask = ~intWr1En->ds2_out_wr_b_frm_end_en; +- wrIntMask1.ds2_out_wr_b_line_base_mask = ~intWr1En->ds2_out_wr_b_line_base_en; +- wrIntMask1.ds2_out_wr_b_err_frm_end_mask = ~intWr1En->ds0_out_wr_uv_err_frm_end_en; +- wrIntMask1.ds2_out_wr_b_err_immediate_mask = ~intWr1En->ds0_out_wr_uv_err_immediate_en; +- dev_dbg(isp->dev,"%s:wrIntMask1(0x%x)\n",__func__,wrIntMask1); ++ wrIntMask1.ds2_out_wr_b_line_base_mask = ~intWr1En->ds2_out_wr_b_line_base_en; ++ wrIntMask1.ds2_out_wr_b_err_frm_end_mask = ~intWr1En->ds0_out_wr_uv_err_frm_end_en; ++ wrIntMask1.ds2_out_wr_b_err_immediate_mask = ~intWr1En->ds0_out_wr_uv_err_immediate_en; ++ dev_dbg(isp->dev,"%s:wrIntMask1(0x%x)\n",__func__,wrIntMask1); + Isp_Drv_R2k_Wrap_SetDmaWRIntMask1(isp,&wrIntMask1); + return 0; + } + // + int isp_r2k_wrap_setIntRd0(struct k510_isp_device *isp,struct isp_wrap_intrd0_info *intRd0En) + { +- ++ + ISP_WRAP_DMA_RD_INT_MASK0_S rdIntMask0; + rdIntMask0.rd_3dnr_y_frm_end_int_mask = ~intRd0En->rd_3dnr_y_frm_end_int_en; +- rdIntMask0.rd_3dnr_y_line_base_int_mask = ~intRd0En->rd_3dnr_y_line_base_int_en; +- rdIntMask0.rd_3dnr_y_err_frm_end_int_mask = ~intRd0En->rd_3dnr_y_err_frm_end_int_en; +- rdIntMask0.rd_3dnr_y_err_immediate_int_mask = ~intRd0En->rd_3dnr_y_err_immediate_int_en; +- rdIntMask0.rd_3dnr_uv_frm_end_int_mask = ~intRd0En->rd_3dnr_uv_frm_end_int_en; +- rdIntMask0.rd_3dnr_uv_line_base_int_mask = ~intRd0En->rd_3dnr_uv_line_base_int_en; +- rdIntMask0.rd_3dnr_uv_err_frm_end_int_mask = ~intRd0En->rd_3dnr_uv_err_frm_end_int_en; ++ rdIntMask0.rd_3dnr_y_line_base_int_mask = ~intRd0En->rd_3dnr_y_line_base_int_en; ++ rdIntMask0.rd_3dnr_y_err_frm_end_int_mask = ~intRd0En->rd_3dnr_y_err_frm_end_int_en; ++ rdIntMask0.rd_3dnr_y_err_immediate_int_mask = ~intRd0En->rd_3dnr_y_err_immediate_int_en; ++ rdIntMask0.rd_3dnr_uv_frm_end_int_mask = ~intRd0En->rd_3dnr_uv_frm_end_int_en; ++ rdIntMask0.rd_3dnr_uv_line_base_int_mask = ~intRd0En->rd_3dnr_uv_line_base_int_en; ++ rdIntMask0.rd_3dnr_uv_err_frm_end_int_mask = ~intRd0En->rd_3dnr_uv_err_frm_end_int_en; + rdIntMask0.rd_3dnr_uv_err_immediate_int_mask = ~intRd0En->rd_3dnr_uv_err_immediate_int_en; +- rdIntMask0.ldc_rd_y_frm_end_int_mask = ~intRd0En->ldc_rd_y_frm_end_int_en; +- rdIntMask0.ldc_rd_y_line_base_int_mask = ~intRd0En->ldc_rd_y_line_base_int_en; +- rdIntMask0.ldc_rd_y_err_frm_end_int_mask = ~intRd0En->ldc_rd_y_err_frm_end_int_en; +- rdIntMask0.ldc_rd_y_err_immediate_int_mask = ~intRd0En->ldc_rd_y_err_immediate_int_en; ++ rdIntMask0.ldc_rd_y_frm_end_int_mask = ~intRd0En->ldc_rd_y_frm_end_int_en; ++ rdIntMask0.ldc_rd_y_line_base_int_mask = ~intRd0En->ldc_rd_y_line_base_int_en; ++ rdIntMask0.ldc_rd_y_err_frm_end_int_mask = ~intRd0En->ldc_rd_y_err_frm_end_int_en; ++ rdIntMask0.ldc_rd_y_err_immediate_int_mask = ~intRd0En->ldc_rd_y_err_immediate_int_en; + rdIntMask0.ldc_rd_uv_frm_end_int_mask = ~intRd0En->ldc_rd_uv_frm_end_int_en; +- rdIntMask0.ldc_rd_uv_line_base_int_mask = ~intRd0En->ldc_rd_uv_line_base_int_en; +- rdIntMask0.ldc_rd_uv_err_frm_end_int_mask = ~intRd0En->ldc_rd_uv_err_frm_end_int_en; +- rdIntMask0.ldc_rd_uv_err_immediate_int_mask = ~intRd0En->ldc_rd_uv_err_immediate_int_en; +- rdIntMask0.wdr_rd_raw_frm_end_int_mask = ~intRd0En->wdr_rd_raw_frm_end_int_en; +- rdIntMask0.wdr_rd_raw_line_base_int_mask = ~intRd0En->wdr_rd_raw_line_base_int_en; +- rdIntMask0.wdr_rd_raw_err_frm_end_int_mask = ~intRd0En->wdr_rd_raw_err_frm_end_int_en; ++ rdIntMask0.ldc_rd_uv_line_base_int_mask = ~intRd0En->ldc_rd_uv_line_base_int_en; ++ rdIntMask0.ldc_rd_uv_err_frm_end_int_mask = ~intRd0En->ldc_rd_uv_err_frm_end_int_en; ++ rdIntMask0.ldc_rd_uv_err_immediate_int_mask = ~intRd0En->ldc_rd_uv_err_immediate_int_en; ++ rdIntMask0.wdr_rd_raw_frm_end_int_mask = ~intRd0En->wdr_rd_raw_frm_end_int_en; ++ rdIntMask0.wdr_rd_raw_line_base_int_mask = ~intRd0En->wdr_rd_raw_line_base_int_en; ++ rdIntMask0.wdr_rd_raw_err_frm_end_int_mask = ~intRd0En->wdr_rd_raw_err_frm_end_int_en; + rdIntMask0.wdr_rd_raw_err_immediate_int_mask = ~intRd0En->wdr_rd_raw_err_immediate_int_en; + Isp_Drv_R2k_Wrap_SetDmaRDIntMask0(isp,&rdIntMask0); + return 0; + } + +-void k510isp_r2k_irq_enable(struct k510_isp_device *isp,struct isp_irq_info *irq_info) ++void k510isp_r2k_irq_enable(struct k510_isp_device *isp,struct isp_irq_info *irq_info) + { + dev_dbg(isp->dev,"%s:start\n",__func__); + struct isp_wrap_intcore_info intCoreEn; + intCoreEn.int_raw_in_en = irq_info->raw_en; + if((1 ==irq_info->awb_en)||(1 ==irq_info->ae_en)||(1 ==irq_info->af_en)) + { +- intCoreEn.int_3a_en = 1; ++ intCoreEn.int_3a_en = 1; + } +- else +- intCoreEn.int_3a_en = 0; ++ else ++ intCoreEn.int_3a_en = 0; + +- intCoreEn.raw_int_en = irq_info->raw_en; +- intCoreEn.rgb_int_en = irq_info->rgb_en; +- intCoreEn.yuv_int_en = irq_info->yuv_en; +- intCoreEn.ldc_int_en = irq_info->ldc_core_en; ++ intCoreEn.raw_int_en = irq_info->raw_en; ++ intCoreEn.rgb_int_en = irq_info->rgb_en; ++ intCoreEn.yuv_int_en = irq_info->yuv_en; ++ intCoreEn.ldc_int_en = irq_info->ldc_core_en; + intCoreEn.main_out_int_en = irq_info->main_core_en; +-#if 0 +- intCoreEn.isp_awb_int_en = irq_info->awb_en; +- intCoreEn.isp_ae_int_en = irq_info->ae_en; +- intCoreEn.isp_af_int_en = irq_info->af_en; ++#if 0 ++ intCoreEn.isp_awb_int_en = irq_info->awb_en; ++ intCoreEn.isp_ae_int_en = irq_info->ae_en; ++ intCoreEn.isp_af_int_en = irq_info->af_en; + #else +- intCoreEn.isp_awb_int_en = 0; +- intCoreEn.isp_ae_int_en = 0; +- intCoreEn.isp_af_int_en = 0; ++ intCoreEn.isp_awb_int_en = 0; ++ intCoreEn.isp_ae_int_en = 0; ++ intCoreEn.isp_af_int_en = 0; + #endif + + isp_r2k_wrap_setIntCore(isp,&intCoreEn); + + static struct isp_wrap_intwr0_info intWr0En; +- intWr0En.wr_3dnr_y_frm_end_int_en = irq_info->nr3d_w_en; ++ intWr0En.wr_3dnr_y_frm_end_int_en = irq_info->nr3d_w_en; + intWr0En.wr_3dnr_uv_frm_end_int_en = irq_info->nr3d_w_en; + intWr0En.ldc_wr_y_frm_end_int_en = irq_info->ldc_w_en; + intWr0En.ldc_wr_uv_frm_end_int_en = irq_info->ldc_w_en; + intWr0En.wdr_wr_raw_frm_end_int_en = irq_info->wdr_w_en; +- intWr0En.main_out_wr_y_frm_end_int_en = irq_info->main_dma_en; ++ intWr0En.main_out_wr_y_frm_end_int_en = irq_info->main_dma_en; + intWr0En.main_out_wr_uv_frm_end_int_en = irq_info->main_dma_en; + dev_dbg(isp->dev,"%s:intWr0En(0x%x)\n",__func__,intWr0En); + isp_r2k_wrap_setIntWr0(isp,&intWr0En); +@@ -859,7 +859,7 @@ void k510isp_r2k_irq_enable(struct k510_isp_device *isp,struct isp_irq_info *irq + static struct isp_wrap_intrd0_info intRd0En; + intRd0En.rd_3dnr_y_frm_end_int_en = irq_info->nr3d_r_en; + intRd0En.rd_3dnr_uv_frm_end_int_en = irq_info->nr3d_r_en; +- intRd0En.ldc_rd_y_frm_end_int_en = irq_info->ldc_r_en; ++ intRd0En.ldc_rd_y_frm_end_int_en = irq_info->ldc_r_en; + intRd0En.ldc_rd_uv_frm_end_int_en = irq_info->ldc_r_en; + intRd0En.wdr_rd_raw_frm_end_int_en = irq_info->wdr_r_en; + isp_r2k_wrap_setIntRd0(isp,&intRd0En); +@@ -870,14 +870,14 @@ void k510isp_r2k_irq_enable(struct k510_isp_device *isp,struct isp_irq_info *irq + //ITC + static int isp_r2k_core_SetItc(struct k510_isp_device *isp,ITC_INFO_S *itcInfo) + { +- ++ + ISP_CORE_ITC_CTL_S stItcCtl; +- stItcCtl.hsync_pol = itcInfo->hsync_pol; +- stItcCtl.vsync_pol = itcInfo->vsync_pol; +- stItcCtl.hsync_input_timing = itcInfo->hsync_input_timing; ++ stItcCtl.hsync_pol = itcInfo->hsync_pol; ++ stItcCtl.vsync_pol = itcInfo->vsync_pol; ++ stItcCtl.hsync_input_timing = itcInfo->hsync_input_timing; + stItcCtl.vsync_input_timing = itcInfo->vsync_input_timing; +- stItcCtl.mirror_ctl = itcInfo->flip_ctl; +- stItcCtl.video_format_ctl = itcInfo->video_fmt_sel; ++ stItcCtl.mirror_ctl = itcInfo->flip_ctl; ++ stItcCtl.video_format_ctl = itcInfo->video_fmt_sel; + Isp_Drv_R2k_Core_SetItcCtl(isp,&stItcCtl); + return 0; + } +@@ -887,10 +887,10 @@ static int isp_r2k_core_SetImage(struct k510_isp_device *isp,ITC_INFO_S *itcInfo + + ISP_CORE_IMAGE_ATTR_S stImgAttr; + stImgAttr.image_height = itcInfo->total_size.Height - 1; +- stImgAttr.image_width = itcInfo->total_size.Width - 1; +- stImgAttr.image_v_start = itcInfo->itc_size.Height_st; +- stImgAttr.image_h_start = itcInfo->itc_size.Width_st; +- stImgAttr.image_active_width = itcInfo->itc_size.Width; ++ stImgAttr.image_width = itcInfo->total_size.Width - 1; ++ stImgAttr.image_v_start = itcInfo->itc_size.Height_st; ++ stImgAttr.image_h_start = itcInfo->itc_size.Width_st; ++ stImgAttr.image_active_width = itcInfo->itc_size.Width; + stImgAttr.image_active_height = itcInfo->itc_size.Height; + Isp_Drv_R2k_Core_SetImageAttr(isp,&stImgAttr); + return 0; +@@ -898,7 +898,7 @@ static int isp_r2k_core_SetImage(struct k510_isp_device *isp,ITC_INFO_S *itcInfo + //TPG + static int isp_r2k_core_SetTpgCtl(struct k510_isp_device *isp,TPG_INFO_S *tpgInfo) + { +- ++ + ISP_CORE_TEST_CTL_S stTestCtl; + stTestCtl.test_pattern_en = tpgInfo->tpg_en; + stTestCtl.bayer_mode_sel = tpgInfo->bayer_mode_sel; +@@ -906,14 +906,14 @@ static int isp_r2k_core_SetTpgCtl(struct k510_isp_device *isp,TPG_INFO_S *tpgInf + stTestCtl.test_pattern_sel = tpgInfo->tpg_sel; + stTestCtl.wdr_l_mul_data = tpgInfo->wdr_l_mul_data; + stTestCtl.wdr_m_mul_data = tpgInfo->wdr_m_mul_data; +- stTestCtl.wdr_s_mul_data = tpgInfo->wdr_s_mul_data; ++ stTestCtl.wdr_s_mul_data = tpgInfo->wdr_s_mul_data; + Isp_Drv_R2k_Core_SetTestCtl(isp,&stTestCtl); + return 0; + } + //BLC + static int isp_r2k_core_SetBlcCtl(struct k510_isp_device *isp,BLC_INFO_S *blcInfo) + { +- ++ + ISP_CORE_BLC_CTL_S stBlcCtl; + stBlcCtl.blc_en = blcInfo->blc_en; + stBlcCtl.blc_offset = blcInfo->blc_offset; +@@ -924,59 +924,59 @@ static int isp_r2k_core_SetBlcCtl(struct k510_isp_device *isp,BLC_INFO_S *blcInf + //LSC + static int isp_r2k_core_SetLscCtl(struct k510_isp_device *isp,LSC_INFO_S *lscInfo) + { +- ++ + ISP_CORE_LSC_CTL_S stLscCtl; +- stLscCtl.lsc_en = lscInfo->lsc_en; +- stLscCtl.lsc_h_center = lscInfo->lsc_h_center; ++ stLscCtl.lsc_en = lscInfo->lsc_en; ++ stLscCtl.lsc_h_center = lscInfo->lsc_h_center; + stLscCtl.lsc_v_center = lscInfo->lsc_v_center; + stLscCtl.lsc_red_ratio = lscInfo->lsc_r_ratio; +- stLscCtl.lsc_green_ratio = lscInfo->lsc_g_ratio; +- stLscCtl.lsc_blue_ratio = lscInfo->lsc_b_ratio; +- stLscCtl.lsc_ir_ratio = lscInfo->lsc_ir_ratio; ++ stLscCtl.lsc_green_ratio = lscInfo->lsc_g_ratio; ++ stLscCtl.lsc_blue_ratio = lscInfo->lsc_b_ratio; ++ stLscCtl.lsc_ir_ratio = lscInfo->lsc_ir_ratio; + Isp_Drv_R2k_Core_SetLscCtl(isp,&stLscCtl); + return 0; + } + //AE + static int isp_r2k_core_SetAeCtl(struct k510_isp_device *isp,AE_INFO_S *aeInfo) + { +- ++ + ISP_CORE_AE_CTL_S stAeCtl; +- stAeCtl.ae_as_en = aeInfo->ae_as_en; +- stAeCtl.ae_ag_en = aeInfo->ae_ag_en; +- stAeCtl.ae_airis_en = aeInfo->ae_airis_en; ++ stAeCtl.ae_as_en = aeInfo->ae_as_en; ++ stAeCtl.ae_ag_en = aeInfo->ae_ag_en; ++ stAeCtl.ae_airis_en = aeInfo->ae_airis_en; + stAeCtl.ae_enter_ls_sel = aeInfo->ae_enter_ls_sel; +- stAeCtl.ae_exit_ls_sel = aeInfo->ae_exit_ls_sel; ++ stAeCtl.ae_exit_ls_sel = aeInfo->ae_exit_ls_sel; + stAeCtl.ae_win_mode_sel = aeInfo->ae_win_mode_sel; + stAeCtl.ae_back_light_mode_sel = aeInfo->ae_back_light_mode_sel; +- stAeCtl.ae_day_change_en = aeInfo->ae_day_change_en; +- stAeCtl.ae_day_change_sel = aeInfo->ae_day_change_sel; ++ stAeCtl.ae_day_change_en = aeInfo->ae_day_change_en; ++ stAeCtl.ae_day_change_sel = aeInfo->ae_day_change_sel; + stAeCtl.ae_win_h_start = aeInfo->ae_win_size.h_start; + stAeCtl.ae_win_v_start = aeInfo->ae_win_size.v_start; +- stAeCtl.ae_win_h_end = aeInfo->ae_win_size.h_end; +- stAeCtl.ae_win_v_end = aeInfo->ae_win_size.v_end; +- stAeCtl.ae_tar_bright = aeInfo->ae_tar_bright; ++ stAeCtl.ae_win_h_end = aeInfo->ae_win_size.h_end; ++ stAeCtl.ae_win_v_end = aeInfo->ae_win_size.v_end; ++ stAeCtl.ae_tar_bright = aeInfo->ae_tar_bright; + stAeCtl.ae_tar_bright_range = aeInfo->ae_tar_bright_range; + stAeCtl.ae_l_ex_time = aeInfo->ae_l_ex_time; + stAeCtl.ae_m_ex_time = aeInfo->ae_m_ex_time; + stAeCtl.ae_s_ex_time = aeInfo->ae_s_ex_time; +- stAeCtl.ae_agc = aeInfo->ae_agc; ++ stAeCtl.ae_agc = aeInfo->ae_agc; + stAeCtl.ae_ad_shuttle_freq = aeInfo->ae_ad_shuttle_freq; + stAeCtl.ae_ad_gain_freq = aeInfo->ae_ad_gain_freq; + stAeCtl.ae_adjust_step_max = aeInfo->ae_adjust_step_max; +- stAeCtl.ae_ex_value_max = aeInfo->ae_ex_value_max; +- stAeCtl.ae_ex_value_mid = aeInfo->ae_ex_value_mid; +- stAeCtl.ae_ex_value_min = aeInfo->ae_ex_value_min; +- stAeCtl.ae_gain_value_max = aeInfo->ae_gain_value_max; ++ stAeCtl.ae_ex_value_max = aeInfo->ae_ex_value_max; ++ stAeCtl.ae_ex_value_mid = aeInfo->ae_ex_value_mid; ++ stAeCtl.ae_ex_value_min = aeInfo->ae_ex_value_min; ++ stAeCtl.ae_gain_value_max = aeInfo->ae_gain_value_max; + stAeCtl.ae_gain_value_mid = aeInfo->ae_gain_value_mid; + stAeCtl.ae_gain_value_min = aeInfo->ae_gain_value_min; + stAeCtl.ae_dn_switch_ad_step_max = aeInfo->ae_dn_switch_ad_step_max; + stAeCtl.ae_dn_switch_wait_time = aeInfo->ae_dn_switch_wait_time; + stAeCtl.ape_max_diff = aeInfo->ape_max_diff; +- stAeCtl.ape_drv_signal_max = aeInfo->ape_drv_signal_max; +- stAeCtl.ape_coeff_distance = aeInfo->ape_coeff_distance; ++ stAeCtl.ape_drv_signal_max = aeInfo->ape_drv_signal_max; ++ stAeCtl.ape_coeff_distance = aeInfo->ape_coeff_distance; + stAeCtl.ape_coeff_speed = aeInfo->ape_coeff_speed; + stAeCtl.ape_coeff_acceleration = aeInfo->ape_coeff_acceleration; +- stAeCtl.ape_drv_manual_value = aeInfo->ape_drv_manual_value; ++ stAeCtl.ape_drv_manual_value = aeInfo->ape_drv_manual_value; + stAeCtl.ape_damp_manual_value = aeInfo->ape_damp_manual_value; + Isp_Drv_R2k_Core_SetAeCtl(isp,&stAeCtl); + return 0; +@@ -1000,18 +1000,18 @@ static int isp_r2k_core_GetAeSts(struct k510_isp_device *isp,struct k510isp_ae_s + //AWB + static int isp_r2k_core_SetAwbCtl(struct k510_isp_device *isp,AWB_INFO_S *awbInfo) + { +- ++ + ISP_CORE_AWB_CTL_S stAwbCtl; +- stAwbCtl.awb_d65_en = awbInfo->awb_d65_en; +- stAwbCtl.awb_ccm_en = awbInfo->awb_ccm_en; +- stAwbCtl.awb_en = awbInfo->awb_en; ++ stAwbCtl.awb_d65_en = awbInfo->awb_d65_en; ++ stAwbCtl.awb_ccm_en = awbInfo->awb_ccm_en; ++ stAwbCtl.awb_en = awbInfo->awb_en; + stAwbCtl.awb_mode_sel = awbInfo->awb_mode_sel; + stAwbCtl.awb_hist_mode_sel = awbInfo->awb_hist_mode_sel; +- stAwbCtl.awb_veri_en = awbInfo->awb_veri_en; +- stAwbCtl.awb_mode_sel = awbInfo->awb_mode_sel; ++ stAwbCtl.awb_veri_en = awbInfo->awb_veri_en; ++ stAwbCtl.awb_mode_sel = awbInfo->awb_mode_sel; + stAwbCtl.awb_value_save_en = awbInfo->awb_value_save_en; + stAwbCtl.awb_ccm_adp_adjust_en = awbInfo->awb_ccm_adp_adjust_en; +- stAwbCtl.awb_stab_en = awbInfo->awb_stab_en; ++ stAwbCtl.awb_stab_en = awbInfo->awb_stab_en; + stAwbCtl.awb_d65_red_gain = awbInfo->awb_d65_red_gain; + stAwbCtl.awb_d65_blue_gain = awbInfo->awb_d65_blue_gain; + stAwbCtl.ccm_rr_coff = awbInfo->ccm_coff[0][0]; +@@ -1026,16 +1026,16 @@ static int isp_r2k_core_SetAwbCtl(struct k510_isp_device *isp,AWB_INFO_S *awbInf + stAwbCtl.ccm_correct_coff = awbInfo->ccm_correct_coff; + stAwbCtl.awb_win_h_start = awbInfo->awb_win_size.h_start; + stAwbCtl.awb_win_v_start = awbInfo->awb_win_size.v_start; +- stAwbCtl.awb_win_h_end = awbInfo->awb_win_size.h_end; +- stAwbCtl.awb_win_v_end = awbInfo->awb_win_size.v_end; +- stAwbCtl.awb_correct_diff_th = awbInfo->awb_correct_diff_th; ++ stAwbCtl.awb_win_h_end = awbInfo->awb_win_size.h_end; ++ stAwbCtl.awb_win_v_end = awbInfo->awb_win_size.v_end; ++ stAwbCtl.awb_correct_diff_th = awbInfo->awb_correct_diff_th; + stAwbCtl.awb_color_changeres_time = awbInfo->awb_color_changeres_time; + stAwbCtl.awb_historgram_th = awbInfo->awb_historgram_th; +- stAwbCtl.awb_red_gain_adjust = awbInfo->awb_red_gain_adjust; +- stAwbCtl.awb_green_gain_adjust = awbInfo->awb_green_gain_adjust; ++ stAwbCtl.awb_red_gain_adjust = awbInfo->awb_red_gain_adjust; ++ stAwbCtl.awb_green_gain_adjust = awbInfo->awb_green_gain_adjust; + stAwbCtl.awb_blue_gain_adjust = awbInfo->awb_blue_gain_adjust; + stAwbCtl.awb_red_max_value = awbInfo->awb_red_max_value; +- stAwbCtl.awb_blue_max_value = awbInfo->awb_blue_max_value; ++ stAwbCtl.awb_blue_max_value = awbInfo->awb_blue_max_value; + stAwbCtl.awb_red_min_value = awbInfo->awb_red_min_value; + stAwbCtl.awb_blue_min_value = awbInfo->awb_blue_min_value; + stAwbCtl.awb_red_obj_value = awbInfo->awb_red_obj_value; +@@ -1043,10 +1043,31 @@ static int isp_r2k_core_SetAwbCtl(struct k510_isp_device *isp,AWB_INFO_S *awbInf + Isp_Drv_R2k_Core_SetAwbCtl(isp,&stAwbCtl); + return 0; + } ++ ++// reg opt ++ ++static int isp_r2k_core_RegSet(struct k510_isp_device *isp,struct k510isp_reg_val *reg_val) ++{ ++ ISP_CORE_REG_VAL_S stRegVal; ++ stRegVal.reg_addr = reg_val->reg_addr; ++ stRegVal.reg_value = reg_val->reg_value; ++ Isp_Drv_R2k_Core_SetReg(isp,&stRegVal); ++ return 0; ++} ++ ++static int isp_r2k_core_RegGet(struct k510_isp_device *isp,struct k510isp_reg_val *reg_val) ++{ ++ ISP_CORE_REG_VAL_S gtRegVal; ++ gtRegVal.reg_addr = reg_val->reg_addr; ++ Isp_Drv_R2k_Core_GetReg(isp,>RegVal); ++ reg_val->reg_value = gtRegVal.reg_value; ++ return 0; ++} ++ + //CSC + static int isp_r2k_core_SetCscCtl(struct k510_isp_device *isp,CSC_INFO_S *cscInfo) + { +- ++ + ISP_CORE_CSC_CTL_S stCscCtl; + stCscCtl.csc_r2y_00 = cscInfo->csc_r2y[0][0]; + stCscCtl.csc_r2y_01 = cscInfo->csc_r2y[0][1]; +@@ -1063,23 +1084,23 @@ static int isp_r2k_core_SetCscCtl(struct k510_isp_device *isp,CSC_INFO_S *cscInf + //ADA + static int isp_r2k_core_SetAdaCtl(struct k510_isp_device *isp,ADA_INFO_S *adaInfo) + { +- ++ + ISP_CORE_ADA_CTL_S stAdaCtl; +- stAdaCtl.ada_rgb_gamma_en = adaInfo->ada_rgb_gamma_en; +- stAdaCtl.ada_yuv_gamma_en = adaInfo->ada_yuv_gamma_en; +- stAdaCtl.ada_adjust_en = adaInfo->ada_adjust_en; ++ stAdaCtl.ada_rgb_gamma_en = adaInfo->ada_rgb_gamma_en; ++ stAdaCtl.ada_yuv_gamma_en = adaInfo->ada_yuv_gamma_en; ++ stAdaCtl.ada_adjust_en = adaInfo->ada_adjust_en; + stAdaCtl.ada_img_stab_en = adaInfo->ada_img_stab_en; + stAdaCtl.ada_ccr_en = adaInfo->ada_ccr_en; + stAdaCtl.ada_adp_en = adaInfo->ada_adp_en; +- stAdaCtl.ada_adp_ccr_en = adaInfo->ada_adp_ccr_en; ++ stAdaCtl.ada_adp_ccr_en = adaInfo->ada_adp_ccr_en; + stAdaCtl.ada_stat_mode_sel = adaInfo->ada_stat_mode_sel; + stAdaCtl.ada_enh_mode_sel = adaInfo->ada_enh_mode_sel; +- stAdaCtl.ada_stat_max_value = adaInfo->ada_stat_max_value; ++ stAdaCtl.ada_stat_max_value = adaInfo->ada_stat_max_value; + stAdaCtl.ada_ad_stren_max_value = adaInfo->ada_ad_stren_max_value; + stAdaCtl.ada_win_h_start = adaInfo->ada_win_size.h_start; + stAdaCtl.ada_win_v_start = adaInfo->ada_win_size.v_start; +- stAdaCtl.ada_win_h_end = adaInfo->ada_win_size.h_end; +- stAdaCtl.ada_win_v_end = adaInfo->ada_win_size.v_end; ++ stAdaCtl.ada_win_h_end = adaInfo->ada_win_size.h_end; ++ stAdaCtl.ada_win_v_end = adaInfo->ada_win_size.v_end; + Isp_Drv_R2k_Core_SetAdaCtl(isp,&stAdaCtl); + return 0; + } +@@ -1088,33 +1109,33 @@ static int isp_r2k_core_SetRgbirCtl(struct k510_isp_device *isp,RGBIR_INFO_S *rg + { + + ISP_CORE_RGBIR_CTL_S stRgbirCtl; +- stRgbirCtl.rgbir_en = rgbirInfo->rgbir_en; +- stRgbirCtl.rgbir_rtf_en = rgbirInfo->rgbir_rtf_en; +- stRgbirCtl.rgbir_rpc_en = rgbirInfo->rgbir_rpc_en; ++ stRgbirCtl.rgbir_en = rgbirInfo->rgbir_en; ++ stRgbirCtl.rgbir_rtf_en = rgbirInfo->rgbir_rtf_en; ++ stRgbirCtl.rgbir_rpc_en = rgbirInfo->rgbir_rpc_en; + stRgbirCtl.rgbir_fusion_en = rgbirInfo->rgbir_fusion_en; + stRgbirCtl.rgbir_output_sel = rgbirInfo->rgbir_output_sel; +- stRgbirCtl.rgbir_rpc_max_value = rgbirInfo->rgbir_rpc_max_value; ++ stRgbirCtl.rgbir_rpc_max_value = rgbirInfo->rgbir_rpc_max_value; + stRgbirCtl.rgbir_rpc_color_coff = rgbirInfo->rgbir_rpc_color_coff; +- stRgbirCtl.rgbir_rpc_luma_coff = rgbirInfo->rgbir_rpc_luma_coff; ++ stRgbirCtl.rgbir_rpc_luma_coff = rgbirInfo->rgbir_rpc_luma_coff; + stRgbirCtl.rgbir_rpc_th = rgbirInfo->rgbir_rpc_th; +- stRgbirCtl.rgbir_rpc_th1 = rgbirInfo->rgbir_rpc_th1; ++ stRgbirCtl.rgbir_rpc_th1 = rgbirInfo->rgbir_rpc_th1; + Isp_Drv_R2k_Core_SetRgbIrCtl(isp,&stRgbirCtl); + return 0; + } + //2DNR + static int isp_r2k_core_Set2dnrCtl(struct k510_isp_device *isp,NR2D_INFO_S *nr2dInfo) + { +- ++ + ISP_CORE_2DNR_CTL_S st2dnrCtl; + st2dnrCtl.core_2dnr_pcf_en = nr2dInfo->d2nr_pcf_en; + st2dnrCtl.core_2dnr_raw_en = nr2dInfo->d2nr_raw_en; +- st2dnrCtl.core_2dnr_edge_en = nr2dInfo->d2nr_edge_en; ++ st2dnrCtl.core_2dnr_edge_en = nr2dInfo->d2nr_edge_en; + st2dnrCtl.core_2dnr_bap_en = nr2dInfo->d2nr_bap_en; +- st2dnrCtl.core_2dnr_luma_en = nr2dInfo->d2nr_luma_en; +- st2dnrCtl.core_2dnr_chroma_en = nr2dInfo->d2nr_chroma_en; +- st2dnrCtl.core_2dnr_pcf_adp_en = nr2dInfo->d2nr_pcf_adp_en; +- st2dnrCtl.core_2dnr_raw_adp_en = nr2dInfo->d2nr_raw_adp_en; +- st2dnrCtl.core_2dnr_luma_adp_en = nr2dInfo->d2nr_luma_adp_en; ++ st2dnrCtl.core_2dnr_luma_en = nr2dInfo->d2nr_luma_en; ++ st2dnrCtl.core_2dnr_chroma_en = nr2dInfo->d2nr_chroma_en; ++ st2dnrCtl.core_2dnr_pcf_adp_en = nr2dInfo->d2nr_pcf_adp_en; ++ st2dnrCtl.core_2dnr_raw_adp_en = nr2dInfo->d2nr_raw_adp_en; ++ st2dnrCtl.core_2dnr_luma_adp_en = nr2dInfo->d2nr_luma_adp_en; + st2dnrCtl.core_2dnr_chroma_adp_en = nr2dInfo->d2nr_chroma_adp_en; + st2dnrCtl.core_2dnr_raw_intensity = nr2dInfo->d2nr_raw_intensity; + st2dnrCtl.core_2dnr_bap_intensity = nr2dInfo->d2nr_bap_intensity; +@@ -1130,17 +1151,17 @@ static int isp_r2k_core_SetEnhCtl(struct k510_isp_device *isp,ENH_INFO_S *enhInf + + ISP_CORE_ENH_CTL_S stEnhCtl; + stEnhCtl.enh_ltm_en = enhInfo->enh_ltm_en; +- stEnhCtl.enh_sharp_en = enhInfo->enh_sharp_en; +- stEnhCtl.enh_cc_en = enhInfo->enh_cc_en; +- stEnhCtl.enh_adp_ltm_en = enhInfo->enh_adp_ltm_en; +- stEnhCtl.enh_adp_sharp_en = enhInfo->enh_adp_sharp_en; +- stEnhCtl.enh_adp_cc_en = enhInfo->enh_adp_cc_en; +- stEnhCtl.ltm_gain = enhInfo->ltm_gain; +- stEnhCtl.ltm_th = enhInfo->ltm_th; +- stEnhCtl.enh_nr_th = enhInfo->enh_nr_th; ++ stEnhCtl.enh_sharp_en = enhInfo->enh_sharp_en; ++ stEnhCtl.enh_cc_en = enhInfo->enh_cc_en; ++ stEnhCtl.enh_adp_ltm_en = enhInfo->enh_adp_ltm_en; ++ stEnhCtl.enh_adp_sharp_en = enhInfo->enh_adp_sharp_en; ++ stEnhCtl.enh_adp_cc_en = enhInfo->enh_adp_cc_en; ++ stEnhCtl.ltm_gain = enhInfo->ltm_gain; ++ stEnhCtl.ltm_th = enhInfo->ltm_th; ++ stEnhCtl.enh_nr_th = enhInfo->enh_nr_th; + stEnhCtl.enh_th1 = enhInfo->enh_th1; + stEnhCtl.enh_th2 = enhInfo->enh_th2; +- stEnhCtl.sharp_gain = enhInfo->sharp_gain; ++ stEnhCtl.sharp_gain = enhInfo->sharp_gain; + Isp_Drv_R2k_Core_SetEnhLtmCtl(isp,&stEnhCtl); + Isp_Drv_R2k_Core_SetEnhCCCtl(isp,&stEnhCtl); + Isp_Drv_R2k_Core_SetEnhSharpenCtl(isp,&stEnhCtl); +@@ -1151,10 +1172,10 @@ static int isp_r2k_core_SetPostCtl(struct k510_isp_device *isp,POST_INFO_S *post + { + + ISP_CORE_POST_CTL_S stPostCtl; +- stPostCtl.post_cont_ad_en = postInfo->post_cont_ad_en; +- stPostCtl.post_luma_ad_en = postInfo->post_luma_ad_en; ++ stPostCtl.post_cont_ad_en = postInfo->post_cont_ad_en; ++ stPostCtl.post_luma_ad_en = postInfo->post_luma_ad_en; + stPostCtl.post_satu_ad_en = postInfo->post_satu_ad_en; +- stPostCtl.cont_ad_intensity = postInfo->cont_ad_intensity; ++ stPostCtl.cont_ad_intensity = postInfo->cont_ad_intensity; + stPostCtl.luma_ad_intensity = postInfo->luma_ad_intensity; + stPostCtl.satu_ad_intensity = postInfo->satu_ad_intensity; + Isp_Drv_R2k_Core_SetPostContCtl(isp,&stPostCtl); +@@ -1165,46 +1186,46 @@ static int isp_r2k_core_SetPostCtl(struct k510_isp_device *isp,POST_INFO_S *post + //OTC + static int isp_r2k_core_SetOtcCtl(struct k510_isp_device *isp,OTC_INFO_S *otcInfo) + { +- ++ + ISP_CORE_OTC_CTL_S stOtcCtl; + stOtcCtl.post_otc_en = otcInfo->post_otc_en; +- stOtcCtl.otc_yc_sel = otcInfo->otc_yc_sel; +- stOtcCtl.otc_uv_format_sel = otcInfo->otc_uv_format_sel; +- stOtcCtl.otc_hsync_pol_sel = otcInfo->otc_hsync_pol_sel; +- stOtcCtl.otc_vsync_pol_sel = otcInfo->otc_vsync_pol_sel; +- stOtcCtl.otc_stt_vr = otcInfo->otc_out_size.Width_st; +- stOtcCtl.otc_stt_hr = otcInfo->otc_out_size.Height_st; +- stOtcCtl.otc_height = otcInfo->otc_out_size.Height; +- stOtcCtl.otc_width = otcInfo->otc_out_size.Width; ++ stOtcCtl.otc_yc_sel = otcInfo->otc_yc_sel; ++ stOtcCtl.otc_uv_format_sel = otcInfo->otc_uv_format_sel; ++ stOtcCtl.otc_hsync_pol_sel = otcInfo->otc_hsync_pol_sel; ++ stOtcCtl.otc_vsync_pol_sel = otcInfo->otc_vsync_pol_sel; ++ stOtcCtl.otc_stt_vr = otcInfo->otc_out_size.Width_st; ++ stOtcCtl.otc_stt_hr = otcInfo->otc_out_size.Height_st; ++ stOtcCtl.otc_height = otcInfo->otc_out_size.Height; ++ stOtcCtl.otc_width = otcInfo->otc_out_size.Width; + Isp_Drv_R2k_Core_SetOtcCtl(isp,&stOtcCtl); + return 0; + } + //LDC + static int isp_r2k_core_SetLdcCtl(struct k510_isp_device *isp,LDC_INFO_S *ldcInfo) + { +- ++ + ISP_CORE_LDC_CTL_S stLdcCtl; +- stLdcCtl.ldc_en = ldcInfo->ldc_en; +- stLdcCtl.ldc_arith_en = ldcInfo->ldc_arith_en; ++ stLdcCtl.ldc_en = ldcInfo->ldc_en; ++ stLdcCtl.ldc_arith_en = ldcInfo->ldc_arith_en; + stLdcCtl.ldc_req_freq = ldcInfo->ldc_req_freq; + stLdcCtl.ldc_stt_ln = ldcInfo->ldc_stt_ln; + stLdcCtl.ldc_h_center_pos = ldcInfo->ldc_h_center_pos; + stLdcCtl.ldc_v_center_pos = ldcInfo->ldc_v_center_pos; + stLdcCtl.ldc_rectify_cr = ldcInfo->ldc_rectify_cr; +- stLdcCtl.ldc_rectify_cz = ldcInfo->ldc_rectify_cz; ++ stLdcCtl.ldc_rectify_cz = ldcInfo->ldc_rectify_cz; + Isp_Drv_R2k_Core_SetLdcCtl(isp,&stLdcCtl); + return 0; + } + //AF + static int isp_r2k_core_SetAfCtl(struct k510_isp_device *isp,AF_INFO_S *afInfo) + { +- ++ + ISP_CORE_AF_CTL_S stAfCtl; +- stAfCtl.af_stat_en = afInfo->af_stat_en; +- stAfCtl.af_stat_mode_sel= afInfo->af_stat_mode_sel; +- stAfCtl.af_stat_win_h_start= afInfo->af_win_size.h_start; +- stAfCtl.af_stat_win_v_start= afInfo->af_win_size.v_start; +- stAfCtl.af_stat_win_h_end= afInfo->af_win_size.h_end; ++ stAfCtl.af_stat_en = afInfo->af_stat_en; ++ stAfCtl.af_stat_mode_sel= afInfo->af_stat_mode_sel; ++ stAfCtl.af_stat_win_h_start= afInfo->af_win_size.h_start; ++ stAfCtl.af_stat_win_v_start= afInfo->af_win_size.v_start; ++ stAfCtl.af_stat_win_h_end= afInfo->af_win_size.h_end; + stAfCtl.af_stat_win_v_end= afInfo->af_win_size.v_end; + Isp_Drv_R2k_Core_SetAfCtl(isp,&stAfCtl); + return 0; +@@ -1289,7 +1310,7 @@ void isp_r2k_ds_SetInputSize(struct k510_isp_device *isp,IMAGE_SIZE *dsInSizeInf + // + void isp_r2k_ds_SetRgb2YuvCoff(struct k510_isp_device *isp) + { +- ++ + unsigned int osd_rgb2yuv_coeff[3][4]; + osd_rgb2yuv_coeff[0][0]= 0x00000132; + osd_rgb2yuv_coeff[0][1]= 0x00000259; +@@ -1308,7 +1329,7 @@ void isp_r2k_ds_SetRgb2YuvCoff(struct k510_isp_device *isp) + // + void isp_r2k_ds_SetYuv2RgbCoff(struct k510_isp_device *isp) + { +- ++ + unsigned int osd_yuv2rgb_coeff[3][4]; + osd_yuv2rgb_coeff[0][0] = 0x00000400; + osd_yuv2rgb_coeff[0][1] = 0x00000000; +@@ -1375,15 +1396,15 @@ void isp_r2k_ds_SetSingleDS(struct k510_isp_device *isp,unsigned int u8Index,str + stDsFormat->out_rgb_mode = dsInfo->out_rgb_mode; + stDsFormat->out_yuv_mode = dsInfo->out_yuv_mode; + stDsFormat->out_uv_swap = dsInfo->out_uv_swap; +- unsigned int osdIndex = 0; ++ unsigned int osdIndex = 0; + ISP_DS_OSD_ATTR_S *stDsOsdAttr = &stDsAttr.DsOsdAttr[osdIndex]; + ISP_OSD_INFO_S *osdInfo = &dsInfo->osdInfo[osdIndex]; + isp_r2k_ds_SetOSD(stDsOsdAttr,osdInfo); +- osdIndex = 1; ++ osdIndex = 1; + stDsOsdAttr = &stDsAttr.DsOsdAttr[osdIndex]; + osdInfo = &dsInfo->osdInfo[osdIndex]; + isp_r2k_ds_SetOSD(stDsOsdAttr,osdInfo); +- osdIndex = 2; ++ osdIndex = 2; + stDsOsdAttr = &stDsAttr.DsOsdAttr[osdIndex]; + osdInfo = &dsInfo->osdInfo[osdIndex]; + isp_r2k_ds_SetOSD(stDsOsdAttr,osdInfo); +@@ -1421,13 +1442,13 @@ static int isp_r2k_ds_config(struct isp_r2k_device *r2k,struct isp_ds_cfg_info * + * + *****************************************************************************/ + static int isp_r2k_config(struct k510_isp_device *isp,struct isp_cfg_info *isp_cfg) +-{ ++{ + struct isp_r2k_device *r2k = &isp->isp_r2k; + struct isp_core_cfg_info *isp_core_cfg =&isp_cfg->isp_core_cfg; + isp_r2k_core_config(r2k,isp_core_cfg); + struct isp_ds_cfg_info *isp_ds_cfg =&isp_cfg->isp_ds_cfg; + isp_r2k_ds_config(r2k,isp_ds_cfg); +- struct isp_wrap_cfg_info *isp_wrap_cfg =&isp_cfg->isp_wrap_cfg; ++ struct isp_wrap_cfg_info *isp_wrap_cfg =&isp_cfg->isp_wrap_cfg; + dev_dbg(isp->dev,"%s:main_y_buf0_base(0x%x)\n",__func__,isp_wrap_cfg->mainInfo.main_y_buf0_base); + isp_r2k_wrap_config(r2k,isp_wrap_cfg); + // printk("isp_r2k_config end \n"); +@@ -1451,7 +1472,7 @@ static void isp_r2k_set_fbc_outaddr(struct isp_r2k_device *r2k, u32 addr) + addr = addr+1920*1080; + isp_reg_writel(isp,addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_MAIN_UV_BUF0_BASE); + isp_reg_writel(isp,addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_MAIN_UV_BUF1_BASE); +- isp_reg_writel(isp,0x30001,ISP_IOMEM_R2K_WRAP,ISP_WRAP_CONFIG_DONE); ++ isp_reg_writel(isp,0x30001,ISP_IOMEM_R2K_WRAP,ISP_WRAP_CONFIG_DONE); + } + + /* +@@ -1472,8 +1493,8 @@ static void isp_r2k_set_main_outaddr(struct isp_r2k_device *r2k, u32 addr) + __func__,main_info->main_line_stride,main_info->main_size.Width,main_info->main_size.Height); + addr = addr + main_info->main_line_stride*main_info->main_size.Height;//1920*1080; + isp_reg_writel(isp,addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_MAIN_UV_BUF0_BASE); +- isp_reg_writel(isp,addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_MAIN_UV_BUF1_BASE); +- isp_reg_writel(isp,0x30001,ISP_IOMEM_R2K_WRAP,ISP_WRAP_CONFIG_DONE); ++ isp_reg_writel(isp,addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_MAIN_UV_BUF1_BASE); ++ isp_reg_writel(isp,0x30001,ISP_IOMEM_R2K_WRAP,ISP_WRAP_CONFIG_DONE); + } + + /* +@@ -1532,7 +1553,7 @@ static void isp_r2k_set_out1_outaddr(struct isp_r2k_device *r2k, u32 addr) + addr = addr + ds1_info->ds1_line_stride*ds1_info->ds1_size.Height;//1920*1080; + isp_reg_writel(isp,addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_DS1_UV_BUF0_BASE); + isp_reg_writel(isp,addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_DS1_UV_BUF1_BASE); +- isp_reg_writel(isp,0x30001,ISP_IOMEM_R2K_WRAP,ISP_WRAP_CONFIG_DONE); ++ isp_reg_writel(isp,0x30001,ISP_IOMEM_R2K_WRAP,ISP_WRAP_CONFIG_DONE); + } + + /* +@@ -1549,23 +1570,23 @@ static void isp_r2k_set_out2_outaddr(struct isp_r2k_device *r2k, u32 addr) + struct isp_wrap_ds2_info *ds2_info = &isp_wrap_cfg->ds2Info; + u32 r_addr,g_addr,b_addr; + unsigned int height = ds2_info->ds2_video_height;//ds2_info->ds2_size.Height +- // = ++ // = + //dev_dbg(r2k->isp->dev,"%s:line_stride (%d),Width(%d),Height(%d)\n",\ + __func__,ds2_info->ds2_line_stride,ds2_info->ds2_size.Width,height); +- r_addr = addr; ++ r_addr = addr; + isp_reg_writel(isp,r_addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_DS2_R_BUF0_BASE); + isp_reg_writel(isp,r_addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_DS2_R_BUF1_BASE); + + if( DS2_S_RGB == ds2_info->ds2_out_img_out_format) + g_addr = r_addr + ds2_info->ds2_line_stride * height; +- else ++ else + g_addr = r_addr + ds2_info->ds2_line_stride; + isp_reg_writel(isp,g_addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_DS2_G_BUF0_BASE); + isp_reg_writel(isp,g_addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_DS2_G_BUF1_BASE); + // + if( DS2_S_RGB == ds2_info->ds2_out_img_out_format) + b_addr = g_addr + ds2_info->ds2_line_stride * height; +- else ++ else + b_addr = g_addr + ds2_info->ds2_line_stride; + isp_reg_writel(isp,b_addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_DS2_B_BUF0_BASE); + isp_reg_writel(isp,b_addr,ISP_IOMEM_R2K_WRAP,ISP_WRAP_DS2_B_BUF1_BASE); +@@ -1594,7 +1615,7 @@ static void isp_r2k_enable(struct isp_r2k_device *r2k) + void isp_r2k_wrap_print_status(struct isp_r2k_device *r2k) + { + +- ++ + struct k510_isp_device *isp = to_isp_device(r2k); + + dev_dbg(isp->dev, "-------------ISP R2K WRAP Register dump start----------\n"); +@@ -1749,13 +1770,13 @@ static void isp_r2k_core_print_status(struct isp_r2k_device *r2k) + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_IMAGE_H_START ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_IMAGE_ACTIVE_WIDTH ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_IMAGE_ACTIVE_HEIGHT ); +- //tpg ++ //tpg + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_TEST_CTL ); +- //blc ++ //blc + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_BLC_CTL ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_BLC_OFFSET ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_BLC_RATIO ); +- //lsc ++ //lsc + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_CTL ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_H_CENTER ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_V_CENTER ); +@@ -1763,7 +1784,7 @@ static void isp_r2k_core_print_status(struct isp_r2k_device *r2k) + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_G_RATIO ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_B_RATIO ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LSC_IR_RATIO ); +- //ae ++ //ae + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_CTL ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_WIN_H_START ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_WIN_V_START ); +@@ -1785,7 +1806,7 @@ static void isp_r2k_core_print_status(struct isp_r2k_device *r2k) + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_GAIN_MIN ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_DN_SWITCH_ADJUST_STEP_MAX); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_DN_SWITCH_WAIT_TIME ); +- ++ + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_DIFF_MAX ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_DRV_SIGNAL_MAX ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_COEFF_DIS ); +@@ -1793,7 +1814,7 @@ static void isp_r2k_core_print_status(struct isp_r2k_device *r2k) + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_COEFF_ACCE ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_DRV_MANUAL_VALUE ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_APE_DAMP_MANUAL_VALUE ); +- ++ + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_VALUE_READY ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_LONG_CUR_EX ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_MID_CUR_EX ); +@@ -1804,7 +1825,7 @@ static void isp_r2k_core_print_status(struct isp_r2k_device *r2k) + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_EX_STATUS ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_SUM ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AE_PIXEL_SUM ); +- //awb ++ //awb + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_CTL ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_D65_RED_GAIN ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_D65_BLUE_GAIN ); +@@ -1848,7 +1869,7 @@ static void isp_r2k_core_print_status(struct isp_r2k_device *r2k) + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_ORG_RED_VALUE ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_ORG_GREEN_VALUE ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AWB_ORG_BLUE_VALUE ); +- //csc ++ //csc + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_00 ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_01 ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_02 ); +@@ -1858,7 +1879,7 @@ static void isp_r2k_core_print_status(struct isp_r2k_device *r2k) + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_20 ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_21 ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CSC_R2Y_22 ); +- //ada ++ //ada + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_CTL ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_STAT_MAX_VALUE ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_AD_STREN_MAX_VALUE ); +@@ -1866,21 +1887,21 @@ static void isp_r2k_core_print_status(struct isp_r2k_device *r2k) + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_WIN_V_START ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_WIN_H_END ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ADA_WIN_V_END ); +- //rgbir ++ //rgbir + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_CTL ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_RPC_MAX_VALUE ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_RPC_COLOR_COFF ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_RPC_LUMA_COFF ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_RPC_TH ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RGBIR_RPC_TH1 ); +- //2dnr ++ //2dnr + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_CTL ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_RAW_INTENSITY ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_BAP_INTENSITY ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_EDGE_INTENSITY ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_LUMA_INTENSITY ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_2DNR_CHROMA_INTENSITY ); +- //enh ++ //enh + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ENH_CTL ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LTM_GAIN ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LTM_TH ); +@@ -1888,28 +1909,28 @@ static void isp_r2k_core_print_status(struct isp_r2k_device *r2k) + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ENH_TH1 ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_ENH_TH2 ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_SHARP_GAIN ); +- //post ++ //post + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_POST_CTL ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_CONT_GAIN ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LUMA_GAIN ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_SATU_GAIN ); +- //otc ++ //otc + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_OTC_STT_VR ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_OTC_STT_HR ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_OTC_HEIGHT ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_OTC_WIDTH ); +- //ldc ++ //ldc + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_CTL ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_REQ_FREQ ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_H_CENTER_POS ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_V_CENTER_POS ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_RECTIFY_CR ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_LDC_RECTIFY_CZ ); +- //ram table ++ //ram table + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RAM_WR_STATUS ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RAM_RD_STATUS ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_RAM_READ_LOCK ); +- //af ++ //af + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AF_CTL ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AF_STAT_WIN_H_START ); + ISP_R2K_CORE_PRINT_REGISTER(isp,ISP_CORE_AF_STAT_WIN_V_START ); +@@ -2100,7 +2121,7 @@ static int isp_r2k_remap_out0_config(struct isp_r2k_device *r2k,struct isp_remap + { + + struct k510_isp_device *isp = to_isp_device(r2k); +- ++ + ISP_DRV_LINE_DRAW_U DrawAreaNum; + ISP_REMAP_ATTR_S stRemapCtl; + +@@ -2113,7 +2134,7 @@ static int isp_r2k_remap_out1_config(struct isp_r2k_device *r2k,struct isp_remap + { + + struct k510_isp_device *isp = to_isp_device(r2k); +- ++ + ISP_DRV_LINE_DRAW_U DrawAreaNum; + ISP_REMAP_ATTR_S stRemapCtl; + Isp_Drv_R2k_Remap_SetOut1Line(isp,DrawAreaNum,&stRemapCtl); +@@ -2137,7 +2158,7 @@ static int isp_r2k_remap_out1_config(struct isp_r2k_device *r2k,struct isp_remap + static void isp_r2k_remap_print_status(struct isp_r2k_device *r2k) + { + +- ++ + struct k510_isp_device *isp = to_isp_device(r2k); + // + dev_dbg(isp->dev, "-------------ISP R2K MAIN REMAP Register dump start----------\n"); +@@ -2205,39 +2226,39 @@ static void isp_r2k_remap_print_status(struct isp_r2k_device *r2k) + ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_30_1_CTRL); + ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_0_CTRL); + ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_1_CTRL); +- +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); ++ ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); + ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_19_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); +- ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); ++ ISP_R2K_MAIN_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); + dev_dbg(isp->dev, "-------------ISP R2K MAIN REMAP Register dump end----------\n"); + // + dev_dbg(isp->dev, "-------------ISP R2K OUT0 REMAP Register dump start----------\n"); +@@ -2305,39 +2326,39 @@ static void isp_r2k_remap_print_status(struct isp_r2k_device *r2k) + ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_30_1_CTRL); + ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_0_CTRL); + ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_1_CTRL); +- +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); ++ ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); + ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_19_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); +- ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); ++ ISP_R2K_OUT0_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); + dev_dbg(isp->dev, "-------------ISP R2K OUT0 REMAP Register dump end----------\n"); + // + dev_dbg(isp->dev, "-------------ISP R2K OUT1 REMAP Register dump start----------\n"); +@@ -2405,39 +2426,39 @@ static void isp_r2k_remap_print_status(struct isp_r2k_device *r2k) + ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_30_1_CTRL); + ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_0_CTRL); + ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_INFO_AREA_31_1_CTRL); +- +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); ++ ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_00_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_01_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_02_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_03_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_04_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_05_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_06_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_07_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_08_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_09_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_10_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_11_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_12_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_13_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_14_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_15_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_16_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_17_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_18_0_CTRL); + ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_19_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); +- ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_20_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_21_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_22_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_23_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_24_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_25_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_26_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_27_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_28_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_29_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_30_0_CTRL); ++ ISP_R2K_OUT1_REMAP_PRINT_REGISTER(isp,ISP_FILL_DATA_AREA_31_0_CTRL); + dev_dbg(isp->dev, "-------------ISP R2K OUT1 REMAP Register dump end----------\n"); + } + +@@ -2453,7 +2474,7 @@ static void video_buffer_next(struct isp_r2k_device *r2k, enum video_type dsNum) + unsigned long flags; + int drop = 0; + struct isp_cfg_info *isp_cfg = &r2k->isp_cfg; +- ++ + dev_dbg(video->isp->dev,"%s:start\n",__func__); + spin_lock_irqsave(&video->irqlock, flags); + if (WARN_ON(list_empty(&video->dmaqueue))) { +@@ -2462,7 +2483,7 @@ static void video_buffer_next(struct isp_r2k_device *r2k, enum video_type dsNum) + if(isp_cfg->isp_wrap_cfg.ds0Info.ds0_out_en == 0 && dsNum == DS0_VIDEO) + { + return; +- } ++ } + r2k->profile.no_buf_drop_cnt++; + return; + } +@@ -2472,15 +2493,15 @@ static void video_buffer_next(struct isp_r2k_device *r2k, enum video_type dsNum) + if(isp_cfg->isp_wrap_cfg.ds0Info.ds0_out_en == 0 && dsNum == DS0_VIDEO) + { + return; +- } ++ } + r2k->profile.no_buf_drop_cnt++; + return; + } + + buf = list_first_entry(&video->dmaqueue, struct k510isp_buffer, irqlist); +- ++ + if(r2k->profile.drop_threshold > 0LL && r2k->profile.buf_set_time[dsNum] != 0) +- { ++ { + unsigned long long delta; + delta = get_usec() - r2k->profile.buf_set_time[dsNum]; + if(delta > r2k->profile.drop_threshold) +@@ -2499,7 +2520,7 @@ static void video_buffer_next(struct isp_r2k_device *r2k, enum video_type dsNum) + list_del(&buf->irqlist); + next_buf = list_first_entry(&video->dmaqueue, struct k510isp_buffer, irqlist); + } +- ++ + if(next_buf != NULL) + { + if(dsNum == MAIN_VIDEO) +@@ -2511,7 +2532,7 @@ static void video_buffer_next(struct isp_r2k_device *r2k, enum video_type dsNum) + else if(dsNum == DS2_VIDEO) + isp_r2k_set_out2_outaddr(r2k, next_buf->dma); + } +- ++ + spin_unlock_irqrestore(&video->irqlock, flags); + + if(!drop) +@@ -2574,7 +2595,7 @@ static void video_buffer_next(struct isp_r2k_device *r2k, enum video_type dsNum) + pipe->state &= ~ISP_PIPELINE_STREAM; + spin_unlock(&pipe->lock); + } +- ++ + spin_unlock_irqrestore(&video->irqlock, flags); + + return; +@@ -2594,7 +2615,7 @@ static void r2k_isr_main_buffer(struct isp_r2k_device *r2k) + return 1; + } + +- video_buffer_next(r2k, MAIN_VIDEO); ++ video_buffer_next(r2k, MAIN_VIDEO); + + r2k->profile.buf_set_time[MAIN_VIDEO] = get_usec(); + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; +@@ -2638,7 +2659,7 @@ static void r2k_isr_out1_buffer(struct isp_r2k_device *r2k) + return 1; + } + +- video_buffer_next(r2k, DS1_VIDEO); ++ video_buffer_next(r2k, DS1_VIDEO); + r2k->profile.buf_set_time[DS1_VIDEO] = get_usec(); + + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; +@@ -2660,7 +2681,7 @@ static void r2k_isr_out2_buffer(struct isp_r2k_device *r2k) + return 1; + } + +- video_buffer_next(r2k, DS2_VIDEO); ++ video_buffer_next(r2k, DS2_VIDEO); + + pipe->state |= ISP_PIPELINE_IDLE_OUTPUT; + +@@ -2693,7 +2714,7 @@ int k510isp_r2k_ds0_isr(struct isp_r2k_device *r2k,u32 events) + /* Handle queued buffers on frame end interrupts */ + //if(events & (IRQW1_STS_OUT0_Y_FRAME_IRQ|IRQW1_STS_OUT0_UV_FRAME_IRQ)) + r2k_isr_out0_buffer(r2k); +- ++ + return 0; + } + +@@ -2704,7 +2725,7 @@ int k510isp_r2k_ds1_isr(struct isp_r2k_device *r2k,u32 events) + return 0; + //if(events & (IRQW1_STS_OUT1_Y_FRAME_IRQ|IRQW1_STS_OUT1_UV_FRAME_IRQ)) + r2k_isr_out1_buffer(r2k); +- ++ + return 0; + } + // +@@ -2736,7 +2757,7 @@ static int r2k_video_queue(struct k510isp_video *video, struct k510isp_buffer *b + { + dev_err(video->isp->dev,"%s:no mem dev\n",__func__); + return -ENODEV; +- } ++ } + if (r2k->output & ISP_R2K_OUTPUT_FBC) + { + isp_r2k_set_fbc_outaddr(r2k, buffer->dma); +@@ -2771,25 +2792,25 @@ static int r2k_video_queue(struct k510isp_video *video, struct k510isp_buffer *b + } + if (r2k->output & ISP_R2K_OUTPUT_MAIN_MEM) + { +- dev_dbg(video->isp->dev,"%s:buffer->dma(0x%x)\n",__func__,buffer->dma); ++ dev_dbg(video->isp->dev,"%s:buffer->dma(0x%x)\n",__func__,buffer->dma); + r2k->pingpong[MAIN_VIDEO] = 0; +- isp_r2k_set_main_outaddr(r2k, buffer->dma); ++ isp_r2k_set_main_outaddr(r2k, buffer->dma); + } + + if (r2k->output & ISP_R2K_OUTPUT_DS0_MEM) + { + r2k->pingpong[DS0_VIDEO] = 0; +- isp_r2k_set_out0_outaddr(r2k, buffer->dma); ++ isp_r2k_set_out0_outaddr(r2k, buffer->dma); + } + if (r2k->output & ISP_R2K_OUTPUT_DS1_MEM) + { + r2k->pingpong[DS1_VIDEO] = 0; +- isp_r2k_set_out1_outaddr(r2k, buffer->dma); ++ isp_r2k_set_out1_outaddr(r2k, buffer->dma); + } + if (r2k->output & ISP_R2K_OUTPUT_DS2_MEM) + { + r2k->pingpong[DS2_VIDEO] = 0; +- isp_r2k_set_out2_outaddr(r2k, buffer->dma); ++ isp_r2k_set_out2_outaddr(r2k, buffer->dma); + } + #endif + /* We now have a buffer queued on the output, restart the pipeline +@@ -2874,7 +2895,7 @@ static long r2k_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) + mutex_lock(&r2k->ioctl_lock); + ret = isp_r2k_remap_out1_config(r2k, arg); + mutex_unlock(&r2k->ioctl_lock); +- break; ++ break; + case VIDIOC_K510ISP_R2K_AE_STAT_REQ: + mutex_lock(&r2k->ioctl_lock); + isp_r2k_core_GetAeSts(r2k->isp,arg); +@@ -2894,6 +2915,16 @@ static long r2k_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) + reset_control_reset(r2k->isp->reset[ISP_R2K_RST]); + mutex_unlock(&r2k->ioctl_lock); + break; ++ case VIDIOC_K510ISP_R2K_CORE_REG_SET: ++ mutex_lock(&r2k->ioctl_lock); ++ isp_r2k_core_RegSet(r2k->isp,arg); ++ mutex_unlock(&r2k->ioctl_lock); ++ break; ++ case VIDIOC_K510ISP_R2K_CORE_REG_GET: ++ mutex_lock(&r2k->ioctl_lock); ++ isp_r2k_core_RegGet(r2k->isp,arg); ++ mutex_unlock(&r2k->ioctl_lock); ++ break; + default: + dev_err(r2k->isp->dev,"%s:cmd(0x%x) err!\n",__func__,cmd); + return -ENOIOCTLCMD; +@@ -2940,8 +2971,8 @@ static int r2k_set_stream(struct v4l2_subdev *sd, int enable) + dev_dbg(r2k->isp->dev,"%s:enable(0x%d)\n",__func__,enable); + + struct isp_cfg_info *isp_cfg = &r2k->isp_cfg; +- struct isp_irq_info irq_info; +- ++ struct isp_irq_info irq_info; ++ + if (r2k->state == ISP_PIPELINE_STREAM_STOPPED) { + if (enable == ISP_PIPELINE_STREAM_STOPPED) + { +@@ -2951,9 +2982,9 @@ static int r2k_set_stream(struct v4l2_subdev *sd, int enable) + k510isp_r2k_reset(isp); + mutex_unlock(&r2k->ioctl_lock); + return 0; +- } ++ } + atomic_set(&r2k->stopping, 0); +- } ++ } + + switch (enable) { + case ISP_PIPELINE_STREAM_CONTINUOUS: +@@ -3016,7 +3047,7 @@ static int r2k_set_stream(struct v4l2_subdev *sd, int enable) + if(r2k->profile.drop_cnt[i] > 0) + dev_info(r2k->isp->dev,"r2k ds%d jump drop_cnt %d\n", i, r2k->profile.drop_cnt[i]); + } +- } ++ } + dev_info(r2k->isp->dev,"r2k dmaErrCnt %d, no_buf_drop_cnt %d, total %d\n", r2k->profile.dmaErrCnt, r2k->profile.no_buf_drop_cnt, r2k->profile.pic_cnt); + break; + } +@@ -3231,7 +3262,7 @@ static int r2k_enum_mbus_code(struct v4l2_subdev *sd, + case ISP_R2K_PAD_SINK: + if (code->index >= ARRAY_SIZE(r2k_fmts)) + { +- dev_err(r2k->isp->dev,"%s:code->index %d\n",__func__,code->index); ++ dev_err(r2k->isp->dev,"%s:code->index %d\n",__func__,code->index); + return -EINVAL; + } + code->code = r2k_fmts[code->index]; +@@ -3253,7 +3284,7 @@ static int r2k_enum_mbus_code(struct v4l2_subdev *sd, + code->code = MEDIA_BUS_FMT_UYVY8_1X16; + else + { +- dev_err(r2k->isp->dev,"%s:code->index1 %d\n",__func__,code->index); ++ dev_err(r2k->isp->dev,"%s:code->index1 %d\n",__func__,code->index); + return -EINVAL; + } + } else { +@@ -3264,7 +3295,7 @@ static int r2k_enum_mbus_code(struct v4l2_subdev *sd, + code->code = format->code; + else + { +- dev_err(r2k->isp->dev,"%s:code->index2 %d\n",__func__,code->index); ++ dev_err(r2k->isp->dev,"%s:code->index2 %d\n",__func__,code->index); + return -EINVAL; + } + } +@@ -3289,7 +3320,7 @@ static int r2k_enum_frame_size(struct v4l2_subdev *sd, + { + dev_err(r2k->isp->dev,"%s:fse->index%d\n",__func__,fse->index); + return -EINVAL; +- } ++ } + + format.code = fse->code; + format.width = 1; +@@ -3302,7 +3333,7 @@ static int r2k_enum_frame_size(struct v4l2_subdev *sd, + { + dev_err(r2k->isp->dev,"%s:format.code,fse->code %d\n",__func__,fse->code); + return -EINVAL; +- } ++ } + + format.code = fse->code; + format.width = -1; +@@ -3337,7 +3368,7 @@ static int r2k_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_pad_conf + { + dev_err(r2k->isp->dev,"%s:no pad\n",__func__); + return -EINVAL; +- } ++ } + + switch (sel->target) { + case V4L2_SEL_TGT_CROP_BOUNDS: +@@ -3387,14 +3418,14 @@ static int r2k_set_selection(struct v4l2_subdev *sd, struct v4l2_subdev_pad_conf + { + dev_err(r2k->isp->dev,"%s:pad == NULL\n",__func__); + return -EINVAL; +- } ++ } + + /* The crop rectangle can't be changed while streaming. */ + if (r2k->state != ISP_PIPELINE_STREAM_STOPPED) + { + dev_err(r2k->isp->dev,"%s:ISP_PIPELINE_STREAM_RUNNING\n",__func__); + return -EBUSY; +- } ++ } + + /* Modifying the crop rectangle always changes the format on the source + * pad. If the KEEP_CONFIG flag is set, just return the current crop +@@ -3499,7 +3530,7 @@ static int r2k_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config + crop->top = 0; + crop->width = fmt->format.width; + crop->height = fmt->format.height; +- // ++ // + format = &fmt->format; + r2k->formats[ISP_R2K_PAD_SINK].width = format->width; + r2k->formats[ISP_R2K_PAD_SINK].height = format->height; +@@ -3521,7 +3552,7 @@ static int r2k_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config + r2k->formats[ISP_R2K_PAD_MAIN_SOURCE].height = format->height; + r2k->formats[ISP_R2K_PAD_MAIN_SOURCE].field = V4L2_FIELD_NONE; + r2k->formats[ISP_R2K_PAD_MAIN_SOURCE].colorspace =V4L2_COLORSPACE_SRGB; +- r2k->formats[ISP_R2K_PAD_MAIN_SOURCE].code = format->code; ++ r2k->formats[ISP_R2K_PAD_MAIN_SOURCE].code = format->code; + } + + if (fmt->pad == ISP_R2K_PAD_DS0_SOURCE) { +@@ -3570,7 +3601,7 @@ static int r2k_link_validate(struct v4l2_subdev *sd, + { + dev_err(r2k->isp->dev,"%s:format error\n",__func__); + return -EPIPE; +- } ++ } + + return 0; + } +@@ -3597,7 +3628,7 @@ static int r2k_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) + format.format.code = r2k->formats[pad].code;//MEDIA_BUS_FMT_SRGGB10_1X10;//MEDIA_BUS_FMT_SGRBG10_1X10; + format.format.width = r2k->formats[pad].width;//1920;//4096; + format.format.height = r2k->formats[pad].height;//1080;//4096; +- r2k_set_format(sd, fh ? fh->pad : NULL, &format); ++ r2k_set_format(sd, fh ? fh->pad : NULL, &format); + } + + return 0; +@@ -3673,12 +3704,12 @@ static int r2k_link_setup(struct media_entity *entity, + { + dev_err(r2k->isp->dev,"%s:!ISP_R2K_INPUT_NONE\n",__func__); + return -EBUSY; +- } ++ } + + if (remote->entity == &r2k->subdev.entity) + r2k->input = ISP_R2K_INPUT_VI; + else +- r2k->input = ISP_R2K_INPUT_NONE; ++ r2k->input = ISP_R2K_INPUT_NONE; + break; + case ISP_R2K_PAD_MAIN_SOURCE: + case ISP_R2K_PAD_MAIN_SOURCE | 2 << 16: +@@ -3688,21 +3719,21 @@ static int r2k_link_setup(struct media_entity *entity, + { + dev_err(r2k->isp->dev,"%s:!ISP_R2K_PAD_MAIN_SOURCE\n",__func__); + return -EBUSY; +- } ++ } + r2k->output |= ISP_R2K_OUTPUT_MAIN_MEM; + } else { + r2k->output &= ~ISP_R2K_OUTPUT_MAIN_MEM; + } + break; + case ISP_R2K_PAD_DS0_SOURCE: +- case ISP_R2K_PAD_DS0_SOURCE | 2 << 16: ++ case ISP_R2K_PAD_DS0_SOURCE | 2 << 16: + /* Write to memory */ + if (flags & MEDIA_LNK_FL_ENABLED) { + if (r2k->output & ISP_R2K_OUTPUT_DS0_MEM) + { + dev_err(r2k->isp->dev,"%s:!ISP_R2K_PAD_DS0_SOURCE\n",__func__); + return -EBUSY; +- } ++ } + r2k->output |= ISP_R2K_OUTPUT_DS0_MEM; + } else { + r2k->output &= ~ISP_R2K_OUTPUT_DS0_MEM; +@@ -3716,7 +3747,7 @@ static int r2k_link_setup(struct media_entity *entity, + { + dev_err(r2k->isp->dev,"%s:!ISP_R2K_PAD_DS1_SOURCE\n",__func__); + return -EBUSY; +- } ++ } + r2k->output |= ISP_R2K_OUTPUT_DS1_MEM; + } else { + r2k->output &= ~ISP_R2K_OUTPUT_DS1_MEM; +@@ -3730,7 +3761,7 @@ static int r2k_link_setup(struct media_entity *entity, + { + dev_err(r2k->isp->dev,"%s:!ISP_R2K_PAD_DS2_SOURCE\n",__func__); + return -EBUSY; +- } ++ } + r2k->output |= ISP_R2K_OUTPUT_DS2_MEM; + } else { + r2k->output &= ~ISP_R2K_OUTPUT_DS2_MEM; +@@ -3738,7 +3769,7 @@ static int r2k_link_setup(struct media_entity *entity, + break; + default: + dev_dbg(r2k->isp->dev,"%s:!no index\n",__func__); +- return -EINVAL; ++ return -EINVAL; + } + + dev_dbg(r2k->isp->dev,"%s:end\n",__func__); +@@ -3822,7 +3853,7 @@ int k510isp_r2k_register_entities(struct isp_r2k_device *r2k, + k510isp_video_unregister(&r2k->video_out[DS1_VIDEO]); + error_ds0: + k510isp_video_unregister(&r2k->video_out[DS0_VIDEO]); +-error_main: ++error_main: + k510isp_video_unregister(&r2k->video_out[MAIN_VIDEO]); + error: + k510isp_r2k_unregister_entities(r2k); +@@ -3870,7 +3901,7 @@ static int k510isp_r2k_init_entities(struct isp_r2k_device *r2k) + { + dev_err(isp->dev,"%s:media_entity_pads_init ret:%d\n",__func__,ret); + return ret; +- } ++ } + dev_dbg(isp->dev,"%s:media_entity_pads_init end\n",__func__); + r2k_init_formats(sd, NULL); + //MAIN +@@ -3887,7 +3918,7 @@ static int k510isp_r2k_init_entities(struct isp_r2k_device *r2k) + { + dev_err(isp->dev,"%s:k510isp_video_init ret:%d\n",__func__,ret); + goto error_video; +- } ++ } + //DS0 + r2k->video_out[DS0_VIDEO].type = V4L2_BUF_TYPE_VIDEO_CAPTURE;//V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;//V4L2_BUF_TYPE_VIDEO_OUTPUT; + r2k->video_out[DS0_VIDEO].bpl_alignment = 32;//16;//32; +@@ -3902,7 +3933,7 @@ static int k510isp_r2k_init_entities(struct isp_r2k_device *r2k) + { + dev_err(isp->dev,"%s:k510isp_video_init ret:%d\n",__func__,ret); + goto error_main_video; +- } ++ } + //DS1 + r2k->video_out[DS1_VIDEO].type = V4L2_BUF_TYPE_VIDEO_CAPTURE;//V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;//V4L2_BUF_TYPE_VIDEO_OUTPUT; + r2k->video_out[DS1_VIDEO].bpl_alignment = 32;//16;//32; +@@ -3917,7 +3948,7 @@ static int k510isp_r2k_init_entities(struct isp_r2k_device *r2k) + { + dev_err(isp->dev,"%s:k510isp_video_init ret:%d\n",__func__,ret); + goto error_ds0_video; +- } ++ } + //DS0 + r2k->video_out[DS2_VIDEO].type = V4L2_BUF_TYPE_VIDEO_CAPTURE;//V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;//V4L2_BUF_TYPE_VIDEO_OUTPUT; + r2k->video_out[DS2_VIDEO].bpl_alignment = 32;//16;//32; +@@ -3932,7 +3963,7 @@ static int k510isp_r2k_init_entities(struct isp_r2k_device *r2k) + { + dev_err(isp->dev,"%s:k510isp_video_init ret:%d\n",__func__,ret); + goto error_ds1_video; +- } ++ } + dev_dbg(isp->dev,"%s: end\n",__func__); + return 0; + +@@ -3978,8 +4009,8 @@ int k510isp_r2k_init(struct k510_isp_device *isp) + dev_err(isp->dev,"%s:k510isp_r2k_init_entities\n",__func__); + mutex_destroy(&r2k->ioctl_lock); + return ret; +- } +- dev_dbg(isp->dev,"%s: end\n",__func__); ++ } ++ dev_dbg(isp->dev,"%s: end\n",__func__); + return 0; + } + /* +@@ -3996,5 +4027,5 @@ void k510isp_r2k_cleanup(struct k510_isp_device *isp) + k510isp_video_cleanup(&r2k->video_out[DS2_VIDEO]); + media_entity_cleanup(&r2k->subdev.entity); + +- mutex_destroy(&r2k->ioctl_lock); ++ mutex_destroy(&r2k->ioctl_lock); + } +diff --git a/include/uapi/linux/k510isp.h b/include/uapi/linux/k510isp.h +index 48d5ba06..2dbcb4fb 100755 +--- a/include/uapi/linux/k510isp.h ++++ b/include/uapi/linux/k510isp.h +@@ -29,7 +29,7 @@ + #define VIDIOC_K510ISP_F2K_REMAP_OUT1_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 7,struct isp_remap_cfg_info) + #define VIDIOC_K510ISP_F2K_FBCD_CFG \ +- _IOWR('V', BASE_VIDIOC_PRIVATE + 8,struct isp_remap_cfg_info) ++ _IOWR('V', BASE_VIDIOC_PRIVATE + 8,struct isp_remap_cfg_info) + #define VIDIOC_K510ISP_R2K_WRAP_CFG \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 9,struct isp_wrap_cfg_info) + #define VIDIOC_K510ISP_R2K_CORE_CFG \ +@@ -96,18 +96,14 @@ + _IOWR('V', BASE_VIDIOC_PRIVATE + 40,unsigned long) + #define VIDIOC_K510ISP_SYSCTL_RST_R2K \ + _IOWR('V', BASE_VIDIOC_PRIVATE + 41,unsigned long) +-#define VIDIOC_K510ISP_F2K_AWB_VAL_GET \ +- _IOWR('V', BASE_VIDIOC_PRIVATE + 42, struct k510isp_awb_sync_info) +-#define VIDIOC_K510ISP_R2K_AWB_VAL_SET \ +- _IOWR('V', BASE_VIDIOC_PRIVATE + 43, struct k510isp_awb_sync_info) + #define VIDIOC_K510ISP_F2K_CORE_REG_SET \ +- _IOWR('V', BASE_VIDIOC_PRIVATE + 44, struct k510isp_reg_val) ++ _IOWR('V', BASE_VIDIOC_PRIVATE + 42, struct k510isp_reg_val) + #define VIDIOC_K510ISP_F2K_CORE_REG_GET \ +- _IOWR('V', BASE_VIDIOC_PRIVATE + 45, struct k510isp_reg_val) ++ _IOWR('V', BASE_VIDIOC_PRIVATE + 43, struct k510isp_reg_val) + #define VIDIOC_K510ISP_R2K_CORE_REG_SET \ +- _IOWR('V', BASE_VIDIOC_PRIVATE + 46, struct k510isp_reg_val) ++ _IOWR('V', BASE_VIDIOC_PRIVATE + 44, struct k510isp_reg_val) + #define VIDIOC_K510ISP_R2K_CORE_REG_GET \ +- _IOWR('V', BASE_VIDIOC_PRIVATE + 47, struct k510isp_reg_val) ++ _IOWR('V', BASE_VIDIOC_PRIVATE + 45, struct k510isp_reg_val) + // + /* + * Events +@@ -170,7 +166,7 @@ struct k510isp_awb_sync_info { + struct k510isp_awb_stats{ + // + __u32 bfb_pos;//Blue hist value of AWB in feedback mode +- __u32 bfb_pot;//Blue hist pixels of AWB in feedback mode ++ __u32 bfb_pot;//Blue hist pixels of AWB in feedback mode + __u32 rfb_pos;//Red hist value of AWB in feedback mode + __u32 rfb_pot;//Red hist pixels of AWB in feedback mode + // +-- +2.36.1 + diff --git a/package/patches/linux/0025-camera-support-gc2053-gc2093-gc2145-sensor-driver.patch b/package/patches/linux/0025-camera-support-gc2053-gc2093-gc2145-sensor-driver.patch new file mode 100644 index 0000000..9d8e1f7 --- /dev/null +++ b/package/patches/linux/0025-camera-support-gc2053-gc2093-gc2145-sensor-driver.patch @@ -0,0 +1,4671 @@ +From fc97ecbf7224a3127a02fcacc3ffc496ea7fe7b2 Mon Sep 17 00:00:00 2001 +From: "Chenggen.Wang" +Date: Tue, 23 Aug 2022 19:52:27 +0800 +Subject: [PATCH 1/2] camera: support gc2053,gc2093,gc2145 sensor driver. + +Signed-off-by: Chenggen.Wang +--- + .../k510_common/camera-gc2053_gc2093.dtsi | 115 ++ + .../k510_common/camera-gc2093_gc2053.dtsi | 115 ++ + .../k510_common/camera-gc2093_gc2145.dtsi | 115 ++ + .../k510_common/camera-gc2145_gc2093.dtsi | 115 ++ + .../boot/dts/canaan/k510_crb_lp3_v1_2.dts | 10 + + .../media/i2c/soc_camera/canaanchip/Kconfig | 33 +- + .../media/i2c/soc_camera/canaanchip/Makefile | 5 +- + .../media/i2c/soc_camera/canaanchip/gc2053.c | 1258 ++++++++++++++ + .../media/i2c/soc_camera/canaanchip/gc2093.c | 1522 +++++++++++++++++ + .../media/i2c/soc_camera/canaanchip/gc2145.c | 1264 ++++++++++++++ + 10 files changed, 4548 insertions(+), 4 deletions(-) + create mode 100755 arch/riscv/boot/dts/canaan/k510_common/camera-gc2053_gc2093.dtsi + create mode 100755 arch/riscv/boot/dts/canaan/k510_common/camera-gc2093_gc2053.dtsi + create mode 100755 arch/riscv/boot/dts/canaan/k510_common/camera-gc2093_gc2145.dtsi + create mode 100755 arch/riscv/boot/dts/canaan/k510_common/camera-gc2145_gc2093.dtsi + create mode 100755 drivers/media/i2c/soc_camera/canaanchip/gc2053.c + create mode 100755 drivers/media/i2c/soc_camera/canaanchip/gc2093.c + create mode 100755 drivers/media/i2c/soc_camera/canaanchip/gc2145.c + +diff --git a/arch/riscv/boot/dts/canaan/k510_common/camera-gc2053_gc2093.dtsi b/arch/riscv/boot/dts/canaan/k510_common/camera-gc2053_gc2093.dtsi +new file mode 100755 +index 00000000..39bb17ea +--- /dev/null ++++ b/arch/riscv/boot/dts/canaan/k510_common/camera-gc2053_gc2093.dtsi +@@ -0,0 +1,115 @@ ++//RGB ++&i2c4 { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ gc2053: gc2053@37 { ++ compatible = "galaxycore,gc2053"; ++ reg = <0x37>; ++ reset-gpios = <&porta 8 GPIO_ACTIVE_LOW>; ++ pwdn-gpios = <&porta 9 GPIO_ACTIVE_LOW>; ++ canaanchip,camera-module-index = <0>; ++ canaanchip,camera-module-facing = "front"; ++ canaanchip,camera-module-name = "BFC105-DUAL-L"; ++ canaanchip,camera-module-lens-name = "RGB"; ++ // ir-cut = <&cam_ircut0>; ++ hflip = <1>; ++ ++ port { ++ ucam_out0: endpoint { ++ remote-endpoint = <&mipi_in_ucam0>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ }; ++}; ++ ++&i2c1 { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ gc2093: gc2093@7e { ++ compatible = "galaxycore,gc2093"; ++ reg = <0x7e>; ++ reset-gpios = <&porta 17 GPIO_ACTIVE_LOW>; ++ pwdn-gpios = <&porta 18 GPIO_ACTIVE_LOW>; ++ canaanchip,camera-module-index = <1>; ++ canaanchip,camera-module-facing = "front"; ++ canaanchip,camera-module-name = "BFC105-DUAL-L"; ++ canaanchip,camera-module-lens-name = "RGB"; ++ //ir-cut = <&cam_ircut0>; ++ hflip = <1>; ++ ++ port { ++ ucam_out1: endpoint { ++ remote-endpoint = <&mipi_in_ucam1>; ++ data-lanes = <3 4>; ++ }; ++ }; ++ }; ++}; ++ ++&isp1{ ++ status = "okay"; ++ sensor_num =<2>; ++ dphy_speed =<1>; //0-RXDPHY_SPEED_MODE_2500M,1-RXDPHY_SPEED_MODE_1500M ++ dphy_mode = <0>;//0-TWO_LANES_MODE,1-FOUR_LANES_MODE ++ sony_mode = <0>;//0-SONY_POL_MODE_DIS,1-SONY_POL_MODE_EN ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ //port@0 { ++ // dvp_in_ucam2: endpoint@2 { ++ // //status = "okay"; ++ // //remote-endpoint = <&ucam_out1>; ++ // //data-lanes = <3 4>; ++ // data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ // tpg_r_en = <0>; ++ // tpg_w_en = <0>; ++ // wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ // wdr_mode = <0>;//0-none wdr mode, 1-2frame wdr mode, 2-3frame wdr mode ++ // mipi_csi_mode = <0>; //0- normal mode, 1 -debug mode ++ // isp_pipeline = <3>;//1 -ISP_F_2K, 2 -ISP_R_2K,3-ISP_TOF ++ // }; ++ //}; ++ port@1 { ++ reg = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mipi_in_ucam0: endpoint@0 { ++ status = "okay"; ++ reg = <1>; ++ remote-endpoint = <&ucam_out0>; ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ tpg_r_en = <0>; ++ tpg_w_en = <0>; ++ wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ wdr_mode = <0>;//0-none wdr mode ,1-2frame wdr mode, 2-3frame wdr mode ++ mipi_csi_mode = <0>; //0- normal mode ,1 -debug mode ++ isp_pipeline = <1>;//1 -ISP_F_2K, 2 -ISP_R_2K, 3-ISP_TOF ++ }; ++ }; ++ port@2 { ++ reg = <2>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mipi_in_ucam1: endpoint@1{ ++ status = "okay"; ++ reg = <1>; ++ remote-endpoint = <&ucam_out1>; ++ clock-lanes = <1>; ++ data-lanes = <3 4>; ++ data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ tpg_r_en = <0>; ++ tpg_w_en = <0>; ++ wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ wdr_mode = <0>;//0-none wdr mode, 1-2frame wdr mode ,2-3frame wdr mode ++ mipi_csi_mode = <0>; //0- normal mode ,1 -debug mode ++ isp_pipeline = <2>;//1 -ISP_F_2K, 2 -ISP_R_2K, 3-ISP_TOF ++ }; ++ }; ++ ++ }; ++}; +diff --git a/arch/riscv/boot/dts/canaan/k510_common/camera-gc2093_gc2053.dtsi b/arch/riscv/boot/dts/canaan/k510_common/camera-gc2093_gc2053.dtsi +new file mode 100755 +index 00000000..1a486f3b +--- /dev/null ++++ b/arch/riscv/boot/dts/canaan/k510_common/camera-gc2093_gc2053.dtsi +@@ -0,0 +1,115 @@ ++//RGB ++&i2c4 { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ gc2053: gc2053@37 { ++ compatible = "galaxycore,gc2053"; ++ reg = <0x37>; ++ reset-gpios = <&porta 8 GPIO_ACTIVE_LOW>; ++ pwdn-gpios = <&porta 9 GPIO_ACTIVE_LOW>; ++ canaanchip,camera-module-index = <1>; ++ canaanchip,camera-module-facing = "front"; ++ canaanchip,camera-module-name = "BFC105-DUAL-L"; ++ canaanchip,camera-module-lens-name = "RGB"; ++ // ir-cut = <&cam_ircut0>; ++ hflip = <1>; ++ ++ port { ++ ucam_out1: endpoint { ++ remote-endpoint = <&mipi_in_ucam1>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ }; ++}; ++ ++&i2c1 { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ gc2093: gc2093@7e { ++ compatible = "galaxycore,gc2093"; ++ reg = <0x7e>; ++ reset-gpios = <&porta 17 GPIO_ACTIVE_LOW>; ++ pwdn-gpios = <&porta 18 GPIO_ACTIVE_LOW>; ++ canaanchip,camera-module-index = <0>; ++ canaanchip,camera-module-facing = "front"; ++ canaanchip,camera-module-name = "BFC105-DUAL-L"; ++ canaanchip,camera-module-lens-name = "RGB"; ++ //ir-cut = <&cam_ircut0>; ++ hflip = <1>; ++ ++ port { ++ ucam_out0: endpoint { ++ remote-endpoint = <&mipi_in_ucam0>; ++ data-lanes = <3 4>; ++ }; ++ }; ++ }; ++}; ++ ++&isp1{ ++ status = "okay"; ++ sensor_num =<2>; ++ dphy_speed =<1>; //0-RXDPHY_SPEED_MODE_2500M,1-RXDPHY_SPEED_MODE_1500M ++ dphy_mode = <0>;//0-TWO_LANES_MODE,1-FOUR_LANES_MODE ++ sony_mode = <0>;//0-SONY_POL_MODE_DIS,1-SONY_POL_MODE_EN ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ //port@0 { ++ // dvp_in_ucam2: endpoint@2 { ++ // //status = "okay"; ++ // //remote-endpoint = <&ucam_out1>; ++ // //data-lanes = <3 4>; ++ // data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ // tpg_r_en = <0>; ++ // tpg_w_en = <0>; ++ // wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ // wdr_mode = <0>;//0-none wdr mode, 1-2frame wdr mode, 2-3frame wdr mode ++ // mipi_csi_mode = <0>; //0- normal mode, 1 -debug mode ++ // isp_pipeline = <3>;//1 -ISP_F_2K, 2 -ISP_R_2K,3-ISP_TOF ++ // }; ++ //}; ++ port@1 { ++ reg = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mipi_in_ucam0: endpoint@0 { ++ status = "okay"; ++ reg = <1>; ++ remote-endpoint = <&ucam_out0>; ++ clock-lanes = <1>; ++ data-lanes = <3 4>; ++ data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ tpg_r_en = <0>; ++ tpg_w_en = <0>; ++ wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ wdr_mode = <0>;//0-none wdr mode ,1-2frame wdr mode, 2-3frame wdr mode ++ mipi_csi_mode = <0>; //0- normal mode ,1 -debug mode ++ isp_pipeline = <1>;//1 -ISP_F_2K, 2 -ISP_R_2K, 3-ISP_TOF ++ }; ++ }; ++ port@2 { ++ reg = <2>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mipi_in_ucam1: endpoint@1{ ++ status = "okay"; ++ reg = <1>; ++ remote-endpoint = <&ucam_out1>; ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ tpg_r_en = <0>; ++ tpg_w_en = <0>; ++ wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ wdr_mode = <0>;//0-none wdr mode, 1-2frame wdr mode ,2-3frame wdr mode ++ mipi_csi_mode = <0>; //0- normal mode ,1 -debug mode ++ isp_pipeline = <2>;//1 -ISP_F_2K, 2 -ISP_R_2K, 3-ISP_TOF ++ }; ++ }; ++ ++ }; ++}; +diff --git a/arch/riscv/boot/dts/canaan/k510_common/camera-gc2093_gc2145.dtsi b/arch/riscv/boot/dts/canaan/k510_common/camera-gc2093_gc2145.dtsi +new file mode 100755 +index 00000000..59d470d6 +--- /dev/null ++++ b/arch/riscv/boot/dts/canaan/k510_common/camera-gc2093_gc2145.dtsi +@@ -0,0 +1,115 @@ ++//RGB ++&i2c1 { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ gc2093: gc2093@37 { ++ compatible = "galaxycore,gc2093"; ++ reg = <0x37>; ++ reset-gpios = <&porta 8 GPIO_ACTIVE_LOW>; ++ pwdn-gpios = <&porta 9 GPIO_ACTIVE_LOW>; ++ canaanchip,camera-module-index = <0>; ++ canaanchip,camera-module-facing = "front"; ++ canaanchip,camera-module-name = "BFC105-DUAL-L"; ++ canaanchip,camera-module-lens-name = "RGB"; ++ // ir-cut = <&cam_ircut0>; ++ hflip = <1>; ++ ++ port { ++ ucam_out0: endpoint { ++ remote-endpoint = <&mipi_in_ucam0>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ }; ++}; ++ ++&i2c4 { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ gc2145: gc2145@3c { ++ compatible = "galaxycore,gc2145"; ++ reg = <0x3c>; ++ reset-gpios = <&porta 23 GPIO_ACTIVE_LOW>; ++ pwdn-gpios = <&porta 17 GPIO_ACTIVE_HIGH>; ++ canaanchip,camera-module-index = <1>; ++ canaanchip,camera-module-facing = "front"; ++ canaanchip,camera-module-name = "BFC105-DUAL-L"; ++ canaanchip,camera-module-lens-name = "RGB"; ++ //ir-cut = <&cam_ircut0>; ++ hflip = <1>; ++ ++ port { ++ ucam_out1: endpoint { ++ remote-endpoint = <&mipi_in_ucam1>; ++ data-lanes = <3 4>; ++ }; ++ }; ++ }; ++}; ++ ++&isp1{ ++ status = "okay"; ++ sensor_num =<2>; ++ dphy_speed =<1>; //0-RXDPHY_SPEED_MODE_2500M,1-RXDPHY_SPEED_MODE_1500M ++ dphy_mode = <0>;//0-TWO_LANES_MODE,1-FOUR_LANES_MODE ++ sony_mode = <0>;//0-SONY_POL_MODE_DIS,1-SONY_POL_MODE_EN ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ //port@0 { ++ // dvp_in_ucam2: endpoint@2 { ++ // //status = "okay"; ++ // //remote-endpoint = <&ucam_out1>; ++ // //data-lanes = <3 4>; ++ // data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ // tpg_r_en = <0>; ++ // tpg_w_en = <0>; ++ // wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ // wdr_mode = <0>;//0-none wdr mode, 1-2frame wdr mode, 2-3frame wdr mode ++ // mipi_csi_mode = <0>; //0- normal mode, 1 -debug mode ++ // isp_pipeline = <3>;//1 -ISP_F_2K, 2 -ISP_R_2K,3-ISP_TOF ++ // }; ++ //}; ++ port@1 { ++ reg = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mipi_in_ucam0: endpoint@0 { ++ status = "okay"; ++ reg = <1>; ++ remote-endpoint = <&ucam_out0>; ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ tpg_r_en = <0>; ++ tpg_w_en = <0>; ++ wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ wdr_mode = <0>;//0-none wdr mode ,1-2frame wdr mode, 2-3frame wdr mode ++ mipi_csi_mode = <0>; //0- normal mode ,1 -debug mode ++ isp_pipeline = <1>;//1 -ISP_F_2K, 2 -ISP_R_2K, 3-ISP_TOF ++ }; ++ }; ++ port@2 { ++ reg = <2>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mipi_in_ucam1: endpoint@1{ ++ status = "okay"; ++ reg = <1>; ++ remote-endpoint = <&ucam_out1>; ++ clock-lanes = <1>; ++ data-lanes = <3 4>; ++ data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ tpg_r_en = <0>; ++ tpg_w_en = <0>; ++ wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ wdr_mode = <0>;//0-none wdr mode, 1-2frame wdr mode ,2-3frame wdr mode ++ mipi_csi_mode = <0>; //0- normal mode ,1 -debug mode ++ isp_pipeline = <2>;//1 -ISP_F_2K, 2 -ISP_R_2K, 3-ISP_TOF ++ }; ++ }; ++ ++ }; ++}; +diff --git a/arch/riscv/boot/dts/canaan/k510_common/camera-gc2145_gc2093.dtsi b/arch/riscv/boot/dts/canaan/k510_common/camera-gc2145_gc2093.dtsi +new file mode 100755 +index 00000000..81a2ff7c +--- /dev/null ++++ b/arch/riscv/boot/dts/canaan/k510_common/camera-gc2145_gc2093.dtsi +@@ -0,0 +1,115 @@ ++//RGB ++&i2c1 { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ gc2093: gc2093@37 { ++ compatible = "galaxycore,gc2093"; ++ reg = <0x37>; ++ reset-gpios = <&porta 8 GPIO_ACTIVE_LOW>; ++ pwdn-gpios = <&porta 9 GPIO_ACTIVE_LOW>; ++ canaanchip,camera-module-index = <1>; ++ canaanchip,camera-module-facing = "front"; ++ canaanchip,camera-module-name = "BFC105-DUAL-L"; ++ canaanchip,camera-module-lens-name = "RGB"; ++ // ir-cut = <&cam_ircut0>; ++ hflip = <1>; ++ ++ port { ++ ucam_out1: endpoint { ++ remote-endpoint = <&mipi_in_ucam1>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ }; ++}; ++ ++&i2c4 { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ gc2145: gc2145@3c { ++ compatible = "galaxycore,gc2145"; ++ reg = <0x3c>; ++ reset-gpios = <&porta 23 GPIO_ACTIVE_LOW>; ++ pwdn-gpios = <&porta 17 GPIO_ACTIVE_HIGH>; ++ canaanchip,camera-module-index = <0>; ++ canaanchip,camera-module-facing = "front"; ++ canaanchip,camera-module-name = "BFC105-DUAL-L"; ++ canaanchip,camera-module-lens-name = "RGB"; ++ //ir-cut = <&cam_ircut0>; ++ hflip = <1>; ++ ++ port { ++ ucam_out0: endpoint { ++ remote-endpoint = <&mipi_in_ucam0>; ++ data-lanes = <3 4>; ++ }; ++ }; ++ }; ++}; ++ ++&isp1{ ++ status = "okay"; ++ sensor_num =<2>; ++ dphy_speed =<1>; //0-RXDPHY_SPEED_MODE_2500M,1-RXDPHY_SPEED_MODE_1500M ++ dphy_mode = <0>;//0-TWO_LANES_MODE,1-FOUR_LANES_MODE ++ sony_mode = <0>;//0-SONY_POL_MODE_DIS,1-SONY_POL_MODE_EN ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ //port@0 { ++ // dvp_in_ucam2: endpoint@2 { ++ // //status = "okay"; ++ // //remote-endpoint = <&ucam_out1>; ++ // //data-lanes = <3 4>; ++ // data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ // tpg_r_en = <0>; ++ // tpg_w_en = <0>; ++ // wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ // wdr_mode = <0>;//0-none wdr mode, 1-2frame wdr mode, 2-3frame wdr mode ++ // mipi_csi_mode = <0>; //0- normal mode, 1 -debug mode ++ // isp_pipeline = <3>;//1 -ISP_F_2K, 2 -ISP_R_2K,3-ISP_TOF ++ // }; ++ //}; ++ port@1 { ++ reg = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mipi_in_ucam0: endpoint@0 { ++ status = "okay"; ++ reg = <1>; ++ remote-endpoint = <&ucam_out0>; ++ clock-lanes = <1>; ++ data-lanes = <3 4>; ++ data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ tpg_r_en = <0>; ++ tpg_w_en = <0>; ++ wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ wdr_mode = <0>;//0-none wdr mode ,1-2frame wdr mode, 2-3frame wdr mode ++ mipi_csi_mode = <0>; //0- normal mode ,1 -debug mode ++ isp_pipeline = <1>;//1 -ISP_F_2K, 2 -ISP_R_2K, 3-ISP_TOF ++ }; ++ }; ++ port@2 { ++ reg = <2>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mipi_in_ucam1: endpoint@1{ ++ status = "okay"; ++ reg = <1>; ++ remote-endpoint = <&ucam_out1>; ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12 ++ tpg_r_en = <0>; ++ tpg_w_en = <0>; ++ wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR ++ wdr_mode = <0>;//0-none wdr mode, 1-2frame wdr mode ,2-3frame wdr mode ++ mipi_csi_mode = <0>; //0- normal mode ,1 -debug mode ++ isp_pipeline = <2>;//1 -ISP_F_2K, 2 -ISP_R_2K, 3-ISP_TOF ++ }; ++ }; ++ ++ }; ++}; +diff --git a/arch/riscv/boot/dts/canaan/k510_crb_lp3_v1_2.dts b/arch/riscv/boot/dts/canaan/k510_crb_lp3_v1_2.dts +index 39e7b26b..cecd61c1 100755 +--- a/arch/riscv/boot/dts/canaan/k510_crb_lp3_v1_2.dts ++++ b/arch/riscv/boot/dts/canaan/k510_crb_lp3_v1_2.dts +@@ -20,6 +20,11 @@ + #include "k510_common/iomux_provider.dtsi" /* k510 soc iomux provider */ + #include "k510_common/iomux_consumer.dtsi" /* k510 soc iomux consumer */ + #include "k510_common/camera-imx219x2.dtsi" /* camera imx219 */ ++//#include "k510_common/camera-gc2053_gc2093.dtsi" /* camera gc2053/gc2093 */ ++//#include "k510_common/camera-gc2093_gc2053.dtsi" /* camera gc2053/gc2093 */ ++//#include "k510_common/camera-gc2093_gc2145.dtsi" /* camera gc2093/gc2145 */ ++//#include "k510_common/camera-gc2145_gc2093.dtsi" /* camera gc2093/gc2145 */ ++ + #include + + /* evalution board device tree, include nandflash/emmc/ethphy/sensor/hdmi/pmic etc. */ +@@ -207,9 +212,13 @@ + pinctrl-k510,pins = < + (32) (FUNC_GPIO22) /*OEB*/ + (34) (FUNC_GPIO21) /*SEL*/ ++ (67) (FUNC_GPIO9) ++ (68) (FUNC_GPIO23) + (69) (FUNC_GPIO2) /*WIFI_WAKE_OUT*/ + (70) (FUNC_GPIO3) /*BT_RST_IN*/ + (71) (FUNC_GPIO4) /*KEY_1*/ ++ (72) (FUNC_GPIO17) ++ (73) (FUNC_GPIO18) + (75) (FUNC_GPIO5) /*HP_INSERT_DET*/ + (76) (FUNC_GPIO6) /*KEY_2*/ + (77) (FUNC_GPIO7) /*SYS_LED*/ +@@ -217,6 +226,7 @@ + (79) (FUNC_GPIO20) /*MIPI_DSI_LCD_EN*/ + (80) (FUNC_GPIO10) /*MIPI_DSI_T_RST*/ + (81) (FUNC_GPIO11) /*BT_WAKE_OUT*/ ++ (82) (FUNC_GPIO8) + (83) (FUNC_GPIO12) /*MIPI_DSI_T_INT*/ + (84) (FUNC_GPIO13) /*BT_WAKE_IN*/ + (85) (FUNC_GPIO14) /*WIFI_EN*/ +diff --git a/drivers/media/i2c/soc_camera/canaanchip/Kconfig b/drivers/media/i2c/soc_camera/canaanchip/Kconfig +index fb072753..7be3e789 100755 +--- a/drivers/media/i2c/soc_camera/canaanchip/Kconfig ++++ b/drivers/media/i2c/soc_camera/canaanchip/Kconfig +@@ -14,9 +14,36 @@ config VIDEO_IMX219_1 + CMOS image sensor. + + config VIDEO_IMX385 +- tristate "Sony IMX385 sensor support" ++ tristate "Sony IMX385 sensor support" ++ depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && VIDEO_CANAAN_K510 ++ depends on MEDIA_CAMERA_SUPPORT ++ ---help--- ++ This is a V4L2 sensor-level driver for the Sony IMX385 ++ CMOS image sensor. ++ ++config VIDEO_GC2053 ++ tristate "Galaxycore GC2053 sensor support" + depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && VIDEO_CANAAN_K510 + depends on MEDIA_CAMERA_SUPPORT + ---help--- +- This is a V4L2 sensor-level driver for the Sony IMX385 +- CMOS image sensor. +\ No newline at end of file ++ This is a V4L2 sensor-level driver for the Galaxycore GC2053 ++ CMOS image sensor. ++ ++config VIDEO_GC2093 ++ tristate "Galaxycore GC2093 sensor support" ++ depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && VIDEO_CANAAN_K510 ++ depends on MEDIA_CAMERA_SUPPORT ++ ---help--- ++ This is a V4L2 sensor-level driver for the Galaxycore GC2093 ++ CMOS image sensor. ++ ++config VIDEO_GC2145 ++ tristate "Galaxycore GC2145 sensor support" ++ depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && VIDEO_CANAAN_K510 ++ depends on MEDIA_CAMERA_SUPPORT ++ ---help--- ++ This is a V4L2 sensor-level driver for the Galaxycore GC2145 ++ CMOS image sensor. ++ ++ ++ +diff --git a/drivers/media/i2c/soc_camera/canaanchip/Makefile b/drivers/media/i2c/soc_camera/canaanchip/Makefile +index feaf60f7..3b53d53e 100755 +--- a/drivers/media/i2c/soc_camera/canaanchip/Makefile ++++ b/drivers/media/i2c/soc_camera/canaanchip/Makefile +@@ -1,3 +1,6 @@ + obj-$(CONFIG_VIDEO_IMX219_0) += imx219_0.o + obj-$(CONFIG_VIDEO_IMX219_1) += imx219_1.o +-obj-$(CONFIG_VIDEO_IMX385) += imx385.o +\ No newline at end of file ++obj-$(CONFIG_VIDEO_IMX385) += imx385.o ++obj-$(CONFIG_VIDEO_GC2053) += gc2053.o ++obj-$(CONFIG_VIDEO_GC2093) += gc2093.o ++obj-$(CONFIG_VIDEO_GC2145) += gc2145.o +diff --git a/drivers/media/i2c/soc_camera/canaanchip/gc2053.c b/drivers/media/i2c/soc_camera/canaanchip/gc2053.c +new file mode 100755 +index 00000000..c939c890 +--- /dev/null ++++ b/drivers/media/i2c/soc_camera/canaanchip/gc2053.c +@@ -0,0 +1,1258 @@ ++/* ++ * Driver for GC2053 CMOS Image Sensor ++ * ++ * Copyright (C) 2022, Canaan Bright Sight Co., Ltd ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x01) ++#define GC2053_NAME "gc2053" ++#define GC2053_MEDIA_BUS_FMT MEDIA_BUS_FMT_SRGGB10_1X10 ++ ++#define MIPI_FREQ_297M 297000000 ++#define GC2053_XVCLK_FREQ 24000000 ++ ++#define GC2053_PAGE_SELECT 0xFE ++ ++#define GC2053_REG_CHIP_ID_H 0xF0 ++#define GC2053_REG_CHIP_ID_L 0xF1 ++ ++#define GC2053_REG_EXP_H 0x03 ++#define GC2053_REG_EXP_L 0x04 ++ ++#define GC2053_REG_VTS_H 0x41 ++#define GC2053_REG_VTS_L 0x42 ++ ++#define GC2053_REG_CTRL_MODE 0x3E ++#define GC2053_MODE_SW_STANDBY 0x11 ++#define GC2053_MODE_STREAMING 0x91 ++ ++#define REG_NULL 0xFF ++ ++#define GC2053_CHIP_ID 0x2053 ++ ++#define GC2053_VTS_MAX 0x3FFF ++#define GC2053_HTS_MAX 0xFFF ++ ++#define GC2053_EXPOSURE_MAX 0x3FFF ++#define GC2053_EXPOSURE_MIN 1 ++#define GC2053_EXPOSURE_STEP 1 ++ ++#define GC2053_GAIN_MIN 0x40 ++#define GC2053_GAIN_MAX 0x2000 ++#define GC2053_GAIN_STEP 1 ++#define GC2053_GAIN_DEFAULT 64 ++ ++#define GC2053_LANES 2 ++ ++#define SENSOR_ID(_msb, _lsb) ((_msb) << 8 | (_lsb)) ++ ++#define GC2053_FLIP_MIRROR_REG 0x17 ++ ++#define GC_MIRROR_BIT_MASK BIT(0) ++#define GC_FLIP_BIT_MASK BIT(1) ++ ++#define GC2053_NUM_SUPPLIES ARRAY_SIZE(gc2053_supply_names) ++ ++#define to_gc2053(sd) container_of(sd, struct gc2053, subdev) ++ ++struct regval { ++ u8 addr; ++ u8 val; ++}; ++ ++struct gc2053_mode { ++ u32 width; ++ u32 height; ++ struct v4l2_fract max_fps; ++ u32 hts_def; ++ u32 vts_def; ++ u32 exp_def; ++ const struct regval *reg_list; ++}; ++ ++struct gc2053 { ++ struct i2c_client *client; ++ struct gpio_desc *reset_gpio; ++ struct gpio_desc *pwdn_gpio; ++ ++ struct v4l2_subdev subdev; ++ struct media_pad pad; ++ struct v4l2_ctrl_handler ctrl_handler; ++ struct v4l2_ctrl *exposure; ++ struct v4l2_ctrl *anal_gain; ++ struct v4l2_ctrl *hblank; ++ struct v4l2_ctrl *vblank; ++ struct v4l2_ctrl *h_flip; ++ struct v4l2_ctrl *v_flip; ++ struct mutex mutex; ++ bool streaming; ++ bool power_on; ++ const struct gc2053_mode *cur_mode; ++ unsigned int lane_num; ++ unsigned int cfg_num; ++ unsigned int pixel_rate; ++ ++ u32 module_index; ++ const char *module_facing; ++ const char *module_name; ++ const char *len_name; ++ u8 flip; ++}; ++ ++static const struct regval gc2053_start[] = { ++ {0xf0, 0x00}, /* mode select streaming on */ ++ {0x3e, 0x91}, ++ {REG_NULL, 0x00}, ++}; ++ ++static const struct regval gc2053_stop[] = { ++ {0xf0, 0x00}, /* mode select streaming off */ ++ {0x3e, 0x00}, ++ {REG_NULL, 0x00}, ++}; ++ ++/* ++ * window_size=1920*1080 mipi@2lane ++ * mclk=24mhz,mipi_clk=594Mbps ++ * pixel_line_total=2200,line_frame_total=1125 ++ * row_time=29.629us,frame_rate=30fps ++ */ ++static const struct regval gc2053_1920x1080_regs_2lane[] = { ++ /****system****/ ++ {0xfe, 0x80}, ++ {0xfe, 0x80}, ++ {0xfe, 0x80}, ++ {0xfe, 0x00}, ++ {0xf2, 0x00}, ++ {0xf3, 0x00}, ++ {0xf4, 0x36}, ++ {0xf5, 0xc0}, ++ {0xf6, 0x44}, ++ {0xf7, 0x01}, ++ {0xf8, 0x63}, ++ {0xf9, 0x40}, ++ {0xfc, 0x8e}, ++ /****CISCTL & ANALOG****/ ++ {0xfe, 0x00}, ++ {0x87, 0x18}, ++ {0xee, 0x30}, ++ {0xd0, 0xb7}, ++ {0x03, 0x04}, ++ {0x04, 0x60}, ++ {0x05, 0x04}, ++ {0x06, 0x4c}, ++ {0x07, 0x00}, ++ {0x08, 0x11}, ++ {0x09, 0x00}, ++ {0x0a, 0x02}, ++ {0x0b, 0x00}, ++ {0x0c, 0x02}, ++ {0x0d, 0x04}, ++ {0x0e, 0x40}, ++ {0x12, 0xe2}, ++ {0x13, 0x16}, ++ {0x19, 0x0a}, ++ {0x21, 0x1c}, ++ {0x28, 0x0a}, ++ {0x29, 0x24}, ++ {0x2b, 0x04}, ++ {0x32, 0xf8}, ++ {0x37, 0x03}, ++ {0x39, 0x15}, ++ {0x43, 0x07}, ++ {0x44, 0x40}, ++ {0x46, 0x0b}, ++ {0x4b, 0x20}, ++ {0x4e, 0x08}, ++ {0x55, 0x20}, ++ {0x66, 0x05}, ++ {0x67, 0x05}, ++ {0x77, 0x01}, ++ {0x78, 0x00}, ++ {0x7c, 0x93}, ++ {0x8c, 0x12}, ++ {0x8d, 0x92}, ++ {0x90, 0x01}, ++ {0x9d, 0x10}, ++ {0xce, 0x7c}, ++ {0xd2, 0x41}, ++ {0xd3, 0xdc}, ++ {0xe6, 0x50}, ++ /*gain*/ ++ {0xb6, 0xc0}, ++ {0xb0, 0x60}, ++ {0xb1, 0x01}, ++ {0xb2, 0x00}, ++ {0xb3, 0x00}, ++ {0xb4, 0x00}, ++ {0xb8, 0x01}, ++ {0xb9, 0x00}, ++ /*blk*/ ++ {0x26, 0x30}, ++ {0xfe, 0x01}, ++ {0x40, 0x23}, ++ {0x55, 0x07}, ++ {0x60, 0x40}, ++ {0xfe, 0x04}, ++ {0x14, 0x78}, ++ {0x15, 0x78}, ++ {0x16, 0x78}, ++ {0x17, 0x78}, ++ /*window*/ ++ {0xfe, 0x01}, ++ {0x92, 0x00}, ++ {0x94, 0x03}, ++ {0x95, 0x04},//[10:0]win_out_height-1080 ++ {0x96, 0x38}, ++ {0x97, 0x07},//[11:0]win_out_width-1920 ++ {0x98, 0x80}, ++ /*ISP*/ ++ {0xfe, 0x01}, ++ {0x01, 0x05}, ++ {0x02, 0x89}, ++ {0x04, 0x01}, ++ {0x07, 0xa6}, ++ {0x08, 0xa9}, ++ {0x09, 0xa8}, ++ {0x0a, 0xa7}, ++ {0x0b, 0xff}, ++ {0x0c, 0xff}, ++ {0x0f, 0x00}, ++ {0x50, 0x1c}, ++ {0x89, 0x03}, ++ {0xfe, 0x04}, ++ {0x28, 0x86}, ++ {0x29, 0x86}, ++ {0x2a, 0x86}, ++ {0x2b, 0x68}, ++ {0x2c, 0x68}, ++ {0x2d, 0x68}, ++ {0x2e, 0x68}, ++ {0x2f, 0x68}, ++ {0x30, 0x4f}, ++ {0x31, 0x68}, ++ {0x32, 0x67}, ++ {0x33, 0x66}, ++ {0x34, 0x66}, ++ {0x35, 0x66}, ++ {0x36, 0x66}, ++ {0x37, 0x66}, ++ {0x38, 0x62}, ++ {0x39, 0x62}, ++ {0x3a, 0x62}, ++ {0x3b, 0x62}, ++ {0x3c, 0x62}, ++ {0x3d, 0x62}, ++ {0x3e, 0x62}, ++ {0x3f, 0x62}, ++ /****DVP & MIPI****/ ++ {0xfe, 0x01}, ++ {0x9a, 0x06}, ++ {0x99, 0x00}, ++ {0xfe, 0x00}, ++ {0x7b, 0x2a}, ++ {0x23, 0x2d}, ++ {0xfe, 0x03}, ++ {0x01, 0x27}, ++ {0x02, 0x56}, ++ {0x03, 0x8e}, ++ {0x12, 0x80}, ++ {0x13, 0x07}, ++ {0xfe, 0x00}, ++ {0x3e, 0x81}, ++ {REG_NULL, 0x00}, ++}; ++ ++static const struct gc2053_mode supported_modes[] = { ++ { ++ .width = 1920, ++ .height = 1080, ++ .max_fps = { ++ .numerator = 10000, ++ .denominator = 300000, ++ }, ++ .exp_def = 0x460, ++ .hts_def = 0x898, ++ .vts_def = 0x465, ++ .reg_list = gc2053_1920x1080_regs_2lane, ++ }, ++}; ++ ++static const s64 link_freq_menu_items[] = { ++ MIPI_FREQ_297M ++}; ++ ++/* sensor register write */ ++static int gc2053_write_reg(struct i2c_client *client, u8 reg, u8 val) ++{ ++ struct i2c_msg msg; ++ u8 buf[2]; ++ int ret; ++ ++ buf[0] = reg & 0xFF; ++ buf[1] = val; ++ ++ msg.addr = client->addr; ++ msg.flags = client->flags; ++ msg.buf = buf; ++ msg.len = sizeof(buf); ++ ++ ret = i2c_transfer(client->adapter, &msg, 1); ++ if (ret >= 0) ++ return 0; ++ ++ dev_err(&client->dev, ++ "gc2053 write reg(0x%x val:0x%x) failed !\n", reg, val); ++ ++ return ret; ++} ++ ++static int gc2053_write_array(struct i2c_client *client, ++ const struct regval *regs) ++{ ++ int i, ret = 0; ++ ++ i = 0; ++ while (regs[i].addr != REG_NULL) { ++ ret = gc2053_write_reg(client, regs[i].addr, regs[i].val); ++ if (ret) { ++ dev_err(&client->dev, "%s failed !\n", __func__); ++ break; ++ } ++ i++; ++ } ++ ++ return ret; ++} ++ ++/* sensor register read */ ++static int gc2053_read_reg(struct i2c_client *client, u8 reg, u8 *val) ++{ ++ struct i2c_msg msg[2]; ++ u8 buf[1]; ++ int ret; ++ ++ buf[0] = reg & 0xFF; ++ ++ msg[0].addr = client->addr; ++ msg[0].flags = client->flags; ++ msg[0].buf = buf; ++ msg[0].len = sizeof(buf); ++ ++ msg[1].addr = client->addr; ++ msg[1].flags = client->flags | I2C_M_RD; ++ msg[1].buf = buf; ++ msg[1].len = 1; ++ ++ ret = i2c_transfer(client->adapter, msg, 2); ++ if (ret >= 0) { ++ *val = buf[0]; ++ return 0; ++ } ++ ++ dev_err(&client->dev, ++ "gc2053 read reg(0x%x val:0x%x) failed !\n", reg, *val); ++ ++ return ret; ++} ++ ++static int gc2053_get_reso_dist(const struct gc2053_mode *mode, ++ struct v4l2_mbus_framefmt *framefmt) ++{ ++ return abs(mode->width - framefmt->width) + ++ abs(mode->height - framefmt->height); ++} ++ ++static const struct gc2053_mode * ++gc2053_find_best_fit(struct gc2053 *gc2053, struct v4l2_subdev_format *fmt) ++{ ++ struct v4l2_mbus_framefmt *framefmt = &fmt->format; ++ int dist; ++ int cur_best_fit = 0; ++ int cur_best_fit_dist = -1; ++ unsigned int i; ++ ++ for (i = 0; i < gc2053->cfg_num; i++) { ++ dist = gc2053_get_reso_dist(&supported_modes[i], framefmt); ++ if (cur_best_fit_dist == -1 || dist <= cur_best_fit_dist) { ++ cur_best_fit_dist = dist; ++ cur_best_fit = i; ++ } ++ } ++ ++ return &supported_modes[cur_best_fit]; ++} ++ ++static uint8_t gain_reg_table[29][4] = { ++ {0x00, 0x00, 0x01, 0x00}, ++ {0x00, 0x10, 0x01, 0x0c}, ++ {0x00, 0x20, 0x01, 0x1b}, ++ {0x00, 0x30, 0x01, 0x2c}, ++ {0x00, 0x40, 0x01, 0x3f}, ++ {0x00, 0x50, 0x02, 0x16}, ++ {0x00, 0x60, 0x02, 0x35}, ++ {0x00, 0x70, 0x03, 0x16}, ++ {0x00, 0x80, 0x04, 0x02}, ++ {0x00, 0x90, 0x04, 0x31}, ++ {0x00, 0xa0, 0x05, 0x32}, ++ {0x00, 0xb0, 0x06, 0x35}, ++ {0x00, 0xc0, 0x08, 0x04}, ++ {0x00, 0x5a, 0x09, 0x19}, ++ {0x00, 0x83, 0x0b, 0x0f}, ++ {0x00, 0x93, 0x0d, 0x12}, ++ {0x00, 0x84, 0x10, 0x00}, ++ {0x00, 0x94, 0x12, 0x3a}, ++ {0x01, 0x2c, 0x1a, 0x02}, ++ {0x01, 0x3c, 0x1b, 0x20}, ++ {0x00, 0x8c, 0x20, 0x0f}, ++ {0x00, 0x9c, 0x26, 0x07}, ++ {0x02, 0x64, 0x36, 0x21}, ++ {0x02, 0x74, 0x37, 0x3a}, ++ {0x00, 0xc6, 0x3d, 0x02}, ++ {0x00, 0xdc, 0x3f, 0x3f}, ++ {0x02, 0x85, 0x3f, 0x3f}, ++ {0x02, 0x95, 0x3f, 0x3f}, ++ {0x00, 0xce, 0x3f, 0x3f}, ++}; ++ ++static uint32_t gain_level_table[30] = { ++ 64, ++ 76, ++ 91, ++ 108, ++ 127, ++ 150, ++ 181, ++ 214, ++ 258, ++ 305, ++ 370, ++ 437, ++ 516, ++ 601, ++ 719, ++ 850, ++ 1024, ++ 1210, ++ 1538, ++ 1760, ++ 2063, ++ 2439, ++ 2881, ++ 3393, ++ 3970, ++ 4737, ++ 5572, ++ 6552, ++ 7713, ++ 0xffffffff ++}; ++ ++static int gc2053_set_gain(struct gc2053 *gc2053, u32 gain) ++{ ++ int ret = 0; ++ uint8_t i = 0; ++ uint8_t total = 0; ++ uint8_t temp = 0; ++ ++ total = sizeof(gain_level_table) / sizeof(u32) - 1; ++ for (i = 0; i < total; i++) { ++ if ((gain_level_table[i] <= gain) && (gain < gain_level_table[i+1])) ++ break; ++ } ++ ++ ret = gc2053_write_reg(gc2053->client, 0xb4, gain_reg_table[i][0]); ++ ret |= gc2053_write_reg(gc2053->client, 0xb3, gain_reg_table[i][1]); ++ ret |= gc2053_write_reg(gc2053->client, 0xb8, gain_reg_table[i][2]); ++ ret |= gc2053_write_reg(gc2053->client, 0xb9, gain_reg_table[i][3]); ++ ++ temp = 64 * gain / gain_level_table[i]; ++ ret |= gc2053_write_reg(gc2053->client, 0xb1, (temp >> 6)); ++ ret |= gc2053_write_reg(gc2053->client, 0xb2, (temp << 2) & 0xfc); ++ ++ return ret; ++} ++ ++static int gc2053_set_ctrl(struct v4l2_ctrl *ctrl) ++{ ++ struct gc2053 *gc2053 = container_of(ctrl->handler, ++ struct gc2053, ctrl_handler); ++ struct i2c_client *client = gc2053->client; ++ s64 max; ++ int ret = 0; ++ u32 vts = 0; ++ ++ /* Propagate change of current control to all related controls */ ++ switch (ctrl->id) { ++ case V4L2_CID_VBLANK: ++ /* Update max exposure while meeting expected vblanking */ ++ max = gc2053->cur_mode->height + ctrl->val - 1; ++ __v4l2_ctrl_modify_range(gc2053->exposure, ++ gc2053->exposure->minimum, max, ++ gc2053->exposure->step, ++ gc2053->exposure->default_value); ++ break; ++ } ++ ++ switch (ctrl->id) { ++ case V4L2_CID_EXPOSURE: ++ ret = gc2053_write_reg(gc2053->client, GC2053_REG_EXP_H, ++ (ctrl->val >> 8) & 0x3f); ++ ret |= gc2053_write_reg(gc2053->client, GC2053_REG_EXP_L, ++ ctrl->val & 0xff); ++ break; ++ case V4L2_CID_ANALOGUE_GAIN: ++ case V4L2_CID_GAIN: ++ gc2053_set_gain(gc2053, ctrl->val); ++ break; ++ case V4L2_CID_VBLANK: ++ vts = ctrl->val + gc2053->cur_mode->height; ++ ret = gc2053_write_reg(gc2053->client, GC2053_REG_VTS_H, (vts >> 8) & 0x3f); ++ ret |= gc2053_write_reg(gc2053->client, GC2053_REG_VTS_L, vts & 0xff); ++ break; ++ case V4L2_CID_HFLIP: ++ if (ctrl->val) ++ gc2053->flip |= GC_MIRROR_BIT_MASK; ++ else ++ gc2053->flip &= ~GC_MIRROR_BIT_MASK; ++ break; ++ case V4L2_CID_VFLIP: ++ if (ctrl->val) ++ gc2053->flip |= GC_FLIP_BIT_MASK; ++ else ++ gc2053->flip &= ~GC_FLIP_BIT_MASK; ++ break; ++ default: ++ dev_warn(&client->dev, "%s Unhandled id:0x%x, val:0x%x\n", ++ __func__, ctrl->id, ctrl->val); ++ break; ++ } ++ ++ return ret; ++} ++ ++static const struct v4l2_ctrl_ops gc2053_ctrl_ops = { ++ .s_ctrl = gc2053_set_ctrl, ++}; ++ ++static int gc2053_parse_of(struct gc2053 *gc2053) ++{ ++ struct device *dev = &gc2053->client->dev; ++ struct device_node *endpoint; ++ struct fwnode_handle *fwnode; ++ int rval; ++ ++ endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); ++ if (!endpoint) { ++ dev_err(dev, "Failed to get endpoint\n"); ++ return -EINVAL; ++ } ++ fwnode = of_fwnode_handle(endpoint); ++ rval = fwnode_property_read_u32_array(fwnode, "data-lanes", NULL, 0); ++ if (rval <= 0) { ++ dev_warn(dev, " Get mipi lane num failed!\n"); ++ return -1; ++ } ++ ++ gc2053->lane_num = rval; ++ if (2 == gc2053->lane_num) { ++ gc2053->cur_mode = &supported_modes[0]; ++ gc2053->cfg_num = ARRAY_SIZE(supported_modes); ++ ++ /*pixel rate = link frequency * 2 * lanes / BITS_PER_SAMPLE */ ++ gc2053->pixel_rate = MIPI_FREQ_297M * 2U * (gc2053->lane_num) / 10U; ++ dev_info(dev, "lane_num(%d) pixel_rate(%u)\n", ++ gc2053->lane_num, gc2053->pixel_rate); ++ } else { ++ dev_info(dev, "gc2053 can not support the lane num(%d)\n", gc2053->lane_num); ++ } ++ return 0; ++} ++ ++static int gc2053_initialize_controls(struct gc2053 *gc2053) ++{ ++ const struct gc2053_mode *mode; ++ struct v4l2_ctrl_handler *handler; ++ struct v4l2_ctrl *ctrl; ++ s64 exposure_max, vblank_def; ++ u32 h_blank; ++ int ret; ++ ++ handler = &gc2053->ctrl_handler; ++ mode = gc2053->cur_mode; ++ ret = v4l2_ctrl_handler_init(handler, 10); ++ if (ret) ++ return ret; ++ handler->lock = &gc2053->mutex; ++ ++ ctrl = v4l2_ctrl_new_int_menu(handler, NULL, V4L2_CID_LINK_FREQ, ++ 0, 0, link_freq_menu_items); ++ if (ctrl) ++ ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; ++ ++ v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, ++ 0, gc2053->pixel_rate, 1, gc2053->pixel_rate); ++ ++ h_blank = mode->hts_def - mode->width; ++ gc2053->hblank = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_HBLANK, ++ h_blank, h_blank, 1, h_blank); ++ if (gc2053->hblank) ++ gc2053->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; ++ ++ vblank_def = mode->vts_def - mode->height; ++ gc2053->vblank = v4l2_ctrl_new_std(handler, &gc2053_ctrl_ops, ++ V4L2_CID_VBLANK, vblank_def, ++ GC2053_VTS_MAX - mode->height, ++ 1, vblank_def); ++ ++ exposure_max = mode->vts_def - 1; ++ gc2053->exposure = v4l2_ctrl_new_std(handler, &gc2053_ctrl_ops, ++ V4L2_CID_EXPOSURE, GC2053_EXPOSURE_MIN, ++ exposure_max, GC2053_EXPOSURE_STEP, ++ mode->exp_def); ++ ++ gc2053->anal_gain = v4l2_ctrl_new_std(handler, &gc2053_ctrl_ops, ++ V4L2_CID_ANALOGUE_GAIN, GC2053_GAIN_MIN, ++ GC2053_GAIN_MAX, GC2053_GAIN_STEP, ++ GC2053_GAIN_DEFAULT); ++ ++ v4l2_ctrl_new_std(handler, &gc2053_ctrl_ops, ++ V4L2_CID_GAIN, GC2053_GAIN_MIN, ++ GC2053_GAIN_MAX, GC2053_GAIN_STEP, ++ GC2053_GAIN_DEFAULT); ++ ++ ++ gc2053->h_flip = v4l2_ctrl_new_std(handler, &gc2053_ctrl_ops, ++ V4L2_CID_HFLIP, 0, 1, 1, 0); ++ ++ gc2053->v_flip = v4l2_ctrl_new_std(handler, &gc2053_ctrl_ops, ++ V4L2_CID_VFLIP, 0, 1, 1, 0); ++ gc2053->flip = 0; ++ ++ if (handler->error) { ++ ret = handler->error; ++ dev_err(&gc2053->client->dev, ++ "Failed to init controls(%d)\n", ret); ++ goto err_free_handler; ++ } ++ ++ gc2053->subdev.ctrl_handler = handler; ++ return 0; ++ ++err_free_handler: ++ v4l2_ctrl_handler_free(handler); ++ return ret; ++} ++ ++/* Calculate the delay in us by clock rate and clock cycles */ ++static inline u32 gc2053_cal_delay(u32 cycles) ++{ ++ return DIV_ROUND_UP(cycles, GC2053_XVCLK_FREQ / 1000 / 1000); ++} ++ ++static int __gc2053_power_on(struct gc2053 *gc2053) ++{ ++ u32 delay_us; ++ ++ if (!IS_ERR(gc2053->reset_gpio)) { ++ gpiod_set_value_cansleep(gc2053->reset_gpio, 1); ++ usleep_range(100, 200); ++ } ++ if (!IS_ERR(gc2053->pwdn_gpio)) ++ gpiod_set_value_cansleep(gc2053->pwdn_gpio, 0); ++ ++ if (!IS_ERR(gc2053->reset_gpio)) ++ gpiod_set_value_cansleep(gc2053->reset_gpio, 0); ++ usleep_range(3000, 6000); ++ /* 8192 cycles prior to first SCCB transaction */ ++ delay_us = gc2053_cal_delay(8192); ++ usleep_range(delay_us, delay_us * 2); ++ return 0; ++} ++ ++static void __gc2053_power_off(struct gc2053 *gc2053) ++{ ++ if (!IS_ERR(gc2053->pwdn_gpio)) ++ gpiod_set_value_cansleep(gc2053->pwdn_gpio, 1); ++ ++ if (!IS_ERR(gc2053->reset_gpio)) ++ gpiod_set_value_cansleep(gc2053->reset_gpio, 1); ++} ++ ++static int gc2053_check_sensor_id(struct gc2053 *gc2053, ++ struct i2c_client *client) ++{ ++ struct device *dev = &gc2053->client->dev; ++ u8 pid = 0, ver = 0; ++ u16 id = 0; ++ int ret = 0; ++ ++ /* Check sensor revision */ ++ ret = gc2053_read_reg(client, GC2053_REG_CHIP_ID_H, &pid); ++ ret |= gc2053_read_reg(client, GC2053_REG_CHIP_ID_L, &ver); ++ if (ret) { ++ dev_err(&client->dev, "gc2053_read_reg failed (%d)\n", ret); ++ return ret; ++ } ++ ++ id = SENSOR_ID(pid, ver); ++ if (id != GC2053_CHIP_ID) { ++ dev_err(&client->dev, ++ "Sensor detection failed (%04X,%d)\n", ++ id, ret); ++ return -ENODEV; ++ } ++ ++ dev_info(dev, "Detected GC%04x sensor\n", id); ++ return 0; ++} ++ ++static int gc2053_set_flip(struct gc2053 *gc2053, u8 mode) ++{ ++ u8 match_reg = 0; ++ ++ gc2053_read_reg(gc2053->client, GC2053_FLIP_MIRROR_REG, &match_reg); ++ ++ if (mode == GC_FLIP_BIT_MASK) { ++ match_reg |= GC_FLIP_BIT_MASK; ++ match_reg &= ~GC_MIRROR_BIT_MASK; ++ } else if (mode == GC_MIRROR_BIT_MASK) { ++ match_reg |= GC_MIRROR_BIT_MASK; ++ match_reg &= ~GC_FLIP_BIT_MASK; ++ } else if (mode == (GC_MIRROR_BIT_MASK | ++ GC_FLIP_BIT_MASK)) { ++ match_reg |= GC_FLIP_BIT_MASK; ++ match_reg |= GC_MIRROR_BIT_MASK; ++ } else { ++ match_reg &= ~GC_FLIP_BIT_MASK; ++ match_reg &= ~GC_MIRROR_BIT_MASK; ++ } ++ return gc2053_write_reg(gc2053->client, GC2053_FLIP_MIRROR_REG, match_reg); ++} ++ ++static int __gc2053_start_stream(struct gc2053 *gc2053) ++{ ++ int ret; ++ ++ ret = gc2053_write_array(gc2053->client, gc2053->cur_mode->reg_list); ++ if (ret) ++ return ret; ++ ++ /* In case these controls are set before streaming */ ++ mutex_unlock(&gc2053->mutex); ++ ret = v4l2_ctrl_handler_setup(&gc2053->ctrl_handler); ++ mutex_lock(&gc2053->mutex); ++ ++ ret = gc2053_set_flip(gc2053, gc2053->flip); ++ if (ret) ++ return ret; ++ ++ ret = gc2053_write_array(gc2053->client, gc2053_start); ++ if (ret) ++ return ret; ++ ++ return ret; ++} ++ ++static int __gc2053_stop_stream(struct gc2053 *gc2053) ++{ ++ int ret; ++ ++ ret = gc2053_write_array(gc2053->client, gc2053_stop); ++ if (ret) ++ return ret; ++ ++ return ret; ++} ++ ++static long gc2053_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) ++{ ++ struct gc2053 *gc2053 = to_gc2053(sd); ++ long ret = 0; ++ ++ dev_info(&gc2053->client->dev, "gc2053_ioctl\n"); ++ ++ switch (cmd) { ++ //case: ++ default: ++ ret = -ENOIOCTLCMD; ++ break; ++ } ++ return ret; ++} ++ ++#ifdef CONFIG_COMPAT ++static long gc2053_compat_ioctl32(struct v4l2_subdev *sd, ++ unsigned int cmd, unsigned long arg) ++{ ++ void __user *up = compat_ptr(arg); ++ struct module_inf *inf; ++ struct module_awb_cfg *awb_cfg; ++ long ret = 0; ++ ++ switch (cmd) { ++ case CANAANMODULE_GET_MODULE_INFO: ++ inf = kzalloc(sizeof(*inf), GFP_KERNEL); ++ if (!inf) { ++ ret = -ENOMEM; ++ return ret; ++ } ++ ++ ret = gc2053_ioctl(sd, cmd, inf); ++ if (!ret) ++ ret = copy_to_user(up, inf, sizeof(*inf)); ++ kfree(inf); ++ break; ++ case CANAANMODULE_AWB_CFG: ++ awb_cfg = kzalloc(sizeof(*awb_cfg), GFP_KERNEL); ++ if (!awb_cfg) { ++ ret = -ENOMEM; ++ return ret; ++ } ++ ++ ret = gc2053_ioctl(sd, cmd, awb_cfg); ++ if (!ret) ++ ret = copy_to_user(up, awb_cfg, sizeof(*awb_cfg)); ++ kfree(awb_cfg); ++ break; ++ default: ++ ret = -ENOIOCTLCMD; ++ break; ++ } ++ return ret; ++} ++ ++#endif ++ ++static int gc2053_s_stream(struct v4l2_subdev *sd, int on) ++{ ++ struct gc2053 *gc2053 = to_gc2053(sd); ++ int ret = 0; ++ ++ mutex_lock(&gc2053->mutex); ++ on = !!on; ++ if (on == gc2053->streaming) ++ goto unlock_and_return; ++ ++ if (on) { ++ ret = __gc2053_start_stream(gc2053); ++ if (ret) { ++ v4l2_err(sd, "start stream failed while write regs\n"); ++ goto unlock_and_return; ++ } ++ } else { ++ __gc2053_stop_stream(gc2053); ++ } ++ ++ gc2053->streaming = on; ++ ++unlock_and_return: ++ mutex_unlock(&gc2053->mutex); ++ return 0; ++} ++ ++static int gc2053_g_frame_interval(struct v4l2_subdev *sd, ++ struct v4l2_subdev_frame_interval *fi) ++{ ++ struct gc2053 *gc2053 = to_gc2053(sd); ++ const struct gc2053_mode *mode = gc2053->cur_mode; ++ ++ mutex_lock(&gc2053->mutex); ++ fi->interval = mode->max_fps; ++ mutex_unlock(&gc2053->mutex); ++ ++ return 0; ++} ++ ++static int gc2053_g_mbus_config(struct v4l2_subdev *sd, ++ struct v4l2_mbus_config *config) ++{ ++ u32 val = 1 << (GC2053_LANES - 1) | V4L2_MBUS_CSI2_CHANNEL_0 | ++ V4L2_MBUS_CSI2_CONTINUOUS_CLOCK; ++ ++ config->type = V4L2_MBUS_CSI2; ++ config->flags = (val | V4L2_MBUS_CSI2_CHANNEL_1); ++ ++ return 0; ++} ++static int gc2053_enum_mbus_code(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_mbus_code_enum *code) ++{ ++ if (code->index != 0) ++ return -EINVAL; ++ code->code = GC2053_MEDIA_BUS_FMT; ++ return 0; ++} ++ ++static int gc2053_enum_frame_sizes(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_frame_size_enum *fse) ++{ ++ struct gc2053 *gc2053 = to_gc2053(sd); ++ ++ if (fse->index >= gc2053->cfg_num) ++ return -EINVAL; ++ ++ if (fse->code != GC2053_MEDIA_BUS_FMT) ++ return -EINVAL; ++ ++ fse->min_width = supported_modes[fse->index].width; ++ fse->max_width = supported_modes[fse->index].width; ++ fse->max_height = supported_modes[fse->index].height; ++ fse->min_height = supported_modes[fse->index].height; ++ return 0; ++} ++ ++static int gc2053_enum_frame_interval(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_frame_interval_enum *fie) ++{ ++ struct gc2053 *gc2053 = to_gc2053(sd); ++ ++ if (fie->index >= gc2053->cfg_num) ++ return -EINVAL; ++ ++ fie->code = GC2053_MEDIA_BUS_FMT; ++ fie->width = supported_modes[fie->index].width; ++ fie->height = supported_modes[fie->index].height; ++ fie->interval = supported_modes[fie->index].max_fps; ++ return 0; ++} ++ ++static int gc2053_set_fmt(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_format *fmt) ++{ ++ struct gc2053 *gc2053 = to_gc2053(sd); ++ const struct gc2053_mode *mode; ++ s64 h_blank, vblank_def; ++ ++ mutex_lock(&gc2053->mutex); ++ ++ mode = gc2053_find_best_fit(gc2053, fmt); ++ dev_info(&gc2053->client->dev, "set_fmt, width:%u, height:%u.\n", mode->width, mode->height); ++ ++ fmt->format.code = GC2053_MEDIA_BUS_FMT; ++ fmt->format.width = mode->width; ++ fmt->format.height = mode->height; ++ fmt->format.field = V4L2_FIELD_NONE; ++ ++ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++ *v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format; ++#else ++ mutex_unlock(&gc2053->mutex); ++ return -ENOTTY; ++#endif ++ } else { ++ gc2053->cur_mode = mode; ++ h_blank = mode->hts_def - mode->width; ++ __v4l2_ctrl_modify_range(gc2053->hblank, h_blank, ++ h_blank, 1, h_blank); ++ vblank_def = mode->vts_def - mode->height; ++ __v4l2_ctrl_modify_range(gc2053->vblank, vblank_def, ++ GC2053_VTS_MAX - mode->height, ++ 1, vblank_def); ++ } ++ ++ mutex_unlock(&gc2053->mutex); ++ return 0; ++} ++ ++static int gc2053_get_fmt(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_format *fmt) ++{ ++ struct gc2053 *gc2053 = to_gc2053(sd); ++ const struct gc2053_mode *mode = gc2053->cur_mode; ++ ++ mutex_lock(&gc2053->mutex); ++ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++ fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad); ++#else ++ mutex_unlock(&gc2053->mutex); ++ return -ENOTTY; ++#endif ++ } else { ++ fmt->format.width = mode->width; ++ fmt->format.height = mode->height; ++ fmt->format.code = GC2053_MEDIA_BUS_FMT; ++ fmt->format.field = V4L2_FIELD_NONE; ++ } ++ mutex_unlock(&gc2053->mutex); ++ return 0; ++} ++ ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++static int gc2053_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) ++{ ++ struct gc2053 *gc2053 = to_gc2053(sd); ++ struct v4l2_mbus_framefmt *try_fmt = ++ v4l2_subdev_get_try_format(sd, fh->pad, 0); ++ const struct gc2053_mode *def_mode = &supported_modes[0]; ++ ++ mutex_lock(&gc2053->mutex); ++ /* Initialize try_fmt */ ++ try_fmt->width = def_mode->width; ++ try_fmt->height = def_mode->height; ++ try_fmt->code = GC2053_MEDIA_BUS_FMT; ++ try_fmt->field = V4L2_FIELD_NONE; ++ ++ mutex_unlock(&gc2053->mutex); ++ /* No crop or compose */ ++ return 0; ++} ++#endif ++ ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++static const struct v4l2_subdev_internal_ops gc2053_internal_ops = { ++ .open = gc2053_open, ++}; ++#endif ++ ++static int gc2053_s_power(struct v4l2_subdev *sd, int on) ++{ ++ struct gc2053 *gc2053 = to_gc2053(sd); ++ int ret = 0; ++ ++ mutex_lock(&gc2053->mutex); ++ ++ /* If the power state is not modified - no work to do. */ ++ if (gc2053->power_on == !!on) ++ goto unlock_and_return; ++ ++ if (on) { ++ gc2053->power_on = true; ++ } else { ++ gc2053->power_on = false; ++ } ++ ++unlock_and_return: ++ mutex_unlock(&gc2053->mutex); ++ ++ return ret; ++} ++ ++static const struct v4l2_subdev_core_ops gc2053_core_ops = { ++ .s_power = gc2053_s_power, ++ .ioctl = gc2053_ioctl, ++#ifdef CONFIG_COMPAT ++ .compat_ioctl32 = gc2053_compat_ioctl32, ++#endif ++}; ++ ++static const struct v4l2_subdev_video_ops gc2053_video_ops = { ++ .s_stream = gc2053_s_stream, ++ .g_frame_interval = gc2053_g_frame_interval, ++ .g_mbus_config = gc2053_g_mbus_config, ++}; ++ ++static const struct v4l2_subdev_pad_ops gc2053_pad_ops = { ++ .enum_mbus_code = gc2053_enum_mbus_code, ++ .enum_frame_size = gc2053_enum_frame_sizes, ++ .enum_frame_interval = gc2053_enum_frame_interval, ++ .get_fmt = gc2053_get_fmt, ++ .set_fmt = gc2053_set_fmt, ++}; ++ ++static const struct v4l2_subdev_ops gc2053_subdev_ops = { ++ .core = &gc2053_core_ops, ++ .video = &gc2053_video_ops, ++ .pad = &gc2053_pad_ops, ++}; ++ ++static int gc2053_probe(struct i2c_client *client, ++ const struct i2c_device_id *id) ++{ ++ struct device *dev = &client->dev; ++ struct device_node *node = dev->of_node; ++ struct gc2053 *gc2053; ++ struct v4l2_subdev *sd; ++ char facing[2]; ++ int ret; ++ ++ dev_info(dev, "driver version: %02x.%02x.%02x", ++ DRIVER_VERSION >> 16, ++ (DRIVER_VERSION & 0xff00) >> 8, ++ DRIVER_VERSION & 0x00ff); ++ ++ gc2053 = devm_kzalloc(dev, sizeof(*gc2053), GFP_KERNEL); ++ if (!gc2053) ++ return -ENOMEM; ++ ++ gc2053->client = client; ++ ret = of_property_read_u32(node, CANAANMODULE_CAMERA_MODULE_INDEX, ++ &gc2053->module_index); ++ ret |= of_property_read_string(node, CANAANMODULE_CAMERA_MODULE_FACING, ++ &gc2053->module_facing); ++ ret |= of_property_read_string(node, CANAANMODULE_CAMERA_MODULE_NAME, ++ &gc2053->module_name); ++ ret |= of_property_read_string(node, CANAANMODULE_CAMERA_LENS_NAME, ++ &gc2053->len_name); ++ if (ret) { ++ dev_err(dev, "could not get module information!\n"); ++ return -EINVAL; ++ } ++ ++ gc2053->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); ++ if (IS_ERR(gc2053->reset_gpio)) ++ dev_warn(dev, "Failed to get reset-gpios\n"); ++ ++ gc2053->pwdn_gpio = devm_gpiod_get(dev, "pwdn", GPIOD_OUT_LOW); ++ if (IS_ERR(gc2053->pwdn_gpio)) ++ dev_info(dev, "Failed to get pwdn-gpios, maybe no used\n"); ++ ++ if (gpiod_export(gc2053->reset_gpio, 0)) { ++ dev_err(dev, "gpiod export gc2053 reset failed."); ++ } ++ ++ if (gpiod_export(gc2053->pwdn_gpio, 0)) { ++ dev_err(dev, "gpiod export gc2053 powerdown failed."); ++ } ++ ++ ret = gc2053_parse_of(gc2053); ++ if (ret != 0) ++ return -EINVAL; ++ ++ /* 1920 * 1080 by default */ ++ gc2053->cur_mode = &supported_modes[0]; ++ gc2053->cfg_num = ARRAY_SIZE(supported_modes); ++ ++ mutex_init(&gc2053->mutex); ++ ++ sd = &gc2053->subdev; ++ v4l2_i2c_subdev_init(sd, client, &gc2053_subdev_ops); ++ ret = gc2053_initialize_controls(gc2053); ++ if (ret) ++ goto err_destroy_mutex; ++ ++ ret = __gc2053_power_on(gc2053); ++ if (ret) ++ goto err_free_handler; ++ ++ ret = gc2053_check_sensor_id(gc2053, client); ++ if (ret) ++ goto err_power_off; ++ ++ sd->internal_ops = &gc2053_internal_ops; ++ sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | ++ V4L2_SUBDEV_FL_HAS_EVENTS; ++ ++ gc2053->pad.flags = MEDIA_PAD_FL_SOURCE; ++ sd->entity.function = MEDIA_ENT_F_CAM_SENSOR; ++ ret = media_entity_pads_init(&sd->entity, 1, &gc2053->pad); ++ if (ret < 0) ++ goto err_power_off; ++ ++ memset(facing, 0, sizeof(facing)); ++ if (strcmp(gc2053->module_facing, "back") == 0) ++ facing[0] = 'b'; ++ else ++ facing[0] = 'f'; ++ ++ snprintf(sd->name, sizeof(sd->name), "m%02d_%s_%s %s", ++ gc2053->module_index, facing, ++ GC2053_NAME, dev_name(sd->dev)); ++ ++ ret = v4l2_async_register_subdev_sensor_common(sd); ++ if (ret) { ++ dev_err(dev, "v4l2 async register subdev failed\n"); ++ goto err_clean_entity; ++ } ++ ++ return 0; ++ ++err_clean_entity: ++#if defined(CONFIG_MEDIA_CONTROLLER) ++ media_entity_cleanup(&sd->entity); ++#endif ++ ++err_power_off: ++ __gc2053_power_off(gc2053); ++err_free_handler: ++ v4l2_ctrl_handler_free(&gc2053->ctrl_handler); ++ ++err_destroy_mutex: ++ mutex_destroy(&gc2053->mutex); ++ return ret; ++} ++ ++static int gc2053_remove(struct i2c_client *client) ++{ ++ struct v4l2_subdev *sd = i2c_get_clientdata(client); ++ struct gc2053 *gc2053 = to_gc2053(sd); ++ ++ v4l2_async_unregister_subdev(sd); ++#if defined(CONFIG_MEDIA_CONTROLLER) ++ media_entity_cleanup(&sd->entity); ++#endif ++ v4l2_ctrl_handler_free(&gc2053->ctrl_handler); ++ mutex_destroy(&gc2053->mutex); ++ ++ pm_runtime_disable(&client->dev); ++ if (!pm_runtime_status_suspended(&client->dev)) ++ __gc2053_power_off(gc2053); ++ pm_runtime_set_suspended(&client->dev); ++ return 0; ++} ++ ++static const struct i2c_device_id gc2053_match_id[] = { ++ { "gc2053", 0 }, ++ { }, ++}; ++ ++#if IS_ENABLED(CONFIG_OF) ++static const struct of_device_id gc2053_of_match[] = { ++ { .compatible = "galaxycore,gc2053" }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, gc2053_of_match); ++#endif ++ ++static struct i2c_driver gc2053_i2c_driver = { ++ .driver = { ++ .name = GC2053_NAME, ++ .of_match_table = of_match_ptr(gc2053_of_match), ++ }, ++ .probe = &gc2053_probe, ++ .remove = &gc2053_remove, ++ .id_table = gc2053_match_id, ++}; ++ ++module_i2c_driver(gc2053_i2c_driver); ++MODULE_DESCRIPTION("GC2035 CMOS Image Sensor driver"); ++MODULE_LICENSE("GPL v2"); ++ +diff --git a/drivers/media/i2c/soc_camera/canaanchip/gc2093.c b/drivers/media/i2c/soc_camera/canaanchip/gc2093.c +new file mode 100755 +index 00000000..d2832b73 +--- /dev/null ++++ b/drivers/media/i2c/soc_camera/canaanchip/gc2093.c +@@ -0,0 +1,1522 @@ ++/* ++ * Driver for GC2093 CMOS Image Sensor ++ * ++ * Copyright (C) 2022, Canaan Bright Sight Co., Ltd ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x01) ++#define GC2093_NAME "gc2093" ++#define GC2093_MEDIA_BUS_FMT MEDIA_BUS_FMT_SRGGB10_1X10 ++ ++#define MIPI_FREQ_297M 297000000 ++#define MIPI_FREQ_396M 396000000 ++ ++#define GC2093_XVCLK_FREQ 24000000 ++ ++#define GC2093_REG_CHIP_ID_H 0x03F0 ++#define GC2093_REG_CHIP_ID_L 0x03F1 ++ ++#define GC2093_REG_EXP_SHORT_H 0x0001 ++#define GC2093_REG_EXP_SHORT_L 0x0002 ++#define GC2093_REG_EXP_LONG_H 0x0003 ++#define GC2093_REG_EXP_LONG_L 0x0004 ++ ++#define GC2093_MIRROR_FLIP_REG 0x0017 ++#define MIRROR_MASK BIT(0) ++#define FLIP_MASK BIT(1) ++ ++#define GC2093_REG_CTRL_MODE 0x003E ++#define GC2093_MODE_SW_STANDBY 0x11 ++#define GC2093_MODE_STREAMING 0x91 ++ ++#define GC2093_CHIP_ID 0x2093 ++ ++#define GC2093_VTS_MAX 0x3FFF ++#define GC2093_HTS_MAX 0xFFF ++ ++#define GC2093_EXPOSURE_MAX 0x3FFF ++#define GC2093_EXPOSURE_MIN 1 ++#define GC2093_EXPOSURE_STEP 1 ++ ++#define GC2093_GAIN_MIN 0x40 ++#define GC2093_GAIN_MAX 0x2000 ++#define GC2093_GAIN_STEP 1 ++#define GC2093_GAIN_DEFAULT 64 ++ ++#define GC2093_LANES 2 ++ ++#define REG_NULL 0xFFFF ++ ++#define to_gc2093(sd) container_of(sd, struct gc2093, subdev) ++ ++enum { ++ LINK_FREQ_297M_INDEX, ++ LINK_FREQ_396M_INDEX, ++}; ++ ++struct gc2093_reg { ++ u16 addr; ++ u8 val; ++}; ++ ++struct gain_reg_config { ++ u32 value; ++ u16 analog_gain; ++ u16 col_gain; ++ u16 analog_sw; ++ u16 ram_width; ++}; ++ ++struct gc2093_mode { ++ u32 width; ++ u32 height; ++ struct v4l2_fract max_fps; ++ u32 hts_def; ++ u32 vts_def; ++ u32 exp_def; ++ u32 link_freq_index; ++ const struct gc2093_reg *reg_list; ++}; ++ ++struct gc2093 { ++ struct i2c_client *client; ++ struct gpio_desc *reset_gpio; ++ struct gpio_desc *pwdn_gpio; ++ ++ struct v4l2_subdev subdev; ++ struct media_pad pad; ++ struct v4l2_ctrl_handler ctrl_handler; ++ struct v4l2_ctrl *exposure; ++ struct v4l2_ctrl *anal_gain; ++ struct v4l2_ctrl *hblank; ++ struct v4l2_ctrl *vblank; ++ struct v4l2_ctrl *h_flip; ++ struct v4l2_ctrl *v_flip; ++ struct v4l2_ctrl *link_freq; ++ struct v4l2_ctrl *pixel_rate; ++ ++ struct mutex lock; ++ bool streaming; ++ bool power_on; ++ unsigned int cfg_num; ++ const struct gc2093_mode *cur_mode; ++ ++ u32 module_index; ++ const char *module_facing; ++ const char *module_name; ++ const char *len_name; ++ ++ bool has_init_exp; ++}; ++ ++static const s64 link_freq_menu_items[] = { ++ MIPI_FREQ_297M, ++ MIPI_FREQ_396M, ++}; ++ ++/* ++ * window size=800*1080 mipi@2lane ++ * mclk=24M mipi_clk=792Mbps ++ * pixel_line_total=2640 line_frame_total=2500 ++ * row_time=13.3333us frame_rate=30fps ++ */ ++static const struct gc2093_reg gc2093_800x1080_linear_30fps_settings[] = { ++ /****system****/ ++ {0x03fe, 0xf0}, ++ {0x03fe, 0xf0}, ++ {0x03fe, 0xf0}, ++ {0x03fe, 0x00}, ++ {0x03f2, 0x00}, ++ {0x03f3, 0x00}, ++ {0x03f4, 0x36}, ++ {0x03f5, 0xc0}, ++ {0x03f6, 0x0b}, ++ {0x03f7, 0x11}, ++ {0x03f8, 0x58}, ++ {0x03f9, 0x42}, ++ {0x03fc, 0x8e}, ++ /****CISCTL & ANALOG****/ ++ {0x0087, 0x18}, ++ {0x00ee, 0x30}, ++ {0x00d0, 0xbf}, ++ {0x01a0, 0x00}, ++ {0x01a4, 0x40}, ++ {0x01a5, 0x40}, ++ {0x01a6, 0x40}, ++ {0x01af, 0x09}, ++ {0x0003, 0x04}, ++ {0x0004, 0x65}, ++ {0x0005, 0x05}, ++ {0x0006, 0x78}, ++ {0x0007, 0x00}, //VB[13:8] ++ {0x0008, 0x11}, //VB[7:0] ++ {0x0009, 0x00}, //Row Start[10:8] ++ {0x000a, 0x02}, //Row Start[7:0] ++ {0x000b, 0x00}, //Col Start[10:8] ++ {0x000c, 0x04}, //Col Start[7:0] ++ {0x000d, 0x04}, //Window height[10:8] 1088 ++ {0x000e, 0x40}, //Window height[7:0] ++ {0x000f, 0x07}, //Window width[11:8] 1932 ++ {0x0010, 0x8c}, //Window width[7:0] ++ {0x0013, 0x15}, ++ {0x0019, 0x0c}, ++ {0x0041, 0x09}, //FrameLength[13:8] 09c4=2500 ++ {0x0042, 0xc4}, //FrameLength[7:0] ++ {0x0053, 0x60}, ++ {0x008d, 0x92}, ++ {0x0090, 0x00}, ++ {0x00c7, 0xe1}, ++ {0x001b, 0x73}, ++ {0x0028, 0x0d}, ++ {0x0029, 0x40}, ++ {0x002b, 0x04}, ++ {0x002e, 0x23}, ++ {0x0037, 0x03}, ++ {0x0043, 0x04}, ++ {0x0044, 0x30}, ++ {0x004a, 0x01}, ++ {0x004b, 0x28}, ++ {0x0055, 0x30}, ++ {0x0066, 0x3f}, ++ {0x0068, 0x3f}, ++ {0x006b, 0x44}, ++ {0x0077, 0x00}, ++ {0x0078, 0x20}, ++ {0x007c, 0xa1}, ++ {0x00ce, 0x7c}, ++ {0x00d3, 0xd4}, ++ {0x00e6, 0x50}, ++ /*gain*/ ++ {0x00b6, 0xc0}, ++ {0x00b0, 0x68},//0x60 ++ /*isp*/ ++ {0x0101, 0x0c}, ++ {0x0102, 0x89}, ++ {0x0104, 0x01}, ++ {0x010f, 0x00}, ++ {0x0158, 0x00}, ++ {/*dark sun*/}, ++ {0x0123, 0x08}, ++ {0x0123, 0x00}, ++ {0x0120, 0x01}, ++ {0x0121, 0x04}, ++ {0x0122, 0xd8}, ++ {0x0124, 0x03}, ++ {0x0125, 0xff}, ++ {0x001a, 0x8c}, ++ {0x00c6, 0xe0}, ++ /*blk*/ ++ {0x0026, 0x30}, ++ {0x0142, 0x00}, ++ {0x0149, 0x1e}, ++ {0x014a, 0x0f}, ++ {0x014b, 0x00}, ++ {0x0155, 0x07}, ++ {0x0414, 0x78}, ++ {0x0415, 0x78}, ++ {0x0416, 0x78}, ++ {0x0417, 0x78}, ++ {0x0454, 0x78}, ++ {0x0455, 0x78}, ++ {0x0456, 0x78}, ++ {0x0457, 0x78}, ++ {0x04e0, 0x18}, ++ /*window*/ ++ {0x0191, 0x00}, //Out Window Y1[10:8] ++ {0x0192, 0x02}, //Out Window Y1[7:0] ++ {0x0193, 0x02}, //Out Window X1[11:8] ++ {0x0194, 0x2f}, //Out Window X1[7:0] ++ {0x0195, 0x04}, //Out Window Height[10:8] 1080=0438 ++ {0x0196, 0x38}, //Out Window Height[7:0] ++ {0x0197, 0x03}, //Out Window Width[11:8] 1920=0780 ++ {0x0198, 0x20}, //Out Window Width[7:0] 800=0320 ++ /****DVP & MIPI****/ ++ {0x019a, 0x06}, ++ {0x007b, 0x2a}, ++ {0x0023, 0x2d}, ++ {0x0201, 0x27}, ++ {0x0202, 0x5f}, ++ {0x0203, 0xce}, ++ {0x0212, 0x20}, ++ {0x0213, 0x03}, ++ {0x0215, 0x10}, ++ {REG_NULL, 0x00}, ++}; ++ ++/* ++ * window size=1920*1080 mipi@2lane ++ * mclk=24M mipi_clk=792Mbps ++ * pixel_line_total= line_frame_total=2500 ++ * row_time=13.3333us frame_rate=30fps ++ */ ++static const struct gc2093_reg gc2093_1080p_linear_30fps_settings[] = { ++ /****system****/ ++ {0x03fe, 0xf0}, ++ {0x03fe, 0xf0}, ++ {0x03fe, 0xf0}, ++ {0x03fe, 0x00}, ++ {0x03f2, 0x00}, ++ {0x03f3, 0x00}, ++ {0x03f4, 0x36}, ++ {0x03f5, 0xc0}, ++ {0x03f6, 0x0B}, ++ {0x03f7, 0x01}, ++ {0x03f8, 0x63}, ++ {0x03f9, 0x40}, ++ {0x03fc, 0x8e}, ++ /****CISCTL & ANALOG****/ ++ {0x0087, 0x18}, ++ {0x00ee, 0x30}, ++ {0x00d0, 0xbf}, ++ {0x01a0, 0x00}, ++ {0x01a4, 0x40}, ++ {0x01a5, 0x40}, ++ {0x01a6, 0x40}, ++ {0x01af, 0x09}, ++ {0x0001, 0x00}, ++ {0x0002, 0x02}, ++ {0x0003, 0x04}, //shutter time[13:8] ++ {0x0004, 0x02}, //shutter time[7:0] ++ {0x0005, 0x02}, //Line length[11:8] ++ {0x0006, 0x94}, //Line length[7:0] ++ {0x0007, 0x00}, //VB[13:8] ++ {0x0008, 0x11}, //VB[7:0] ++ {0x0009, 0x00}, //Row Start[10:8] ++ {0x000a, 0x02}, //Row Start[7:0] ++ {0x000b, 0x00}, //Col Start[10:8] ++ {0x000c, 0x04}, //Col Start[7:0] ++ {0x000d, 0x04}, //Window height[10:8] 1088 ++ {0x000e, 0x40}, //Window height[7:0] ++ {0x000f, 0x07}, //Window width[11:8] 1932 ++ {0x0010, 0x8c}, //Window width[7:0] ++ {0x0013, 0x15}, ++ {0x0013, 0x15}, ++ {0x0019, 0x0c}, ++ {0x0041, 0x09}, //FrameLength[13:8] 09c4=2500 ++ {0x0042, 0xc4}, //FrameLength[7:0] ++ {0x0053, 0x60}, ++ {0x008d, 0x92}, ++ {0x0090, 0x00}, ++ {0x00c7, 0xe1}, ++ {0x001b, 0x73}, ++ {0x0028, 0x0d}, ++ {0x0029, 0x24}, ++ {0x002b, 0x04}, ++ {0x002e, 0x23}, ++ {0x0037, 0x03}, ++ {0x0043, 0x04}, ++ {0x0044, 0x28}, ++ {0x004a, 0x01}, ++ {0x004b, 0x20}, ++ {0x0055, 0x28}, ++ {0x0066, 0x3f}, ++ {0x0068, 0x3f}, ++ {0x006b, 0x44}, ++ {0x0077, 0x00}, ++ {0x0078, 0x20}, ++ {0x007c, 0xa1}, ++ {0x00ce, 0x7c}, ++ {0x00d3, 0xd4}, ++ {0x00e6, 0x50}, ++ /*gain*/ ++ {0x00b6, 0xc0}, ++ {0x00b0, 0x68},//0x60 ++ /*isp*/ ++ {0x0101, 0x0c}, ++ {0x0102, 0x89}, ++ {0x0104, 0x01}, ++ {0x010f, 0x00}, ++ {0x0158, 0x00}, ++ {/*dark sun*/}, ++ {0x0123, 0x08}, ++ {0x0123, 0x00}, ++ {0x0120, 0x01}, ++ {0x0121, 0x04}, ++ {0x0122, 0xd8}, ++ {0x0124, 0x03}, ++ {0x0125, 0xff}, ++ {0x001a, 0x8c}, ++ {0x00c6, 0xe0}, ++ /*blk*/ ++ {0x0026, 0x30}, ++ {0x0142, 0x00}, ++ {0x0149, 0x1e}, ++ {0x014a, 0x0f}, ++ {0x014b, 0x00}, ++ {0x0155, 0x07}, ++ {0x0414, 0x78}, ++ {0x0415, 0x78}, ++ {0x0416, 0x78}, ++ {0x0417, 0x78}, ++ {0x0454, 0x78}, ++ {0x0455, 0x78}, ++ {0x0456, 0x78}, ++ {0x0457, 0x78}, ++ {0x04e0, 0x18}, ++ /*window*/ ++ {0x0192, 0x02}, //Out Window Y1[7:0] ++ {0x0194, 0x03}, //Out Window X1[7:0] ++ {0x0195, 0x04}, //Out Window Height[10:8] ++ {0x0196, 0x38}, //Out Window Height[7:0] ++ {0x0197, 0x07}, //Out Window Width[11:8] ++ {0x0198, 0x80}, //Out Window Width[7:0] ++ /****DVP & MIPI****/ ++ {0x019a, 0x06}, ++ {0x007b, 0x2a}, ++ {0x0023, 0x2d}, ++ {0x0201, 0x27}, ++ {0x0202, 0x56}, ++ {0x0203, 0xce}, ++ {0x0212, 0x80}, ++ {0x0213, 0x07}, ++ {0x0215, 0x10}, ++ {REG_NULL, 0x00}, ++}; ++ ++/* ++ * window size=1920*1080 mipi@2lane ++ * mclk=24M mipi_clk=792Mbps ++ * pixel_line_total=2640 line_frame_total=1250 ++ * row_time=13.3333us frame_rate=60fps ++ */ ++static const struct gc2093_reg gc2093_1080p_linear_60fps_settings[] = { ++ /****system****/ ++ {0x03fe, 0xf0}, ++ {0x03fe, 0xf0}, ++ {0x03fe, 0xf0}, ++ {0x03fe, 0x00}, ++ {0x03f2, 0x00}, ++ {0x03f3, 0x00}, ++ {0x03f4, 0x36}, ++ {0x03f5, 0xc0}, ++ {0x03f6, 0x0B}, ++ {0x03f7, 0x01}, ++ {0x03f8, 0x63}, ++ {0x03f9, 0x40}, ++ {0x03fc, 0x8e}, ++ /****CISCTL & ANALOG****/ ++ {0x0087, 0x18}, ++ {0x00ee, 0x30}, ++ {0x00d0, 0xbf}, ++ {0x01a0, 0x00}, ++ {0x01a4, 0x40}, ++ {0x01a5, 0x40}, ++ {0x01a6, 0x40}, ++ {0x01af, 0x09}, ++ {0x0001, 0x00}, ++ {0x0002, 0x02}, ++ {0x0003, 0x04}, //shutter time[13:8] ++ {0x0004, 0x02}, //shutter time[7:0] ++ {0x0005, 0x02}, //Line length[11:8] ++ {0x0006, 0x94}, //Line length[7:0] ++ {0x0007, 0x00}, //VB[13:8] ++ {0x0008, 0x11}, //VB[7:0] ++ {0x0009, 0x00}, //Row Start[10:8] ++ {0x000a, 0x02}, //Row Start[7:0] ++ {0x000b, 0x00}, //Col Start[10:8] ++ {0x000c, 0x04}, //Col Start[7:0] ++ {0x000d, 0x04}, //Window height[10:8] 1088 ++ {0x000e, 0x40}, //Window height[7:0] ++ {0x000f, 0x07}, //Window width[11:8] 1932 ++ {0x0010, 0x8c}, //Window width[7:0] ++ {0x0013, 0x15}, ++ {0x0013, 0x15}, ++ {0x0019, 0x0c}, ++ {0x0041, 0x04}, //FrameLength[13:8] 09c4=2500 ++ {0x0042, 0xe2}, //FrameLength[7:0] ++ {0x0053, 0x60}, ++ {0x008d, 0x92}, ++ {0x0090, 0x00}, ++ {0x00c7, 0xe1}, ++ {0x001b, 0x73}, ++ {0x0028, 0x0d}, ++ {0x0029, 0x24}, ++ {0x002b, 0x04}, ++ {0x002e, 0x23}, ++ {0x0037, 0x03}, ++ {0x0043, 0x04}, ++ {0x0044, 0x28}, ++ {0x004a, 0x01}, ++ {0x004b, 0x20}, ++ {0x0055, 0x28}, ++ {0x0066, 0x3f}, ++ {0x0068, 0x3f}, ++ {0x006b, 0x44}, ++ {0x0077, 0x00}, ++ {0x0078, 0x20}, ++ {0x007c, 0xa1}, ++ {0x00ce, 0x7c}, ++ {0x00d3, 0xd4}, ++ {0x00e6, 0x50}, ++ /*gain*/ ++ {0x00b6, 0xc0}, ++ {0x00b0, 0x68},//0x60 ++ /*isp*/ ++ {0x0101, 0x0c}, ++ {0x0102, 0x89}, ++ {0x0104, 0x01}, ++ {0x010f, 0x00}, ++ {0x0158, 0x00}, ++ {/*dark sun*/}, ++ {0x0123, 0x08}, ++ {0x0123, 0x00}, ++ {0x0120, 0x01}, ++ {0x0121, 0x04}, ++ {0x0122, 0xd8}, ++ {0x0124, 0x03}, ++ {0x0125, 0xff}, ++ {0x001a, 0x8c}, ++ {0x00c6, 0xe0}, ++ /*blk*/ ++ {0x0026, 0x30}, ++ {0x0142, 0x00}, ++ {0x0149, 0x1e}, ++ {0x014a, 0x0f}, ++ {0x014b, 0x00}, ++ {0x0155, 0x07}, ++ {0x0414, 0x78}, ++ {0x0415, 0x78}, ++ {0x0416, 0x78}, ++ {0x0417, 0x78}, ++ {0x0454, 0x78}, ++ {0x0455, 0x78}, ++ {0x0456, 0x78}, ++ {0x0457, 0x78}, ++ {0x04e0, 0x18}, ++ /*window*/ ++ {0x0192, 0x02}, //Out Window Y1[7:0] ++ {0x0194, 0x03}, //Out Window X1[7:0] ++ {0x0195, 0x04}, //Out Window Height[10:8] ++ {0x0196, 0x38}, //Out Window Height[7:0] ++ {0x0197, 0x07}, //Out Window Width[11:8] ++ {0x0198, 0x80}, //Out Window Width[7:0] ++ /****DVP & MIPI****/ ++ {0x019a, 0x06}, ++ {0x007b, 0x2a}, ++ {0x0023, 0x2d}, ++ {0x0201, 0x27}, ++ {0x0202, 0x56}, ++ {0x0203, 0xce}, ++ {0x0212, 0x80}, ++ {0x0213, 0x07}, ++ {0x0215, 0x10}, ++ {REG_NULL, 0x00}, ++}; ++ ++/* ++ * window size=1920*1080 mipi@2lane ++ * mclk=24M mipi_clk=792Mbps ++ * pixel_line_total=2640 line_frame_total=1250 ++ * row_time=13.3333us frame_rate=30fps ++ */ ++static const struct gc2093_reg gc2093_1080p_hdr_30fps_settings[] = { ++ /****system****/ ++ {0x03fe, 0xf0}, ++ {0x03fe, 0xf0}, ++ {0x03fe, 0xf0}, ++ {0x03fe, 0x00}, ++ {0x03f2, 0x00}, ++ {0x03f3, 0x00}, ++ {0x03f4, 0x36}, ++ {0x03f5, 0xc0}, ++ {0x03f6, 0x0B}, ++ {0x03f7, 0x01}, ++ {0x03f8, 0x63}, ++ {0x03f9, 0x40}, ++ {0x03fc, 0x8e}, ++ /****CISCTL & ANALOG****/ ++ {0x0087, 0x18}, ++ {0x00ee, 0x30}, ++ {0x00d0, 0xbf}, ++ {0x01a0, 0x00}, ++ {0x01a4, 0x40}, ++ {0x01a5, 0x40}, ++ {0x01a6, 0x40}, ++ {0x01af, 0x09}, ++ {0x0001, 0x00}, ++ {0x0002, 0x02}, ++ {0x0003, 0x04}, //shutter time[13:8] ++ {0x0004, 0x02}, //shutter time[7:0] ++ {0x0005, 0x02}, //Line length[11:8] ++ {0x0006, 0x94}, //Line length[7:0] ++ {0x0007, 0x00}, //VB[13:8] ++ {0x0008, 0x11}, //VB[7:0] ++ {0x0009, 0x00}, //Row Start[10:8] ++ {0x000a, 0x02}, //Row Start[7:0] ++ {0x000b, 0x00}, //Col Start[10:8] ++ {0x000c, 0x04}, //Col Start[7:0] ++ {0x000d, 0x04}, //Window height[10:8] 1088 ++ {0x000e, 0x40}, //Window height[7:0] ++ {0x000f, 0x07}, //Window width[11:8] 1932 ++ {0x0010, 0x8c}, //Window width[7:0] ++ {0x0013, 0x15}, ++ {0x0013, 0x15}, ++ {0x0019, 0x0c}, ++ {0x0041, 0x04}, //FrameLength[13:8] 09c4=2500 04e2=1250 ++ {0x0042, 0xe2}, //FrameLength[7:0] ++ {0x0053, 0x60}, ++ {0x008d, 0x92}, ++ {0x0090, 0x00}, ++ {0x00c7, 0xe1}, ++ {0x001b, 0x73}, ++ {0x0028, 0x0d}, ++ {0x0029, 0x24}, ++ {0x002b, 0x04}, ++ {0x002e, 0x23}, ++ {0x0037, 0x03}, ++ {0x0043, 0x04}, ++ {0x0044, 0x28}, ++ {0x004a, 0x01}, ++ {0x004b, 0x20}, ++ {0x0055, 0x28}, ++ {0x0066, 0x3f}, ++ {0x0068, 0x3f}, ++ {0x006b, 0x44}, ++ {0x0077, 0x00}, ++ {0x0078, 0x20}, ++ {0x007c, 0xa1}, ++ {0x00ce, 0x7c}, ++ {0x00d3, 0xd4}, ++ {0x00e6, 0x50}, ++ /*gain*/ ++ {0x00b6, 0xc0}, ++ {0x00b0, 0x68},//0x60 ++ /*isp*/ ++ {0x0101, 0x0c}, ++ {0x0102, 0x89}, ++ {0x0104, 0x01}, ++ {0x010e, 0x01}, ++ {0x010f, 0x00}, ++ {0x0158, 0x00}, ++ {/*dark sun*/}, ++ {0x0123, 0x08}, ++ {0x0123, 0x00}, ++ {0x0120, 0x01}, ++ {0x0121, 0x04}, ++ {0x0122, 0xd8}, ++ {0x0124, 0x03}, ++ {0x0125, 0xff}, ++ {0x001a, 0x8c}, ++ {0x00c6, 0xe0}, ++ /*blk*/ ++ {0x0026, 0x30}, ++ {0x0142, 0x00}, ++ {0x0149, 0x1e}, ++ {0x014a, 0x0f}, ++ {0x014b, 0x00}, ++ {0x0155, 0x07}, ++ {0x0414, 0x78}, ++ {0x0415, 0x78}, ++ {0x0416, 0x78}, ++ {0x0417, 0x78}, ++ {0x0454, 0x78}, ++ {0x0455, 0x78}, ++ {0x0456, 0x78}, ++ {0x0457, 0x78}, ++ {0x04e0, 0x18}, ++ /*window*/ ++ {0x0192, 0x02}, //Out Window Y1[7:0] ++ {0x0194, 0x03}, //Out Window X1[7:0] ++ {0x0195, 0x04}, //Out Window Height[10:8] ++ {0x0196, 0x38}, //Out Window Height[7:0] ++ {0x0197, 0x07}, //Out Window Width[11:8] ++ {0x0198, 0x80}, //Out Window Width[7:0] ++ /****DVP & MIPI****/ ++ {0x019a, 0x06}, ++ {0x007b, 0x2a}, ++ {0x0023, 0x2d}, ++ {0x0201, 0x27}, ++ {0x0202, 0x5f}, ++ {0x0203, 0xce}, ++ {0x0212, 0x80}, ++ {0x0213, 0x07}, ++ {0x0215, 0x10}, ++ /****HDR EN****/ ++ {0x0027, 0x71}, ++ {0x0215, 0x92}, ++ {0x024d, 0x01}, ++ //{0x001a, 0x9c}, //exp_exp2_th_mode ++ //{0x005a, 0x00}, //exp_exp2_th ++ //{0x005b, 0x49}, //exp_exp2_th ++ {REG_NULL, 0x00}, ++}; ++ ++static const struct gc2093_mode supported_modes[] = { ++ { ++ .width = 1920, ++ .height = 1080, ++ .max_fps = { ++ .numerator = 10000, ++ .denominator = 300000, ++ }, ++ .exp_def = 0x460, ++ .hts_def = 0xa50,//0x898, ++ .vts_def = 0x9c4,//0x465, ++ .link_freq_index = LINK_FREQ_396M_INDEX, ++ .reg_list = gc2093_1080p_linear_30fps_settings, ++ }, ++ { ++ .width = 1920, ++ .height = 1080, ++ .max_fps = { ++ .numerator = 10000, ++ .denominator = 600000, ++ }, ++ .exp_def = 0x460, ++ .hts_def = 0xa50, ++ .vts_def = 0x4e2, ++ .link_freq_index = LINK_FREQ_396M_INDEX, ++ .reg_list = gc2093_1080p_linear_60fps_settings, ++ }, ++ { ++ .width = 1920, ++ .height = 1080, ++ .max_fps = { ++ .numerator = 10000, ++ .denominator = 300000, ++ }, ++ .exp_def = 0x460, ++ .hts_def = 0xa50, ++ .vts_def = 0x4e2, ++ .link_freq_index = LINK_FREQ_396M_INDEX, ++ .reg_list = gc2093_1080p_hdr_30fps_settings, ++ }, ++ { ++ .width = 800, ++ .height = 1080, ++ .max_fps = { ++ .numerator = 10000, ++ .denominator = 300000, ++ }, ++ .exp_def = 0x460, ++ .hts_def = 0xa50,//0x898, ++ .vts_def = 0x9c4,//0x465, ++ .link_freq_index = LINK_FREQ_396M_INDEX, ++ .reg_list = gc2093_800x1080_linear_30fps_settings, ++ }, ++}; ++ ++/* pixel rate = link frequency * 2 * lanes / BITS_PER_SAMPLE */ ++static u64 to_pixel_rate(u32 index) ++{ ++ u64 pixel_rate = link_freq_menu_items[index] * 2 * GC2093_LANES; ++ ++ do_div(pixel_rate, 10); ++ ++ return pixel_rate; ++} ++ ++/* sensor register write */ ++static int gc2093_write_reg(struct i2c_client *client, u16 reg, u8 val) ++{ ++ struct i2c_msg msg; ++ u8 buf[3]; ++ int ret; ++ ++ buf[0] = reg >> 8; ++ buf[1] = reg & 0xff; ++ buf[2] = val; ++ ++ msg.addr = client->addr; ++ msg.flags = client->flags; ++ msg.buf = buf; ++ msg.len = sizeof(buf); ++ ++ ret = i2c_transfer(client->adapter, &msg, 1); ++ if (ret >= 0) ++ return 0; ++ ++ dev_err(&client->dev, "write reg(0x%x val:0x%x) failed !\n", reg, val); ++ ++ return ret; ++} ++ ++static int gc2093_write_array(struct i2c_client *client, ++ const struct gc2093_reg *regs) ++{ ++ int i, ret = 0; ++ ++ i = 0; ++ while (regs[i].addr != REG_NULL) { ++ ret = gc2093_write_reg(client, regs[i].addr, regs[i].val); ++ if (ret) { ++ dev_err(&client->dev, "%s failed !\n", __func__); ++ break; ++ } ++ i++; ++ } ++ ++ return ret; ++} ++ ++/* sensor register read */ ++static int gc2093_read_reg(struct i2c_client *client, u16 reg, u8 *val) ++{ ++ u8 buf[2] = {reg >> 8, reg & 0xff}; ++ int ret; ++ struct i2c_msg msgs[] = { ++ { ++ .addr = client->addr, ++ .flags = 0, ++ .len = 2, ++ .buf = buf, ++ }, { ++ .addr = client->addr, ++ .flags = I2C_M_RD, ++ .len = 1, ++ .buf = buf, ++ }, ++ }; ++ ++ ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); ++ if (ret >= 0) { ++ *val = buf[0]; ++ return 0; ++ } ++ ++ dev_err(&client->dev, "read reg(0x%x val:0x%x) failed !\n", reg, *val); ++ ++ return ret; ++} ++ ++ ++static const struct gain_reg_config gain_reg_configs[] = { ++ { 64, 0x0000, 0x0100, 0x6807, 0x00f8}, ++ { 75, 0x0010, 0x010c, 0x6807, 0x00f8}, ++ { 90, 0x0020, 0x011b, 0x6c08, 0x00f9}, ++ { 105, 0x0030, 0x012c, 0x6c0a, 0x00fa}, ++ { 122, 0x0040, 0x013f, 0x7c0b, 0x00fb}, ++ { 142, 0x0050, 0x0216, 0x7c0d, 0x00fe}, ++ { 167, 0x0060, 0x0235, 0x7c0e, 0x00ff}, ++ { 193, 0x0070, 0x0316, 0x7c10, 0x0801}, ++ { 223, 0x0080, 0x0402, 0x7c12, 0x0802}, ++ { 257, 0x0090, 0x0431, 0x7c13, 0x0803}, ++ { 299, 0x00a0, 0x0532, 0x7c15, 0x0805}, ++ { 346, 0x00b0, 0x0635, 0x7c17, 0x0807}, ++ { 397, 0x00c0, 0x0804, 0x7c18, 0x0808}, ++ { 444, 0x005a, 0x0919, 0x7c17, 0x0807}, ++ { 523, 0x0083, 0x0b0f, 0x7c17, 0x0807}, ++ { 607, 0x0093, 0x0d12, 0x7c19, 0x0809}, ++ { 700, 0x0084, 0x1000, 0x7c1b, 0x080c}, ++ { 817, 0x0094, 0x123a, 0x7c1e, 0x080f}, ++ {1131, 0x005d, 0x1a02, 0x7c23, 0x0814}, ++ {1142, 0x009b, 0x1b20, 0x7c25, 0x0816}, ++ {1334, 0x008c, 0x200f, 0x7c27, 0x0818}, ++ {1568, 0x009c, 0x2607, 0x7c2a, 0x081b}, ++ {2195, 0x00b6, 0x3621, 0x7c32, 0x0823}, ++ {2637, 0x00ad, 0x373a, 0x7c36, 0x0827}, ++ {3121, 0x00bd, 0x3d02, 0x7c3a, 0x082b}, ++}; ++ ++static int gc2093_set_gain(struct gc2093 *gc2093, u32 gain) ++{ ++ int ret, i = 0; ++ u16 pre_gain = 0; ++ ++ for (i = 0; i < ARRAY_SIZE(gain_reg_configs) - 1; i++) ++ if ((gain_reg_configs[i].value <= gain) && (gain < gain_reg_configs[i+1].value)) ++ break; ++ ++ ret = gc2093_write_reg(gc2093->client, 0x00b4, gain_reg_configs[i].analog_gain >> 8); ++ ret |= gc2093_write_reg(gc2093->client, 0x00b3, gain_reg_configs[i].analog_gain & 0xff); ++ ret |= gc2093_write_reg(gc2093->client, 0x00b8, gain_reg_configs[i].col_gain >> 8); ++ ret |= gc2093_write_reg(gc2093->client, 0x00b9, gain_reg_configs[i].col_gain & 0xff); ++ ret |= gc2093_write_reg(gc2093->client, 0x00ce, gain_reg_configs[i].analog_sw >> 8); ++ ret |= gc2093_write_reg(gc2093->client, 0x00c2, gain_reg_configs[i].analog_sw & 0xff); ++ ret |= gc2093_write_reg(gc2093->client, 0x00cf, gain_reg_configs[i].ram_width >> 8); ++ ret |= gc2093_write_reg(gc2093->client, 0x00d9, gain_reg_configs[i].ram_width & 0xff); ++ ++ pre_gain = 64 * gain / gain_reg_configs[i].value; ++ ++ ret |= gc2093_write_reg(gc2093->client, 0x00b1, (pre_gain >> 6)); ++ ret |= gc2093_write_reg(gc2093->client, 0x00b2, ((pre_gain & 0x3f) << 2)); ++ ++ return ret; ++} ++ ++static int gc2093_set_ctrl(struct v4l2_ctrl *ctrl) ++{ ++ struct gc2093 *gc2093 = container_of(ctrl->handler, ++ struct gc2093, ctrl_handler); ++ s64 max; ++ int ret = 0; ++ dev_dbg(&gc2093->client->dev, "%s enter, id:0x%X val:%d.\n", __func__, ctrl->id, ctrl->val); ++ ++ /* Propagate change of current control to all related controls */ ++ switch (ctrl->id) { ++ case V4L2_CID_VBLANK: ++ /* Update max exposure while meeting expected vblanking */ ++ max = gc2093->cur_mode->height + ctrl->val - 1; ++ __v4l2_ctrl_modify_range(gc2093->exposure, ++ gc2093->exposure->minimum, max, ++ gc2093->exposure->step, ++ gc2093->exposure->default_value); ++ break; ++ } ++ ++ switch (ctrl->id) { ++ case V4L2_CID_EXPOSURE: ++ ret = gc2093_write_reg(gc2093->client, GC2093_REG_EXP_LONG_H, ++ (ctrl->val >> 8) & 0x3f); ++ ret |= gc2093_write_reg(gc2093->client, GC2093_REG_EXP_LONG_L, ++ ctrl->val & 0xff); ++ break; ++ case V4L2_CID_ANALOGUE_GAIN: ++ case V4L2_CID_GAIN: ++ gc2093_set_gain(gc2093, ctrl->val); ++ break; ++ case V4L2_CID_VBLANK: ++ /* The exposure goes up and reduces the frame rate, no need to write vb */ ++ break; ++ case V4L2_CID_HFLIP: ++ break; ++ case V4L2_CID_VFLIP: ++ break; ++ default: ++ dev_warn(&gc2093->client->dev, "%s Unhandled id:0x%x, val:0x%x\n", ++ __func__, ctrl->id, ctrl->val); ++ break; ++ } ++ ++ return ret; ++} ++ ++static const struct v4l2_ctrl_ops gc2093_ctrl_ops = { ++ .s_ctrl = gc2093_set_ctrl, ++}; ++ ++static int gc2093_initialize_controls(struct gc2093 *gc2093) ++{ ++ const struct gc2093_mode *mode; ++ struct v4l2_ctrl_handler *handler; ++ s64 exposure_max, vblank_def; ++ u32 h_blank; ++ int ret; ++ ++ handler = &gc2093->ctrl_handler; ++ mode = gc2093->cur_mode; ++ ret = v4l2_ctrl_handler_init(handler, 10); ++ if (ret) ++ return ret; ++ handler->lock = &gc2093->lock; ++ ++ gc2093->link_freq = v4l2_ctrl_new_int_menu(handler, NULL, V4L2_CID_LINK_FREQ, ++ ARRAY_SIZE(link_freq_menu_items) - 1, 0, ++ link_freq_menu_items); ++ ++ gc2093->pixel_rate = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, ++ 0, to_pixel_rate(LINK_FREQ_396M_INDEX), ++ 1, to_pixel_rate(LINK_FREQ_297M_INDEX)); ++ ++ h_blank = mode->hts_def - mode->width; ++ gc2093->hblank = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_HBLANK, ++ h_blank, h_blank, 1, h_blank); ++ if (gc2093->hblank) ++ gc2093->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; ++ ++ vblank_def = mode->vts_def - mode->height; ++ gc2093->vblank = v4l2_ctrl_new_std(handler, &gc2093_ctrl_ops, ++ V4L2_CID_VBLANK, vblank_def, ++ GC2093_VTS_MAX - mode->height, ++ 1, vblank_def); ++ ++ exposure_max = mode->vts_def - 1; ++ gc2093->exposure = v4l2_ctrl_new_std(handler, &gc2093_ctrl_ops, ++ V4L2_CID_EXPOSURE, GC2093_EXPOSURE_MIN, ++ exposure_max, GC2093_EXPOSURE_STEP, ++ mode->exp_def); ++ ++ gc2093->anal_gain = v4l2_ctrl_new_std(handler, &gc2093_ctrl_ops, ++ V4L2_CID_ANALOGUE_GAIN, GC2093_GAIN_MIN, ++ GC2093_GAIN_MAX, GC2093_GAIN_STEP, ++ GC2093_GAIN_DEFAULT); ++ ++ v4l2_ctrl_new_std(handler, &gc2093_ctrl_ops, ++ V4L2_CID_GAIN, GC2093_GAIN_MIN, ++ GC2093_GAIN_MAX, GC2093_GAIN_STEP, ++ GC2093_GAIN_DEFAULT); ++ ++ gc2093->h_flip = v4l2_ctrl_new_std(handler, &gc2093_ctrl_ops, ++ V4L2_CID_HFLIP, 0, 1, 1, 0); ++ ++ gc2093->v_flip = v4l2_ctrl_new_std(handler, &gc2093_ctrl_ops, ++ V4L2_CID_VFLIP, 0, 1, 1, 0); ++ ++ if (handler->error) { ++ ret = handler->error; ++ dev_err(&gc2093->client->dev, "Failed to init controls(%d)\n", ret); ++ goto err_free_handler; ++ } ++ ++ gc2093->subdev.ctrl_handler = handler; ++ gc2093->has_init_exp = false; ++ ++ return 0; ++ ++err_free_handler: ++ v4l2_ctrl_handler_free(handler); ++ return ret; ++} ++ ++/* Calculate the delay in us by clock rate and clock cycles */ ++static inline u32 gc2093_cal_delay(u32 cycles) ++{ ++ return DIV_ROUND_UP(cycles, GC2093_XVCLK_FREQ / 1000 / 1000); ++} ++ ++static int __gc2093_power_on(struct gc2093 *gc2093) ++{ ++ u32 delay_us; ++ ++ if (!IS_ERR(gc2093->reset_gpio)) { ++ gpiod_set_value_cansleep(gc2093->reset_gpio, 1); ++ usleep_range(100, 200); ++ } ++ if (!IS_ERR(gc2093->pwdn_gpio)) ++ gpiod_set_value_cansleep(gc2093->pwdn_gpio, 0); ++ ++ if (!IS_ERR(gc2093->reset_gpio)) ++ gpiod_set_value_cansleep(gc2093->reset_gpio, 0); ++ usleep_range(3000, 6000); ++ /* 8192 cycles prior to first SCCB transaction */ ++ delay_us = gc2093_cal_delay(8192); ++ usleep_range(delay_us, delay_us * 2); ++ return 0; ++} ++ ++ ++static void __gc2093_power_off(struct gc2093 *gc2093) ++{ ++ if (!IS_ERR(gc2093->reset_gpio)) ++ gpiod_set_value_cansleep(gc2093->reset_gpio, 1); ++ if (!IS_ERR(gc2093->pwdn_gpio)) ++ gpiod_set_value_cansleep(gc2093->pwdn_gpio, 0); ++} ++ ++static int gc2093_check_sensor_id(struct gc2093 *gc2093) ++{ ++ struct device *dev = &gc2093->client->dev; ++ u8 id_h = 0, id_l = 0; ++ u16 id = 0; ++ int ret = 0; ++ ++ ret = gc2093_read_reg(gc2093->client, GC2093_REG_CHIP_ID_H, &id_h); ++ ret |= gc2093_read_reg(gc2093->client, GC2093_REG_CHIP_ID_L, &id_l); ++ if (ret) { ++ dev_err(dev, "Failed to read sensor id, (%d)\n", ret); ++ return ret; ++ } ++ ++ id = id_h << 8 | id_l; ++ if (id != GC2093_CHIP_ID) { ++ dev_err(dev, "sensor id: %04X mismatched\n", id); ++ return -ENODEV; ++ } ++ ++ dev_info(dev, "Detected GC2093 sensor\n"); ++ return 0; ++} ++ ++static long gc2093_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) ++{ ++ struct gc2093 *gc2093 = to_gc2093(sd); ++ long ret = 0; ++ ++ dev_info(&gc2093->client->dev, "gc2093_ioctl\n"); ++ ++ switch (cmd) { ++ //case: ++ default: ++ ret = -ENOIOCTLCMD; ++ break; ++ } ++ return ret; ++} ++ ++static int __gc2093_start_stream(struct gc2093 *gc2093) ++{ ++ int ret; ++ dev_info(&gc2093->client->dev, "%s enter\n",__func__); ++ ++ ret = gc2093_write_array(gc2093->client, gc2093->cur_mode->reg_list); ++ if (ret) ++ return ret; ++ ++ /* Apply customized control from user */ ++ mutex_unlock(&gc2093->lock); ++ v4l2_ctrl_handler_setup(&gc2093->ctrl_handler); ++ mutex_lock(&gc2093->lock); ++ ++ return gc2093_write_reg(gc2093->client, GC2093_REG_CTRL_MODE, ++ GC2093_MODE_STREAMING); ++} ++ ++static int __gc2093_stop_stream(struct gc2093 *gc2093) ++{ ++ gc2093->has_init_exp = false; ++ return gc2093_write_reg(gc2093->client, GC2093_REG_CTRL_MODE, ++ GC2093_MODE_SW_STANDBY); ++} ++ ++#ifdef CONFIG_COMPAT ++static long gc2093_compat_ioctl32(struct v4l2_subdev *sd, ++ unsigned int cmd, unsigned long arg) ++{ ++ void __user *up = compat_ptr(arg); ++ struct module_inf *inf; ++ struct module_awb_cfg *awb_cfg; ++ long ret = 0; ++ ++ switch (cmd) { ++ case CANAANMODULE_GET_MODULE_INFO: ++ inf = kzalloc(sizeof(*inf), GFP_KERNEL); ++ if (!inf) { ++ ret = -ENOMEM; ++ return ret; ++ } ++ ++ ret = gc2093_ioctl(sd, cmd, inf); ++ if (!ret) ++ ret = copy_to_user(up, inf, sizeof(*inf)); ++ kfree(inf); ++ break; ++ case CANAANMODULE_AWB_CFG: ++ awb_cfg = kzalloc(sizeof(*awb_cfg), GFP_KERNEL); ++ if (!awb_cfg) { ++ ret = -ENOMEM; ++ return ret; ++ } ++ ++ ret = gc2093_ioctl(sd, cmd, awb_cfg); ++ if (!ret) ++ ret = copy_to_user(up, awb_cfg, sizeof(*awb_cfg)); ++ kfree(awb_cfg); ++ break; ++ default: ++ ret = -ENOIOCTLCMD; ++ break; ++ } ++ return ret; ++} ++#endif ++ ++static int gc2093_s_stream(struct v4l2_subdev *sd, int on) ++{ ++ struct gc2093 *gc2093 = to_gc2093(sd); ++ int ret = 0; ++ ++ mutex_lock(&gc2093->lock); ++ on = !!on; ++ if (on == gc2093->streaming) ++ goto unlock_and_return; ++ ++ if (on) { ++ ret = __gc2093_start_stream(gc2093); ++ if (ret) { ++ dev_err(&gc2093->client->dev, "Failed to start gc2093 stream\n"); ++ goto unlock_and_return; ++ } ++ } else { ++ __gc2093_stop_stream(gc2093); ++ } ++ ++ gc2093->streaming = on; ++ ++unlock_and_return: ++ mutex_unlock(&gc2093->lock); ++ return 0; ++} ++ ++static int gc2093_g_frame_interval(struct v4l2_subdev *sd, ++ struct v4l2_subdev_frame_interval *fi) ++{ ++ struct gc2093 *gc2093 = to_gc2093(sd); ++ const struct gc2093_mode *mode = gc2093->cur_mode; ++ ++ mutex_lock(&gc2093->lock); ++ fi->interval = mode->max_fps; ++ mutex_unlock(&gc2093->lock); ++ ++ return 0; ++} ++ ++static int gc2093_g_mbus_config(struct v4l2_subdev *sd, ++ struct v4l2_mbus_config *config) ++{ ++ u32 val = 1 << (GC2093_LANES - 1) | V4L2_MBUS_CSI2_CHANNEL_0 | ++ V4L2_MBUS_CSI2_CONTINUOUS_CLOCK; ++ ++ config->type = V4L2_MBUS_CSI2; ++ config->flags = (val | V4L2_MBUS_CSI2_CHANNEL_1); ++ ++ return 0; ++} ++ ++static int gc2093_enum_mbus_code(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_mbus_code_enum *code) ++{ ++ if (code->index != 0) ++ return -EINVAL; ++ code->code = GC2093_MEDIA_BUS_FMT; ++ return 0; ++} ++ ++static int gc2093_enum_frame_sizes(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_frame_size_enum *fse) ++{ ++ struct gc2093 *gc2093 = to_gc2093(sd); ++ ++ if (fse->index >= gc2093->cfg_num) ++ return -EINVAL; ++ ++ if (fse->code != GC2093_MEDIA_BUS_FMT) ++ return -EINVAL; ++ ++ fse->min_width = supported_modes[fse->index].width; ++ fse->max_width = supported_modes[fse->index].width; ++ fse->max_height = supported_modes[fse->index].height; ++ fse->min_height = supported_modes[fse->index].height; ++ return 0; ++} ++ ++static int gc2093_enum_frame_interval(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_frame_interval_enum *fie) ++{ ++ struct gc2093 *gc2093 = to_gc2093(sd); ++ ++ if (fie->index >= gc2093->cfg_num) ++ return -EINVAL; ++ ++ fie->code = GC2093_MEDIA_BUS_FMT; ++ fie->width = supported_modes[fie->index].width; ++ fie->height = supported_modes[fie->index].height; ++ fie->interval = supported_modes[fie->index].max_fps; ++ return 0; ++} ++ ++static int gc2093_set_fmt(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_format *fmt) ++{ ++ struct gc2093 *gc2093 = to_gc2093(sd); ++ const struct gc2093_mode *mode; ++ s64 h_blank, vblank_def; ++ ++ mutex_lock(&gc2093->lock); ++ ++ mode = v4l2_find_nearest_size(supported_modes, ++ ARRAY_SIZE(supported_modes), ++ width, height, ++ fmt->format.width, fmt->format.height); ++ dev_info(&gc2093->client->dev, "set_fmt, width:%u, height:%u.\n", mode->width, mode->height); ++ ++ fmt->format.code = GC2093_MEDIA_BUS_FMT; ++ fmt->format.width = mode->width; ++ fmt->format.height = mode->height; ++ fmt->format.field = V4L2_FIELD_NONE; ++ ++ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++ *v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format; ++#else ++ mutex_unlock(&gc2093->lock); ++ return -ENOTTY; ++#endif ++ } else { ++ gc2093->cur_mode = mode; ++ __v4l2_ctrl_s_ctrl(gc2093->link_freq, mode->link_freq_index); ++ __v4l2_ctrl_s_ctrl_int64(gc2093->pixel_rate, ++ to_pixel_rate(mode->link_freq_index)); ++ h_blank = mode->hts_def - mode->width; ++ __v4l2_ctrl_modify_range(gc2093->hblank, h_blank, ++ h_blank, 1, h_blank); ++ vblank_def = mode->vts_def - mode->height; ++ __v4l2_ctrl_modify_range(gc2093->vblank, vblank_def, ++ GC2093_VTS_MAX - mode->height, ++ 1, vblank_def); ++ } ++ ++ mutex_unlock(&gc2093->lock); ++ return 0; ++} ++ ++static int gc2093_get_fmt(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_format *fmt) ++{ ++ struct gc2093 *gc2093 = to_gc2093(sd); ++ const struct gc2093_mode *mode = gc2093->cur_mode; ++ ++ mutex_lock(&gc2093->lock); ++ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++ fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad); ++#else ++ mutex_unlock(&gc2093->lock); ++ return -ENOTTY; ++#endif ++ } else { ++ fmt->format.width = mode->width; ++ fmt->format.height = mode->height; ++ fmt->format.code = GC2093_MEDIA_BUS_FMT; ++ fmt->format.field = V4L2_FIELD_NONE; ++ } ++ mutex_unlock(&gc2093->lock); ++ return 0; ++} ++ ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++static int gc2093_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) ++{ ++ struct gc2093 *gc2093 = to_gc2093(sd); ++ struct v4l2_mbus_framefmt *try_fmt = ++ v4l2_subdev_get_try_format(sd, fh->pad, 0); ++ const struct gc2093_mode *def_mode = &supported_modes[0]; ++ ++ mutex_lock(&gc2093->lock); ++ /* Initialize try_fmt */ ++ try_fmt->width = def_mode->width; ++ try_fmt->height = def_mode->height; ++ try_fmt->code = GC2093_MEDIA_BUS_FMT; ++ try_fmt->field = V4L2_FIELD_NONE; ++ mutex_unlock(&gc2093->lock); ++ ++ return 0; ++} ++#endif ++ ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++static const struct v4l2_subdev_internal_ops gc2093_internal_ops = { ++ .open = gc2093_open, ++}; ++#endif ++ ++static int gc2093_s_power(struct v4l2_subdev *sd, int on) ++{ ++ struct gc2093 *gc2093 = to_gc2093(sd); ++ int ret = 0; ++ ++ mutex_lock(&gc2093->lock); ++ ++ if (gc2093->power_on == !!on) ++ goto unlock_and_return; ++ ++ if (on) { ++ gc2093->power_on = true; ++ } else { ++ gc2093->power_on = false; ++ } ++ ++unlock_and_return: ++ mutex_unlock(&gc2093->lock); ++ ++ return ret; ++} ++ ++static const struct v4l2_subdev_core_ops gc2093_core_ops = { ++ .s_power = gc2093_s_power, ++ .ioctl = gc2093_ioctl, ++#ifdef CONFIG_COMPAT ++ .compat_ioctl32 = gc2093_compat_ioctl32, ++#endif ++}; ++ ++static const struct v4l2_subdev_video_ops gc2093_video_ops = { ++ .s_stream = gc2093_s_stream, ++ .g_frame_interval = gc2093_g_frame_interval, ++ .g_mbus_config = gc2093_g_mbus_config, ++}; ++ ++static const struct v4l2_subdev_pad_ops gc2093_pad_ops = { ++ .enum_mbus_code = gc2093_enum_mbus_code, ++ .enum_frame_size = gc2093_enum_frame_sizes, ++ .enum_frame_interval = gc2093_enum_frame_interval, ++ .get_fmt = gc2093_get_fmt, ++ .set_fmt = gc2093_set_fmt, ++}; ++ ++static const struct v4l2_subdev_ops gc2093_subdev_ops = { ++ .core = &gc2093_core_ops, ++ .video = &gc2093_video_ops, ++ .pad = &gc2093_pad_ops, ++}; ++ ++static int gc2093_probe(struct i2c_client *client, ++ const struct i2c_device_id *id) ++{ ++ struct device *dev = &client->dev; ++ struct device_node *node = dev->of_node; ++ struct gc2093 *gc2093; ++ struct v4l2_subdev *sd; ++ char facing[2]; ++ int ret; ++ ++ dev_info(dev, "driver version: %02x.%02x.%02x", ++ DRIVER_VERSION >> 16, ++ (DRIVER_VERSION & 0xff00) >> 8, ++ DRIVER_VERSION & 0x00ff); ++ ++ gc2093 = devm_kzalloc(dev, sizeof(*gc2093), GFP_KERNEL); ++ if (!gc2093) ++ return -ENOMEM; ++ ++ gc2093->client = client; ++ ret = of_property_read_u32(node, CANAANMODULE_CAMERA_MODULE_INDEX, ++ &gc2093->module_index); ++ ret |= of_property_read_string(node, CANAANMODULE_CAMERA_MODULE_FACING, ++ &gc2093->module_facing); ++ ret |= of_property_read_string(node, CANAANMODULE_CAMERA_MODULE_NAME, ++ &gc2093->module_name); ++ ret |= of_property_read_string(node, CANAANMODULE_CAMERA_LENS_NAME, ++ &gc2093->len_name); ++ ++ if (ret) { ++ dev_err(dev, "Failed to get module information\n"); ++ return -EINVAL; ++ } ++ ++ gc2093->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); ++ if (IS_ERR(gc2093->reset_gpio)) ++ dev_warn(dev, "Failed to get reset-gpios\n"); ++ ++ gc2093->pwdn_gpio = devm_gpiod_get(dev, "pwdn", GPIOD_OUT_HIGH); ++ if (IS_ERR(gc2093->pwdn_gpio)) ++ dev_warn(dev, "Failed to get pwdn-gpios\n"); ++ ++ ++ if (gpiod_export(gc2093->reset_gpio, 0)) { ++ dev_err(dev, "gpiod export gc2093 reset failed."); ++ } ++ ++ if (gpiod_export(gc2093->pwdn_gpio, 0)) { ++ dev_err(dev, "gpiod export gc2093 powerdown failed."); ++ } ++ ++ mutex_init(&gc2093->lock); ++ ++ /* set default mode */ ++ gc2093->cur_mode = &supported_modes[0]; ++ gc2093->cfg_num = ARRAY_SIZE(supported_modes); ++ ++ sd = &gc2093->subdev; ++ v4l2_i2c_subdev_init(sd, client, &gc2093_subdev_ops); ++ ret = gc2093_initialize_controls(gc2093); ++ if (ret) ++ goto err_destroy_mutex; ++ ++ ret = __gc2093_power_on(gc2093); ++ if (ret) ++ goto err_free_handler; ++ ++ ret = gc2093_check_sensor_id(gc2093); ++ if (ret) ++ goto err_power_off; ++ ++ sd->internal_ops = &gc2093_internal_ops; ++ sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | ++ V4L2_SUBDEV_FL_HAS_EVENTS; ++ ++ gc2093->pad.flags = MEDIA_PAD_FL_SOURCE; ++ sd->entity.function = MEDIA_ENT_F_CAM_SENSOR; ++ ret = media_entity_pads_init(&sd->entity, 1, &gc2093->pad); ++ if (ret < 0) ++ goto err_power_off; ++ ++ memset(facing, 0, sizeof(facing)); ++ if (strcmp(gc2093->module_facing, "back") == 0) ++ facing[0] = 'b'; ++ else ++ facing[0] = 'f'; ++ ++ snprintf(sd->name, sizeof(sd->name), "m%02d_%s_%s %s", ++ gc2093->module_index, facing, ++ GC2093_NAME, dev_name(sd->dev)); ++ ++ ret = v4l2_async_register_subdev_sensor_common(sd); ++ if (ret) { ++ dev_err(dev, "Failed to register v4l2 async subdev\n"); ++ goto err_clean_entity; ++ } ++ ++ return 0; ++ ++err_clean_entity: ++#ifdef CONFIG_MEDIA_CONTROLLER ++ media_entity_cleanup(&sd->entity); ++#endif ++err_power_off: ++ __gc2093_power_off(gc2093); ++err_free_handler: ++ v4l2_ctrl_handler_free(&gc2093->ctrl_handler); ++err_destroy_mutex: ++ mutex_destroy(&gc2093->lock); ++ ++ return ret; ++} ++ ++static int gc2093_remove(struct i2c_client *client) ++{ ++ struct v4l2_subdev *sd = i2c_get_clientdata(client); ++ struct gc2093 *gc2093 = to_gc2093(sd); ++ ++ v4l2_async_unregister_subdev(sd); ++#ifdef CONFIG_MEDIA_CONTROLLER ++ media_entity_cleanup(&sd->entity); ++#endif ++ v4l2_ctrl_handler_free(&gc2093->ctrl_handler); ++ mutex_destroy(&gc2093->lock); ++ ++ __gc2093_power_off(gc2093); ++ return 0; ++} ++ ++static const struct i2c_device_id gc2093_match_id[] = { ++ { "gc2093", 0 }, ++ { }, ++}; ++ ++static const struct of_device_id gc2093_of_match[] = { ++ { .compatible = "galaxycore,gc2093" }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, gc2093_of_match); ++ ++static struct i2c_driver gc2093_i2c_driver = { ++ .driver = { ++ .name = GC2093_NAME, ++ .of_match_table = of_match_ptr(gc2093_of_match), ++ }, ++ .probe = &gc2093_probe, ++ .remove = &gc2093_remove, ++ .id_table = gc2093_match_id, ++}; ++ ++module_i2c_driver(gc2093_i2c_driver); ++MODULE_DESCRIPTION("Galaxycore GC2093 Image Sensor driver"); ++MODULE_LICENSE("GPL v2"); ++ +diff --git a/drivers/media/i2c/soc_camera/canaanchip/gc2145.c b/drivers/media/i2c/soc_camera/canaanchip/gc2145.c +new file mode 100755 +index 00000000..a1b23d35 +--- /dev/null ++++ b/drivers/media/i2c/soc_camera/canaanchip/gc2145.c +@@ -0,0 +1,1264 @@ ++/* ++ * Driver for GC2145 CMOS Image Sensor ++ * ++ * Copyright (C) 2022, Canaan Bright Sight Co., Ltd ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x01) ++#define GC2145_NAME "gc2145" ++#define GC2145_MEDIA_BUS_FMT MEDIA_BUS_FMT_SRGGB10_1X10 ++ ++#define MIPI_FREQ_120M 120000000 ++#define MIPI_FREQ_240M 240000000 ++ ++#define GC2145_XVCLK_FREQ 24000000 ++ ++#define GC2145_REG_CHIP_ID_H 0xF0 ++#define GC2145_REG_CHIP_ID_L 0xF1 ++ ++#define GC2145_REG_EXP_SHORT_H 0x01 ++#define GC2145_REG_EXP_SHORT_L 0x02 ++#define GC2145_REG_EXP_LONG_H 0x03 ++#define GC2145_REG_EXP_LONG_L 0x04 ++ ++#define GC2145_MIRROR_FLIP_REG 0x17 ++#define MIRROR_MASK BIT(0) ++#define FLIP_MASK BIT(1) ++ ++#define GC2145_CHIP_ID 0x2145 ++ ++#define GC2145_VTS_MAX 0x3FFF ++#define GC2145_HTS_MAX 0xFFF ++ ++#define GC2145_EXPOSURE_MAX 0x3FFF ++#define GC2145_EXPOSURE_MIN 1 ++#define GC2145_EXPOSURE_STEP 1 ++ ++#define GC2145_GAIN_MIN 0x40 ++#define GC2145_GAIN_MAX 0x2000 ++#define GC2145_GAIN_STEP 1 ++#define GC2145_GAIN_DEFAULT 64 ++ ++#define GC2145_LANES 2 ++ ++#define REG_NULL 0xFF ++ ++#define to_gc2145(sd) container_of(sd, struct gc2145, subdev) ++ ++enum { ++ LINK_FREQ_120M_INDEX, ++ LINK_FREQ_240M_INDEX, ++}; ++ ++struct gc2145_reg { ++ u8 addr; ++ u8 val; ++}; ++ ++struct gain_reg_config { ++ u32 value; ++ u16 analog_gain; ++ u16 col_gain; ++ u16 analog_sw; ++ u16 ram_width; ++}; ++ ++struct gc2145_mode { ++ u32 width; ++ u32 height; ++ struct v4l2_fract max_fps; ++ u32 hts_def; ++ u32 vts_def; ++ u32 exp_def; ++ u32 link_freq_index; ++ const struct gc2145_reg *reg_list; ++}; ++ ++struct gc2145 { ++ struct i2c_client *client; ++ struct gpio_desc *reset_gpio; ++ struct gpio_desc *pwdn_gpio; ++ ++ struct v4l2_subdev subdev; ++ struct media_pad pad; ++ struct v4l2_ctrl_handler ctrl_handler; ++ struct v4l2_ctrl *exposure; ++ struct v4l2_ctrl *anal_gain; ++ struct v4l2_ctrl *hblank; ++ struct v4l2_ctrl *vblank; ++ struct v4l2_ctrl *h_flip; ++ struct v4l2_ctrl *v_flip; ++ struct v4l2_ctrl *link_freq; ++ struct v4l2_ctrl *pixel_rate; ++ ++ struct mutex lock; ++ bool streaming; ++ bool power_on; ++ unsigned int cfg_num; ++ const struct gc2145_mode *cur_mode; ++ ++ u32 module_index; ++ const char *module_facing; ++ const char *module_name; ++ const char *len_name; ++ ++ bool has_init_exp; ++}; ++ ++static const s64 link_freq_menu_items[] = { ++ MIPI_FREQ_120M, ++ MIPI_FREQ_240M, ++}; ++ ++static const struct gc2145_reg gc2145_start[] = { ++ {0xfe, 0x03}, ++ {0x10, 0x91},/* mode select streaming on */ ++ {0xfe, 0x00}, ++ {REG_NULL, 0x00}, ++}; ++ ++static const struct gc2145_reg gc2145_stop[] = { ++ {0xfe, 0x03}, ++ {0x10, 0x81},/* mode select streaming off */ ++ {0xfe, 0x00}, ++ {REG_NULL, 0x00}, ++}; ++ ++/* ++ * window size=1600*1200 mipi@2lane ++ * mclk=24M mipi_clk=480Mbps ++ * pixel_line_total=1920 line_frame_total=1250 ++ * row_time=40us frame_rate=20fps ++ */ ++static const struct gc2145_reg gc2145_1600x1200_mipi_raw10_settings[] = { ++ {0xfe,0xf0}, ++ {0xfe,0xf0}, ++ {0xfe,0xf0}, ++ {0xfc,0x06}, ++ {0xf6,0x00}, ++ {0xf7,0x1d}, ++ {0xf8,0x84}, ++ {0xfa,0x00}, ++ {0xf9,0x8e}, ++ {0xf2,0x00}, ++ ++ /*** Analog & Cisctl ***/ ++ {0xfe,0x00}, ++ {0x03,0x04},//Exposure[12:8] ++ {0x04,0xe2},//Exposure[7:0] ++ {0x05,0x01},//hb[11:8] ++ {0x06,0x56},//hb[7:0] ++ {0x07,0x00},//vb[12:8] ++ {0x08,0x14},//vb[7:0] ++ ++ {0x09,0x00},//row_start[10:8] ++ {0x0a,0x00},//row_start[7:0] ++ {0x0b,0x00},//col_start[10:8] ++ {0x0c,0x00},//col_start[7:1] ++ {0x0d,0x04},//win_height[10:8] 04c0=1216 ++ {0x0e,0xc0},//win_height[7:0] ++ {0x0f,0x06},//win_width[10:8] 0652=1618 ++ {0x10,0x52},//win_width[7:0] ++ {0x12,0x2e}, ++ {0x17,0x13}, ++ {0x18,0x22}, ++ {0x19,0x0e}, ++ {0x1a,0x01}, ++ {0x1b,0x4b}, ++ {0x1c,0x07}, ++ {0x1d,0x10}, ++ {0x1e,0x88}, ++ {0x1f,0x78}, ++ {0x20,0x03}, ++ {0x21,0x40}, ++ {0x22,0xa0}, ++ {0x24,0x16}, ++ {0x25,0x01}, ++ {0x26,0x10}, ++ {0x2d,0x60}, ++ {0x30,0x01}, ++ {0x31,0x90}, ++ {0x33,0x06}, ++ {0x34,0x01}, ++ ++ /*** ISP reg ***/ ++ {0x80,0x06}, ++ {0x81,0x00}, ++ {0x82,0x30}, ++ {0x83,0x00}, ++ {0x84,0x19}, ++ {0x86,0x02}, ++ {0x88,0x03}, ++ {0x89,0x03}, ++ {0x85,0x30}, ++ {0x8a,0x00}, ++ {0x8b,0x00}, ++ {0xb0,0x55}, ++ {0xc3,0x00}, ++ {0xc4,0x80}, ++ {0xc5,0x90}, ++ {0xc6,0x38}, ++ {0xc7,0x40}, ++ {0xec,0x06}, ++ {0xed,0x04}, ++ {0xee,0x60}, ++ {0xef,0x90}, ++ {0xb6,0x00}, //close aec ++ {0x90,0x01}, ++ {0x91,0x00},//out_win_y1[10:8] ++ {0x92,0x01},//out_win_y1[7:0] ++ {0x93,0x00},//out_win_x1[10:8] ++ {0x94,0x01},//out_win_x1[7:0] ++ {0x95,0x04},//out_win_height[10:8] 1200=04b0 ++ {0x96,0xb0},//out_win_height[7:0] ++ {0x97,0x06},//out_win_width[10:8] 1600=0640 ++ {0x98,0x40},//out_win_width[7:0] ++ ++ /*** BLK ***/ ++ {0x40,0x42}, ++ {0x41,0x00}, ++ {0x43,0x54}, ++ {0x5e,0x00}, ++ {0x5f,0x00}, ++ {0x60,0x00}, ++ {0x61,0x00}, ++ {0x62,0x00}, ++ {0x63,0x00}, ++ {0x64,0x00}, ++ {0x65,0x00}, ++ {0x66,0x20}, ++ {0x67,0x20}, ++ {0x68,0x20}, ++ {0x69,0x20}, ++ {0x76,0x00}, ++ {0x6a,0x08}, ++ {0x6b,0x08}, ++ {0x6c,0x08}, ++ {0x6d,0x08}, ++ {0x6e,0x08}, ++ {0x6f,0x08}, ++ {0x70,0x08}, ++ {0x71,0x08}, ++ {0x76,0x00}, ++ {0x72,0xf0}, ++ {0x7e,0x3c}, ++ {0x7f,0x00}, ++ {0xfe,0x02}, ++ {0x48,0x15}, ++ {0x49,0x00}, ++ {0x4b,0x0b}, ++ {0xfe,0x00}, ++ ++ /*** dark sun ***/ ++ {0xfe,0x00}, ++ {0x18,0x22}, ++ {0xfe,0x02}, ++ {0x40,0xbf}, ++ {0x46,0xcf}, ++ {0xfe,0x00}, ++ ++ /***MIPI*****/ ++ {0xfe,0x03}, ++ {0x01,0x87},//[7]:clk lane_p2s_sel ++ {0x02,0x22}, ++ {0x03,0x10},//[4]: ++ {0x04,0x90}, ++ {0x05,0x01}, ++ {0x06,0x88}, ++ {0x11,0x2b}, ++ {0x12,0xd0}, ++ {0x13,0x07}, ++ {0x15,0x10}, ++ {0x17,0xf1}, ++ {0xfe,0x00}, ++ {REG_NULL, 0x00}, ++}; ++ ++static const struct gc2145_reg gc2145_1280x960_mipi_raw10_settings[] = { ++ {0xfe, 0xf0}, ++ {0xfe, 0xf0}, ++ {0xfe, 0xf0}, ++ {0xfc, 0x06}, ++ {0xf6, 0x00}, ++ {0xf7, 0x1d}, ++ {0xf8, 0x84}, ++ {0xfa, 0x00}, ++ {0xf9, 0x8e}, ++ {0xf2, 0x00}, ++ ++ /*** Analog & Cisctl ***/ ++ {0xfe, 0x00}, ++ {0x03, 0x04}, ++ {0x04, 0xe2}, ++ {0x05, 0x01}, ++ {0x06, 0x56}, ++ {0x07, 0x00}, ++ {0x08, 0x14}, ++ {0x09, 0x00},//row_start[10:8] ++ {0x0a, 0x00},//row_start[7:0] ++ {0x0b, 0x00},//col_start[10:8] ++ {0x0c, 0x00},//col_start[7:1] ++ {0x0d, 0x04},//win_height[10:8] 04c0=1216 ++ {0x0e, 0xc0},//win_height[7:0] ++ {0x0f, 0x06},//win_width[10:8] 0652=1618 ++ {0x10, 0x52},//win_width[7:0] ++ ++ {0x12, 0x2e}, ++ {0x17, 0x13}, //mirror ++ {0x18, 0x22}, ++ {0x19, 0x0e}, ++ {0x1a, 0x01}, ++ {0x1b, 0x4b}, ++ {0x1c, 0x07}, ++ {0x1d, 0x10}, ++ {0x1e, 0x88}, ++ {0x1f, 0x78}, ++ {0x20, 0x03}, ++ {0x21, 0x40}, ++ {0x22, 0xa0}, ++ {0x24, 0x16}, ++ {0x25, 0x01}, ++ {0x26, 0x10}, ++ {0x2d, 0x60}, ++ {0x30, 0x01}, ++ {0x31, 0x90}, ++ {0x33, 0x06}, ++ {0x34, 0x01}, ++ ++ /*** ISP reg ***/ ++ {0xfe, 0x00}, ++ {0x80, 0x06}, ++ {0x81, 0x00}, ++ {0x82, 0x30}, ++ {0x83, 0x00}, ++ {0x84, 0x19}, ++ {0x86, 0x02}, ++ {0x88, 0x03}, ++ {0x89, 0x03}, ++ {0x85, 0x30}, ++ {0x8a, 0x00}, ++ {0x8b, 0x00}, ++ {0xb0, 0x55}, ++ {0xc3, 0x00}, ++ {0xc4, 0x80}, ++ {0xc5, 0x90}, ++ {0xc6, 0x38}, ++ {0xc7, 0x40}, ++ {0xec, 0x06}, ++ {0xed, 0x04}, ++ {0xee, 0x60}, ++ {0xef, 0x90}, ++ {0xb6, 0x00}, //close aec ++ {0x90, 0x01},//Crop enable ++ {0x91, 0x00},//out_win_y1[10:8] ++ {0x92, 0x01},//out_win_y1[7:0] ++ {0x93, 0x00},//out_win_x1[10:8] ++ {0x94, 0x01},//out_win_x1[7:0] ++ {0x95, 0x03},//out_win_height[10:8] ++ {0x96, 0xc0},//out_win_height[7:0] //960 ++ {0x97, 0x05},//out_win_width[10:8] ++ {0x98, 0x00},//out_win_width[7:0] //1280 ++ ++ /*** BLK ***/ ++ {0x40, 0x42}, ++ {0x41, 0x00}, ++ {0x43, 0x54}, ++ {0x5e, 0x00}, ++ {0x5f, 0x00}, ++ {0x60, 0x00}, ++ {0x61, 0x00}, ++ {0x62, 0x00}, ++ {0x63, 0x00}, ++ {0x64, 0x00}, ++ {0x65, 0x00}, ++ {0x66, 0x20}, ++ {0x67, 0x20}, ++ {0x68, 0x20}, ++ {0x69, 0x20}, ++ {0x76, 0x00}, ++ {0x6a, 0x08}, ++ {0x6b, 0x08}, ++ {0x6c, 0x08}, ++ {0x6d, 0x08}, ++ {0x6e, 0x08}, ++ {0x6f, 0x08}, ++ {0x70, 0x08}, ++ {0x71, 0x08}, ++ {0x76, 0x00}, ++ {0x72, 0xf0}, ++ {0x7e, 0x3c}, ++ {0x7f, 0x00}, ++ {0xfe, 0x02}, ++ {0x48, 0x15}, ++ {0x49, 0x00}, ++ {0x4b, 0x0b}, ++ {0xfe, 0x00}, ++ ++ /*** dark sun ***/ ++ {0xfe, 0x00}, ++ {0x18, 0x22}, ++ {0xfe, 0x02}, ++ {0x40, 0xbf}, ++ {0x46, 0xcf}, ++ {0xfe, 0x00}, ++ ++ /***MIPI*****/ ++ {0xfe, 0x03}, ++ {0x01, 0x87}, ++ {0x02, 0x22}, ++ {0x03, 0x10}, ++ {0x04, 0x90}, ++ {0x05, 0x01}, ++ {0x06, 0x88}, ++ {0x11, 0x2b}, ++ {0x12, 0x40}, ++ {0x13, 0x06}, ++ {0x15, 0x10}, ++ {0x17, 0xf1}, ++ {0xfe, 0x00}, ++ {REG_NULL, 0x00}, ++}; ++ ++static const struct gc2145_mode supported_modes[] = { ++ { ++ .width = 1280, ++ .height = 960, ++ .max_fps = { ++ .numerator = 10000, ++ .denominator = 200000, ++ }, ++ .exp_def = 0x460, ++ .hts_def = 0x780, ++ .vts_def = 0x4e2, ++ .link_freq_index = LINK_FREQ_240M_INDEX, ++ .reg_list = gc2145_1280x960_mipi_raw10_settings, ++ }, ++ { ++ .width = 1600, ++ .height = 1200, ++ .max_fps = { ++ .numerator = 10000, ++ .denominator = 200000, ++ }, ++ .exp_def = 0x460, ++ .hts_def = 0x780, ++ .vts_def = 0x4e2, ++ .link_freq_index = LINK_FREQ_240M_INDEX, ++ .reg_list = gc2145_1600x1200_mipi_raw10_settings, ++ }, ++}; ++ ++/* pixel rate = link frequency * 2 * lanes / BITS_PER_SAMPLE */ ++static u64 to_pixel_rate(u32 index) ++{ ++ u64 pixel_rate = link_freq_menu_items[index] * 2 * GC2145_LANES; ++ ++ do_div(pixel_rate, 10); ++ ++ return pixel_rate; ++} ++ ++/* sensor register write */ ++static int gc2145_write_reg(struct i2c_client *client, u8 reg, u8 val) ++{ ++ struct i2c_msg msg; ++ u8 buf[2]; ++ int ret; ++ ++ buf[0] = reg & 0xFF; ++ buf[1] = val; ++ ++ msg.addr = client->addr; ++ msg.flags = client->flags; ++ msg.buf = buf; ++ msg.len = sizeof(buf); ++ ++ ret = i2c_transfer(client->adapter, &msg, 1); ++ if (ret >= 0) ++ return 0; ++ ++ dev_err(&client->dev, ++ "gc2053 write reg(0x%x val:0x%x) failed !\n", reg, val); ++ ++ return ret; ++} ++ ++static int gc2145_write_array(struct i2c_client *client, ++ const struct gc2145_reg *regs) ++{ ++ int i, ret = 0; ++ ++ i = 0; ++ while (regs[i].addr != REG_NULL) { ++ ret = gc2145_write_reg(client, regs[i].addr, regs[i].val); ++ if (ret) { ++ dev_err(&client->dev, "%s failed !\n", __func__); ++ break; ++ } ++ i++; ++ } ++ ++ return ret; ++} ++ ++/* sensor register read */ ++static int gc2145_read_reg(struct i2c_client *client, u8 reg, u8 *val) ++{ ++ struct i2c_msg msg[2]; ++ u8 buf[1]; ++ int ret; ++ ++ buf[0] = reg & 0xFF; ++ ++ msg[0].addr = client->addr; ++ msg[0].flags = client->flags; ++ msg[0].buf = buf; ++ msg[0].len = sizeof(buf); ++ ++ msg[1].addr = client->addr; ++ msg[1].flags = client->flags | I2C_M_RD; ++ msg[1].buf = buf; ++ msg[1].len = 1; ++ ++ ret = i2c_transfer(client->adapter, msg, 2); ++ if (ret >= 0) { ++ *val = buf[0]; ++ return 0; ++ } ++ ++ dev_err(&client->dev, ++ "gc2145 read reg(0x%x val:0x%x) failed !\n", reg, *val); ++ ++ return ret; ++} ++ ++static const struct gain_reg_config gain_reg_configs[] = { ++ { 64, 0x0000, 0x0100, 0x6807, 0x00f8}, ++ { 75, 0x0010, 0x010c, 0x6807, 0x00f8}, ++ { 90, 0x0020, 0x011b, 0x6c08, 0x00f9}, ++ { 105, 0x0030, 0x012c, 0x6c0a, 0x00fa}, ++ { 122, 0x0040, 0x013f, 0x7c0b, 0x00fb}, ++ { 142, 0x0050, 0x0216, 0x7c0d, 0x00fe}, ++ { 167, 0x0060, 0x0235, 0x7c0e, 0x00ff}, ++ { 193, 0x0070, 0x0316, 0x7c10, 0x0801}, ++ { 223, 0x0080, 0x0402, 0x7c12, 0x0802}, ++ { 257, 0x0090, 0x0431, 0x7c13, 0x0803}, ++ { 299, 0x00a0, 0x0532, 0x7c15, 0x0805}, ++ { 346, 0x00b0, 0x0635, 0x7c17, 0x0807}, ++ { 397, 0x00c0, 0x0804, 0x7c18, 0x0808}, ++ { 444, 0x005a, 0x0919, 0x7c17, 0x0807}, ++ { 523, 0x0083, 0x0b0f, 0x7c17, 0x0807}, ++ { 607, 0x0093, 0x0d12, 0x7c19, 0x0809}, ++ { 700, 0x0084, 0x1000, 0x7c1b, 0x080c}, ++ { 817, 0x0094, 0x123a, 0x7c1e, 0x080f}, ++ {1131, 0x005d, 0x1a02, 0x7c23, 0x0814}, ++ {1142, 0x009b, 0x1b20, 0x7c25, 0x0816}, ++ {1334, 0x008c, 0x200f, 0x7c27, 0x0818}, ++ {1568, 0x009c, 0x2607, 0x7c2a, 0x081b}, ++ {2195, 0x00b6, 0x3621, 0x7c32, 0x0823}, ++ {2637, 0x00ad, 0x373a, 0x7c36, 0x0827}, ++ {3121, 0x00bd, 0x3d02, 0x7c3a, 0x082b}, ++}; ++ ++static int gc2145_set_gain(struct gc2145 *gc2145, u32 gain) ++{ ++ return 0; ++} ++ ++static int gc2145_set_ctrl(struct v4l2_ctrl *ctrl) ++{ ++ struct gc2145 *gc2145 = container_of(ctrl->handler, ++ struct gc2145, ctrl_handler); ++ s64 max; ++ int ret = 0; ++ dev_dbg(&gc2145->client->dev, "%s enter, id:0x%X val:%d.\n", __func__, ctrl->id, ctrl->val); ++ ++ /* Propagate change of current control to all related controls */ ++ switch (ctrl->id) { ++ case V4L2_CID_VBLANK: ++ /* Update max exposure while meeting expected vblanking */ ++ max = gc2145->cur_mode->height + ctrl->val - 1; ++ __v4l2_ctrl_modify_range(gc2145->exposure, ++ gc2145->exposure->minimum, max, ++ gc2145->exposure->step, ++ gc2145->exposure->default_value); ++ break; ++ } ++ ++ switch (ctrl->id) { ++ case V4L2_CID_EXPOSURE: ++ break; ++ case V4L2_CID_ANALOGUE_GAIN: ++ case V4L2_CID_GAIN: ++ gc2145_set_gain(gc2145, ctrl->val); ++ break; ++ case V4L2_CID_VBLANK: ++ /* The exposure goes up and reduces the frame rate, no need to write vb */ ++ break; ++ case V4L2_CID_HFLIP: ++ break; ++ case V4L2_CID_VFLIP: ++ break; ++ default: ++ dev_warn(&gc2145->client->dev, "%s Unhandled id:0x%x, val:0x%x\n", ++ __func__, ctrl->id, ctrl->val); ++ break; ++ } ++ ++ return ret; ++} ++ ++static const struct v4l2_ctrl_ops gc2145_ctrl_ops = { ++ .s_ctrl = gc2145_set_ctrl, ++}; ++ ++static int gc2145_initialize_controls(struct gc2145 *gc2145) ++{ ++ const struct gc2145_mode *mode; ++ struct v4l2_ctrl_handler *handler; ++ s64 exposure_max, vblank_def; ++ u32 h_blank; ++ int ret; ++ ++ handler = &gc2145->ctrl_handler; ++ mode = gc2145->cur_mode; ++ ret = v4l2_ctrl_handler_init(handler, 10); ++ if (ret) ++ return ret; ++ handler->lock = &gc2145->lock; ++ ++ gc2145->link_freq = v4l2_ctrl_new_int_menu(handler, NULL, V4L2_CID_LINK_FREQ, ++ ARRAY_SIZE(link_freq_menu_items) - 1, 0, ++ link_freq_menu_items); ++ ++ gc2145->pixel_rate = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, ++ 0, to_pixel_rate(LINK_FREQ_240M_INDEX), ++ 1, to_pixel_rate(LINK_FREQ_120M_INDEX)); ++ ++ h_blank = mode->hts_def - mode->width; ++ gc2145->hblank = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_HBLANK, ++ h_blank, h_blank, 1, h_blank); ++ if (gc2145->hblank) ++ gc2145->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; ++ ++ vblank_def = mode->vts_def - mode->height; ++ gc2145->vblank = v4l2_ctrl_new_std(handler, &gc2145_ctrl_ops, ++ V4L2_CID_VBLANK, vblank_def, ++ GC2145_VTS_MAX - mode->height, ++ 1, vblank_def); ++ ++ exposure_max = mode->vts_def - 1; ++ gc2145->exposure = v4l2_ctrl_new_std(handler, &gc2145_ctrl_ops, ++ V4L2_CID_EXPOSURE, GC2145_EXPOSURE_MIN, ++ exposure_max, GC2145_EXPOSURE_STEP, ++ mode->exp_def); ++ ++ gc2145->anal_gain = v4l2_ctrl_new_std(handler, &gc2145_ctrl_ops, ++ V4L2_CID_ANALOGUE_GAIN, GC2145_GAIN_MIN, ++ GC2145_GAIN_MAX, GC2145_GAIN_STEP, ++ GC2145_GAIN_DEFAULT); ++ ++ ++ v4l2_ctrl_new_std(handler, &gc2145_ctrl_ops, ++ V4L2_CID_GAIN, GC2145_GAIN_MIN, ++ GC2145_GAIN_MAX, GC2145_GAIN_STEP, ++ GC2145_GAIN_DEFAULT); ++ ++ gc2145->h_flip = v4l2_ctrl_new_std(handler, &gc2145_ctrl_ops, ++ V4L2_CID_HFLIP, 0, 1, 1, 0); ++ ++ gc2145->v_flip = v4l2_ctrl_new_std(handler, &gc2145_ctrl_ops, ++ V4L2_CID_VFLIP, 0, 1, 1, 0); ++ ++ if (handler->error) { ++ ret = handler->error; ++ dev_err(&gc2145->client->dev, "Failed to init controls(%d)\n", ret); ++ goto err_free_handler; ++ } ++ ++ gc2145->subdev.ctrl_handler = handler; ++ gc2145->has_init_exp = false; ++ ++ return 0; ++ ++err_free_handler: ++ v4l2_ctrl_handler_free(handler); ++ return ret; ++} ++ ++/* Calculate the delay in us by clock rate and clock cycles */ ++static inline u32 gc2145_cal_delay(u32 cycles) ++{ ++ return DIV_ROUND_UP(cycles, GC2145_XVCLK_FREQ / 1000 / 1000); ++} ++ ++static int __gc2145_power_on(struct gc2145 *gc2145) ++{ ++ u32 delay_us; ++ ++ if (!IS_ERR(gc2145->pwdn_gpio)) { ++ gpiod_set_value_cansleep(gc2145->pwdn_gpio, 0);//exit powerdown mode ++ usleep_range(500, 800); ++ } ++ ++ if (!IS_ERR(gc2145->reset_gpio)) { ++ gpiod_set_value_cansleep(gc2145->reset_gpio, 0);//exit reset mode ++ usleep_range(3000, 6000); ++ } ++ if (!IS_ERR(gc2145->reset_gpio)) { ++ gpiod_set_value_cansleep(gc2145->reset_gpio, 1);//enter reset mode ++ usleep_range(3000, 6000); ++ } ++ ++ if (!IS_ERR(gc2145->reset_gpio)) ++ gpiod_set_value_cansleep(gc2145->reset_gpio, 0);//exit reset mode ++ ++ /* 8192 cycles prior to first SCCB transaction */ ++ delay_us = gc2145_cal_delay(8192); ++ usleep_range(delay_us, delay_us * 2); ++ return 0; ++} ++ ++ ++static void __gc2145_power_off(struct gc2145 *gc2145) ++{ ++ if (!IS_ERR(gc2145->reset_gpio)) ++ gpiod_set_value_cansleep(gc2145->reset_gpio, 1); ++ if (!IS_ERR(gc2145->pwdn_gpio)) ++ gpiod_set_value_cansleep(gc2145->pwdn_gpio, 0); ++} ++ ++static int gc2145_check_sensor_id(struct gc2145 *gc2145) ++{ ++ struct device *dev = &gc2145->client->dev; ++ u8 id_h = 0, id_l = 0; ++ u16 id = 0; ++ int ret = 0; ++ ++ ret = gc2145_read_reg(gc2145->client, GC2145_REG_CHIP_ID_H, &id_h); ++ ret |= gc2145_read_reg(gc2145->client, GC2145_REG_CHIP_ID_L, &id_l); ++ if (ret) { ++ dev_err(dev, "Failed to read sensor id, (%d)\n", ret); ++ return ret; ++ } ++ ++ id = id_h << 8 | id_l; ++ if (id != GC2145_CHIP_ID) { ++ dev_err(dev, "sensor id: %04X mismatched\n", id); ++ return -ENODEV; ++ } ++ ++ dev_info(dev, "Detected GC2145 sensor\n"); ++ return 0; ++} ++ ++static long gc2145_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) ++{ ++ struct gc2145 *gc2145 = to_gc2145(sd); ++ long ret = 0; ++ ++ dev_info(&gc2145->client->dev, "gc2145_ioctl\n"); ++ ++ switch (cmd) { ++ //case: ++ default: ++ ret = -ENOIOCTLCMD; ++ break; ++ } ++ return ret; ++} ++ ++static int __gc2145_start_stream(struct gc2145 *gc2145) ++{ ++ int ret; ++ ++ ret = gc2145_write_array(gc2145->client, gc2145->cur_mode->reg_list); ++ if (ret) ++ return ret; ++ usleep_range(2000, 5000); ++ ++ /* Apply customized control from user */ ++ mutex_unlock(&gc2145->lock); ++ ret = v4l2_ctrl_handler_setup(&gc2145->ctrl_handler); ++ mutex_lock(&gc2145->lock); ++ ++ ret = gc2145_write_array(gc2145->client, gc2145_start); ++ if (ret) ++ return ret; ++ ++ return ret; ++} ++ ++static int __gc2145_stop_stream(struct gc2145 *gc2145) ++{ ++ int ret; ++ ++ ret = gc2145_write_array(gc2145->client, gc2145_stop); ++ if (ret) ++ return ret; ++ ++ return ret; ++} ++ ++#ifdef CONFIG_COMPAT ++static long gc2145_compat_ioctl32(struct v4l2_subdev *sd, ++ unsigned int cmd, unsigned long arg) ++{ ++ void __user *up = compat_ptr(arg); ++ struct module_inf *inf; ++ struct module_awb_cfg *awb_cfg; ++ long ret = 0; ++ ++ switch (cmd) { ++ case CANAANMODULE_GET_MODULE_INFO: ++ inf = kzalloc(sizeof(*inf), GFP_KERNEL); ++ if (!inf) { ++ ret = -ENOMEM; ++ return ret; ++ } ++ ++ ret = gc2145_ioctl(sd, cmd, inf); ++ if (!ret) ++ ret = copy_to_user(up, inf, sizeof(*inf)); ++ kfree(inf); ++ break; ++ case CANAANMODULE_AWB_CFG: ++ awb_cfg = kzalloc(sizeof(*awb_cfg), GFP_KERNEL); ++ if (!awb_cfg) { ++ ret = -ENOMEM; ++ return ret; ++ } ++ ++ ret = gc2145_ioctl(sd, cmd, awb_cfg); ++ if (!ret) ++ ret = copy_to_user(up, awb_cfg, sizeof(*awb_cfg)); ++ kfree(awb_cfg); ++ break; ++ default: ++ ret = -ENOIOCTLCMD; ++ break; ++ } ++ return ret; ++} ++#endif ++ ++static int gc2145_s_stream(struct v4l2_subdev *sd, int on) ++{ ++ struct gc2145 *gc2145 = to_gc2145(sd); ++ int ret = 0; ++ dev_info(&gc2145->client->dev, "%s enter\n",__func__); ++ ++ mutex_lock(&gc2145->lock); ++ on = !!on; ++ if (on == gc2145->streaming) ++ goto unlock_and_return; ++ ++ if (on) { ++ ret = __gc2145_start_stream(gc2145); ++ if (ret) { ++ dev_err(&gc2145->client->dev, "Failed to start gc2145 stream\n"); ++ goto unlock_and_return; ++ } ++ } else { ++ __gc2145_stop_stream(gc2145); ++ } ++ ++ gc2145->streaming = on; ++ ++unlock_and_return: ++ mutex_unlock(&gc2145->lock); ++ dev_info(&gc2145->client->dev, "%s exit\n",__func__); ++ ++ return 0; ++} ++ ++static int gc2145_g_frame_interval(struct v4l2_subdev *sd, ++ struct v4l2_subdev_frame_interval *fi) ++{ ++ struct gc2145 *gc2145 = to_gc2145(sd); ++ const struct gc2145_mode *mode = gc2145->cur_mode; ++ ++ mutex_lock(&gc2145->lock); ++ fi->interval = mode->max_fps; ++ mutex_unlock(&gc2145->lock); ++ ++ return 0; ++} ++ ++static int gc2145_g_mbus_config(struct v4l2_subdev *sd, ++ struct v4l2_mbus_config *config) ++{ ++ config->type = V4L2_MBUS_CSI2; ++ config->flags = 1 << (GC2145_LANES - 1) | V4L2_MBUS_CSI2_CHANNEL_0 | ++ V4L2_MBUS_CSI2_CONTINUOUS_CLOCK; ++ ++ return 0; ++} ++ ++static int gc2145_enum_mbus_code(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_mbus_code_enum *code) ++{ ++ if (code->index != 0) ++ return -EINVAL; ++ code->code = GC2145_MEDIA_BUS_FMT; ++ return 0; ++} ++ ++static int gc2145_enum_frame_sizes(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_frame_size_enum *fse) ++{ ++ struct gc2145 *gc2145 = to_gc2145(sd); ++ ++ if (fse->index >= gc2145->cfg_num) ++ return -EINVAL; ++ ++ if (fse->code != GC2145_MEDIA_BUS_FMT) ++ return -EINVAL; ++ ++ fse->min_width = supported_modes[fse->index].width; ++ fse->max_width = supported_modes[fse->index].width; ++ fse->max_height = supported_modes[fse->index].height; ++ fse->min_height = supported_modes[fse->index].height; ++ return 0; ++} ++ ++static int gc2145_enum_frame_interval(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_frame_interval_enum *fie) ++{ ++ struct gc2145 *gc2145 = to_gc2145(sd); ++ ++ if (fie->index >= gc2145->cfg_num) ++ return -EINVAL; ++ ++ fie->code = GC2145_MEDIA_BUS_FMT; ++ fie->width = supported_modes[fie->index].width; ++ fie->height = supported_modes[fie->index].height; ++ fie->interval = supported_modes[fie->index].max_fps; ++ return 0; ++} ++ ++static int gc2145_set_fmt(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_format *fmt) ++{ ++ struct gc2145 *gc2145 = to_gc2145(sd); ++ const struct gc2145_mode *mode; ++ s64 h_blank, vblank_def; ++ ++ mutex_lock(&gc2145->lock); ++ ++ mode = v4l2_find_nearest_size(supported_modes, ++ ARRAY_SIZE(supported_modes), ++ width, height, ++ fmt->format.width, fmt->format.height); ++ dev_info(&gc2145->client->dev, "set_fmt, width:%u, height:%u.\n", mode->width, mode->height); ++ ++ fmt->format.code = GC2145_MEDIA_BUS_FMT; ++ fmt->format.width = mode->width; ++ fmt->format.height = mode->height; ++ fmt->format.field = V4L2_FIELD_NONE; ++ ++ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++ *v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format; ++#else ++ mutex_unlock(&gc2145->lock); ++ return -ENOTTY; ++#endif ++ } else { ++ gc2145->cur_mode = mode; ++ __v4l2_ctrl_s_ctrl(gc2145->link_freq, mode->link_freq_index); ++ __v4l2_ctrl_s_ctrl_int64(gc2145->pixel_rate, ++ to_pixel_rate(mode->link_freq_index)); ++ h_blank = mode->hts_def - mode->width; ++ __v4l2_ctrl_modify_range(gc2145->hblank, h_blank, ++ h_blank, 1, h_blank); ++ vblank_def = mode->vts_def - mode->height; ++ __v4l2_ctrl_modify_range(gc2145->vblank, vblank_def, ++ GC2145_VTS_MAX - mode->height, ++ 1, vblank_def); ++ } ++ ++ mutex_unlock(&gc2145->lock); ++ return 0; ++} ++ ++static int gc2145_get_fmt(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_format *fmt) ++{ ++ struct gc2145 *gc2145 = to_gc2145(sd); ++ const struct gc2145_mode *mode = gc2145->cur_mode; ++ ++ mutex_lock(&gc2145->lock); ++ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++ fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad); ++#else ++ mutex_unlock(&gc2145->lock); ++ return -ENOTTY; ++#endif ++ } else { ++ fmt->format.width = mode->width; ++ fmt->format.height = mode->height; ++ fmt->format.code = GC2145_MEDIA_BUS_FMT; ++ fmt->format.field = V4L2_FIELD_NONE; ++ } ++ mutex_unlock(&gc2145->lock); ++ return 0; ++} ++ ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++static int gc2145_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) ++{ ++ struct gc2145 *gc2145 = to_gc2145(sd); ++ struct v4l2_mbus_framefmt *try_fmt = ++ v4l2_subdev_get_try_format(sd, fh->pad, 0); ++ const struct gc2145_mode *def_mode = &supported_modes[0]; ++ ++ mutex_lock(&gc2145->lock); ++ /* Initialize try_fmt */ ++ try_fmt->width = def_mode->width; ++ try_fmt->height = def_mode->height; ++ try_fmt->code = GC2145_MEDIA_BUS_FMT; ++ try_fmt->field = V4L2_FIELD_NONE; ++ mutex_unlock(&gc2145->lock); ++ ++ return 0; ++} ++#endif ++ ++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API ++static const struct v4l2_subdev_internal_ops gc2145_internal_ops = { ++ .open = gc2145_open, ++}; ++#endif ++ ++static int gc2145_s_power(struct v4l2_subdev *sd, int on) ++{ ++ struct gc2145 *gc2145 = to_gc2145(sd); ++ int ret = 0; ++ ++ mutex_lock(&gc2145->lock); ++ ++ if (gc2145->power_on == !!on) ++ goto unlock_and_return; ++ ++ if (on) { ++ gc2145->power_on = true; ++ } else { ++ gc2145->power_on = false; ++ } ++ ++unlock_and_return: ++ mutex_unlock(&gc2145->lock); ++ ++ return ret; ++} ++ ++static const struct v4l2_subdev_core_ops gc2145_core_ops = { ++ .s_power = gc2145_s_power, ++ .ioctl = gc2145_ioctl, ++#ifdef CONFIG_COMPAT ++ .compat_ioctl32 = gc2145_compat_ioctl32, ++#endif ++}; ++ ++static const struct v4l2_subdev_video_ops gc2145_video_ops = { ++ .s_stream = gc2145_s_stream, ++ .g_frame_interval = gc2145_g_frame_interval, ++ .g_mbus_config = gc2145_g_mbus_config, ++}; ++ ++static const struct v4l2_subdev_pad_ops gc2145_pad_ops = { ++ .enum_mbus_code = gc2145_enum_mbus_code, ++ .enum_frame_size = gc2145_enum_frame_sizes, ++ .enum_frame_interval = gc2145_enum_frame_interval, ++ .get_fmt = gc2145_get_fmt, ++ .set_fmt = gc2145_set_fmt, ++}; ++ ++static const struct v4l2_subdev_ops gc2145_subdev_ops = { ++ .core = &gc2145_core_ops, ++ .video = &gc2145_video_ops, ++ .pad = &gc2145_pad_ops, ++}; ++ ++static int gc2145_probe(struct i2c_client *client, ++ const struct i2c_device_id *id) ++{ ++ struct device *dev = &client->dev; ++ struct device_node *node = dev->of_node; ++ struct gc2145 *gc2145; ++ struct v4l2_subdev *sd; ++ char facing[2]; ++ int ret; ++ ++ dev_info(dev, "driver version: %02x.%02x.%02x", ++ DRIVER_VERSION >> 16, ++ (DRIVER_VERSION & 0xff00) >> 8, ++ DRIVER_VERSION & 0x00ff); ++ ++ gc2145 = devm_kzalloc(dev, sizeof(*gc2145), GFP_KERNEL); ++ if (!gc2145) ++ return -ENOMEM; ++ ++ gc2145->client = client; ++ ret = of_property_read_u32(node, CANAANMODULE_CAMERA_MODULE_INDEX, ++ &gc2145->module_index); ++ ret |= of_property_read_string(node, CANAANMODULE_CAMERA_MODULE_FACING, ++ &gc2145->module_facing); ++ ret |= of_property_read_string(node, CANAANMODULE_CAMERA_MODULE_NAME, ++ &gc2145->module_name); ++ ret |= of_property_read_string(node, CANAANMODULE_CAMERA_LENS_NAME, ++ &gc2145->len_name); ++ ++ if (ret) { ++ dev_err(dev, "Failed to get module information\n"); ++ return -EINVAL; ++ } ++ ++ gc2145->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);//reset pin low actvie, set logical value. ++ if (IS_ERR(gc2145->reset_gpio)) ++ dev_warn(dev, "Failed to get reset-gpios\n"); ++ ++ gc2145->pwdn_gpio = devm_gpiod_get(dev, "pwdn", GPIOD_OUT_HIGH);//pwdn pin high active, set logical value. ++ if (IS_ERR(gc2145->pwdn_gpio)) ++ dev_warn(dev, "Failed to get pwdn-gpios\n"); ++ ++ if (gpiod_export(gc2145->reset_gpio, 0)) { ++ dev_err(dev, "gpiod export gc2145 reset failed."); ++ } ++ ++ if (gpiod_export(gc2145->pwdn_gpio, 0)) { ++ dev_err(dev, "gpiod export gc2145 powerdown failed."); ++ } ++ ++ mutex_init(&gc2145->lock); ++ ++ /* set default mode */ ++ gc2145->cur_mode = &supported_modes[0]; ++ gc2145->cfg_num = ARRAY_SIZE(supported_modes); ++ ++ sd = &gc2145->subdev; ++ v4l2_i2c_subdev_init(sd, client, &gc2145_subdev_ops); ++ ret = gc2145_initialize_controls(gc2145); ++ if (ret) ++ goto err_destroy_mutex; ++ ++ ret = __gc2145_power_on(gc2145); ++ if (ret) ++ goto err_free_handler; ++ ++ ret = gc2145_check_sensor_id(gc2145); ++ if (ret) ++ goto err_power_off; ++ ++ sd->internal_ops = &gc2145_internal_ops; ++ sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | ++ V4L2_SUBDEV_FL_HAS_EVENTS; ++ ++ gc2145->pad.flags = MEDIA_PAD_FL_SOURCE; ++ sd->entity.function = MEDIA_ENT_F_CAM_SENSOR; ++ ret = media_entity_pads_init(&sd->entity, 1, &gc2145->pad); ++ if (ret < 0) ++ goto err_power_off; ++ ++ memset(facing, 0, sizeof(facing)); ++ if (strcmp(gc2145->module_facing, "back") == 0) ++ facing[0] = 'b'; ++ else ++ facing[0] = 'f'; ++ ++ snprintf(sd->name, sizeof(sd->name), "m%02d_%s_%s %s", ++ gc2145->module_index, facing, ++ GC2145_NAME, dev_name(sd->dev)); ++ ++ ret = v4l2_async_register_subdev_sensor_common(sd); ++ if (ret) { ++ dev_err(dev, "Failed to register v4l2 async subdev\n"); ++ goto err_clean_entity; ++ } ++ ++ return 0; ++ ++err_clean_entity: ++#ifdef CONFIG_MEDIA_CONTROLLER ++ media_entity_cleanup(&sd->entity); ++#endif ++err_power_off: ++ __gc2145_power_off(gc2145); ++err_free_handler: ++ v4l2_ctrl_handler_free(&gc2145->ctrl_handler); ++err_destroy_mutex: ++ mutex_destroy(&gc2145->lock); ++ ++ return ret; ++} ++ ++static int gc2145_remove(struct i2c_client *client) ++{ ++ struct v4l2_subdev *sd = i2c_get_clientdata(client); ++ struct gc2145 *gc2145 = to_gc2145(sd); ++ ++ v4l2_async_unregister_subdev(sd); ++#ifdef CONFIG_MEDIA_CONTROLLER ++ media_entity_cleanup(&sd->entity); ++#endif ++ v4l2_ctrl_handler_free(&gc2145->ctrl_handler); ++ mutex_destroy(&gc2145->lock); ++ ++ __gc2145_power_off(gc2145); ++ return 0; ++} ++ ++static const struct i2c_device_id gc2145_match_id[] = { ++ { "gc2145", 0 }, ++ { }, ++}; ++ ++static const struct of_device_id gc2145_of_match[] = { ++ { .compatible = "galaxycore,gc2145" }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, gc2145_of_match); ++ ++static struct i2c_driver gc2145_i2c_driver = { ++ .driver = { ++ .name = GC2145_NAME, ++ .of_match_table = of_match_ptr(gc2145_of_match), ++ }, ++ .probe = &gc2145_probe, ++ .remove = &gc2145_remove, ++ .id_table = gc2145_match_id, ++}; ++ ++module_i2c_driver(gc2145_i2c_driver); ++MODULE_DESCRIPTION("Galaxycore GC2145 Image Sensor driver"); ++MODULE_LICENSE("GPL v2"); ++ +-- +2.17.1 + diff --git a/package/patches/linux/0026-DAC-channel-reversed.patch b/package/patches/linux/0026-DAC-channel-reversed.patch new file mode 100644 index 0000000..2f67112 --- /dev/null +++ b/package/patches/linux/0026-DAC-channel-reversed.patch @@ -0,0 +1,25 @@ +From f1cc881b652a0b003d7d447dd7e578667b87e4b0 Mon Sep 17 00:00:00 2001 +From: gh-sxp +Date: Sun, 28 Aug 2022 14:27:15 +0800 +Subject: [PATCH] modify nau8822 + +--- + sound/soc/codecs/nau8822.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c +index bb061740..0086a471 100644 +--- a/sound/soc/codecs/nau8822.c ++++ b/sound/soc/codecs/nau8822.c +@@ -40,7 +40,7 @@ static const struct reg_default nau8822_reg_defaults[] = { + { NAU8822_REG_POWER_MANAGEMENT_1, 0x0000 }, + { NAU8822_REG_POWER_MANAGEMENT_2, 0x0000 }, + { NAU8822_REG_POWER_MANAGEMENT_3, 0x0000 }, +- { NAU8822_REG_AUDIO_INTERFACE, 0x0050 }, ++ { NAU8822_REG_AUDIO_INTERFACE, 0x0054 }, + { NAU8822_REG_COMPANDING_CONTROL, 0x0000 }, + { NAU8822_REG_CLOCKING, 0x0140 }, + { NAU8822_REG_ADDITIONAL_CONTROL, 0x0000 }, +-- +2.36.1 + diff --git a/package/patches/linux/0026-drm-panel-mutli-panel-support.patch b/package/patches/linux/0026-drm-panel-mutli-panel-support.patch new file mode 100644 index 0000000..1b121a1 --- /dev/null +++ b/package/patches/linux/0026-drm-panel-mutli-panel-support.patch @@ -0,0 +1,2506 @@ +From 6a415ca06b0b2ab6606af99af1b0dd70b196955c Mon Sep 17 00:00:00 2001 +From: "Chenggen.Wang" +Date: Wed, 24 Aug 2022 09:22:36 +0800 +Subject: [PATCH 2/2] drm/panel: mutli panel support. + +Signed-off-by: Chenggen.Wang +--- + .../boot/dts/canaan/k510_crb_lp3_v1_2.dts | 98 +- + drivers/gpu/drm/canaan/kendryte_dsi.c | 2307 +++++++++-------- + drivers/gpu/drm/panel/panel-simple.c | 23 +- + 3 files changed, 1237 insertions(+), 1191 deletions(-) + mode change 100644 => 100755 drivers/gpu/drm/panel/panel-simple.c + +diff --git a/arch/riscv/boot/dts/canaan/k510_crb_lp3_v1_2.dts b/arch/riscv/boot/dts/canaan/k510_crb_lp3_v1_2.dts +index cecd61c1..1620998c 100755 +--- a/arch/riscv/boot/dts/canaan/k510_crb_lp3_v1_2.dts ++++ b/arch/riscv/boot/dts/canaan/k510_crb_lp3_v1_2.dts +@@ -542,50 +542,50 @@ + dsi,lanes = <4>; + + panel-init-sequence-v1 = [ +-39 00 04 B9 Ff 83 99 +-39 00 10 B1 02 04 70 90 01 32 33 11 11 4D 57 56 73 02 02 +-39 00 0c B2 00 80 80 AE 05 07 5A 11 10 10 00 +-39 00 2e B4 00 FF 04 08 0C 00 00 00 10 00 00 02 00 24 02 04 09 21 03 00 00 0A 90 88 04 08 0C 00 00 00 04 00 00 02 00 24 02 04 08 00 00 02 88 00 08 +-39 00 28 D3 00 00 00 00 00 00 04 04 32 10 04 00 04 00 00 00 00 00 00 00 00 00 00 21 00 05 05 13 00 00 00 05 40 00 00 00 05 20 80 +-39 00 21 D5 00 00 21 20 19 19 18 18 00 00 01 00 18 18 03 02 19 19 00 00 00 00 00 00 00 00 31 31 30 30 2F 2F +-39 00 21 D6 40 40 20 21 18 18 19 19 40 40 02 03 18 18 00 01 19 19 40 40 40 40 40 40 40 40 31 31 30 30 2F 2F +-39 00 11 D8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +-39 00 02 BD 01 +-39 00 11 D8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +-39 00 02 BD 02 +-39 00 09 D8 AA AE EA AA AA AE EA AA +-39 00 02 BD 00 +-39 00 37 E0 01 15 22 1E 46 51 5E 5A 63 6A 71 76 7B 82 88 8D 92 9C A0 AB A2 B5 BD 63 61 6E 7A 01 15 22 1E 46 51 5E 5A 63 6A 71 76 7B 82 89 8E 92 9C A0 AB A2 B5 BD 63 61 6E 7A +-39 00 03 C0 25 5A +-39 00 03 B6 91 91 +-39 00 02 D2 66 +-39 00 02 CC 00 +-39 00 02 36 01 +-05 00 01 11 +-05 00 01 29 ++ 39 00 04 B9 Ff 83 99 ++ 39 00 10 B1 02 04 70 90 01 32 33 11 11 4D 57 56 73 02 02 ++ 39 00 0c B2 00 80 80 AE 05 07 5A 11 10 10 00 ++ 39 00 2e B4 00 FF 04 08 0C 00 00 00 10 00 00 02 00 24 02 04 09 21 03 00 00 0A 90 88 04 08 0C 00 00 00 04 00 00 02 00 24 02 04 08 00 00 02 88 00 08 ++ 39 00 28 D3 00 00 00 00 00 00 04 04 32 10 04 00 04 00 00 00 00 00 00 00 00 00 00 21 00 05 05 13 00 00 00 05 40 00 00 00 05 20 80 ++ 39 00 21 D5 00 00 21 20 19 19 18 18 00 00 01 00 18 18 03 02 19 19 00 00 00 00 00 00 00 00 31 31 30 30 2F 2F ++ 39 00 21 D6 40 40 20 21 18 18 19 19 40 40 02 03 18 18 00 01 19 19 40 40 40 40 40 40 40 40 31 31 30 30 2F 2F ++ 39 00 11 D8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ++ 39 00 02 BD 01 ++ 39 00 11 D8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ++ 39 00 02 BD 02 ++ 39 00 09 D8 AA AE EA AA AA AE EA AA ++ 39 00 02 BD 00 ++ 39 00 37 E0 01 15 22 1E 46 51 5E 5A 63 6A 71 76 7B 82 88 8D 92 9C A0 AB A2 B5 BD 63 61 6E 7A 01 15 22 1E 46 51 5E 5A 63 6A 71 76 7B 82 89 8E 92 9C A0 AB A2 B5 BD 63 61 6E 7A ++ 39 00 03 C0 25 5A ++ 39 00 03 B6 91 91 ++ 39 00 02 D2 66 ++ 39 00 02 CC 00 ++ 39 00 02 36 01 ++ 05 00 01 11 ++ 05 00 01 29 + ]; + + panel-init-sequence-v2 = [ +-39 00 04 B9 FF 83 99 +-39 00 02 D2 AA +-39 00 10 B1 02 04 71 91 01 32 33 11 11 ab 4d 56 73 02 02 +-39 00 10 B2 00 80 80 ae 05 07 5a 11 00 00 10 1e 70 03 d4 +-39 00 2D B4 00 FF 02 C0 02 c0 00 00 08 00 04 06 00 32 04 0a 08 21 03 01 00 0f b8 8b 02 c0 02 c0 00 00 08 00 04 06 00 32 04 0a 08 01 00 0f b8 01 +-39 00 22 D3 00 00 00 00 00 00 06 00 00 10 04 00 04 00 00 00 00 00 00 00 00 00 00 01 00 05 05 07 00 00 00 05 40 +-39 00 21 D5 18 18 19 19 18 18 21 20 01 00 07 06 05 04 03 02 18 18 18 18 18 18 2f 2f 30 30 31 31 18 18 18 18 +-39 00 21 D6 18 18 19 19 40 40 20 21 02 03 04 05 06 07 00 01 40 40 40 40 40 40 2f 2f 30 30 31 31 40 40 40 40 +-39 00 11 D8 a2 aa 02 a0 a2 a8 02 a0 b0 00 00 00 b0 00 00 00 +-39 00 02 BD 01 +-39 00 11 D8 B0 00 00 00 B0 00 00 00 E2 AA 03 F0 E2 AA 03 F0 +-39 00 02 BD 02 +-39 00 09 D8 E2 AA 03 F0 E2 AA 03 F0 +-39 00 02 BD 00 +-39 00 03 B6 8D 8D +-39 00 37 E0 00 12 1f 1a 40 4a 59 55 5e 67 6f 75 7a 82 8b 90 95 9f a3 ad a2 b2 B6 5e 5a 65 77 00 12 1f 1a 40 4a 59 55 5e 67 6f 75 7a 82 8b 90 95 9f a3 ad a2 b2 B6 5e 5a 65 77 +-39 00 03 C6 FF F9 +-39 00 02 CC 04 +-05 00 01 11 +-05 00 01 29 ++ 39 00 04 B9 FF 83 99 ++ 39 00 02 D2 AA ++ 39 00 10 B1 02 04 71 91 01 32 33 11 11 ab 4d 56 73 02 02 ++ 39 00 10 B2 00 80 80 ae 05 07 5a 11 00 00 10 1e 70 03 d4 ++ 39 00 2D B4 00 FF 02 C0 02 c0 00 00 08 00 04 06 00 32 04 0a 08 21 03 01 00 0f b8 8b 02 c0 02 c0 00 00 08 00 04 06 00 32 04 0a 08 01 00 0f b8 01 ++ 39 00 22 D3 00 00 00 00 00 00 06 00 00 10 04 00 04 00 00 00 00 00 00 00 00 00 00 01 00 05 05 07 00 00 00 05 40 ++ 39 00 21 D5 18 18 19 19 18 18 21 20 01 00 07 06 05 04 03 02 18 18 18 18 18 18 2f 2f 30 30 31 31 18 18 18 18 ++ 39 00 21 D6 18 18 19 19 40 40 20 21 02 03 04 05 06 07 00 01 40 40 40 40 40 40 2f 2f 30 30 31 31 40 40 40 40 ++ 39 00 11 D8 a2 aa 02 a0 a2 a8 02 a0 b0 00 00 00 b0 00 00 00 ++ 39 00 02 BD 01 ++ 39 00 11 D8 B0 00 00 00 B0 00 00 00 E2 AA 03 F0 E2 AA 03 F0 ++ 39 00 02 BD 02 ++ 39 00 09 D8 E2 AA 03 F0 E2 AA 03 F0 ++ 39 00 02 BD 00 ++ 39 00 03 B6 8D 8D ++ 39 00 37 E0 00 12 1f 1a 40 4a 59 55 5e 67 6f 75 7a 82 8b 90 95 9f a3 ad a2 b2 B6 5e 5a 65 77 00 12 1f 1a 40 4a 59 55 5e 67 6f 75 7a 82 8b 90 95 9f a3 ad a2 b2 B6 5e 5a 65 77 ++ 39 00 03 C6 FF F9 ++ 39 00 02 CC 04 ++ 05 00 01 11 ++ 05 00 01 29 + ]; + + display-timings { +@@ -606,6 +606,22 @@ + de-active = <1>; + pixelclk-active = <0>; + }; ++ ++ timing1: timing1 { ++ clock-frequency = <37125000>; ++ hactive = <800>; ++ vactive = <1280>; ++ hsync-len = <24>; ++ hfront-porch = <30>; ++ hback-porch = <24>; ++ vsync-len = <4>; ++ vfront-porch = <8>; ++ vback-porch = <12>; ++ hsync-active = <0>; ++ vsync-active = <0>; ++ de-active = <1>; ++ pixelclk-active = <0>; ++ }; + }; + + ports { +diff --git a/drivers/gpu/drm/canaan/kendryte_dsi.c b/drivers/gpu/drm/canaan/kendryte_dsi.c +index 68b12188..0650589c 100755 +--- a/drivers/gpu/drm/canaan/kendryte_dsi.c ++++ b/drivers/gpu/drm/canaan/kendryte_dsi.c +@@ -1,712 +1,717 @@ +-/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License version 2 as +- * published by the Free Software Foundation. +-*/ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include