diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index dd4726a1..37a15410 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -8,97 +8,44 @@ on: pull_request: jobs: - build-ipu6ep-on-ubuntu-2204: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v2 - - - name: Build for ipu6ep - run: | - echo "APT::Get::Always-Include-Phased-Updates True;" | sudo tee -a /etc/apt/apt.conf - sudo apt-get update -q -q - sudo apt-get install git cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev --yes - git clone https://github.com/intel/ipu6-camera-bins -b main --depth 1 - sudo cp -rv ipu6-camera-bins/ipu6ep/include/* /usr/include/ - sudo cp -rv ipu6-camera-bins/ipu6ep/lib/* /usr/lib/ - rm -fr ipu6-camera-bins - mkdir -p ./build/out/install/usr && cd ./build/ - cmake -DCMAKE_BUILD_TYPE=Release \ - -DIPU_VER=ipu6ep \ - -DENABLE_VIRTUAL_IPU_PIPE=OFF \ - -DUSE_PG_LITE_PIPE=ON \ - -DUSE_STATIC_GRAPH=OFF \ - -DCMAKE_INSTALL_PREFIX=/usr .. - make - sudo make install build-ipu6-on-ubuntu-2204: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v2 - - - name: Build for ipu6 - run: | - echo "APT::Get::Always-Include-Phased-Updates True;" | sudo tee -a /etc/apt/apt.conf - sudo apt-get update -q -q - sudo apt-get install git cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev --yes - git clone https://github.com/intel/ipu6-camera-bins -b main --depth 1 - sudo cp -rv ipu6-camera-bins/ipu6/include/* /usr/include/ - sudo cp -rv ipu6-camera-bins/ipu6/lib/* /usr/lib/ - rm -fr ipu6-camera-bins - mkdir -p ./build/out/install/usr && cd ./build/ - cmake -DCMAKE_BUILD_TYPE=Release \ - -DIPU_VER=ipu6 \ - -DENABLE_VIRTUAL_IPU_PIPE=OFF \ - -DUSE_PG_LITE_PIPE=ON \ - -DUSE_STATIC_GRAPH=OFF \ - -DCMAKE_INSTALL_PREFIX=/usr .. - make - sudo make install - build-ipu6ep-on-ubuntu-2004: - runs-on: ubuntu-20.04 - + runs-on: ubuntu-latest + container: ubuntu:22.04 steps: - - uses: actions/checkout@v2 - - - name: Build for ipu6ep + - uses: actions/checkout@v3 + - name: Build on Ubuntu 22.04 run: | - sudo apt-get update -q -q - sudo apt-get install git cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev --yes + echo 'APT::Get::Always-Include-Phased-Updates True;' | tee -a /etc/apt/apt.conf + echo 'Acquire::http::User-Agent-Non-Interactive "true";' | tee -a /etc/apt/apt.conf + apt-get update -q + echo "" | apt-get install git build-essential cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev --yes git clone https://github.com/intel/ipu6-camera-bins -b main --depth 1 - sudo cp -rv ipu6-camera-bins/ipu6ep/include/* /usr/include/ - sudo cp -rv ipu6-camera-bins/ipu6ep/lib/* /usr/lib/ + cp -rv ipu6-camera-bins/include/* /usr/include/ + cp -rv ipu6-camera-bins/lib/* /usr/lib/ rm -fr ipu6-camera-bins - mkdir -p ./build/out/install/usr && cd ./build/ - cmake -DCMAKE_BUILD_TYPE=Release \ - -DIPU_VER=ipu6ep \ - -DENABLE_VIRTUAL_IPU_PIPE=OFF \ - -DUSE_PG_LITE_PIPE=ON \ - -DUSE_STATIC_GRAPH=OFF \ - -DCMAKE_INSTALL_PREFIX=/usr .. - make - sudo make install + git clone https://github.com/intel/icamerasrc.git -b icamerasrc_slim_api ../icamerasrc --depth 1 + ./build.sh -s ${PWD}/.. -i ${PWD}/out --board ipu_tgl ipu_adl ipu_mtl + cp -rv ./out/install/include/* /usr/include + cp -rv ./out/install/lib/* /usr/lib + cp -rv ./out/install/share/* /usr/share build-ipu6-on-ubuntu-2004: - runs-on: ubuntu-20.04 - + runs-on: ubuntu-latest + container: ubuntu:20.04 steps: - - uses: actions/checkout@v2 - - - name: Build for ipu6 + - uses: actions/checkout@v3 + - name: Build on Ubuntu 20.04 run: | - sudo apt-get update -q -q - sudo apt-get install git cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev --yes + echo 'Acquire::http::User-Agent-Non-Interactive "true";' | tee -a /etc/apt/apt.conf + apt-get update -q + export TZ=Asia/Shanghai + echo "" | apt-get install -qy tzdata + echo "" | apt-get install git build-essential cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libdrm-dev --yes git clone https://github.com/intel/ipu6-camera-bins -b main --depth 1 - sudo cp -rv ipu6-camera-bins/ipu6/include/* /usr/include/ - sudo cp -rv ipu6-camera-bins/ipu6/lib/* /usr/lib/ + cp -rv ipu6-camera-bins/include/* /usr/include/ + cp -rv ipu6-camera-bins/lib/* /usr/lib/ rm -fr ipu6-camera-bins - mkdir -p ./build/out/install/usr && cd ./build/ - cmake -DCMAKE_BUILD_TYPE=Release \ - -DIPU_VER=ipu6 \ - -DENABLE_VIRTUAL_IPU_PIPE=OFF \ - -DUSE_PG_LITE_PIPE=ON \ - -DUSE_STATIC_GRAPH=OFF \ - -DCMAKE_INSTALL_PREFIX=/usr .. - make - sudo make install + git clone https://github.com/intel/icamerasrc.git -b icamerasrc_slim_api ../icamerasrc --depth 1 + ./build.sh -s ${PWD}/.. -i ${PWD}/out --board ipu_tgl ipu_adl ipu_mtl + cp -rv ./out/install/include/* /usr/include + cp -rv ./out/install/lib/* /usr/lib + cp -rv ./out/install/share/* /usr/share diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d3690c0..80a33aa0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2017-2022 Intel Corporation +# Copyright (C) 2017-2023 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -253,6 +253,13 @@ else() endif() add_library(camhal_static STATIC ${LIBCAMHAL_SRCS}) + +if (NOT CAL_BUILD AND (NOT "${CMAKE_INSTALL_SUB_PATH}" STREQUAL "")) + set(CMAKE_SKIP_RPATH TRUE) + set_target_properties(camhal PROPERTIES LINK_FLAGS + "-Wl,-rpath,/usr/lib/${CMAKE_INSTALL_SUB_PATH}") + add_compile_definitions(SUB_CONFIG_PATH="${CMAKE_INSTALL_SUB_PATH}") +endif() set_target_properties(camhal_static PROPERTIES OUTPUT_NAME "camhal") #---------------------------- Link settings ---------------------------- @@ -375,68 +382,37 @@ endif() #ENABLE_SANDBOXING #--------------------------- Install settings --------------------------- if (NOT CAL_BUILD) # Install headers -install(DIRECTORY include/ DESTINATION include/libcamhal) -if (SUPPORT_LIVE_TUNING) - install(FILES modules/livetune/LiveTuning.h DESTINATION include/libcamhal/api) -endif() #SUPPORT_LIVE_TUNING +if ("${CMAKE_INSTALL_SUB_PATH}" STREQUAL "") + install(DIRECTORY include/ DESTINATION include/libcamhal) + if (SUPPORT_LIVE_TUNING) + install(FILES modules/livetune/LiveTuning.h DESTINATION include/libcamhal/api) + endif() #SUPPORT_LIVE_TUNING +endif() -# Install configure files -# By default ipu4 is used -if("${IPU_VER}" STREQUAL "ipu6") - if("${PRODUCTION_NAME}" STREQUAL "Andrews") - message("Install TGL Andrews configure files") - install(DIRECTORY config/ubuntu/tgl/ DESTINATION share/defaults/etc/camera) - else() - message("Install TGL IPU6 configure files") - install(DIRECTORY config/linux/ipu6/ DESTINATION share/defaults/etc/camera) - endif() -elseif("${IPU_VER}" STREQUAL "ipu6ep") - if("${PRODUCTION_NAME}" STREQUAL "ccg_platform") - message("Install ADL Platform configure files") - install(DIRECTORY config/ubuntu/adl/ DESTINATION share/defaults/etc/camera) - elseif("${PRODUCTION_NAME}" STREQUAL "Tributo") - message("Install ADL Tributo configure files") - install(DIRECTORY config/ubuntu/adl/ DESTINATION share/defaults/etc/camera) - else() - message("Install ADL IPU6EP configure files") - install(DIRECTORY config/linux/ipu6ep/ DESTINATION share/defaults/etc/camera) - endif() -elseif("${IPU_VER}" STREQUAL "ipu6epmtl") - if("${PRODUCTION_NAME}" STREQUAL "mtl-ubuntu") - message("Install MTL ubuntu configure files") - install(DIRECTORY config/ubuntu/mtl/ DESTINATION share/defaults/etc/camera) - elseif("${PRODUCTION_NAME}" STREQUAL "mtl-iotg") - message("Install MTL iotg configure files") - install(DIRECTORY config/linux/ipu6ep/ DESTINATION share/defaults/etc/camera) - else() - message("Install MTL configure files") - install(DIRECTORY config/linux/ipu6ep/ DESTINATION share/defaults/etc/camera) - endif() -elseif("${IPU_VER}" STREQUAL "ipu6sepla") - if("${PRODUCTION_NAME}" STREQUAL "penguin_peak") - message("Install JSL penguin peak configure files") - install(DIRECTORY config/ubuntu/jsl/ DESTINATION share/defaults/etc/camera) - endif() +# Install configure files, by default ipu4 is used +if(("${IPU_VER}" STREQUAL "") OR ("${IPU_VER}" STREQUAL "ipu4")) + message("Install camera configure files for ipu4") + install(DIRECTORY config/linux/ipu4/ DESTINATION share/defaults/etc/camera/${CMAKE_INSTALL_SUB_PATH}) else() - message("Install APL IPU4 configure files") - install(DIRECTORY config/linux/ipu4/ DESTINATION share/defaults/etc/camera) + message("Install camera configure files for" ${IPU_VER}) + install(DIRECTORY config/linux/${IPU_VER}/ DESTINATION share/defaults/etc/camera/${CMAKE_INSTALL_SUB_PATH}) endif() # Install libraries if (${CMAKE_VERSION} VERSION_LESS 3.11) install(TARGETS camhal camhal_static - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib/${CMAKE_INSTALL_SUB_PATH} + ARCHIVE DESTINATION lib/${CMAKE_INSTALL_SUB_PATH} ) else() -install(TARGETS camhal camhal_static) +install(TARGETS camhal camhal_static DESTINATION lib/${CMAKE_INSTALL_SUB_PATH}) endif() # Install package config file configure_file(${PROJECT_SOURCE_DIR}/cmake/libcamhal.pc.cmakein ${PROJECT_SOURCE_DIR}/libcamhal.pc @ONLY) install(FILES libcamhal.pc - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CMAKE_INSTALL_SUB_PATH}/pkgconfig) endif() #NOT CAL_BUILD diff --git a/README.md b/README.md index 8b29a19c..b78cc785 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ipu6-camera-hal -This repository supports MIPI cameras through the IPU6 on Intel Tiger Lake and -Alder Lake platforms. There are 4 repositories that provide the complete setup: +This repository supports MIPI cameras through the IPU6 on Intel Tiger Lake, Alder Lake, Raptor Lake and Meteor Lake platforms. +There are 4 repositories that provide the complete setup: - https://github.com/intel/ipu6-drivers - kernel drivers for the IPU and sensors - https://github.com/intel/ipu6-camera-bins - IPU firmware and proprietary image processing libraries @@ -13,108 +13,29 @@ Alder Lake platforms. There are 4 repositories that provide the complete setup: ## Build instructions: - Dependencies: ipu6-camera-bins -- Dependencies: libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev -- For cameras supporting privacy mode (ov01a1s, ov02c10, ov2740), add a dummy image for it: - ```shell - cd config/linux/ipu6ep - ffmpeg -i -pix_fmt nv12 privacy_image_-uf__.yuv - ``` -- Build and install: - -1. Set IPU6 version and product name for build - - For Tiger Lake, set: - ```shell - IPU6_VER=ipu6 - ``` - - - For Alder Lake, set: - ```shell - IPU6_VER=ipu6ep - ``` - -2. Then continue: - ```shell - cd ipu6-camera-hal - mkdir -p ./build/out/install/usr && cd ./build/ - - cmake -DCMAKE_BUILD_TYPE=Release \ - -DIPU_VER=${IPU6_VER} \ - -DENABLE_VIRTUAL_IPU_PIPE=OFF \ - -DUSE_PG_LITE_PIPE=ON \ - -DUSE_STATIC_GRAPH=OFF \ - -DCMAKE_INSTALL_PREFIX=/usr .. - # if don't want install to /usr, use -DCMAKE_INSTALL_PREFIX=./out/install/usr, export PKG_CONFIG_PATH="$workdir/build/out/install/usr/lib/pkgconfig" + Please follow https://github.com/intel/ipu6-camera-bins README to install. - make -j`nproc` - sudo make install - ``` - -3. Move user space driver for different platforms **(if you build for either ipu6-only or ipu6ep-only support, skip this step)**: - ```shell - mkdir /usr/lib/${IPU6_VER} - mkdir /usr/share/defaults/etc/${IPU6_VER} +- Dependencies: libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev - mv /usr/lib/libtbd.so.0.0.0 /usr/lib/${IPU6_VER}/libtbd.so.0.0.0 - - mv /usr/lib/libSkyCamAIC.so /usr/lib/${IPU6_VER}/libSkyCamAIC.so - mv /usr/lib/libSkyCamAICKBL.so /usr/lib/${IPU6_VER}/libSkyCamAICKBL.so - mv /usr/lib/libStatsConverter.so /usr/lib/${IPU6_VER}/libStatsConverter.so - mv /usr/lib/libbroxton_ia_pal.so /usr/lib/${IPU6_VER}/libbroxton_ia_pal.so - mv /usr/lib/libia_aec.so /usr/lib/${IPU6_VER}/libia_aec.so - mv /usr/lib/libia_aic.so /usr/lib/${IPU6_VER}/libia_aic.so - mv /usr/lib/libia_aic_engine.so /usr/lib/${IPU6_VER}/libia_aic_engine.so - mv /usr/lib/libia_aic_myriad.so /usr/lib/${IPU6_VER}/libia_aic_myriad.so - mv /usr/lib/libia_aiq.so /usr/lib/${IPU6_VER}/libia_aiq.so - mv /usr/lib/libia_aiq_file_debug.so /usr/lib/${IPU6_VER}/libia_aiq_file_debug.so - mv /usr/lib/libia_aiqb_parser.so /usr/lib/${IPU6_VER}/libia_aiqb_parser.so - mv /usr/lib/libia_bcomp.so /usr/lib/${IPU6_VER}/libia_bcomp.so - mv /usr/lib/libia_cca.so /usr/lib/${IPU6_VER}/libia_cca.so - mv /usr/lib/libia_cca_file_debug.so /usr/lib/${IPU6_VER}/libia_cca_file_debug.so - mv /usr/lib/libia_ccat.so /usr/lib/${IPU6_VER}/libia_ccat.so - mv /usr/lib/libia_cmc_parser.so /usr/lib/${IPU6_VER}/libia_cmc_parser.so - mv /usr/lib/libia_coordinate.so /usr/lib/${IPU6_VER}/libia_coordinate.so - mv /usr/lib/libia_dpc.so /usr/lib/${IPU6_VER}/libia_dpc.so - mv /usr/lib/libia_dvs.so /usr/lib/${IPU6_VER}/libia_dvs.so - mv /usr/lib/libia_dvs_file_debug.so /usr/lib/${IPU6_VER}/libia_dvs_file_debug.so - mv /usr/lib/libia_emd_decoder.so /usr/lib/${IPU6_VER}/libia_emd_decoder.so - mv /usr/lib/libia_exc.so /usr/lib/${IPU6_VER}/libia_exc.so - mv /usr/lib/libia_intrinsics.so /usr/lib/${IPU6_VER}/libia_intrinsics.so - mv /usr/lib/libia_isp_bxt.so /usr/lib/${IPU6_VER}/libia_isp_bxt.so - mv /usr/lib/libia_isp_bxt_file_debug.so /usr/lib/${IPU6_VER}/libia_isp_bxt_file_debug.so - mv /usr/lib/libia_lard.so /usr/lib/${IPU6_VER}/libia_lard.so - mv /usr/lib/libia_log.so /usr/lib/${IPU6_VER}/libia_log.so - mv /usr/lib/libia_ltm.so /usr/lib/${IPU6_VER}/libia_ltm.so - mv /usr/lib/libia_ltm_file_debug.so /usr/lib/${IPU6_VER}/libia_ltm_file_debug.so - mv /usr/lib/libia_me_corner.so /usr/lib/${IPU6_VER}/libia_me_corner.so - mv /usr/lib/libia_mkn.so /usr/lib/${IPU6_VER}/libia_mkn.so - mv /usr/lib/libia_nvm.so /usr/lib/${IPU6_VER}/libia_nvm.so - mv /usr/lib/libia_ob.so /usr/lib/${IPU6_VER}/libia_ob.so - mv /usr/lib/libia_pd.so /usr/lib/${IPU6_VER}/libia_pd.so - mv /usr/lib/libia_view.so /usr/lib/${IPU6_VER}/libia_view.so - mv /usr/lib/libpvl_blink_detection.so /usr/lib/${IPU6_VER}/libpvl_blink_detection.so - mv /usr/lib/libpvl_eye_detection.so /usr/lib/${IPU6_VER}/libpvl_eye_detection.so - mv /usr/lib/libpvl_face_detection.so /usr/lib/${IPU6_VER}/libpvl_face_detection.so - mv /usr/lib/libpvl_face_recognition.so /usr/lib/${IPU6_VER}/libpvl_face_recognition.so - mv /usr/lib/libpvl_mouth_detection.so /usr/lib/${IPU6_VER}/libpvl_mouth_detection.so - mv /usr/lib/libpvl_object_tracking.so /usr/lib/${IPU6_VER}/libpvl_object_tracking.so - mv /usr/lib/libpvl_smile_detection.so /usr/lib/${IPU6_VER}/libpvl_smile_detection.so - - mv /usr/lib/libcisu.so.0.0.0 /usr/lib/${IPU6_VER}/libcisu.so.0.0.0 - mv /usr/lib/libcisu_os_plugin.so.1.0.0 /usr/lib/${IPU6_VER}/libcisu_os_plugin.so.1.0.0 - mv /usr/lib/libgcss.so.0.0.0 /usr/lib/${IPU6_VER}/libgcss.so.0.0.0 - mv /usr/lib/libia_camera.so.0.0.0 /usr/lib/${IPU6_VER}/libia_camera.so.0.0.0 - mv /usr/lib/libia_cipf.so.0.0.0 /usr/lib/${IPU6_VER}/libia_cipf.so.0.0.0 - - mv /usr/lib/libcamhal.so /usr/lib/${IPU6_VER}/libcamhal.so - mv /usr/share/defaults/etc/camera /usr/share/defaults/etc/${IPU6_VER}/ +- Build and install: + Recommend to build together with icamerasrc and using `build.sh` in this repo. +1. Put ipu6-camera-hal, icameasrc and build.sh parallel as below: ``` - -4. Copy ipu6-camera-hal/config/linux/rules.d/*.rules to /lib/udev/rules.d/: - ```shell - cp ../config/linux/rules.d/*.rules /lib/udev/rules.d/ + cp build.sh .. && cd .. + # work + # ├── build.sh + # ├── icamerasrc + # ├── ipu6-camera-hal + # └── out ``` -5. Reboot to make udev rules take effect. +2. In `work` folder, run `./build.sh`. Output binaries will be in `out/install`. (RPM build is not implemented yet) + +3. Install contents in `out/install` to your `/usr`: + ```sh + sudo cp -r ./out/install/include/* /usr/include + sudo cp -r ./out/install/lib/* /usr/lib + sudo cp -r ./out/install/share/* /usr/share + ``` -## Tagged for removal: -The folder icamerasrc contains a gst plugin. This has been moved to https://github.com/intel/icamerasrc and will eventually be removed. +For more building details please reference the `build.sh`. \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..9e2a5674 --- /dev/null +++ b/build.sh @@ -0,0 +1,176 @@ +#!/bin/bash + +function check_result() { + local res=$1 + local func=$2 + + if [ $res -eq 0 ] ; then + echo "###############" " $func OK " "#############" + else + echo "###############" " $func FAIL " "#############" + exit 1 + fi +} + +function parse_argument() { + export SOURCE_DIR=${PWD} + export INSTALL_DIR=${PWD}/out + export BOARD_LIST="ipu_tgl ipu_adl ipu_mtl" + export BUILD_RPM=ON + + while true; do + case $1 in + -s|--source) + export SOURCE_DIR=$2 + echo "$2" + shift + ;; + -i|--install) + export INSTALL_DIR=$2 + echo "$2" + shift + ;; + --no-rpm) + export BUILD_RPM=OFF + ;; + --board) + shift + export BOARD_LIST=$@ + echo "$$" + break + ;; + -?*) + echo "WARNING: not supported option: $1" + ;; + *) + break + esac + + shift + done + + echo "=========================== Build Config ============================" + echo "SOURCE_DIR: $SOURCE_DIR" + echo "INSTALL_DIR: $INSTALL_DIR" + echo "BUILD_RPM: $BUILD_RPM" + echo "BOARD_LIST: $BOARD_LIST" + echo "=====================================================================" +} + +function print_helper() { + echo + echo "========================= Command Helper ============================" + echo "./build_release.sh -s source_dir -i install_dir --board target1 targert2 ..." + echo "=====================================================================" + echo +} + +standardize_pkg_config_path(){ + if [[ ! -f $1 ]]; then echo "file $1 not exsist."; exit 0; fi + sed -i '1c prefix=\/usr' $* +} + +function build_target() { + rm -fr build && mkdir -p build && cd build + + local target=$1 + export IPU_VERSION= + if [ "$target" = "ipu_tgl" ]; then + IPU_VERSION=ipu6 + elif [ "$target" = "ipu_adl" ]; then + IPU_VERSION=ipu6ep + elif [ "$target" = "ipu_mtl" ]; then + IPU_VERSION=ipu6epmtl + else + echo "Error: unsupport the target name : $target" + exit -1 + fi + + # indicate the install folder of binary package + # export PKG_CONFIG_PATH=~/work/linux/camera_submit/camera/out/install/lib/$target/pkgconfig:$PKG_CONFIG_PATH + export PKG_CONFIG_PATH=/usr/lib/$target/pkgconfig:$PKG_CONFIG_PATH + + command cmake -DCMAKE_BUILD_TYPE=Release \ + -DIPU_VER=$IPU_VERSION \ + -DBUILD_CAMHAL_TESTS=OFF \ + -DUSE_PG_LITE_PIPE=ON \ + -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR/install \ + -DCMAKE_INSTALL_SUB_PATH=$target .. + + # make and install + make -j`nproc` + check_result $? "$FUNCNAME: $target" + + make install + check_result $? "$FUNCNAME: $target" + standardize_pkg_config_path ${INSTALL_DIR}/install/lib/${target}/pkgconfig/libcamhal.pc + cd .. +} + +function build_hal() { + cd $SOURCE_DIR/ipu6-camera-hal + + for target in $BOARD_LIST + do + build_target $target + done +} + +function build_hal_adaptor() { + cd $SOURCE_DIR/ipu6-camera-hal/src/hal/hal_adaptor + rm -fr build && mkdir -p build && cd build + + command cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR/install ../ + + # make and install + make -j + check_result $? $FUNCNAME + + make install + check_result $? $FUNCNAME + standardize_pkg_config_path ${INSTALL_DIR}/install/lib/pkgconfig/hal_adaptor.pc +} + +function build_icamerasrc() { + cd $SOURCE_DIR/icamerasrc/ + + export CAMHAL_LIBS="-L$INSTALL_DIR/install/lib -lhal_adaptor" + export CAMHAL_CFLAGS="-I$INSTALL_DIR/install/include/hal_adaptor \ + -I$INSTALL_DIR/install/include/hal_adaptor/api \ + -I$INSTALL_DIR/install/include/hal_adaptor/utils \ + -I$INSTALL_DIR/install/include/hal_adaptor/linux" + export CHROME_SLIM_CAMHAL=ON + export PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:${PKG_CONFIG_PATH}" + + rm -fr config.h.in autom4te.cache/ aclocal.m4 *-libtool config.guess compile \ + config.sub configure depcomp install-sh ltmain.sh m4 + autoreconf --install + CFLAGS="-O2" CXXFLAGS="-O2" ./configure --with-haladaptor=yes ${CONFIGURE_FLAGS} \ + --prefix=$INSTALL_DIR/install DEFAULT_CAMERA=0 + check_result $? $FUNCNAME + + make clean + make -j + check_result $? $FUNCNAME + + make install + check_result $? $FUNCNAME + find $INSTALL_DIR/install/ -name "*.la" -exec rm -f "{}" \; + standardize_pkg_config_path ${INSTALL_DIR}/install/lib/pkgconfig/libgsticamerasrc.pc +} + +function main () { + parse_argument $@ + if [ -z "$SOURCE_DIR" ] || [ -z "$INSTALL_DIR" ] || [ -z "$BOARD_LIST" ]; then + print_helper + exit 1 + fi + rm -fr $INSTALL_DIR/install $INSTALL_DIR/rpm && mkdir -p $INSTALL_DIR/install $INSTALL_DIR/rpm + build_hal + build_hal_adaptor + build_icamerasrc + + # TODO: Generate the RPM for hal, hal_adaptor and icamerasrc together +} + +main $@ diff --git a/cmake/FindIA_IMAGING.cmake b/cmake/FindIA_IMAGING.cmake index 6ad61c6c..05afd78e 100644 --- a/cmake/FindIA_IMAGING.cmake +++ b/cmake/FindIA_IMAGING.cmake @@ -42,6 +42,9 @@ find_library(IA_EXC_LIB ia_exc) find_library(IA_MKN_LIB ia_mkn) # SENSOR_EMD_DECODER find_library(IA_EMD_LIB ia_emd_decoder) +# DOL_FEATURE_S +find_library(IA_BCOMP_LIB ia_bcomp) +# DOL_FEATURE_E find_library(IA_NVM_LIB ia_nvm) find_library(IA_LOG_LIB ia_log) find_library(IA_DVS_LIB ia_dvs) diff --git a/cmake/libcamhal.pc.cmakein b/cmake/libcamhal.pc.cmakein index ceeaa881..b63d711a 100644 --- a/cmake/libcamhal.pc.cmakein +++ b/cmake/libcamhal.pc.cmakein @@ -1,7 +1,7 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include/libcamhal +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix}/@CMAKE_INSTALL_SUB_PATH@ +libdir=${prefix}/lib/@CMAKE_INSTALL_SUB_PATH@ +includedir=${prefix}/include/@CMAKE_INSTALL_SUB_PATH@/libcamhal Name: libcamhal Description: Camera HAL Library diff --git a/config/linux/ipu6/0315_imx274_wfov.IPU6.aiqb b/config/linux/ipu6/0315_imx274_wfov.IPU6.aiqb new file mode 100644 index 00000000..59a0bee9 Binary files /dev/null and b/config/linux/ipu6/0315_imx274_wfov.IPU6.aiqb differ diff --git a/config/linux/ipu6/AR0234_BARCODE_TGL.aiqb b/config/linux/ipu6/AR0234_BARCODE_TGL.aiqb new file mode 100644 index 00000000..0eab4246 Binary files /dev/null and b/config/linux/ipu6/AR0234_BARCODE_TGL.aiqb differ diff --git a/config/linux/ipu6/AR0234_TGL_10bits.aiqb b/config/linux/ipu6/AR0234_TGL_10bits.aiqb new file mode 100644 index 00000000..51c3409a Binary files /dev/null and b/config/linux/ipu6/AR0234_TGL_10bits.aiqb differ diff --git a/config/linux/ipu6/IMX135_13P2BAD33_TGL.aiqb b/config/linux/ipu6/IMX135_13P2BAD33_TGL.aiqb new file mode 100644 index 00000000..a977662b Binary files /dev/null and b/config/linux/ipu6/IMX135_13P2BAD33_TGL.aiqb differ diff --git a/config/linux/ipu6/IMX390_HDR_TGL.aiqb b/config/linux/ipu6/IMX390_HDR_TGL.aiqb new file mode 100644 index 00000000..2df11318 Binary files /dev/null and b/config/linux/ipu6/IMX390_HDR_TGL.aiqb differ diff --git a/config/linux/ipu6/IMX390_HDR_TGL_2.aiqb b/config/linux/ipu6/IMX390_HDR_TGL_2.aiqb new file mode 100644 index 00000000..2df11318 Binary files /dev/null and b/config/linux/ipu6/IMX390_HDR_TGL_2.aiqb differ diff --git a/config/linux/ipu6/IMX477_MOD255I_DOL_TGL.aiqb b/config/linux/ipu6/IMX477_MOD255I_DOL_TGL.aiqb new file mode 100644 index 00000000..77409882 Binary files /dev/null and b/config/linux/ipu6/IMX477_MOD255I_DOL_TGL.aiqb differ diff --git a/config/linux/ipu6/IMX477_MOD26552_BAYER_TGL.aiqb b/config/linux/ipu6/IMX477_MOD26552_BAYER_TGL.aiqb new file mode 100644 index 00000000..0ea2cd75 Binary files /dev/null and b/config/linux/ipu6/IMX477_MOD26552_BAYER_TGL.aiqb differ diff --git a/config/linux/ipu6/IMX477_MOD26552_WFOV_TGL.aiqb b/config/linux/ipu6/IMX477_MOD26552_WFOV_TGL.aiqb new file mode 100644 index 00000000..f3e5b3a3 Binary files /dev/null and b/config/linux/ipu6/IMX477_MOD26552_WFOV_TGL.aiqb differ diff --git a/config/linux/ipu6/gcss/graph_settings_ar0234.xml b/config/linux/ipu6/gcss/graph_settings_ar0234.xml new file mode 100644 index 00000000..d32233ec --- /dev/null +++ b/config/linux/ipu6/gcss/graph_settings_ar0234.xml @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6/gcss/graph_settings_external_source.xml b/config/linux/ipu6/gcss/graph_settings_external_source.xml new file mode 100644 index 00000000..a25b82fc --- /dev/null +++ b/config/linux/ipu6/gcss/graph_settings_external_source.xml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + legacy + true + + + diff --git a/config/linux/ipu6/gcss/graph_settings_imx390.xml b/config/linux/ipu6/gcss/graph_settings_imx390.xml new file mode 100644 index 00000000..321e4884 --- /dev/null +++ b/config/linux/ipu6/gcss/graph_settings_imx390.xml @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6/gcss/graph_settings_usb.xml b/config/linux/ipu6/gcss/graph_settings_usb.xml new file mode 100644 index 00000000..b38fa1e5 --- /dev/null +++ b/config/linux/ipu6/gcss/graph_settings_usb.xml @@ -0,0 +1,329 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + legacy + true + + + diff --git a/config/linux/ipu6/libcamhal_profile.xml b/config/linux/ipu6/libcamhal_profile.xml index 87b2e53a..23ffd607 100644 --- a/config/linux/ipu6/libcamhal_profile.xml +++ b/config/linux/ipu6/libcamhal_profile.xml @@ -1,5 +1,5 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6/sensors/ar0234_usb.xml b/config/linux/ipu6/sensors/ar0234_usb.xml new file mode 100755 index 00000000..02a10f0a --- /dev/null +++ b/config/linux/ipu6/sensors/ar0234_usb.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6/sensors/external_source.xml b/config/linux/ipu6/sensors/external_source.xml new file mode 100644 index 00000000..9949e22e --- /dev/null +++ b/config/linux/ipu6/sensors/external_source.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6/sensors/imx390.xml b/config/linux/ipu6/sensors/imx390.xml new file mode 100644 index 00000000..4bd6dbb7 --- /dev/null +++ b/config/linux/ipu6/sensors/imx390.xml @@ -0,0 +1,900 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6/sensors/lt6911uxc.xml b/config/linux/ipu6/sensors/lt6911uxc.xml new file mode 100644 index 00000000..c45cd3c2 --- /dev/null +++ b/config/linux/ipu6/sensors/lt6911uxc.xml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6/tunning_profiles.xml b/config/linux/ipu6/tunning_profiles.xml new file mode 100644 index 00000000..f1bc2c1f --- /dev/null +++ b/config/linux/ipu6/tunning_profiles.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/AR0234_TGL_10bits.aiqb b/config/linux/ipu6ep/AR0234_TGL_10bits.aiqb new file mode 100644 index 00000000..51c3409a Binary files /dev/null and b/config/linux/ipu6ep/AR0234_TGL_10bits.aiqb differ diff --git a/config/linux/ipu6ep/IMX390_HDR_TGL.aiqb b/config/linux/ipu6ep/IMX390_HDR_TGL.aiqb new file mode 100644 index 00000000..2df11318 Binary files /dev/null and b/config/linux/ipu6ep/IMX390_HDR_TGL.aiqb differ diff --git a/config/linux/ipu6ep/IMX390_HDR_TGL_2.aiqb b/config/linux/ipu6ep/IMX390_HDR_TGL_2.aiqb new file mode 100644 index 00000000..2df11318 Binary files /dev/null and b/config/linux/ipu6ep/IMX390_HDR_TGL_2.aiqb differ diff --git a/config/linux/ipu6ep/OV08A10_YHUT_ADL.aiqb b/config/linux/ipu6ep/OV08A10_YHUT_ADL.aiqb new file mode 100644 index 00000000..aa833866 Binary files /dev/null and b/config/linux/ipu6ep/OV08A10_YHUT_ADL.aiqb differ diff --git a/config/linux/ipu6ep/gcss/graph_settings_OV08A10_YHUT_ADL.xml b/config/linux/ipu6ep/gcss/graph_settings_OV08A10_YHUT_ADL.xml new file mode 100644 index 00000000..f82bc98a --- /dev/null +++ b/config/linux/ipu6ep/gcss/graph_settings_OV08A10_YHUT_ADL.xml @@ -0,0 +1,9513 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/gcss/graph_settings_ar0234.xml b/config/linux/ipu6ep/gcss/graph_settings_ar0234.xml new file mode 100644 index 00000000..040e423a --- /dev/null +++ b/config/linux/ipu6ep/gcss/graph_settings_ar0234.xml @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/gcss/graph_settings_external_source.xml b/config/linux/ipu6ep/gcss/graph_settings_external_source.xml new file mode 100644 index 00000000..a25b82fc --- /dev/null +++ b/config/linux/ipu6ep/gcss/graph_settings_external_source.xml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + legacy + true + + + diff --git a/config/linux/ipu6ep/gcss/graph_settings_imx390.xml b/config/linux/ipu6ep/gcss/graph_settings_imx390.xml new file mode 100644 index 00000000..321e4884 --- /dev/null +++ b/config/linux/ipu6ep/gcss/graph_settings_imx390.xml @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/gcss/graph_settings_usb.xml b/config/linux/ipu6ep/gcss/graph_settings_usb.xml new file mode 100644 index 00000000..f244c832 --- /dev/null +++ b/config/linux/ipu6ep/gcss/graph_settings_usb.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/libcamhal_profile.xml b/config/linux/ipu6ep/libcamhal_profile.xml index 1ccd696a..14b32bed 100644 --- a/config/linux/ipu6ep/libcamhal_profile.xml +++ b/config/linux/ipu6ep/libcamhal_profile.xml @@ -1,5 +1,5 @@ - - + + diff --git a/config/linux/ipu6ep/ov13b10.aiqb b/config/linux/ipu6ep/ov13b10.aiqb new file mode 100644 index 00000000..b1428c69 Binary files /dev/null and b/config/linux/ipu6ep/ov13b10.aiqb differ diff --git a/config/linux/ipu6ep/ov8856.aiqb b/config/linux/ipu6ep/ov8856.aiqb new file mode 100644 index 00000000..97d8ff72 Binary files /dev/null and b/config/linux/ipu6ep/ov8856.aiqb differ diff --git a/config/linux/ipu6ep/psys_policy_profiles.xml b/config/linux/ipu6ep/psys_policy_profiles.xml index f690d31f..a75ecf88 100644 --- a/config/linux/ipu6ep/psys_policy_profiles.xml +++ b/config/linux/ipu6ep/psys_policy_profiles.xml @@ -1,5 +1,5 @@ - - - + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/ar0234.xml b/config/linux/ipu6ep/sensors/ar0234.xml new file mode 100644 index 00000000..52c444ff --- /dev/null +++ b/config/linux/ipu6ep/sensors/ar0234.xml @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/ar0234_usb.xml b/config/linux/ipu6ep/sensors/ar0234_usb.xml new file mode 100755 index 00000000..26f5068d --- /dev/null +++ b/config/linux/ipu6ep/sensors/ar0234_usb.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/external_source.xml b/config/linux/ipu6ep/sensors/external_source.xml new file mode 100644 index 00000000..6c85981b --- /dev/null +++ b/config/linux/ipu6ep/sensors/external_source.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/imx390.xml b/config/linux/ipu6ep/sensors/imx390.xml new file mode 100644 index 00000000..ceb8cac0 --- /dev/null +++ b/config/linux/ipu6ep/sensors/imx390.xml @@ -0,0 +1,1085 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/lt6911uxc.xml b/config/linux/ipu6ep/sensors/lt6911uxc.xml new file mode 100644 index 00000000..0f2f0c1c --- /dev/null +++ b/config/linux/ipu6ep/sensors/lt6911uxc.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/lt6911uxe.xml b/config/linux/ipu6ep/sensors/lt6911uxe.xml new file mode 100644 index 00000000..f9d5dd06 --- /dev/null +++ b/config/linux/ipu6ep/sensors/lt6911uxe.xml @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/ov08a10-uf.xml b/config/linux/ipu6ep/sensors/ov08a10-uf.xml new file mode 100644 index 00000000..3cd03672 --- /dev/null +++ b/config/linux/ipu6ep/sensors/ov08a10-uf.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/tunning_profiles.xml b/config/linux/ipu6ep/tunning_profiles.xml new file mode 100644 index 00000000..f1bc2c1f --- /dev/null +++ b/config/linux/ipu6ep/tunning_profiles.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/AR0234_TGL_10bits.aiqb b/config/linux/ipu6epmtl/AR0234_TGL_10bits.aiqb new file mode 100644 index 00000000..51c3409a Binary files /dev/null and b/config/linux/ipu6epmtl/AR0234_TGL_10bits.aiqb differ diff --git a/config/linux/ipu6epmtl/IMX390_HDR_TGL.aiqb b/config/linux/ipu6epmtl/IMX390_HDR_TGL.aiqb new file mode 100644 index 00000000..2df11318 Binary files /dev/null and b/config/linux/ipu6epmtl/IMX390_HDR_TGL.aiqb differ diff --git a/config/linux/ipu6epmtl/OV13B10_09B13_MTL_PDAF_DPC_T3.aiqb b/config/linux/ipu6epmtl/OV13B10_09B13_MTL_PDAF_DPC_T3.aiqb new file mode 100644 index 00000000..06c9b7ce Binary files /dev/null and b/config/linux/ipu6epmtl/OV13B10_09B13_MTL_PDAF_DPC_T3.aiqb differ diff --git a/config/linux/ipu6epmtl/gcss/graph_descriptor.xml b/config/linux/ipu6epmtl/gcss/graph_descriptor.xml new file mode 100644 index 00000000..5108edd4 --- /dev/null +++ b/config/linux/ipu6epmtl/gcss/graph_descriptor.xml @@ -0,0 +1,15238 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/linux/ipu6epmtl/gcss/graph_settings_OV13B10_09B13_DPC_T3_MTL.xml b/config/linux/ipu6epmtl/gcss/graph_settings_OV13B10_09B13_DPC_T3_MTL.xml new file mode 100644 index 00000000..a1de3c8f --- /dev/null +++ b/config/linux/ipu6epmtl/gcss/graph_settings_OV13B10_09B13_DPC_T3_MTL.xml @@ -0,0 +1,18602 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/gcss/graph_settings_ar0234.xml b/config/linux/ipu6epmtl/gcss/graph_settings_ar0234.xml new file mode 100644 index 00000000..040e423a --- /dev/null +++ b/config/linux/ipu6epmtl/gcss/graph_settings_ar0234.xml @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/gcss/graph_settings_external_source.xml b/config/linux/ipu6epmtl/gcss/graph_settings_external_source.xml new file mode 100644 index 00000000..a25b82fc --- /dev/null +++ b/config/linux/ipu6epmtl/gcss/graph_settings_external_source.xml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + legacy + true + + + diff --git a/config/linux/ipu6epmtl/gcss/graph_settings_hm2172_ASG205N3_MTL.xml b/config/linux/ipu6epmtl/gcss/graph_settings_hm2172_ASG205N3_MTL.xml new file mode 100644 index 00000000..e437ba90 --- /dev/null +++ b/config/linux/ipu6epmtl/gcss/graph_settings_hm2172_ASG205N3_MTL.xml @@ -0,0 +1,3262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/gcss/graph_settings_imx390.xml b/config/linux/ipu6epmtl/gcss/graph_settings_imx390.xml new file mode 100644 index 00000000..321e4884 --- /dev/null +++ b/config/linux/ipu6epmtl/gcss/graph_settings_imx390.xml @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/gcss/graph_settings_ov5675.xml b/config/linux/ipu6epmtl/gcss/graph_settings_ov5675.xml new file mode 100644 index 00000000..13c40bb4 --- /dev/null +++ b/config/linux/ipu6epmtl/gcss/graph_settings_ov5675.xml @@ -0,0 +1,8269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/gcss/graph_settings_usb.xml b/config/linux/ipu6epmtl/gcss/graph_settings_usb.xml new file mode 100644 index 00000000..f244c832 --- /dev/null +++ b/config/linux/ipu6epmtl/gcss/graph_settings_usb.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/hm2172_ASG205N3_MTL.aiqb b/config/linux/ipu6epmtl/hm2172_ASG205N3_MTL.aiqb new file mode 100644 index 00000000..5ad66da9 Binary files /dev/null and b/config/linux/ipu6epmtl/hm2172_ASG205N3_MTL.aiqb differ diff --git a/config/linux/ipu6epmtl/libcamhal_profile.xml b/config/linux/ipu6epmtl/libcamhal_profile.xml new file mode 100644 index 00000000..9270dd6f --- /dev/null +++ b/config/linux/ipu6epmtl/libcamhal_profile.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/ov5675.aiqb b/config/linux/ipu6epmtl/ov5675.aiqb new file mode 100644 index 00000000..7eabfa0d Binary files /dev/null and b/config/linux/ipu6epmtl/ov5675.aiqb differ diff --git a/config/linux/ipu6epmtl/psys_policy_profiles.xml b/config/linux/ipu6epmtl/psys_policy_profiles.xml new file mode 100644 index 00000000..8091bfe2 --- /dev/null +++ b/config/linux/ipu6epmtl/psys_policy_profiles.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/ar0234.xml b/config/linux/ipu6epmtl/sensors/ar0234.xml new file mode 100644 index 00000000..52c444ff --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/ar0234.xml @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/ar0234_usb.xml b/config/linux/ipu6epmtl/sensors/ar0234_usb.xml new file mode 100755 index 00000000..26f5068d --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/ar0234_usb.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/external_source.xml b/config/linux/ipu6epmtl/sensors/external_source.xml new file mode 100644 index 00000000..6c85981b --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/external_source.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/hm2172-uf.xml b/config/linux/ipu6epmtl/sensors/hm2172-uf.xml new file mode 100644 index 00000000..ed7b4638 --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/hm2172-uf.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/imx390.xml b/config/linux/ipu6epmtl/sensors/imx390.xml new file mode 100644 index 00000000..ceb8cac0 --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/imx390.xml @@ -0,0 +1,1085 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/lt6911uxc.xml b/config/linux/ipu6epmtl/sensors/lt6911uxc.xml new file mode 100644 index 00000000..390eacdd --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/lt6911uxc.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/lt6911uxe.xml b/config/linux/ipu6epmtl/sensors/lt6911uxe.xml new file mode 100644 index 00000000..d0ce0dfc --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/lt6911uxe.xml @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/ov13b10-uf.xml b/config/linux/ipu6epmtl/sensors/ov13b10-uf.xml new file mode 100644 index 00000000..a5187a7c --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/ov13b10-uf.xml @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/ov13b10-wf.xml b/config/linux/ipu6epmtl/sensors/ov13b10-wf.xml new file mode 100644 index 00000000..4a632390 --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/ov13b10-wf.xml @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/ov5675-uf.xml b/config/linux/ipu6epmtl/sensors/ov5675-uf.xml new file mode 100644 index 00000000..f12183e2 --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/ov5675-uf.xml @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/tunning_profiles.xml b/config/linux/ipu6epmtl/tunning_profiles.xml new file mode 100644 index 00000000..f1bc2c1f --- /dev/null +++ b/config/linux/ipu6epmtl/tunning_profiles.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + diff --git a/config/linux/ipu6sepla/gcss/graph_descriptor.xml b/config/linux/ipu6sepla/gcss/graph_descriptor.xml new file mode 100644 index 00000000..93226830 --- /dev/null +++ b/config/linux/ipu6sepla/gcss/graph_descriptor.xml @@ -0,0 +1,1965 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6sepla/gcss/graph_settings_OV13858_YHCE_JSLP.xml b/config/linux/ipu6sepla/gcss/graph_settings_OV13858_YHCE_JSLP.xml new file mode 100644 index 00000000..70285a3c --- /dev/null +++ b/config/linux/ipu6sepla/gcss/graph_settings_OV13858_YHCE_JSLP.xml @@ -0,0 +1,629 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6sepla/libcamhal_profile.xml b/config/linux/ipu6sepla/libcamhal_profile.xml new file mode 100644 index 00000000..471609b5 --- /dev/null +++ b/config/linux/ipu6sepla/libcamhal_profile.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/config/linux/ipu6sepla/psys_policy_profiles.xml b/config/linux/ipu6sepla/psys_policy_profiles.xml new file mode 100644 index 00000000..d5cf006a --- /dev/null +++ b/config/linux/ipu6sepla/psys_policy_profiles.xml @@ -0,0 +1,23 @@ + + + + + + + + + + diff --git a/config/linux/ipu6sepla/sensors/ov13858-uf.xml b/config/linux/ipu6sepla/sensors/ov13858-uf.xml new file mode 100644 index 00000000..b27ea2eb --- /dev/null +++ b/config/linux/ipu6sepla/sensors/ov13858-uf.xml @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/rules.d/60-intel-ipu-adlp.rules b/config/linux/rules.d/60-intel-ipu-adlp.rules deleted file mode 100644 index d6a5df1b..00000000 --- a/config/linux/rules.d/60-intel-ipu-adlp.rules +++ /dev/null @@ -1,57 +0,0 @@ -# aiqb -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libtbd.so.0.0.0 /usr/lib/libtbd.so.0.0.0" - -# libiaaiq -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libSkyCamAIC.so /usr/lib/libSkyCamAIC.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libSkyCamAICKBL.so /usr/lib/libSkyCamAICKBL.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libStatsConverter.so /usr/lib/libStatsConverter.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libbroxton_ia_pal.so /usr/lib/libbroxton_ia_pal.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_aec.so /usr/lib/libia_aec.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_aic.so /usr/lib/libia_aic.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_aic_engine.so /usr/lib/libia_aic_engine.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_aic_myriad.so /usr/lib/libia_aic_myriad.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_aiq.so /usr/lib/libia_aiq.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_aiq_file_debug.so /usr/lib/libia_aiq_file_debug.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_aiqb_parser.so /usr/lib/libia_aiqb_parser.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_bcomp.so /usr/lib/libia_bcomp.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_cca.so /usr/lib/libia_cca.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_cca_file_debug.so /usr/lib/libia_cca_file_debug.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_ccat.so /usr/lib/libia_ccat.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_cmc_parser.so /usr/lib/libia_cmc_parser.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_coordinate.so /usr/lib/libia_coordinate.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_dpc.so /usr/lib/libia_dpc.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_dvs.so /usr/lib/libia_dvs.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_dvs_file_debug.so /usr/lib/libia_dvs_file_debug.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_emd_decoder.so /usr/lib/libia_emd_decoder.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_exc.so /usr/lib/libia_exc.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_intrinsics.so /usr/lib/libia_intrinsics.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_isp_bxt.so /usr/lib/libia_isp_bxt.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_isp_bxt_file_debug.so /usr/lib/libia_isp_bxt_file_debug.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_lard.so /usr/lib/libia_lard.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_log.so /usr/lib/libia_log.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_ltm.so /usr/lib/libia_ltm.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_ltm_file_debug.so /usr/lib/libia_ltm_file_debug.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_me_corner.so /usr/lib/libia_me_corner.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_mkn.so /usr/lib/libia_mkn.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_nvm.so /usr/lib/libia_nvm.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_ob.so /usr/lib/libia_ob.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_pd.so /usr/lib/libia_pd.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_view.so /usr/lib/libia_view.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libpvl_blink_detection.so /usr/lib/libpvl_blink_detection.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libpvl_eye_detection.so /usr/lib/libpvl_eye_detection.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libpvl_face_detection.so /usr/lib/libpvl_face_detection.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libpvl_face_recognition.so /usr/lib/libpvl_face_recognition.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libpvl_mouth_detection.so /usr/lib/libpvl_mouth_detection.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libpvl_object_tracking.so /usr/lib/libpvl_object_tracking.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libpvl_smile_detection.so /usr/lib/libpvl_smile_detection.so" - -# libiacss -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libcisu.so.0.0.0 /usr/lib/libcisu.so.0.0.0" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libcisu_os_plugin.so.1.0.0 /usr/lib/libcisu_os_plugin.so.1.0.0" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libgcss.so.0.0.0 /usr/lib/libgcss.so.0.0.0" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_camera.so.0.0.0 /usr/lib/libia_camera.so.0.0.0" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libia_cipf.so.0.0.0 /usr/lib/libia_cipf.so.0.0.0" - -# libcamhal -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/lib/ipu6ep/libcamhal.so /usr/lib/libcamhal.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x465d", RUN+="/bin/ln -sf /usr/share/defaults/etc/ipu6ep/camera /usr/share/defaults/etc/camera" \ No newline at end of file diff --git a/config/linux/rules.d/60-intel-ipu-tglu.rules b/config/linux/rules.d/60-intel-ipu-tglu.rules deleted file mode 100644 index b56bbf75..00000000 --- a/config/linux/rules.d/60-intel-ipu-tglu.rules +++ /dev/null @@ -1,57 +0,0 @@ -# aiqb -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libtbd.so.0.0.0 /usr/lib/libtbd.so.0.0.0" - -# libiaaiq -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libSkyCamAIC.so /usr/lib/libSkyCamAIC.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libSkyCamAICKBL.so /usr/lib/libSkyCamAICKBL.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libStatsConverter.so /usr/lib/libStatsConverter.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libbroxton_ia_pal.so /usr/lib/libbroxton_ia_pal.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_aec.so /usr/lib/libia_aec.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_aic.so /usr/lib/libia_aic.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_aic_engine.so /usr/lib/libia_aic_engine.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_aic_myriad.so /usr/lib/libia_aic_myriad.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_aiq.so /usr/lib/libia_aiq.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_aiq_file_debug.so /usr/lib/libia_aiq_file_debug.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_aiqb_parser.so /usr/lib/libia_aiqb_parser.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_bcomp.so /usr/lib/libia_bcomp.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_cca.so /usr/lib/libia_cca.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_cca_file_debug.so /usr/lib/libia_cca_file_debug.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_ccat.so /usr/lib/libia_ccat.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_cmc_parser.so /usr/lib/libia_cmc_parser.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_coordinate.so /usr/lib/libia_coordinate.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_dpc.so /usr/lib/libia_dpc.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_dvs.so /usr/lib/libia_dvs.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_dvs_file_debug.so /usr/lib/libia_dvs_file_debug.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_emd_decoder.so /usr/lib/libia_emd_decoder.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_exc.so /usr/lib/libia_exc.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_intrinsics.so /usr/lib/libia_intrinsics.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_isp_bxt.so /usr/lib/libia_isp_bxt.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_isp_bxt_file_debug.so /usr/lib/libia_isp_bxt_file_debug.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_lard.so /usr/lib/libia_lard.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_log.so /usr/lib/libia_log.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_ltm.so /usr/lib/libia_ltm.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_ltm_file_debug.so /usr/lib/libia_ltm_file_debug.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_me_corner.so /usr/lib/libia_me_corner.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_mkn.so /usr/lib/libia_mkn.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_nvm.so /usr/lib/libia_nvm.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_ob.so /usr/lib/libia_ob.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_pd.so /usr/lib/libia_pd.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_view.so /usr/lib/libia_view.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libpvl_blink_detection.so /usr/lib/libpvl_blink_detection.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libpvl_eye_detection.so /usr/lib/libpvl_eye_detection.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libpvl_face_detection.so /usr/lib/libpvl_face_detection.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libpvl_face_recognition.so /usr/lib/libpvl_face_recognition.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libpvl_mouth_detection.so /usr/lib/libpvl_mouth_detection.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libpvl_object_tracking.so /usr/lib/libpvl_object_tracking.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libpvl_smile_detection.so /usr/lib/libpvl_smile_detection.so" - -# libiacss -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libcisu.so.0.0.0 /usr/lib/libcisu.so.0.0.0" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libcisu_os_plugin.so.1.0.0 /usr/lib/libcisu_os_plugin.so.1.0.0" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libgcss.so.0.0.0 /usr/lib/libgcss.so.0.0.0" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_camera.so.0.0.0 /usr/lib/libia_camera.so.0.0.0" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libia_cipf.so.0.0.0 /usr/lib/libia_cipf.so.0.0.0" - -# libcamhal -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/lib/ipu6/libcamhal.so /usr/lib/libcamhal.so" -SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x9a19", RUN+="/bin/ln -sf /usr/share/defaults/etc/ipu6/camera /usr/share/defaults/etc/camera" diff --git a/include/api/ICamera.h b/include/api/ICamera.h index 4bc8ca32..10ca2284 100644 --- a/include/api/ICamera.h +++ b/include/api/ICamera.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,6 +68,11 @@ * Version 0.61 Add API camera_callback_register() to notify event to AAL ******************************************************************************* * Version 0.62 Add sequence in camera_get_parameters to fetch settings + ******************************************************************************* + * Version 0.63 Merge camera_device_open API with/without vc_num together + * ------------------------------------------------------------------------------ + ******************************************************************************* + * Version 0.64 Remove deprecated VC API * ------------------------------------------------------------------------------ * */ @@ -81,6 +86,18 @@ extern "C" { namespace icamera { +// VIRTUAL_CHANNEL_S +/** + * \struct vc_info_t: Define the virtual channel information for the device + */ +typedef struct { + int total_num; /**< the total camera number of virtual channel. 0: the virtual channel is + disabled */ + int sequence; /**< the current camera's sequence in all the virtual channel cameras */ + int group; /**< the virtual channel group id */ +} vc_info_t; +// VIRTUAL_CHANNEL_E + /** * \struct camera_info_t: Define each camera basic information */ @@ -91,6 +108,9 @@ typedef struct { const char* name; /**< Sensor name */ const char* description; /**< Sensor description */ const Parameters* capability; /**< camera capability */ + // VIRTUAL_CHANNEL_S + vc_info_t vc; /**< Virtual Channel information */ + // VIRTUAL_CHANNEL_E } camera_info_t; /** @@ -194,6 +214,10 @@ void camera_callback_register(int camera_id, const camera_callback_ops_t* callba * * \param[in] * int camera_id: ID of the camera + // VIRTUAL_CHANNEL_S + * \param[in] + * int vc_num: the total virtual channel camera number to be opened, default value is 0 + // VIRTUAL_CHANNEL_E * * \return * 0 succeed to open camera device @@ -207,7 +231,7 @@ void camera_callback_register(int camera_id, const camera_callback_ops_t* callba * int ret = camera_device_open(camera_id); * \endcode **/ -int camera_device_open(int camera_id); +int camera_device_open(int camera_id, int vc_num = 0); /** * \brief diff --git a/include/api/Parameters.h b/include/api/Parameters.h index de1507c5..b2f7ab1d 100644 --- a/include/api/Parameters.h +++ b/include/api/Parameters.h @@ -726,6 +726,7 @@ typedef enum { CAMERA_METADATA_READY, CAMERA_DEVICE_ERROR, CAMERA_IPC_ERROR, + CAMERA_METADATA_ENTRY, } camera_msg_type_t; /** @@ -768,6 +769,22 @@ typedef struct { int64_t sequence; } metadata_ready_t; +/** + * \struct metadata_entry_t: Use to set metadata entry. + */ +typedef struct { + uint32_t tag; + uint32_t frameNumber; + size_t count; + union { + const uint8_t* u8; + const int32_t* i32; + const float* f; + const int64_t* i64; + const double* d; + } data; +} metadata_entry_t; + /** * \struct camera_msg_data_t: Use to specify msg data. */ @@ -776,6 +793,7 @@ typedef struct { union { isp_buffer_ready_t buffer_ready; metadata_ready_t metadata_ready; + metadata_entry_t metadata_entry; } data; } camera_msg_data_t; @@ -1930,6 +1948,26 @@ class Parameters { int setIrisLevel(int level); int getIrisLevel(int& level); + // HDR_FEATURE_S + /** + * \brief Set WDR mode + * + * \param[in] camera_wdr_mode_t wdrMode + * + * \return 0 if set successfully, otherwise non-0 value is returned. + */ + int setWdrMode(camera_wdr_mode_t wdrMode); + + /** + * \brief Get WDR mode currently used. + * + * \param[out] camera_wdr_mode_t& wdrMode + * + * \return 0 if awb mode was set, non-0 means no awb mode was set. + */ + int getWdrMode(camera_wdr_mode_t& wdrMode) const; + // HDR_FEATURE_E + /** * \brief Set WDR Level * @@ -2687,6 +2725,24 @@ class Parameters { */ int getRawDataOutput(raw_data_output_t& mode) const; + /** + * \brief Set HDR ratio + * + * \param[in] float + * + * \return 0 if set successfully, otherwise non-0 value is returned. + */ + int setHdrRatio(float hdrRatio); + + /** + * \brief Get HDR ratio + * + * \param[out] float + * + * \return 0 if HDR ratio was set, otherwise non-0 value is returned. + */ + int getHdrRatio(float& hdrRatio) const; + /** * \brief Set total exposure target * @@ -2777,101 +2833,42 @@ class Parameters { */ int getCallbackTmCurve(bool* enabled) const; - // ENABLE_EVCP_S - /** - * \brief Set EVCP ECC status - * - * \param[in] int enabled - * - * \return 0 if set successfully, otherwise non-0 value is returned. - */ - int setEvcpEccMode(uint8_t enabled); - /** - * \brief Get EVCP ECC enable status - * - * \param[out] int enabled - * - * \return 0 if flag was set, otherwise non-0 value is returned. - */ - int getEvcpEccMode(uint8_t* enabled) const; - /** - * \brief Set EVCP BC Mode + * \brief Set scale & crop region * - * \param[in] uint8_t Mode + * \param[in] camera_zoom_region_t region * * \return 0 if set successfully, otherwise non-0 value is returned. */ - int setEvcpBCMode(uint8_t mode); - - /** - * \brief Get EVCP BC Mode - * - * \param[out] uint8_t mode - * - * \return 0 if flag was set, otherwise non-0 value is returned. - */ - int getEvcpBCMode(uint8_t* mode) const; + int setZoomRegion(const camera_zoom_region_t& region); /** - * \brief Set EVCP BR Parameters - * - * \param[in] int height - * \param[in] int width - * \param[in] int fd - * - * \return 0 if set successfully, otherwise non-0 value is returned. - */ - int setEvcpBRParameters(int height, int width, int fd); - /** - * \brief Get EVCP BR Parameters + * \brief Get scale & crop region * - * \param[out] int height - * \param[out] int width - * \param[out] int fd + * \param[in] camera_zoom_region_t region * * \return 0 if flag was set, otherwise non-0 value is returned. */ - int getEvcpBRParameters(int* height, int* width, int* fd) const; + int getZoomRegion(camera_zoom_region_t* region) const; + // LEVEL0_ICBM_S /** - * \brief Set EVCP FF Mode + * \brief Set ICBM FF Mode * * \param[in] uint8_t Mode * * \return 0 if set successfully, otherwise non-0 value is returned. */ - int setEvcpFFMode(uint8_t mode); + int setICBMUFMode(uint8_t mode); /** - * \brief Get EVCP FF Mode + * \brief Get ICBM UF Mode * * \param[out] uint8_t mode * * \return 0 if flag was set, otherwise non-0 value is returned. */ - int getEvcpFFMode(uint8_t* mode) const; - // ENABLE_EVCP_E - - /** - * \brief Set scale & crop region - * - * \param[in] camera_zoom_region_t region - * - * \return 0 if set successfully, otherwise non-0 value is returned. - */ - int setZoomRegion(const camera_zoom_region_t& region); - - /** - * \brief Get scale & crop region - * - * \param[in] camera_zoom_region_t region - * - * \return 0 if flag was set, otherwise non-0 value is returned. - */ - int getZoomRegion(camera_zoom_region_t* region) const; - - // LEVEL0_ICBM_S + int getICBMUFMode(uint8_t* mode) const; /** * \brief Set ICBM FF Mode * @@ -2879,16 +2876,16 @@ class Parameters { * * \return 0 if set successfully, otherwise non-0 value is returned. */ - int setICBMUFMode(uint8_t mode); + int setICBMBBMode(uint8_t mode); /** - * \brief Get ICBM UF Mode + * \brief Get ICBM BB Mode * * \param[out] uint8_t mode * * \return 0 if flag was set, otherwise non-0 value is returned. */ - int getICBMUFMode(uint8_t* mode) const; + int getICBMBBMode(uint8_t* mode) const; // LEVEL0_ICBM_E private: diff --git a/include/api/intel_vendor_metadata_tags.h b/include/api/intel_vendor_metadata_tags.h index 79f35c73..d5e6502b 100644 --- a/include/api/intel_vendor_metadata_tags.h +++ b/include/api/intel_vendor_metadata_tags.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2012 The Android Open Source Project - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,27 +55,28 @@ typedef enum vendor_metadata_tag { INTEL_VENDOR_CAMERA_CALLBACK_TM_CURVE, // enum | public INTEL_VENDOR_CAMERA_TONE_MAP_CURVE, // float[] | public INTEL_VENDOR_CAMERA_POWER_MODE, // enum | public -// ENABLE_EVCP_S +// LEVEL0_ICBM_S INTEL_VENDOR_CAMERA_IC_CAPS, // int32 | public -// ENABLE_EVCP_E -// ENABLE_EVCP_S +// LEVEL0_ICBM_E +// LEVEL0_ICBM_S INTEL_VENDOR_CAMERA_IC_PEACE_FEATURES, // int32[] | public -// ENABLE_EVCP_E -// ENABLE_EVCP_S +// LEVEL0_ICBM_E +// LEVEL0_ICBM_S INTEL_VENDOR_CAMERA_IC_ECC_MODE, // enum | public -// ENABLE_EVCP_E -// ENABLE_EVCP_S +// LEVEL0_ICBM_E +// LEVEL0_ICBM_S INTEL_VENDOR_CAMERA_IC_BC_MODE, // enum | public -// ENABLE_EVCP_E -// ENABLE_EVCP_S +// LEVEL0_ICBM_E +// LEVEL0_ICBM_S INTEL_VENDOR_CAMERA_IC_BR_PARAMETERS, // int32[] | public -// ENABLE_EVCP_E -// ENABLE_EVCP_S +// LEVEL0_ICBM_E +// LEVEL0_ICBM_S INTEL_VENDOR_CAMERA_IC_UF_MODE, // enum | public -// ENABLE_EVCP_E +// LEVEL0_ICBM_E INTEL_VENDOR_CAMERA_TOTAL_EXPOSURE_TARGET, // int64 | public INTEL_VENDOR_CAMERA_TOTAL_EXPOSURE_TARGET_RANGE, // int64[] | public INTEL_VENDOR_CAMERA_RAW_DATA_OUTPUT, // enum | public + INTEL_VENDOR_CAMERA_HDR_RATIO, // float | public INTEL_VENDOR_CAMERA_END, } vendor_metadata_tag_t; @@ -107,15 +108,15 @@ typedef enum vendor_metadata_enum_intel_vendor_camera_power_mode { INTEL_VENDOR_CAMERA_POWER_MODE_HIGH_QUALITY, } vendor_metadata_enum_intel_vendor_camera_power_mode_t; -// ENABLE_EVCP_S +// LEVEL0_ICBM_S // INTEL_VENDOR_CAMERA_IC_ECC_MODE typedef enum vendor_metadata_enum_intel_vendor_camera_ic_ecc_mode { INTEL_VENDOR_CAMERA_IC_ECC_MODE_OFF, INTEL_VENDOR_CAMERA_IC_ECC_MODE_ON, } vendor_metadata_enum_intel_vendor_camera_ic_ecc_mode_t; -// ENABLE_EVCP_E -// ENABLE_EVCP_S +// LEVEL0_ICBM_E +// LEVEL0_ICBM_S // INTEL_VENDOR_CAMERA_IC_BC_MODE typedef enum vendor_metadata_enum_intel_vendor_camera_ic_bc_mode { INTEL_VENDOR_CAMERA_IC_BC_MODE_OFF, @@ -123,15 +124,15 @@ typedef enum vendor_metadata_enum_intel_vendor_camera_ic_bc_mode { INTEL_VENDOR_CAMERA_IC_BC_MODE_REPLACEMENT, } vendor_metadata_enum_intel_vendor_camera_ic_bc_mode_t; -// ENABLE_EVCP_E -// ENABLE_EVCP_S +// LEVEL0_ICBM_E +// LEVEL0_ICBM_S // INTEL_VENDOR_CAMERA_IC_UF_MODE typedef enum vendor_metadata_enum_intel_vendor_camera_ic_uf_mode { INTEL_VENDOR_CAMERA_IC_UF_MODE_OFF, INTEL_VENDOR_CAMERA_IC_UF_MODE_AUTO, } vendor_metadata_enum_intel_vendor_camera_ic_uf_mode_t; -// ENABLE_EVCP_E +// LEVEL0_ICBM_E // INTEL_VENDOR_CAMERA_RAW_DATA_OUTPUT typedef enum vendor_metadata_enum_intel_vendor_camera_raw_data_output { INTEL_VENDOR_CAMERA_RAW_DATA_OUTPUT_OFF, diff --git a/include/linux/crlmodule.h b/include/linux/crlmodule.h new file mode 100644 index 00000000..9203b6ce --- /dev/null +++ b/include/linux/crlmodule.h @@ -0,0 +1,53 @@ +/**************************************************************************** + * Copyright (c) 2016-2017 Intel Corporation. + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + *** To edit the content of this header, modify the corresponding + *** source file (e.g. under external/kernel-headers/original/) then + *** run bionic/libc/kernel/tools/update_all.py + *** + *** Any manual change here will be lost the next time this script will + *** be run. You've been warned! + *** + **************************************************************************** + ****************************************************************************/ +#ifndef UAPI_LINUX_CRLMODULE_H +#define UAPI_LINUX_CRLMODULE_H +#define V4L2_CID_CRLMODULE_BASE (V4L2_CID_USER_BASE + 0x2050) +#define V4L2_CID_FRAME_LENGTH_LINES (V4L2_CID_CRLMODULE_BASE + 1) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define V4L2_CID_LINE_LENGTH_PIXELS (V4L2_CID_CRLMODULE_BASE + 2) +#define CRL_CID_SENSOR_THERMAL_DATA (V4L2_CID_CRLMODULE_BASE + 3) +#define CRL_CID_SENSOR_MODE (V4L2_CID_CRLMODULE_BASE + 4) +#define CRL_CID_IMX230_HDR_MODE (V4L2_CID_CRLMODULE_BASE + 5) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define CRL_CID_IMX230_HDR_ET_RATIO (V4L2_CID_CRLMODULE_BASE + 6) +#define CRL_CID_EXPOSURE_SHS1 (V4L2_CID_CRLMODULE_BASE + 8) +#define CRL_CID_EXPOSURE_SHS2 (V4L2_CID_CRLMODULE_BASE + 9) +#define CRL_CID_EXPOSURE_SHS3 (V4L2_CID_CRLMODULE_BASE + 10) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define CRL_CID_EXPOSURE_RHS1 (V4L2_CID_CRLMODULE_BASE + 11) +#define CRL_CID_EXPOSURE_RHS2 (V4L2_CID_CRLMODULE_BASE + 12) +#define CRL_CID_SENSOR_PDAF (V4L2_CID_CRLMODULE_BASE + 13) +#define CRL_CID_DIGITAL_GAIN_L (V4L2_CID_CRLMODULE_BASE + 14) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define CRL_CID_DIGITAL_GAIN_S (V4L2_CID_CRLMODULE_BASE + 15) +#define CRL_CID_DIGITAL_GAIN_VS (V4L2_CID_CRLMODULE_BASE + 16) +#define CRL_CID_SENSOR_BIT_LINEAR (V4L2_CID_CRLMODULE_BASE + 17) +#define CRL_CID_MSB_ALIGN (V4L2_CID_CRLMODULE_BASE + 18) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define CRL_CID_AUTO_EXPOSURE_DEBUG (V4L2_CID_CRLMODULE_BASE + 19) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define CRL_CID_ANALOG_GAIN_L (V4L2_CID_CRLMODULE_BASE + 20) +#define CRL_CID_ANALOG_GAIN_S (V4L2_CID_CRLMODULE_BASE + 21) +#define CRL_CID_ANALOG_GAIN_VS (V4L2_CID_CRLMODULE_BASE + 22) +#define CRL_CID_EXPOSURE_MODE (V4L2_CID_CRLMODULE_BASE + 23) +#define CRL_CID_EXPOSURE_HDR_RATIO (V4L2_CID_CRLMODULE_BASE + 24) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif diff --git a/include/linux/ipu-isys.h b/include/linux/ipu-isys.h index 7ecf35c4..d96e95e1 100644 --- a/include/linux/ipu-isys.h +++ b/include/linux/ipu-isys.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (C) 2019 Intel Corporation. + * Copyright (C) 2019-2023 Intel Corporation. **************************************************************************** *** *** This header was automatically generated from a Linux kernel header @@ -24,6 +24,7 @@ /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define V4L2_CID_IPU_STORE_CSI2_HEADER (V4L2_CID_IPU_BASE + 2) #define V4L2_CID_IPU_ISYS_COMPRESSION (V4L2_CID_IPU_BASE + 3) +#define V4L2_CID_IPU_QUERY_SUB_STREAM (V4L2_CID_IPU_BASE + 4) #define V4L2_IPU_ISA_EN_BLC (1 << 0) #define V4L2_IPU_ISA_EN_LSC (1 << 1) #define V4L2_IPU_ISA_EN_DPC (1 << 2) diff --git a/modules/algowrapper/IntelCca.cpp b/modules/algowrapper/IntelCca.cpp index 914fc229..5db4715a 100644 --- a/modules/algowrapper/IntelCca.cpp +++ b/modules/algowrapper/IntelCca.cpp @@ -122,7 +122,7 @@ ia_err IntelCca::runAEC(uint64_t frameId, const cca::cca_ae_input_params& params } ia_err IntelCca::runAIQ(uint64_t frameId, const cca::cca_aiq_params& params, - cca::cca_aiq_results* results) { + cca::cca_aiq_results* results, camera_makernote_mode_t mode) { CheckAndLogError(!results, ia_err_argument, "@%s, results is nullptr", __func__); ia_err ret = getIntelCCA()->runAIQ(frameId, params, results); @@ -138,6 +138,14 @@ ia_err IntelCca::runLTM(uint64_t frameId, const cca::cca_ltm_input_params& param return ret; } +ia_err IntelCca::reconfigDvs(const cca::cca_dvs_init_param& dvsInitParam, + const cca::cca_gdc_configurations& gdcConfigs) { + ia_err ret = getIntelCCA()->reconfigDvs(dvsInitParam, gdcConfigs); + LOG2("@%s, ret:%d", __func__, ret); + + return ret; +} + ia_err IntelCca::updateZoom(uint32_t streamId, const cca::cca_dvs_zoom& params) { ia_err ret = getIntelCCA()->updateZoom(streamId, params); LOG2("@%s, ret:%d", __func__, ret); @@ -157,7 +165,8 @@ ia_err IntelCca::runAIC(uint64_t frameId, const cca::cca_pal_input_params* param CheckAndLogError(!params, ia_err_argument, "@%s, params is nullptr", __func__); CheckAndLogError(!pal, ia_err_argument, "@%s, pal is nullptr", __func__); - ia_err ret = getIntelCCA()->runAIC(frameId, *params, pal); + // Currently the aicId is same as stream_id + ia_err ret = getIntelCCA()->runAIC(frameId, *params, pal, params->stream_id); // if PAL doesn't run, set output size to 0 if (ret == ia_err_not_run) pal->size = 0; @@ -167,10 +176,10 @@ ia_err IntelCca::runAIC(uint64_t frameId, const cca::cca_pal_input_params* param return ret; } -ia_err IntelCca::getCMC(cca::cca_cmc* cmc) { +ia_err IntelCca::getCMC(cca::cca_cmc* cmc, const cca::cca_cpf* cpf) { CheckAndLogError(!cmc, ia_err_argument, "@%s, cmc is nullptr", __func__); - ia_err ret = getIntelCCA()->getCMC(*cmc); + ia_err ret = getIntelCCA()->getCMC(*cmc, cpf); LOG2("@%s, ret:%d", __func__, ret); return ret; @@ -286,12 +295,16 @@ void IntelCca::deinit() { ia_err IntelCca::decodeStats(uint64_t statsPointer, uint32_t statsSize, uint32_t bitmap, ia_isp_bxt_statistics_query_results_t* results, cca::cca_out_stats* outStats) { - CheckAndLogError(!results, ia_err_argument, "@%s, results is nullptr", __func__); + ia_isp_bxt_statistics_query_results_t resultsTmp = {}; + ia_isp_bxt_statistics_query_results_t* query = results ? results : &resultsTmp; - ia_err ret = getIntelCCA()->decodeStats(statsPointer, statsSize, bitmap, results, outStats); + ia_err ret = getIntelCCA()->decodeStats(statsPointer, statsSize, bitmap, query, outStats); LOG2("@%s, statsPointer: 0x%lu, statsSize:%d, bitmap:%x, ret: %d", __func__, statsPointer, statsSize, bitmap, ret); + LOG2("%s, query results: rgbs_grid(%d), af_grid(%d), dvs_stats(%d), paf_grid(%d)", __func__, + query->rgbs_grid, query->af_grid, query->dvs_stats, query->paf_grid); + return ret; } diff --git a/modules/algowrapper/IntelCca.h b/modules/algowrapper/IntelCca.h index ecb85104..429236b2 100644 --- a/modules/algowrapper/IntelCca.h +++ b/modules/algowrapper/IntelCca.h @@ -44,17 +44,20 @@ class IntelCca { ia_err runAEC(uint64_t frameId, const cca::cca_ae_input_params& params, cca::cca_ae_results* results); ia_err runAIQ(uint64_t frameId, const cca::cca_aiq_params& params, - cca::cca_aiq_results* results); + cca::cca_aiq_results* results, camera_makernote_mode_t mode = MAKERNOTE_MODE_OFF); ia_err runLTM(uint64_t frameId, const cca::cca_ltm_input_params& params); + ia_err reconfigDvs(const cca::cca_dvs_init_param& dvsInitParam, + const cca::cca_gdc_configurations& gdcConfigs); + ia_err updateZoom(uint32_t streamId, const cca::cca_dvs_zoom& params); ia_err runDVS(uint32_t streamId, uint64_t frameId); ia_err runAIC(uint64_t frameId, const cca::cca_pal_input_params* params, ia_binary_data* pal); - ia_err getCMC(cca::cca_cmc* cmc); + ia_err getCMC(cca::cca_cmc* cmc, const cca::cca_cpf* cpf = nullptr); ia_err getMKN(ia_mkn_trg type, cca::cca_mkn* mkn); ia_err getAiqd(cca::cca_aiqd* aiqd); ia_err updateTuning(uint8_t lardTags, const ia_lard_input_params& lardParams, @@ -64,14 +67,16 @@ class IntelCca { // PRIVACY_MODE_E bool allocStatsDataMem(unsigned int size); + void freeStatsDataMem(); void* getStatsDataBuffer(); void decodeHwStatsDone(int64_t sequence, unsigned int byteUsed); void* fetchHwStatsData(int64_t sequence, unsigned int* byteUsed); void deinit(); + // Do decoding if results is valid ia_err decodeStats(uint64_t statsPointer, uint32_t statsSize, uint32_t bitmap, - ia_isp_bxt_statistics_query_results_t* results, + ia_isp_bxt_statistics_query_results_t* results = nullptr, cca::cca_out_stats* outStats = nullptr); uint32_t getPalDataSize(const cca::cca_program_group& programGroup); @@ -81,7 +86,6 @@ class IntelCca { private: cca::IntelCCA* getIntelCCA(); void releaseIntelCCA(); - void freeStatsDataMem(); private: int mCameraId; diff --git a/modules/algowrapper/IntelICBM.cpp b/modules/algowrapper/IntelICBM.cpp index a257f8ce..acca8c2b 100644 --- a/modules/algowrapper/IntelICBM.cpp +++ b/modules/algowrapper/IntelICBM.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,26 +17,40 @@ #define LOG_TAG IntelICBM #include "modules/algowrapper/IntelICBM.h" -#include "src/icbm/ICBMFactory.h" #include "Errors.h" #include "iutils/CameraLog.h" +#include "iutils/Utils.h" namespace icamera { -Result IntelICBM::setup(ICBMInitInfo* initParam) { - mIIntelICBM = std::unique_ptr(createIntelICBM()); +int IntelICBM::setup(ICBMInitInfo* initParam, std::shared_ptr handle) { + mIntelOPIC2 = IntelOPIC2::getInstance(); - return mIIntelICBM->setup(initParam); + return mIntelOPIC2->setup(initParam, handle); } -void IntelICBM::shutdown() { - mIIntelICBM->shutdown(); +int IntelICBM::shutdown(const ICBMReqInfo& request) { + CheckAndLogError(mIntelOPIC2 == nullptr, UNKNOWN_ERROR, "@%s, no active ICBM session", + __func__); + int ret = mIntelOPIC2->shutdown(request); + // ret is the active session count, only release the object when no active session + if (ret == 0) { + IntelOPIC2::releaseInstance(); + mIntelOPIC2 = nullptr; + } + return ret; } -Result IntelICBM::processFrame(const ImageInfo& iii, const ImageInfo& iio, - const ICBMReqInfo& reqInfo) { - return mIIntelICBM->processFrame(iii, iio, reqInfo); +int IntelICBM::processFrame(const ICBMReqInfo& reqInfo) { + CheckAndLogError(mIntelOPIC2 == nullptr, UNKNOWN_ERROR, "@%s, no active ICBM session", + __func__); + if (reqInfo.reqType & + (icamera::ICBMFeatureType::USER_FRAMING | icamera::ICBMFeatureType::BC_MODE_BB)) + return mIntelOPIC2->processFrame(reqInfo); + if (reqInfo.reqType & icamera::ICBMFeatureType::LEVEL0_TNR) + return mIntelOPIC2->runTnrFrame(reqInfo); + return 0; } } // namespace icamera diff --git a/modules/algowrapper/IntelICBM.h b/modules/algowrapper/IntelICBM.h index faa1b16d..6d7774ea 100644 --- a/modules/algowrapper/IntelICBM.h +++ b/modules/algowrapper/IntelICBM.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,19 +19,19 @@ #include #include -#include "src/icbm/IntelICBM.h" +#include "src/icbm/OnePunchIC2.h" #include "src/icbm/ICBMTypes.h" namespace icamera { class IntelICBM { public: - Result setup(ICBMInitInfo* initParam); - void shutdown(); + int setup(ICBMInitInfo* initParam, std::shared_ptr handle = nullptr); + int shutdown(const ICBMReqInfo& reqInfo); - Result processFrame(const ImageInfo& iii, const ImageInfo& iio, const ICBMReqInfo& reqInfo); + int processFrame(const ICBMReqInfo& reqInfo); private: - std::unique_ptr mIIntelICBM; + IntelOPIC2* mIntelOPIC2; }; } // namespace icamera diff --git a/modules/algowrapper/IntelPGParam.cpp b/modules/algowrapper/IntelPGParam.cpp index 998bc0b1..5a221bd8 100644 --- a/modules/algowrapper/IntelPGParam.cpp +++ b/modules/algowrapper/IntelPGParam.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation. + * Copyright (C) 2018-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ namespace icamera { -IntelPGParam::IntelPGParam(int pgId) +IntelPGParam::IntelPGParam(int pgId, int cameraId, TuningMode tuningMode) : mPgId(pgId), mTerminalCount(0), mFragmentCount(0), @@ -35,6 +35,8 @@ IntelPGParam::IntelPGParam(int pgId) mProcessGroup(nullptr), mProgramControlInitTerminalIndex(-1), mProcessGroupMemory(nullptr) { + UNUSED(cameraId); + UNUSED(tuningMode); CLEAR(mP2pCacheBuffer); } @@ -657,9 +659,11 @@ int IntelPGParam::encodeTerminal(ia_css_terminal_t* terminal, ia_binary_data pay return ret; } -int IntelPGParam::decode(int payloadCount, ia_binary_data* payload, ia_binary_data* statistics) { +int IntelPGParam::decode(int payloadCount, ia_binary_data* payload, ia_binary_data* statistics, + int64_t sequence) { CheckAndLogError(!mProcessGroup, INVALID_OPERATION, "Can't decode due to null pg."); CheckAndLogError(!payload, INVALID_OPERATION, "nullptr payload."); + UNUSED(sequence); if (statistics && statistics->data) { ia_p2p_set_statistics_buffer(mP2pHandle, statistics->data); diff --git a/modules/algowrapper/IntelPGParam.h b/modules/algowrapper/IntelPGParam.h index 43bc9b46..551179b6 100644 --- a/modules/algowrapper/IntelPGParam.h +++ b/modules/algowrapper/IntelPGParam.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation. + * Copyright (C) 2018-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,7 @@ extern "C" { #include "iutils/Errors.h" #include "iutils/Utils.h" #include "modules/ia_cipr/include/Utils.h" +#include "CameraTypes.h" #include "src/core/psysprocessor/PGUtils.h" namespace icamera { @@ -69,7 +70,7 @@ namespace icamera { */ class IntelPGParam { public: - explicit IntelPGParam(int pgId); + explicit IntelPGParam(int pgId, int cameraId = 0, TuningMode tuningMode = TUNING_MODE_VIDEO); ~IntelPGParam(); /** @@ -107,7 +108,8 @@ class IntelPGParam { /** * Decode payload data for all related terminals. */ - int decode(int payloadCount, ia_binary_data* payload, ia_binary_data* statistics); + int decode(int payloadCount, ia_binary_data* payload, ia_binary_data* statistics, + int64_t sequence = -1); /** * Use to deinit P2P handle. diff --git a/modules/algowrapper/IntelTNR7US.cpp b/modules/algowrapper/IntelTNR7US.cpp index 404d7a8e..66404596 100644 --- a/modules/algowrapper/IntelTNR7US.cpp +++ b/modules/algowrapper/IntelTNR7US.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ #include "modules/algowrapper/IntelTNR7US.h" -#include +#include #include #include @@ -31,39 +31,39 @@ namespace icamera { -IntelTNR7US::IntelTNR7US(int cameraId) - : mCameraId(cameraId), - mWidth(0), - mHeight(0), - mTnrType(TNR_INSTANCE_MAX), - mTnrParam(nullptr) {} +IntelTNR7US* IntelTNR7US::createIntelTNR(int cameraId) { +#ifdef TNR7_CM + return new IntelC4mTNR(cameraId); +#endif +} -IntelTNR7US::~IntelTNR7US() { +Tnr7Param* IntelTNR7US::allocTnr7ParamBuf() { + LOG1("@%s, type %d", mCameraId, __func__, mTnrType); + mTnrParam = new Tnr7Param; + return mTnrParam; +} + +#ifdef TNR7_CM +IntelC4mTNR::~IntelC4mTNR() { for (auto surface : mCMSurfaceMap) { destroyCMSurface(surface.second); } mCMSurfaceMap.clear(); } -int IntelTNR7US::init(int width, int height, TnrType type) { +int IntelC4mTNR::init(int width, int height, TnrType type) { LOG1("@%s size %dx%d, type %d", mCameraId, __func__, width, height, type); mWidth = width; mHeight = height; mTnrType = type; - std::string threadName = "IntelTNR7US" + std::to_string(type + (mCameraId << 1)); + std::string threadName = "IntelC4mTNR" + std::to_string(type + (mCameraId << 1)); mThread = std::unique_ptr(new base::Thread(threadName)); mThread->Start(); return OK; } -Tnr7Param* IntelTNR7US::allocTnr7ParamBuf() { - LOG1("<%d>@%s, type %d", mCameraId, __func__, mTnrType); - mTnrParam = new Tnr7Param; - return mTnrParam; -} - -void* IntelTNR7US::allocCamBuf(uint32_t bufSize, int id) { +void* IntelC4mTNR::allocCamBuf(uint32_t bufSize, int id) { LOG1("<%d>@%s, type %d, id: %d", mCameraId, __func__, mTnrType, id); void* buffer = nullptr; int ret = posix_memalign(&buffer, getpagesize(), bufSize); @@ -78,7 +78,7 @@ void* IntelTNR7US::allocCamBuf(uint32_t bufSize, int id) { return buffer; } -void IntelTNR7US::freeAllBufs() { +void IntelC4mTNR::freeAllBufs() { LOG1("<%d>@%s, type %d", mCameraId, __func__, mTnrType); for (auto surface : mCMSurfaceMap) { ::free(surface.first); @@ -88,7 +88,7 @@ void IntelTNR7US::freeAllBufs() { } } -int IntelTNR7US::prepareSurface(void* bufAddr, int size) { +int IntelC4mTNR::prepareSurface(void* bufAddr, int size) { CheckAndLogError(size < mWidth * mHeight * 3 / 2, UNKNOWN_ERROR, "%s, invalid buffer size:%d", __func__, size); CmSurface2DUP* surface = createCMSurface(bufAddr); @@ -98,10 +98,9 @@ int IntelTNR7US::prepareSurface(void* bufAddr, int size) { return OK; } -int IntelTNR7US::runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, +int IntelC4mTNR::runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, uint32_t outBufSize, Tnr7Param* tnrParam, bool syncUpdate, int fd) { - PERF_CAMERA_ATRACE(); - TRACE_LOG_PROCESS("IntelTNR7US", "runTnrFrame"); + TRACE_LOG_PROCESS("IntelC4mTNR", "runTnrFrame"); LOG2("<%d>@%s type %d", mCameraId, __func__, mTnrType); CheckAndLogError(inBufAddr == nullptr || outBufAddr == nullptr || tnrParam == nullptr, UNKNOWN_ERROR, "@%s, buffer is nullptr", __func__); @@ -118,7 +117,9 @@ int IntelTNR7US::runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t i CheckAndLogError(outSurface == nullptr, UNKNOWN_ERROR, "Failed to get CMSurface for output buffer"); struct timespec beginTime = {}; - if (Log::isLogTagEnabled(ST_GPU_TNR)) clock_gettime(CLOCK_MONOTONIC, &beginTime); + if (Log::isLogTagEnabled(ST_GPU_TNR, CAMERA_DEBUG_LOG_LEVEL2)) { + clock_gettime(CLOCK_MONOTONIC, &beginTime); + } /* call Tnr api to run tnr for the inSurface and store the result in outSurface */ int ret = run_tnr7us_frame(mWidth, mHeight, mWidth, inSurface, outSurface, &tnrParam->scale, @@ -127,7 +128,7 @@ int IntelTNR7US::runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t i destroyCMSurface(outSurface); } CheckAndLogError(ret != OK, UNKNOWN_ERROR, "tnr7us process failed"); - if (Log::isLogTagEnabled(ST_GPU_TNR)) { + if (Log::isLogTagEnabled(ST_GPU_TNR, CAMERA_DEBUG_LOG_LEVEL2)) { struct timespec endTime = {}; clock_gettime(CLOCK_MONOTONIC, &endTime); uint64_t timeUsedUs = (endTime.tv_sec - beginTime.tv_sec) * 1000000 + @@ -137,16 +138,16 @@ int IntelTNR7US::runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t i return OK; } -int IntelTNR7US::asyncParamUpdate(int gain, bool forceUpdate) { +int IntelC4mTNR::asyncParamUpdate(int gain, bool forceUpdate) { if (mThread->task_runner()) { mThread->task_runner()->PostTask( - FROM_HERE, - base::Bind(&IntelTNR7US::handleParamUpdate, base::Unretained(this), gain, forceUpdate)); + FROM_HERE, base::BindOnce(&IntelC4mTNR::handleParamUpdate, base::Unretained(this), gain, + forceUpdate)); } return OK; } -int32_t IntelTNR7US::getSurfaceInfo(int width, int height, uint32_t* size) { +int32_t IntelC4mTNR::getTnrBufferSize(int width, int height, uint32_t* size) { uint32_t pitch = 0; uint32_t physicalSize = 0; int ret = getSurface2DInfo(uint32_t(width), uint32_t(CM_SURFACE_ALIGN_HEIGHT(height)), @@ -157,15 +158,16 @@ int32_t IntelTNR7US::getSurfaceInfo(int width, int height, uint32_t* size) { return OK; } -void IntelTNR7US::handleParamUpdate(int gain, bool forceUpdate) { - PERF_CAMERA_ATRACE(); +void IntelC4mTNR::handleParamUpdate(int gain, bool forceUpdate) { LOG2("@%s gain: %d", __func__, gain); // gain value is from AE expore analog_gain * digital_gain struct timespec beginTime = {}; - if (Log::isLogTagEnabled(ST_GPU_TNR)) clock_gettime(CLOCK_MONOTONIC, &beginTime); + if (Log::isLogTagEnabled(ST_GPU_TNR, CAMERA_DEBUG_LOG_LEVEL2)) { + clock_gettime(CLOCK_MONOTONIC, &beginTime); + } tnr7usParamUpdate(gain, forceUpdate, mTnrType); - if (Log::isLogTagEnabled(ST_GPU_TNR)) { + if (Log::isLogTagEnabled(ST_GPU_TNR, CAMERA_DEBUG_LOG_LEVEL2)) { struct timespec endTime = {}; clock_gettime(CLOCK_MONOTONIC, &endTime); uint64_t timeUsedUs = (endTime.tv_sec - beginTime.tv_sec) * 1000000 + @@ -174,7 +176,7 @@ void IntelTNR7US::handleParamUpdate(int gain, bool forceUpdate) { } } -CmSurface2DUP* IntelTNR7US::getBufferCMSurface(void* bufAddr) { +CmSurface2DUP* IntelC4mTNR::getBufferCMSurface(void* bufAddr) { if (mCMSurfaceMap.find(bufAddr) != mCMSurfaceMap.end()) { return mCMSurfaceMap[bufAddr]; } @@ -182,16 +184,16 @@ CmSurface2DUP* IntelTNR7US::getBufferCMSurface(void* bufAddr) { return nullptr; } -CmSurface2DUP* IntelTNR7US::createCMSurface(void* bufAddr) { - PERF_CAMERA_ATRACE(); +CmSurface2DUP* IntelC4mTNR::createCMSurface(void* bufAddr) { CmSurface2DUP* cmSurface = nullptr; int32_t ret = createCmSurface2DUP(mWidth, mHeight, CM_SURFACE_FORMAT_NV12, bufAddr, cmSurface); CheckAndLogError(ret != 0, nullptr, "failed to create CmSurface2DUP object"); return cmSurface; } -int32_t IntelTNR7US::destroyCMSurface(CmSurface2DUP* surface) { +int32_t IntelC4mTNR::destroyCMSurface(CmSurface2DUP* surface) { return destroyCMSurface2DUP(surface); } +#endif } // namespace icamera diff --git a/modules/algowrapper/IntelTNR7US.h b/modules/algowrapper/IntelTNR7US.h index 57b4381e..2db4d59b 100644 --- a/modules/algowrapper/IntelTNR7US.h +++ b/modules/algowrapper/IntelTNR7US.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ extern "C" { #include "PlatformData.h" #include "TNRCommon.h" +#ifdef TNR7_CM /* the cm_rt.h has some build error with current clang build flags * use the ignored setting to ignore these errors, and use * push/pop to make the ignore only take effect on this file */ @@ -53,15 +54,14 @@ extern int32_t destroyCMSurface2DUP(CmSurface2DUP*& surface); extern int tnr7usParamUpdate(int gain, bool forceUpdate = false, int type = 0); extern int32_t getSurface2DInfo(uint32_t width, uint32_t height, CM_SURFACE_FORMAT format, uint32_t& pitch, uint32_t& physicalSize); - +#endif namespace icamera { -// IntelTNR7US object is for using Intel GPU tnr(tnr7ultraslim) feature. class IntelTNR7US { public: - explicit IntelTNR7US(int cameraId); - ~IntelTNR7US(); - int init(int width, int height, TnrType type); + static IntelTNR7US* createIntelTNR(int cameraId); + virtual ~IntelTNR7US() {} + virtual int init(int width, int height, TnrType type = TNR_INSTANCE0) = 0; /** * call tnr api to calc tnr result * @@ -70,14 +70,55 @@ class IntelTNR7US { * \param tnrParam: tnr parameters from ISP * \param fd: user output buffer file handle */ - int runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, - uint32_t outBufSize, Tnr7Param* tnrParam, bool syncUpdate, int fd = -1); + virtual int runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, + uint32_t outBufSize, Tnr7Param* tnrParam, bool syncUpdate, + int fd = -1) = 0; Tnr7Param* allocTnr7ParamBuf(); - void* allocCamBuf(uint32_t bufSize, int id); - void freeAllBufs(); - int prepareSurface(void* bufAddr, int size); - int asyncParamUpdate(int gain, bool forceUpdate); - int getSurfaceInfo(int width, int height, uint32_t* size); + virtual void* allocCamBuf(uint32_t bufSize, int id) = 0; + virtual void freeAllBufs() = 0; + virtual int prepareSurface(void* bufAddr, int size) { return OK; } + virtual int asyncParamUpdate(int gain, bool forceUpdate) { return OK; } + virtual int getTnrBufferSize(int width, int height, uint32_t* size) { return BAD_VALUE; } + + protected: + explicit IntelTNR7US(int cameraId) + : mCameraId(cameraId), + mWidth(0), + mHeight(0), + mTnrType(TNR_INSTANCE_MAX), + mTnrParam(nullptr){}; + + protected: + int mCameraId; + int mWidth; + int mHeight; + TnrType mTnrType; + Tnr7Param* mTnrParam; + + DISALLOW_COPY_AND_ASSIGN(IntelTNR7US); +}; + +#ifdef TNR7_CM +class IntelC4mTNR : public IntelTNR7US { + public: + explicit IntelC4mTNR(int cameraId) : IntelTNR7US(cameraId) {} + virtual ~IntelC4mTNR(); + virtual int init(int width, int height, TnrType type = TNR_INSTANCE0); + /** + * call tnr api to calc tnr result + * + * \param inBufAddr: input image buffer + * \param outBufAddr: tnr output + * \param tnrParam: tnr parameters from ISP + * \param fd: user output buffer file handle + */ + virtual int runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, + uint32_t outBufSize, Tnr7Param* tnrParam, bool syncUpdate, int fd = -1); + virtual void* allocCamBuf(uint32_t bufSize, int id); + virtual void freeAllBufs(); + virtual int prepareSurface(void* bufAddr, int size); + virtual int asyncParamUpdate(int gain, bool forceUpdate); + virtual int getTnrBufferSize(int width, int height, uint32_t* size); private: /* tnr api use CmSurface2DUP object as data buffer, call this api to create @@ -88,17 +129,12 @@ class IntelTNR7US { CmSurface2DUP* getBufferCMSurface(void* bufAddr); /* call tnr7us API to update params */ void handleParamUpdate(int gain, bool forceUpdate); + DISALLOW_COPY_AND_ASSIGN(IntelC4mTNR); private: - int mCameraId; - int mWidth; - int mHeight; - TnrType mTnrType; // Tnr will create CMSurface for input buffers and cache them in the map std::unordered_map mCMSurfaceMap; - Tnr7Param* mTnrParam; std::unique_ptr mThread; - - DISALLOW_COPY_AND_ASSIGN(IntelTNR7US); }; +#endif } // namespace icamera diff --git a/modules/algowrapper/graph/GraphConfigImpl.cpp b/modules/algowrapper/graph/GraphConfigImpl.cpp index d42391ec..ce599f40 100644 --- a/modules/algowrapper/graph/GraphConfigImpl.cpp +++ b/modules/algowrapper/graph/GraphConfigImpl.cpp @@ -221,7 +221,7 @@ status_t GraphConfigImpl::createQueryRule(const vector& activeStream mQuery.clear(); mStreamToSinkIdMap.clear(); - int videoIndex = 0, stillIndex = 0; + int videoIndex = 0, stillIndex = 0, stillTnrIndex = 0; map videoQuery; map stillQuery; map videoStreamToSinkIdMap; @@ -230,7 +230,8 @@ status_t GraphConfigImpl::createQueryRule(const vector& activeStream GCSS_KEY_VIDEO2}; vector stillStreamKeys = {GCSS_KEY_STILL0, GCSS_KEY_STILL1, GCSS_KEY_STILL2}; - + vector stillTnrStreamKeys = {GCSS_KEY_STILLTNR0, GCSS_KEY_STILLTNR1, + GCSS_KEY_STILLTNR2}; // Depends on outputs numbers in GC settings int vOutputNum = (mType == DISPERSED) ? DISPERSED_MAX_OUTPUTS : videoStreamKeys.size(); int sOutputNum = (mType == DISPERSED) ? DISPERSED_MAX_OUTPUTS : stillStreamKeys.size(); @@ -261,6 +262,15 @@ status_t GraphConfigImpl::createQueryRule(const vector& activeStream query[h] = std::to_string(stream->height()); streamToSinkId[stream] = key; LOG2("Adding stream %p to map %s", stream, ItemUID::key2str(key)); + if (dummyStillSink && !isVideo) { + AndroidGraphConfigKey key = stillTnrStreamKeys[stillTnrIndex++]; + ItemUID w = {key, GCSS_KEY_WIDTH}; + ItemUID h = {key, GCSS_KEY_HEIGHT}; + + query[w] = std::to_string(stream->width()); + query[h] = std::to_string(stream->height()); + LOG2("Adding dummy stream %p to %s", stream, ItemUID::key2str(key)); + } } if (mType == COUPLED) { @@ -344,6 +354,9 @@ status_t GraphConfigImpl::getRawInputSize(GCSS::IGraphConfig* query, camera_reso "%s, Failed to create the graph", __func__); vector isysOutput = {"csi_be:output", + // DOL_FEATURE_S + "csi_be_dol:output", + // DOL_FEATURE_E "csi_be_soc:output"}; for (auto& item : isysOutput) { GCSS::IGraphConfig* isysNode = graphResult->getDescendantByString(item.c_str()); @@ -629,6 +642,10 @@ status_t GraphConfigImpl::getGraphConfigData(IGraphType::GraphConfigData* data) // The graph id, csi output and sensor mode must be same if there are two graph config pipes data->graphId = mGraphConfigPipe.begin()->second->getGraphId(); mGraphConfigPipe.begin()->second->getCSIOutputResolution(&(data->csiReso)); + // DOL_FEATURE_S + mGraphConfigPipe.begin()->second->getDolInfo(&(data->dolInfo.conversionGain), + &(data->dolInfo.dolMode)); + // DOL_FEATURE_E data->mcId = mMcId; getGdcKernelSetting(&data->gdcInfos); @@ -666,7 +683,7 @@ status_t GraphConfigImpl::getGraphConfigData(IGraphType::GraphConfigData* data) return OK; } -status_t GraphConfigImpl::getGdcKernelSetting(std::vector *gdcInfos) { +status_t GraphConfigImpl::getGdcKernelSetting(std::vector* gdcInfos) { CheckAndLogError(mGraphConfigPipe.empty(), UNKNOWN_ERROR, "%s, the mGraphConfigPipe is empty", __func__); CheckAndLogError(!gdcInfos, UNKNOWN_ERROR, "%s, the gdcInfos is nullptr", __func__); diff --git a/modules/algowrapper/graph/GraphConfigPipe.cpp b/modules/algowrapper/graph/GraphConfigPipe.cpp index bd811d72..4ec2e03a 100644 --- a/modules/algowrapper/graph/GraphConfigPipe.cpp +++ b/modules/algowrapper/graph/GraphConfigPipe.cpp @@ -147,6 +147,9 @@ status_t GraphConfigPipe::analyzeSourceType() { status_t GraphConfigPipe::analyzeCSIOutput() { vector csiBeOutput = {"csi_be:output", + // DOL_FEATURE_S + "csi_be_dol:output", + // DOL_FEATURE_E "csi_be_soc:output"}; for (auto& item : csiBeOutput) { GCSS::IGraphConfig* csiBeNode = @@ -998,7 +1001,7 @@ status_t GraphConfigPipe::getScalerByStreamId( if (((input_crop->left == 0) && (input_crop->top == 0) && (input_crop->right == 0) && (input_crop->bottom == 0)) && ((output_crop->left == 0) && (output_crop->top == 0) && - (output_crop->right == 0) &&(output_crop->bottom == 0))) { + (output_crop->right == 0) && (output_crop->bottom == 0))) { gdcScalerW = static_cast(gdcResolution.input_width) / static_cast(gdcResolution.output_width); gdcScalerH = static_cast(gdcResolution.input_height) / @@ -1490,6 +1493,15 @@ status_t GraphConfigPipe::portGetClientStream(Node* port, HalStream** stream) { return BAD_VALUE; } + /* When using the still tnr mode, both still(x) and stilltnr(x) port eventually mapped to the + * same Hal stream. stilltnr(x) is dummy port and will not appear in mStreamToSinkIdMap, so need + * use still(x) to find the corresponding Hal stream + */ + string::size_type pos = 0; + if ((pos = portName.find("tnr")) != string::npos) { + portName = portName.erase(pos, 3); + } + uid_t vPortId = GCSS::ItemUID::str2key(portName); *stream = getHalStreamByVirtualId(vPortId); @@ -1565,6 +1577,17 @@ bool GraphConfigPipe::portIsEdgePort(Node* port) { return isEdge; } +// DOL_FEATURE_S +int GraphConfigPipe::getDolInfo(float* gain, string* mode) { + CheckAndLogError(!gain || !mode, UNKNOWN_ERROR, "%s, the gain or mode is nullptr", __func__); + + css_err_t status = mGCSSAicUtil.getDolInfo(*gain, *mode); + CheckAndLogError(status != css_err_none, UNKNOWN_ERROR, "%s, Get DOL info fails", __func__); + + return OK; +} +// DOL_FEATURE_E + void GraphConfigPipe::dumpSettings() { mSettings->dumpNodeTree(mSettings, 2); } diff --git a/modules/algowrapper/graph/GraphConfigPipe.h b/modules/algowrapper/graph/GraphConfigPipe.h index 4de09b1c..db3b129f 100644 --- a/modules/algowrapper/graph/GraphConfigPipe.h +++ b/modules/algowrapper/graph/GraphConfigPipe.h @@ -144,6 +144,12 @@ class GraphConfigPipe { * -1 will be returned if cannot find the valid PG id. */ int getStreamIdByPgName(std::string pgName); + // DOL_FEATURE_S + /* + * retieve the conversion gain and the DOL mode from the settings of the sensor mode. + */ + int getDolInfo(float* gain, std::string* mode); + // DOL_FEATURE_E /* * Debugging support diff --git a/modules/ia_css/ipu6ep/include/assert_support.h b/modules/ia_css/ipu6ep/include/assert_support.h index aa1724c7..947fc5f0 100644 --- a/modules/ia_css/ipu6ep/include/assert_support.h +++ b/modules/ia_css/ipu6ep/include/assert_support.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/cpu_mem_support.h b/modules/ia_css/ipu6ep/include/cpu_mem_support.h index 98fd104f..d0f1b0f1 100644 --- a/modules/ia_css/ipu6ep/include/cpu_mem_support.h +++ b/modules/ia_css/ipu6ep/include/cpu_mem_support.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/error_support.h b/modules/ia_css/ipu6ep/include/error_support.h index 54d3496d..4d43f296 100644 --- a/modules/ia_css/ipu6ep/include/error_support.h +++ b/modules/ia_css/ipu6ep/include/error_support.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/frame_support.h b/modules/ia_css/ipu6ep/include/frame_support.h index b5120abe..5243a860 100644 --- a/modules/ia_css/ipu6ep/include/frame_support.h +++ b/modules/ia_css/ipu6ep/include/frame_support.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_base_types.h b/modules/ia_css/ipu6ep/include/ia_css_base_types.h index 8a8af09e..3883e8f1 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_base_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_base_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_isa_parameter_defs.h b/modules/ia_css/ipu6ep/include/ia_css_isa_parameter_defs.h index 683c2f5d..689c8995 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_isa_parameter_defs.h +++ b/modules/ia_css/ipu6ep/include/ia_css_isa_parameter_defs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_isa_parameter_defs_dep.h b/modules/ia_css/ipu6ep/include/ia_css_isa_parameter_defs_dep.h index 4b92c7b2..8ef25173 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_isa_parameter_defs_dep.h +++ b/modules/ia_css/ipu6ep/include/ia_css_isa_parameter_defs_dep.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_kernel_bitmap.h b/modules/ia_css/ipu6ep/include/ia_css_kernel_bitmap.h index 508ca278..4881fdd5 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_kernel_bitmap.h +++ b/modules/ia_css/ipu6ep/include/ia_css_kernel_bitmap.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_kernel_bitmap_impl.h b/modules/ia_css/ipu6ep/include/ia_css_kernel_bitmap_impl.h index 45dbcda2..5b1974b7 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_kernel_bitmap_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_kernel_bitmap_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_kernel_user_param_types.h b/modules/ia_css/ipu6ep/include/ia_css_kernel_user_param_types.h index b4619aab..c4c0ef52 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_kernel_user_param_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_kernel_user_param_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_program_group_data.h b/modules/ia_css/ipu6ep/include/ia_css_program_group_data.h index fc1cd1ce..e3be7548 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_program_group_data.h +++ b/modules/ia_css/ipu6ep/include/ia_css_program_group_data.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ * * The data objects are separate from the process group terminal, * although they are stored by value rather than by reference and - * make the process group terminal dependendent on its definition + * make the process group terminal dependent on its definition * * This frame definition overloads the current CSS frame definition * they are the same object, just a slightly different implementation @@ -155,14 +155,14 @@ struct ia_css_param_frame_s { /** * Structure defining the frame (size and access) properties for - * inbuild types only. + * inbuilt types only. * - * The inbuild types like FourCC, MIPI and CSS private types are supported + * The inbuilt types like FourCC, MIPI and CSS private types are supported * by FW all other types are custom types which interpretation must be encoded * on the buffer itself or known by the source and sink */ struct ia_css_frame_descriptor_s { - /** Indicates if this is a generic type or inbuild with + /** Indicates if this is a generic type or inbuilt with * variable size descriptor. */ ia_css_frame_format_type_t frame_format_type; @@ -203,14 +203,14 @@ struct ia_css_frame_descriptor_s { + (N_PADDING_UINT8_IN_FRAME_STRUCT * 8)) /** - * Main frame structure holding the main store and auxilary access properties + * Main frame structure holding the main store and auxiliary access properties * the "pointer_state" and "access_scope" should be encoded on the * "vied_vaddress_t" type * * @note A number of fields in this structure are either no longer * used, or their use is trivialized, in the current code base. This is * due to the Persistent Program Group (PPG) concept which separated the - * attatchment of frame buffers into a separate structure, the buffer set. + * attachment of frame buffers into a separate structure, the buffer set. * @par Set all unused fields to zero, unless otherwise noted. * @see ia_css_buffer_set_s */ diff --git a/modules/ia_css/ipu6ep/include/ia_css_program_group_data_defs.h b/modules/ia_css/ipu6ep/include/ia_css_program_group_data_defs.h index 9d1ddac9..aaad08e9 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_program_group_data_defs.h +++ b/modules/ia_css/ipu6ep/include/ia_css_program_group_data_defs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_program_group_data_impl.h b/modules/ia_css/ipu6ep/include/ia_css_program_group_data_impl.h index 5f1a2856..91e54f12 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_program_group_data_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_program_group_data_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_program_group_param.h b/modules/ia_css/ipu6ep/include/ia_css_program_group_param.h index a8a15522..d45c769a 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_program_group_param.h +++ b/modules/ia_css/ipu6ep/include/ia_css_program_group_param.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_program_group_param.sim.h b/modules/ia_css/ipu6ep/include/ia_css_program_group_param.sim.h index 820ac610..ffe3faa0 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_program_group_param.sim.h +++ b/modules/ia_css/ipu6ep/include/ia_css_program_group_param.sim.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_program_group_param_private.h b/modules/ia_css/ipu6ep/include/ia_css_program_group_param_private.h index b03f27c9..3e13c71c 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_program_group_param_private.h +++ b/modules/ia_css/ipu6ep/include/ia_css_program_group_param_private.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_program_group_param_types.h b/modules/ia_css/ipu6ep/include/ia_css_program_group_param_types.h index 816882cb..26755f44 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_program_group_param_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_program_group_param_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_buffer_set.h b/modules/ia_css/ipu6ep/include/ia_css_psys_buffer_set.h index 8e5816c6..c7b208e7 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_buffer_set.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_buffer_set.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_data_trace.h b/modules/ia_css/ipu6ep/include/ia_css_psys_data_trace.h index fc2e1025..5e20f3ae 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_data_trace.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_data_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_dynamic_trace.h b/modules/ia_css/ipu6ep/include/ia_css_psys_dynamic_trace.h index 5c3323d2..c8179c51 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_dynamic_trace.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_dynamic_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_kernel_trace.h b/modules/ia_css/ipu6ep/include/ia_css_psys_kernel_trace.h index 2a90e812..07ff8446 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_kernel_trace.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_kernel_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_manifest_types.h b/modules/ia_css/ipu6ep/include/ia_css_psys_manifest_types.h index bd7bf4ee..baebf5ec 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_manifest_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_manifest_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ typedef uint8_t ia_css_connection_bitmap_t; #define IA_CSS_CONNECTION_TYPE_BITS 32 -/** Describes the tranfer method of data between terminals */ +/** Describes the transfer method of data between terminals */ typedef enum ia_css_connection_type { /** The data buffer must be fully written to main memory by the producer * before it can be read by the consumer */ diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_param_trace.h b/modules/ia_css/ipu6ep/include/ia_css_psys_param_trace.h index 688ccd0a..87110165 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_param_trace.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_param_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_private_pg_data.h b/modules/ia_css/ipu6ep/include/ia_css_psys_private_pg_data.h index 743de9d9..29ceb655 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_private_pg_data.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_private_pg_data.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process.h index 1e2b04e6..6e57cef6 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -382,7 +382,7 @@ uint32_t ia_css_process_get_program_idx( /*! Returns the process extension (ONLY ALLOWED TO BE USED BY FIRMWARE). * @param process[in] process object - * @return process entension, NULL if there is none. + * @return process extension, NULL if there is none. */ IA_CSS_PSYS_DYNAMIC_STORAGE_CLASS_H ia_css_process_ext_t *ia_css_process_get_extension( diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process.hsys.kernel.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process.hsys.kernel.h index 2ef42d15..02a66ee5 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process.hsys.kernel.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process.hsys.kernel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process.hsys.user.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process.hsys.user.h index 8c45d773..ccddfd6c 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process.hsys.user.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process.hsys.user.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process.psys.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process.psys.h index a208fdff..212331bc 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process.psys.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process.psys.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,12 +30,12 @@ * Process manager */ -/*! Acquire the resources specificed in process object +/*! Acquire the resources specified in process object @param process[in] process object Postcondition: This is a try process if any of the - resources is not available, all succesfully acquired + resources is not available, all successfully acquired ones will be release and the function will return an error @@ -43,7 +43,7 @@ */ extern int ia_css_process_acquire(ia_css_process_t *process); -/*! Release the resources specificed in process object +/*! Release the resources specified in process object @param process[in] process object diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.h index 6bcea892..c35bb30f 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.hsys.kernel.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.hsys.kernel.h index 3c43d585..5c300322 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.hsys.kernel.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.hsys.kernel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ * This file, together with the user space header, ia_css_psys_process_group.hsys.user.h, * defines the functions required to manage the lifetime of a process group. * - * Sequence for settup up and queueing processing tasks with a persistent program group + * Sequence for setup up and queuing processing tasks with a persistent program group * to IPU is: * * # Get Program Group manifest by ID @@ -34,7 +34,7 @@ * # Configure process group * ## Set kernel and terminal enables * ## Set terminal attributes - * # Submit processs group + * # Submit process group * # Start process group * # Disown process group * # Frame/Fragment processing loop @@ -250,7 +250,7 @@ extern int ia_css_process_group_disown( @par For PPG's, buffer is ignored as the buffers will be sent later on with ia_css_enqueue_buffer_set(). Nonetheless, this function must be - called before ia_css_process_group_submit() as sets up some internal bookeeping. + called before ia_css_process_group_submit() as sets up some internal bookkeeping. @note The buffer can be in memory or streaming over memory diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.hsys.user.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.hsys.user.h index e166c5b4..f25c0a30 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.hsys.user.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.hsys.user.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.psys.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.psys.h index 49c04df5..de2e4dd9 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.psys.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group.psys.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ extern int ia_css_process_group_run( Note: Stop indicates that the process group has completed execution - Postcondition: The external resoruces can now be detached + Postcondition: The external resources can now be detached @return < 0 on error */ diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group_cmd_impl.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group_cmd_impl.h index de0b78f7..2e60e001 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group_cmd_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group_cmd_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ * * This is the root structure passed in a number of PG commands via * the syscom queuing interface to firmware from the host. A pointer - * to this structure in main memroy is passed in the following + * to this structure in main memory is passed in the following * PG commands: start, resume, suspend, stop, abort. * * A process group is created based on a program group specification @@ -53,7 +53,7 @@ * also has terminals, which connect it to the outside world. Each * terminal represents either parameters or image data flowing in or * out of the group. Terminals come in different types and may have - * addtional attributes. For example, a data termainal will have + * additional attributes. For example, a data terminal will have * a frame format attribute. * @see ia_css_process_group_create() * @see ia_css_program_group_manifest_t and related API and: @@ -64,7 +64,7 @@ * * @note Some of the fields within are used internally within the * firmware only, after the firmware copies the process group structure - * to its internel cache. The original in main memory is not updated. + * to its internal cache. The original in main memory is not updated. * All such fields should be initialized to zero, unless otherwise * noted. * See the individual field descriptions for which fields are "internal". @@ -79,14 +79,14 @@ struct ia_css_process_group_s { /** PG routing bitmap used to set connection between program group * components */ ia_css_rbm_t routing_bitmap; - /** PG kernel bitmap. Marks which program kernels (i.e. kernel==device, when impelementation is fixed) + /** PG kernel bitmap. Marks which program kernels (i.e. kernel==device, when implementation is fixed) * are enabled. This bitmap covers all kernels in the group, no matter which program they belong to. */ ia_css_kernel_bitmap_t kernel_bitmap; /** Size of this structure in bytes */ uint32_t size; /** The timestamp when PG load starts * @note Internal firmware use only. */ - /**< PSYS server init time in cycless */ + /**< PSYS server init time in cycles */ uint32_t psys_server_init_cycles; /**< The timestamp when PG load starts */ uint32_t pg_load_start_ts; @@ -100,7 +100,7 @@ struct ia_css_process_group_s { * @note Internal firmware use only. */ uint32_t pg_processing_cycles; /** Referral ID to program group FW. This identifies the "type" of the process group - * and associcates the process group with the program group defined in the manifest. */ + * and associates the process group with the program group defined in the manifest. */ /**< PG next frame init time in cycles */ uint32_t pg_next_frame_init_cycles; /**< PG complete time in cycles */ @@ -139,7 +139,7 @@ struct ia_css_process_group_s { uint16_t terminals_offset; /** Parameter dependent number of processes in this process group, determined at process * group creation taking into account the enabled kernels. That is, if all of a program's - * associcated kernels are disabled, then no process is instantiated for that program and + * associated kernels are disabled, then no process is instantiated for that program and * it must not be counted in the process count. * * @see processes_offset in this structure @@ -150,8 +150,8 @@ struct ia_css_process_group_s { /** Parameter dependent number of terminals on this process group, determined at process * group creation. Must not be greater than the terminal count as defined in the manifest, * but taking into account the enabled kernels. That is, for those terminal types that have - * kernel associations, the terminal is diabled if all of its associated kernels are disabled. - * Execptions by terminal type: + * kernel associations, the terminal is disabled if all of its associated kernels are disabled. + * Exceptions by terminal type: * - IA_CSS_TERMINAL_TYPE_PROGRAM - As described above, but parameter descriptors are examined to determine the * kernel association, as the terminal type itself does not have an associated kernel field or kernel bitmap field. * - IA_CSS_TERMINAL_TYPE_PROGRAM_CONTROL_INIT -- Always enabled @@ -202,7 +202,7 @@ extern int ia_css_process_group_on_create( const ia_css_program_group_manifest_t *program_group_manifest, const ia_css_program_group_param_t *program_group_param); -/*! Callback before process group is about to be destoyed. Any implementation +/*! Callback before process group is about to be destroyed. Any implementation * specific cleanups can be done here. @param process_group[in] process group object @@ -268,7 +268,7 @@ extern int ia_css_process_group_store( ia_css_process_group_t *process_group, bool secure); -/*! Need to get the right context for each PG for FW test app only +/*! Need to get the right context for each PG for FW test application only * * @param process_group[in] process group object * diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group_impl.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group_impl.h index 4ada788b..614eaad3 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process_group_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process_group_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process_impl.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process_impl.h index de5719c7..55c0c19f 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process_private_types.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process_private_types.h index e2252295..d7804fe4 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process_private_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process_private_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,11 +29,11 @@ #endif #define SIZE_OF_PROCESS_EXTENSION \ - ((VIED_NCI_RESOURCE_BITMAP_BITS * VIED_NCI_N_DEV_DFM_ID) \ - + (VIED_NCI_RESOURCE_BITMAP_BITS * VIED_NCI_N_DEV_DFM_ID) \ - + (VIED_NCI_N_DATA_MEM_TYPE_ID * VIED_NCI_RESOURCE_SIZE_BITS) \ - + (VIED_NCI_N_DEV_CHN_ID * VIED_NCI_RESOURCE_SIZE_BITS) \ - + (VIED_NCI_N_DATA_MEM_TYPE_ID * VIED_NCI_RESOURCE_ID_BITS) \ + ((VIED_NCI_RESOURCE_BITMAP_BITS * VIED_NCI_N_DEV_DFM_ID_MAX) \ + + (VIED_NCI_RESOURCE_BITMAP_BITS * VIED_NCI_N_DEV_DFM_ID_MAX) \ + + (VIED_NCI_N_DATA_MEM_TYPE_ID_MAX * VIED_NCI_RESOURCE_SIZE_BITS) \ + + (VIED_NCI_N_DEV_CHN_ID_MAX * VIED_NCI_RESOURCE_SIZE_BITS) \ + + (VIED_NCI_N_DATA_MEM_TYPE_ID_MAX * VIED_NCI_RESOURCE_ID_BITS) \ + (N_PADDING_UINT8_IN_PROCESS_EXT_STRUCT * 8)) /** Extended process attributes describing more resource requirements @@ -41,24 +41,16 @@ * ia_css_process_s. */ struct ia_css_process_ext_s { -#if VIED_NCI_N_DEV_DFM_ID > 0 /** DFM port allocated to this process */ - vied_nci_resource_bitmap_t dfm_port_bitmap[VIED_NCI_N_DEV_DFM_ID]; + vied_nci_resource_bitmap_t dfm_port_bitmap[VIED_NCI_N_DEV_DFM_ID_MAX]; /** Active DFM ports which need a kick */ - vied_nci_resource_bitmap_t dfm_active_port_bitmap[VIED_NCI_N_DEV_DFM_ID]; -#endif -#if VIED_NCI_N_DATA_MEM_TYPE_ID > 0 + vied_nci_resource_bitmap_t dfm_active_port_bitmap[VIED_NCI_N_DEV_DFM_ID_MAX]; /** (external) Memory allocation offset given to this process */ - vied_nci_resource_size_t ext_mem_offset[VIED_NCI_N_DATA_MEM_TYPE_ID]; -#endif -#if VIED_NCI_N_DEV_CHN_ID > 0 + vied_nci_resource_size_t ext_mem_offset[VIED_NCI_N_DATA_MEM_TYPE_ID_MAX]; /** Device channel allocation offset given to this process */ - vied_nci_resource_size_t dev_chn_offset[VIED_NCI_N_DEV_CHN_ID]; -#endif -#if VIED_NCI_N_DATA_MEM_TYPE_ID > 0 + vied_nci_resource_size_t dev_chn_offset[VIED_NCI_N_DEV_CHN_ID_MAX]; /** (external) Memory ID */ - vied_nci_resource_id_t ext_mem_id[VIED_NCI_N_DATA_MEM_TYPE_ID]; -#endif + vied_nci_resource_id_t ext_mem_id[VIED_NCI_N_DATA_MEM_TYPE_ID_MAX]; #if N_PADDING_UINT8_IN_PROCESS_EXT_STRUCT > 0 /** Number of processes (mapped on cells) this process depends on */ uint8_t padding[N_PADDING_UINT8_IN_PROCESS_EXT_STRUCT]; @@ -97,11 +89,11 @@ struct ia_css_process_s { /** Offset in bytes to process extension structure, ia_css_process_ext_s * Align to 32 bit boundary. * Set to zero if extension is not used. The manifest must be queried to - * find out if the extensino is necessary. + * find out if the extension is necessary. * @see ia_css_program_manifest_process_requires_extension() */ uint8_t process_extension_offset; - /** Referal ID to a specific program. This ID is unique across PG's and - * can be used to retreive program meta data (AKA "program descriptor") + /** Referral ID to a specific program. This ID is unique across PG's and + * can be used to retrieve program meta data (AKA "program descriptor") * from the client package, including the program manifest and even * firmware program code, if the program is to be executed on a DSP. */ ia_css_program_ID_t ID; diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_process_types.h b/modules/ia_css/ipu6ep/include/ia_css_psys_process_types.h index 748db439..9c7a9dc8 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_process_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_process_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.h b/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.h index 9a06e995..afac8563 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -144,7 +144,7 @@ uint8_t ia_css_program_group_manifest_get_terminal_count( /*! Get the (pointer to) private data blob in the manifest - Private data is used by FW and is opauque to the SW stack + Private data is used by FW and is opaque to the SW stack @param manifest[in] program group manifest object @@ -288,7 +288,7 @@ ia_css_program_group_manifest_get_program_terminal_manifest( sections of the program init terminal, @param kernel_fragment_seq_count[in] Number of kernel fragment - seqence info. + sequence info. @param progctrlinit_load_section_counts[in] Number of progctrinit load sections (size of array is program_count) @param progctrlinit_connect_section_counts[in] Number of progctrinit connect diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.hsys.user.h b/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.hsys.user.h index dc79168a..093f7f0e 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.hsys.user.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.hsys.user.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.sim.h b/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.sim.h index 98d6a023..1ed3f796 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.sim.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest.sim.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest_impl.h b/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest_impl.h index e86ff939..5ffec7e6 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_manifest_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_private.h b/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_private.h index 04c826a3..4424050f 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_private.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_program_group_private.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,13 +77,13 @@ struct ia_css_program_group_manifest_s { }; #define SIZE_OF_PROGRAM_MANIFEST_EXT_STRUCT_IN_BYTES \ - ((VIED_NCI_RESOURCE_BITMAP_BITS * VIED_NCI_N_DEV_DFM_ID) \ - + (VIED_NCI_RESOURCE_BITMAP_BITS * VIED_NCI_N_DEV_DFM_ID) \ - + (VIED_NCI_RESOURCE_SIZE_BITS * VIED_NCI_N_DATA_MEM_TYPE_ID * 2) \ - + (VIED_NCI_RESOURCE_SIZE_BITS * VIED_NCI_N_DEV_CHN_ID * 2) \ + ((VIED_NCI_RESOURCE_BITMAP_BITS * VIED_NCI_N_DEV_DFM_ID_MAX) \ + + (VIED_NCI_RESOURCE_BITMAP_BITS * VIED_NCI_N_DEV_DFM_ID_MAX) \ + + (VIED_NCI_RESOURCE_SIZE_BITS * VIED_NCI_N_DATA_MEM_TYPE_ID_MAX * 2) \ + + (VIED_NCI_RESOURCE_SIZE_BITS * VIED_NCI_N_DEV_CHN_ID_MAX * 2) \ + (2 * IA_CSS_UINT8_T_BITS * IA_CSS_MAX_INPUT_DEC_RESOURCES) \ + (2 * IA_CSS_UINT8_T_BITS * IA_CSS_MAX_OUTPUT_DEC_RESOURCES) \ - + (IA_CSS_UINT8_T_BITS * VIED_NCI_N_DEV_DFM_ID) + \ + + (IA_CSS_UINT8_T_BITS * VIED_NCI_N_DEV_DFM_ID_MAX) + \ + (N_PADDING_UINT8_IN_PROGRAM_MANIFEST_EXT * IA_CSS_UINT8_T_BITS)) /** "Extended" meta-data for a single program @@ -91,33 +91,25 @@ struct ia_css_program_group_manifest_s { * Mostly, if not completely, internal to FW and of no interest to the SW stack. */ struct ia_css_program_manifest_ext_s { -#if VIED_NCI_N_DEV_DFM_ID > 0 /** DFM port allocation of this program */ - vied_nci_resource_bitmap_t dfm_port_bitmap[VIED_NCI_N_DEV_DFM_ID]; + vied_nci_resource_bitmap_t dfm_port_bitmap[VIED_NCI_N_DEV_DFM_ID_MAX]; /** Active DFM ports which need a kick * If an empty port is configured to run in active mode, the empty * port and the corresponding full port(s) in the stream must be kicked. * The empty port must always be kicked after the full port. */ - vied_nci_resource_bitmap_t dfm_active_port_bitmap[VIED_NCI_N_DEV_DFM_ID]; -#endif -#if VIED_NCI_N_DATA_MEM_TYPE_ID > 0 + vied_nci_resource_bitmap_t dfm_active_port_bitmap[VIED_NCI_N_DEV_DFM_ID_MAX]; /** (external) Memory allocation size needs of this program */ - vied_nci_resource_size_t ext_mem_size[VIED_NCI_N_DATA_MEM_TYPE_ID]; - vied_nci_resource_size_t ext_mem_offset[VIED_NCI_N_DATA_MEM_TYPE_ID]; -#endif -#if VIED_NCI_N_DEV_CHN_ID > 0 + vied_nci_resource_size_t ext_mem_size[VIED_NCI_N_DATA_MEM_TYPE_ID_MAX]; + vied_nci_resource_size_t ext_mem_offset[VIED_NCI_N_DATA_MEM_TYPE_ID_MAX]; /** Device channel allocation size needs of this program */ - vied_nci_resource_size_t dev_chn_size[VIED_NCI_N_DEV_CHN_ID]; - vied_nci_resource_size_t dev_chn_offset[VIED_NCI_N_DEV_CHN_ID]; -#endif -#if VIED_NCI_N_DEV_DFM_ID > 0 + vied_nci_resource_size_t dev_chn_size[VIED_NCI_N_DEV_CHN_ID_MAX]; + vied_nci_resource_size_t dev_chn_offset[VIED_NCI_N_DEV_CHN_ID_MAX]; /** DFM ports are relocatable if value is set to 1. * The flag is per dfm port type. * This will not be supported for now. */ - uint8_t is_dfm_relocatable[VIED_NCI_N_DEV_DFM_ID]; -#endif + uint8_t is_dfm_relocatable[VIED_NCI_N_DEV_DFM_ID_MAX]; #if IA_CSS_MAX_INPUT_DEC_RESOURCES > 0 /** DEC compression flush service entry, describing which streams * require flush service handling for decompression (input). diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.h b/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.h index db426f95..99b6d9ab 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -380,7 +380,7 @@ uint8_t ia_css_program_manifest_get_is_dfm_relocatable( @return 0 when not applicable and/or invalid arguments - @deprecated Implementation is trival (returns 0) and + @deprecated Implementation is trivial (returns 0) and no known users or known intention for future use. */ IA_CSS_PSYS_STATIC_STORAGE_CLASS_H diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.hsys.kernel.h b/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.hsys.kernel.h index 30e31d22..6708a653 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.hsys.kernel.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.hsys.kernel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.hsys.user.h b/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.hsys.user.h index 12a77700..aa2bb79e 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.hsys.user.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.hsys.user.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.sim.h b/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.sim.h index 50ecd3ee..2843b62c 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.sim.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest.sim.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest_impl.h b/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest_impl.h index 04803a38..8d424c3d 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_program_manifest_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ ia_css_program_manifest_ext_t *ia_css_program_manifest_get_extension(const ia_cs EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_extension invalid argument\n"); + "ia_css_program_manifest_get_extension invalid argument\n"); } return NULL; } @@ -56,8 +56,8 @@ vied_nci_resource_size_t ia_css_program_manifest_get_int_mem_size( (void)manifest; (void)mem_type_id; IA_CSS_TRACE_0(PSYSAPI_STATIC, INFO, - "ia_css_program_manifest_get_int_mem_size always returns 0" - "(internally memory feature not used).\n"); + "ia_css_program_manifest_get_int_mem_size always returns 0" + "(internally memory feature not used).\n"); return 0; } @@ -70,7 +70,7 @@ uint8_t ia_css_program_manifest_get_input_terminal_id( ia_css_program_manifest_ext_t *manifest_ext = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_input_stream_id(): enter:\n"); + "ia_css_program_manifest_get_input_stream_id(): enter:\n"); verifexitval(manifest != NULL, EFAULT); verifexitval(idx < IA_CSS_MAX_INPUT_DEC_RESOURCES, EFAULT); manifest_ext = ia_css_program_manifest_get_extension(manifest); @@ -98,7 +98,7 @@ uint8_t ia_css_program_manifest_get_output_terminal_id( ia_css_program_manifest_ext_t *manifest_ext = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_output_terminal_id(): enter:\n"); + "ia_css_program_manifest_get_output_terminal_id(): enter:\n"); verifexitval(manifest != NULL, EFAULT); verifexitval(idx < IA_CSS_MAX_OUTPUT_DEC_RESOURCES, EFAULT); manifest_ext = ia_css_program_manifest_get_extension(manifest); @@ -127,7 +127,7 @@ uint8_t ia_css_program_manifest_get_input_stream_id( ia_css_program_manifest_ext_t *manifest_ext = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_input_stream_id(): enter:\n"); + "ia_css_program_manifest_get_input_stream_id(): enter:\n"); verifexitval(manifest != NULL, EFAULT); verifexitval(idx < IA_CSS_MAX_INPUT_DEC_RESOURCES, EFAULT); manifest_ext = ia_css_program_manifest_get_extension(manifest); @@ -155,7 +155,7 @@ uint8_t ia_css_program_manifest_get_output_stream_id( ia_css_program_manifest_ext_t *manifest_ext = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_output_stream_id(): enter:\n"); + "ia_css_program_manifest_get_output_stream_id(): enter:\n"); verifexitval(manifest != NULL, EFAULT); verifexitval(idx < IA_CSS_MAX_OUTPUT_DEC_RESOURCES, EFAULT); manifest_ext = ia_css_program_manifest_get_extension(manifest); @@ -184,7 +184,7 @@ uint8_t ia_css_program_manifest_get_is_dfm_relocatable( ia_css_program_manifest_ext_t *manifest_ext = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_is_dfm_relocatable(): enter:\n"); + "ia_css_program_manifest_get_is_dfm_relocatable(): enter:\n"); verifexitval(manifest != NULL, EFAULT); verifexitval(dfm_type_id < VIED_NCI_N_DEV_DFM_ID, EFAULT); manifest_ext = ia_css_program_manifest_get_extension(manifest); @@ -194,7 +194,7 @@ uint8_t ia_css_program_manifest_get_is_dfm_relocatable( EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_is_dfm_relocatable invalid argument\n"); + "ia_css_program_manifest_get_is_dfm_relocatable invalid argument\n"); return 0; } return manifest_ext->is_dfm_relocatable[dfm_type_id]; @@ -209,7 +209,7 @@ vied_nci_resource_bitmap_t ia_css_program_manifest_get_dfm_port_bitmap( ia_css_program_manifest_ext_t *manifest_ext = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_dfm_port_bitmap(): enter:\n"); + "ia_css_program_manifest_get_dfm_port_bitmap(): enter:\n"); verifexitval(manifest != NULL, EFAULT); verifexitval(dfm_type_id < VIED_NCI_N_DEV_DFM_ID, EFAULT); manifest_ext = ia_css_program_manifest_get_extension(manifest); @@ -219,7 +219,7 @@ vied_nci_resource_bitmap_t ia_css_program_manifest_get_dfm_port_bitmap( EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_dfm_port_bitmap invalid argument\n"); + "ia_css_program_manifest_get_dfm_port_bitmap invalid argument\n"); return 0; } return manifest_ext->dfm_port_bitmap[dfm_type_id]; @@ -234,7 +234,7 @@ vied_nci_resource_bitmap_t ia_css_program_manifest_get_dfm_active_port_bitmap( ia_css_program_manifest_ext_t *manifest_ext = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_dfm_active_port_bitmap(): enter:\n"); + "ia_css_program_manifest_get_dfm_active_port_bitmap(): enter:\n"); verifexitval(manifest != NULL, EFAULT); verifexitval(dfm_type_id < VIED_NCI_N_DEV_DFM_ID, EFAULT); manifest_ext = ia_css_program_manifest_get_extension(manifest); @@ -244,7 +244,7 @@ vied_nci_resource_bitmap_t ia_css_program_manifest_get_dfm_active_port_bitmap( EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_dfm_active_port_bitmap invalid argument\n"); + "ia_css_program_manifest_get_dfm_active_port_bitmap invalid argument\n"); return 0; } return manifest_ext->dfm_active_port_bitmap[dfm_type_id]; @@ -260,7 +260,7 @@ vied_nci_resource_size_t ia_css_program_manifest_get_ext_mem_size( ia_css_program_manifest_ext_t *manifest_ext = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_ext_mem_size(): enter:\n"); + "ia_css_program_manifest_get_ext_mem_size(): enter:\n"); verifexitval(manifest != NULL, EFAULT); verifexitval(mem_type_id < VIED_NCI_N_DATA_MEM_TYPE_ID, EFAULT); manifest_ext = ia_css_program_manifest_get_extension(manifest); @@ -270,7 +270,7 @@ vied_nci_resource_size_t ia_css_program_manifest_get_ext_mem_size( EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_ext_mem_size invalid argument\n"); + "ia_css_program_manifest_get_ext_mem_size invalid argument\n"); return 0; } return manifest_ext->ext_mem_size[mem_type_id]; @@ -285,7 +285,7 @@ vied_nci_resource_size_t ia_css_program_manifest_get_ext_mem_offset( ia_css_program_manifest_ext_t *manifest_ext = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_ext_mem_offset(): enter:\n"); + "ia_css_program_manifest_get_ext_mem_offset(): enter:\n"); verifexitval(manifest != NULL, EFAULT); verifexitval(mem_type_id < VIED_NCI_N_DATA_MEM_TYPE_ID, EFAULT); manifest_ext = ia_css_program_manifest_get_extension(manifest); @@ -295,7 +295,7 @@ vied_nci_resource_size_t ia_css_program_manifest_get_ext_mem_offset( EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_ext_mem_offset invalid argument\n"); + "ia_css_program_manifest_get_ext_mem_offset invalid argument\n"); return 0; } return manifest_ext->ext_mem_offset[mem_type_id]; @@ -311,7 +311,7 @@ vied_nci_resource_size_t ia_css_program_manifest_get_dev_chn_size( ia_css_program_manifest_ext_t *manifest_ext = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_dev_chn_size(): enter:\n"); + "ia_css_program_manifest_get_dev_chn_size(): enter:\n"); verifexitval(manifest != NULL, EFAULT); verifexitval(dev_chn_id < VIED_NCI_N_DEV_CHN_ID, EFAULT); manifest_ext = ia_css_program_manifest_get_extension(manifest); @@ -321,7 +321,7 @@ vied_nci_resource_size_t ia_css_program_manifest_get_dev_chn_size( EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_dev_chn_size invalid argument\n"); + "ia_css_program_manifest_get_dev_chn_size invalid argument\n"); return 0; } return manifest_ext->dev_chn_size[dev_chn_id]; @@ -336,7 +336,7 @@ vied_nci_resource_size_t ia_css_program_manifest_get_dev_chn_offset( ia_css_program_manifest_ext_t *manifest_ext = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_dev_chn_offset(): enter:\n"); + "ia_css_program_manifest_get_dev_chn_offset(): enter:\n"); verifexitval(manifest != NULL, EFAULT); verifexitval(dev_chn_id < VIED_NCI_N_DEV_CHN_ID, EFAULT); manifest_ext = ia_css_program_manifest_get_extension(manifest); @@ -346,7 +346,7 @@ vied_nci_resource_size_t ia_css_program_manifest_get_dev_chn_offset( EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_dev_chn_offset invalid argument\n"); + "ia_css_program_manifest_get_dev_chn_offset invalid argument\n"); return 0; } return manifest_ext->dev_chn_offset[dev_chn_id]; @@ -360,12 +360,12 @@ size_t ia_css_program_manifest_get_size( DECLARE_ERRVAL IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_size(): enter:\n"); + "ia_css_program_manifest_get_size(): enter:\n"); verifexitval(manifest != NULL, EFAULT); EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_size invalid argument\n"); + "ia_css_program_manifest_get_size invalid argument\n"); return 0; } @@ -379,12 +379,12 @@ ia_css_program_ID_t ia_css_program_manifest_get_program_ID( DECLARE_ERRVAL IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_program_ID(): enter:\n"); + "ia_css_program_manifest_get_program_ID(): enter:\n"); verifexitval(manifest != NULL, EFAULT); EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_program_ID invalid argument\n"); + "ia_css_program_manifest_get_program_ID invalid argument\n"); return IA_CSS_PROGRAM_INVALID_ID; } return manifest->ID; @@ -398,14 +398,14 @@ ia_css_program_group_manifest_t *ia_css_program_manifest_get_parent( char *base = NULL; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_parent(): enter:\n"); + "ia_css_program_manifest_get_parent(): enter:\n"); verifexitval(manifest != NULL, EFAULT); base = (char *)((char *)manifest + manifest->parent_offset); EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_parent invalid argument\n"); + "ia_css_program_manifest_get_parent invalid argument\n"); return NULL; } return (ia_css_program_group_manifest_t *)(base); @@ -418,12 +418,12 @@ vied_nci_cell_type_ID_t ia_css_program_manifest_get_cell_type_ID( DECLARE_ERRVAL IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_cell_type_ID(): enter:\n"); + "ia_css_program_manifest_get_cell_type_ID(): enter:\n"); verifexitval(manifest != NULL, EFAULT); EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_cell_type_ID invalid argument\n"); + "ia_css_program_manifest_get_cell_type_ID invalid argument\n"); return VIED_NCI_N_CELL_TYPE_ID; } return manifest->cell_type_id; @@ -436,12 +436,12 @@ ia_css_program_type_t ia_css_program_manifest_get_type( DECLARE_ERRVAL IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_type(): enter:\n"); + "ia_css_program_manifest_get_type(): enter:\n"); verifexitval(manifest != NULL, EFAULT); EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_type invalid argument\n"); + "ia_css_program_manifest_get_type invalid argument\n"); return IA_CSS_N_PROGRAM_TYPES; } return manifest->program_type; @@ -454,12 +454,12 @@ uint8_t ia_css_program_manifest_get_terminal_dependency_count( DECLARE_ERRVAL IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_terminal_dependency_count(): enter:\n"); + "ia_css_program_manifest_get_terminal_dependency_count(): enter:\n"); verifexitval(manifest != NULL, EFAULT); EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_terminal_dependency_count invalid argument\n"); + "ia_css_program_manifest_get_terminal_dependency_count invalid argument\n"); return 0; } return manifest->terminal_dependency_count; @@ -475,7 +475,7 @@ uint8_t ia_css_program_manifest_get_terminal_dependency( uint8_t terminal_dependency_count; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_terminal_dependency(): enter:\n"); + "ia_css_program_manifest_get_terminal_dependency(): enter:\n"); verifexitval(manifest != NULL, EFAULT); terminal_dependency_count = ia_css_program_manifest_get_terminal_dependency_count(manifest); @@ -486,7 +486,7 @@ uint8_t ia_css_program_manifest_get_terminal_dependency( EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_terminal_dependency invalid argument\n"); + "ia_css_program_manifest_get_terminal_dependency invalid argument\n"); return IA_CSS_PROGRAM_INVALID_DEPENDENCY; } return *terminal_dep_ptr; @@ -499,7 +499,7 @@ bool ia_css_is_program_manifest_singular_program_type( ia_css_program_type_t program_type; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_is_program_manifest_singular_program_type(): enter:\n"); + "ia_css_is_program_manifest_singular_program_type(): enter:\n"); program_type = ia_css_program_manifest_get_type(manifest); @@ -521,7 +521,7 @@ uint8_t ia_css_program_manifest_get_program_dependency_count( EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_program_dependency_count invalid argument\n"); + "ia_css_program_manifest_get_program_dependency_count invalid argument\n"); return 0; } return manifest->program_dependency_count; @@ -537,7 +537,7 @@ uint8_t ia_css_program_manifest_get_program_dependency( uint8_t program_dependency_count; IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_program_dependency(): enter:\n"); + "ia_css_program_manifest_get_program_dependency(): enter:\n"); verifexitval(manifest != NULL, EFAULT); program_dependency_count = @@ -550,7 +550,7 @@ uint8_t ia_css_program_manifest_get_program_dependency( EXIT: if (!noerror()) { IA_CSS_TRACE_0(PSYSAPI_STATIC, WARNING, - "ia_css_program_manifest_get_program_dependency invalid argument\n"); + "ia_css_program_manifest_get_program_dependency invalid argument\n"); return IA_CSS_PROGRAM_INVALID_DEPENDENCY; } return *program_dep_ptr; @@ -563,7 +563,7 @@ ia_css_kernel_bitmap_t ia_css_program_manifest_get_kernel_bitmap( DECLARE_ERRVAL IA_CSS_TRACE_0(PSYSAPI_STATIC, VERBOSE, - "ia_css_program_manifest_get_kernel_bitmap(): enter:\n"); + "ia_css_program_manifest_get_kernel_bitmap(): enter:\n"); verifexitval(manifest != NULL, EFAULT); EXIT: if (!noerror()) { diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_sim_trace.h b/modules/ia_css/ipu6ep/include/ia_css_psys_sim_trace.h index a5cf6f78..75f07d5c 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_sim_trace.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_sim_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_static_trace.h b/modules/ia_css/ipu6ep/include/ia_css_psys_static_trace.h index 03c355b3..5f0f5a30 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_static_trace.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_static_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal.h b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal.h index 1dcb3b3c..1794009a 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -208,7 +208,7 @@ int ia_css_data_terminal_set_link_id( /*! Set stream2gen buffer size used in stream to GEN connection * This function should be called, in case we are in streaming use-case, and * we need to configure the stream2gen_buffer_size to be less than full image's height. - * Note, that the stream2gen_buffer_size is set to a defalut value of full image's height + * Note, that the stream2gen_buffer_size is set to a default value of full image's height * during terminal_create function. * @param terminal[in] data terminal object @@ -258,7 +258,7 @@ bool ia_css_is_terminal_valid( /* ================= Program Control Init Terminal - START ================= */ /*! - * Gets the program init terminal descripor size + * Gets the program init terminal descriptor size * @param manifest[in] program control init terminal manifest * @param pg_manifest[in] program group manifest * @param kernel_bitmap[in] kernel enable bitmap @@ -278,7 +278,7 @@ ia_css_program_control_init_terminal_get_descriptor_size( * @param manifest[in] program control init terminal manifest * @param pg_manifest[in] program group manifest * @param kernel_bitmap[in] kernel enable bitmap - * @return < 0 on erro + * @return < 0 on error */ IA_CSS_PSYS_DYNAMIC_STORAGE_CLASS_H int @@ -302,7 +302,7 @@ ia_css_program_control_init_terminal_get_program_desc( ); /*! - * Pretty prints the program control init termnial + * Pretty prints the program control init terminal * @param terminal[in] program control init terminal */ IA_CSS_PSYS_DYNAMIC_STORAGE_CLASS_H diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal.hsys.user.h b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal.hsys.user.h index 5abd3211..7970906e 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal.hsys.user.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal.hsys.user.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_impl.h b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_impl.h index 5a965794..9b044fc9 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.h b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.h index 3255e10f..5a0ee23c 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.hsys.user.h b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.hsys.user.h index 1a7b7995..7bc46b3d 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.hsys.user.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.hsys.user.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.sim.h b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.sim.h index 22c40422..a38336b2 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.sim.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest.sim.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest_impl.h b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest_impl.h index 8c99fa5d..e7d54ffc 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_manifest_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -211,10 +211,10 @@ static void ia_css_terminal_manifest_set_attributes_by_type( ia_css_terminal_manifest_set_connect_buffer_type(manifest, connect_buf_type); } -/** Temporary implementation for new fields until the manfifest generator +/** Temporary implementation for new fields until the manifest generator * tool will be enhance to set values directly. * - * - Attibutes are set to meaningful values by mapping terminal type to + * - Attributes are set to meaningful values by mapping terminal type to * attributes * - connect_ID is set to the invalid terminal ID value: IA_CSS_TERMINAL_INVALID_ID * - max_payload_size is set to UINT32_MAX diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_private_types.h b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_private_types.h index ef3b7915..def3bdbf 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_private_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_terminal_private_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,7 +61,7 @@ struct ia_css_data_terminal_s { /** Reserved * @note No known intent for this reservation field. */ uint32_t reserved; - /** Tranfer method for send/receving data to/from this terminal. */ + /** Transfer method for send/receiving data to/from this terminal. */ ia_css_connection_type_t connection_type; /** Offset in bytes from the start of this structure to a Array[fragment_count] of * type "ia_css_fragment_descriptor_t", aligned to a 64 bit boundary. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_transport.h b/modules/ia_css/ipu6ep/include/ia_css_psys_transport.h index 23f84fd9..cfba5b0c 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_transport.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_transport.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psys_transport_dep.h b/modules/ia_css/ipu6ep/include/ia_css_psys_transport_dep.h index 5010c5b7..ffd88ead 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psys_transport_dep.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psys_transport_dep.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psysapi_fw_version.h b/modules/ia_css/ipu6ep/include/ia_css_psysapi_fw_version.h index 89c63a75..724870d8 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psysapi_fw_version.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psysapi_fw_version.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_psysapi_trace.h b/modules/ia_css/ipu6ep/include/ia_css_psysapi_trace.h index a98c47c3..4ac6cc01 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_psysapi_trace.h +++ b/modules/ia_css/ipu6ep/include/ia_css_psysapi_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_rbm.h b/modules/ia_css/ipu6ep/include/ia_css_rbm.h index fbe6222a..915407e0 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_rbm.h +++ b/modules/ia_css/ipu6ep/include/ia_css_rbm.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_rbm_impl.h b/modules/ia_css/ipu6ep/include/ia_css_rbm_impl.h index 0ed56842..aaa095ab 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_rbm_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_rbm_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -202,7 +202,7 @@ ia_css_rbm_t ia_css_rbm_create_from_uint64( result = ia_css_rbm_clear(); for (i = 0; i < MIN(nof_elems_bits64, IA_CSS_RBM_NOF_ELEMS); i++) { - /* masking is done implictly, the MSB bits of casting will be chopped off */ + /* masking is done implicitly, the MSB bits of casting will be chopped off */ result.data[i] = (IA_CSS_RBM_ELEM_TYPE) (value >> (i * IA_CSS_RBM_ELEM_BITS)); } @@ -308,7 +308,7 @@ int ia_css_rbm_range_val( IA_CSS_TRACE_0(RBM, VERBOSE, "ia_css_rbm_range_val(): enter:\n"); assert(index < IA_CSS_RBM_BITS); - /* Extract the bit range from the data array relevane entry */ + /* Extract the bit range from the data array relevant entry */ elem_index = index / IA_CSS_RBM_ELEM_BITS; elem_index_end = (index + size - 1) / IA_CSS_RBM_ELEM_BITS; elem_bit_index = index % IA_CSS_RBM_ELEM_BITS; diff --git a/modules/ia_css/ipu6ep/include/ia_css_rbm_manifest.h b/modules/ia_css/ipu6ep/include/ia_css_rbm_manifest.h index 3145e0e1..76568c39 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_rbm_manifest.h +++ b/modules/ia_css/ipu6ep/include/ia_css_rbm_manifest.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_rbm_manifest_types.h b/modules/ia_css/ipu6ep/include/ia_css_rbm_manifest_types.h index 662b9ef3..35bbf36e 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_rbm_manifest_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_rbm_manifest_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_rbm_trace.h b/modules/ia_css/ipu6ep/include/ia_css_rbm_trace.h index 80086ca5..3f45f1cd 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_rbm_trace.h +++ b/modules/ia_css/ipu6ep/include/ia_css_rbm_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_terminal.h b/modules/ia_css/ipu6ep/include/ia_css_terminal.h index 9959c01f..ac53e25e 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_terminal.h +++ b/modules/ia_css/ipu6ep/include/ia_css_terminal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_terminal_base_types.h b/modules/ia_css/ipu6ep/include/ia_css_terminal_base_types.h index 91dfc139..e2d60553 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_terminal_base_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_terminal_base_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,17 +35,17 @@ /** Base structure for all terminal types. * * Terminals describe an opening between a program group and the outside world. - * They come in various types (data, statisitics, parameters, etc.) which may have + * They come in various types (data, statistics, parameters, etc.) which may have * extensions specific to those types. This structure is the base for all of those and - * must be the first field in any subclassed terminal structure type. + * must be the first field in any subclasses terminal structure type. */ struct ia_css_terminal_s { /**< Base terminal */ ia_css_terminal_type_t terminal_type; /**< Type ID of the terminal. This type enum defines the purpose of the terminal and its structure. */ uint32_t payload_size; /**< Size of buffer passed in buffer set for this terminal */ int16_t parent_offset; /**< Offset to the containing process group */ - uint16_t size; /**< Size of this whole terminal layout-structure, including subclassed extensions. */ + uint16_t size; /**< Size of this whole terminal layout-structure, including subclasses extensions. */ uint16_t tm_index; /**< Index of the terminal manifest object in the program group manifest. */ - ia_css_terminal_ID_t ID; /**< Absolute referal ID for this terminal, valid ID's != 0 */ + ia_css_terminal_ID_t ID; /**< Absolute referral ID for this terminal, valid ID's != 0 */ uint8_t padding[N_PADDING_UINT8_IN_TERMINAL_STRUCT]; }; /* ==================== Base Terminal - END ==================== */ diff --git a/modules/ia_css/ipu6ep/include/ia_css_terminal_defs.h b/modules/ia_css/ipu6ep/include/ia_css_terminal_defs.h index 0766c323..7e235086 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_terminal_defs.h +++ b/modules/ia_css/ipu6ep/include/ia_css_terminal_defs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -93,7 +93,7 @@ typedef enum ia_css_connect_buf_type { * and ia_css_connect_buf_type_t * To stage the changes, this type will remain - for now... * - * Inital type to attribute mapping table for staging: + * Initial type to attribute mapping table for staging: * ia_css_terminal_type_t | ia_css_terminal_cat_t | ia_css_terminal_dir_t | ia_css_terminal_rou_t | ia_css_connect_buf_type_t | notes * ----------------------------------------- | --------------------- | --------------------- | --------------------- | ---------------------------- | ----- * IA_CSS_TERMINAL_TYPE_DATA_IN | CAT_CONNECT | DIR_IN | ROU_FRAG? | BUF_TYPE_DATA | Fragment handling unclear @@ -143,14 +143,14 @@ typedef enum ia_css_terminal_type { IA_CSS_TERMINAL_TYPE_STATE_OUT, /** Program parameters, may change per fragment */ IA_CSS_TERMINAL_TYPE_PROGRAM, - /** Program control parameters. Non-alogrithmic parameters for system devices. */ + /** Program control parameters. Non-algorithmic parameters for system devices. */ IA_CSS_TERMINAL_TYPE_PROGRAM_CONTROL_INIT, IA_CSS_N_TERMINAL_TYPES } ia_css_terminal_type_t; #define IA_CSS_TERMINAL_TYPE_BITS 32 -/* Temporary redirection needed to facilicate merging with the drivers +/* Temporary redirection needed to facilitate merging with the drivers in a backwards compatible manner */ #define IA_CSS_TERMINAL_TYPE_PARAM_CACHED IA_CSS_TERMINAL_TYPE_PARAM_CACHED_IN diff --git a/modules/ia_css/ipu6ep/include/ia_css_terminal_impl.h b/modules/ia_css/ipu6ep/include/ia_css_terminal_impl.h index ff6ff35c..b7e79b9c 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_terminal_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_terminal_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest.h b/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest.h index 1868b157..1dc90554 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest.h +++ b/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_base_types.h b/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_base_types.h index bf4f46c8..63d91c3b 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_base_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_base_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_impl.h b/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_impl.h index 450a4b29..a44fe0ef 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_impl.h +++ b/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_types.h b/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_types.h index 220ac9b3..c63c1752 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_terminal_manifest_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ * section belongs to, and the target memory type (usually device registers). * * A region ID allows specifying multiple sections for a single device when a - * device's configuration registers are not all contigous. + * device's configuration registers are not all contiguous. */ struct ia_css_param_manifest_section_desc_s { /** Maximum size of the related parameter region */ @@ -170,7 +170,7 @@ struct ia_css_spatial_param_terminal_manifest_s { /** Contains limits for the frame spatial parameters */ ia_css_frame_grid_manifest_desc_t frame_grid_desc; /** - * Constains limits for the fragment spatial parameters + * Constrains limits for the fragment spatial parameters * - COMMON AMONG FRAGMENTS */ ia_css_fragment_grid_manifest_desc_t common_fragment_grid_desc; @@ -191,7 +191,7 @@ struct ia_css_spatial_param_terminal_manifest_s { uint8_t kernel_id; /** * Groups together compute units in order to achieve alignment - * requirements for transfes and to achieve canonical frame + * requirements for transfer and to achieve canonical frame * representation */ uint8_t compute_units_p_elem; @@ -247,7 +247,7 @@ struct ia_css_sliced_param_terminal_manifest_s { uint16_t sliced_param_section_count; /** * Points to array of ia_css_sliced_param_manifest_section_desc_s - * which constain info for the slicing of the parameters + * which contain info for the slicing of the parameters */ uint16_t sliced_param_section_offset; /** Kernel identifier */ diff --git a/modules/ia_css/ipu6ep/include/ia_css_terminal_types.h b/modules/ia_css/ipu6ep/include/ia_css_terminal_types.h index 7e635082..ad611e94 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_terminal_types.h +++ b/modules/ia_css/ipu6ep/include/ia_css_terminal_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -205,7 +205,7 @@ struct ia_css_spatial_param_terminal_s { uint16_t frame_grid_param_section_desc_offset; /** * Points to array of ia_css_fragment_spatial_desc_t - * which constain info for the fragments of spatial parameters + * which contain info for the fragments of spatial parameters */ uint16_t fragment_grid_desc_offset; }; @@ -217,7 +217,7 @@ struct ia_css_spatial_param_terminal_s { #define SIZE_OF_SLICE_PARAM_SECTION_DESC_STRUCT_BITS \ (N_UINT32_IN_SLICE_PARAM_SECTION_DESC_STRUCT * IA_CSS_UINT32_T_BITS) -/** A Slice of parameters ready to be trasferred from/to registers */ +/** A Slice of parameters ready to be transferred from/to registers */ struct ia_css_slice_param_section_desc_s { /** Offset of the parameter allocation in memory */ uint32_t mem_offset; @@ -235,7 +235,7 @@ struct ia_css_slice_param_section_desc_s { struct ia_css_fragment_slice_desc_s { /** * Points to array of ia_css_slice_param_section_desc_t - * which constain info for each prameter slice + * which contain info for each parameter slice */ uint16_t slice_section_desc_offset; /** Number of slices for the parameters for this fragment */ @@ -263,7 +263,7 @@ struct ia_css_sliced_param_terminal_s { uint32_t kernel_id; /** * Points to array of ia_css_fragment_slice_desc_t - * which constain info for the slicing of the parameters + * which contain info for the slicing of the parameters */ uint16_t fragment_slice_desc_offset; uint8_t padding[N_PADDING_UINT8_SLICED_PARAM_TERMINAL_STRUCT]; @@ -413,7 +413,7 @@ struct ia_css_fragment_param_section_desc_s { #define SIZE_OF_FRAG_SEQ_COMMANDS_STRUCT_BITS \ (N_UINT16_IN_FRAG_SEQ_COMMAND_STRUCT * IA_CSS_UINT16_T_BITS) -/** 4 commands packe together to save memory space */ +/** 4 commands packed together to save memory space */ struct ia_css_kernel_fragment_sequencer_command_desc_s { /** Contains the "(command_index%4) == index" command desc */ uint16_t line_count[IA_CSS_N_COMMAND_COUNT]; diff --git a/modules/ia_css/ipu6ep/include/ia_css_trace.h b/modules/ia_css/ipu6ep/include/ia_css_trace.h index 6ab5e289..bd8212a9 100644 --- a/modules/ia_css/ipu6ep/include/ia_css_trace.h +++ b/modules/ia_css/ipu6ep/include/ia_css_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -161,7 +161,7 @@ #define IA_CSS_TRACE_DYNAMIC_DECLARE(module) \ IA_CSS_TRACE_DYNAMIC_DECLARE_IMPL(module) /** -* Declares the configuration function for the dynamic api seperatly, if one +* Declares the configuration function for the dynamic api separately, if one * wants to use it. */ #define IA_CSS_TRACE_DYNAMIC_DECLARE_CONFIG_FUNC(module) \ @@ -178,7 +178,7 @@ #define IA_CSS_TRACE_DYNAMIC_DEFINE(module) \ IA_CSS_TRACE_DYNAMIC_DEFINE_IMPL(module) /** -* Defines the configuration function for the dynamic api seperatly, if one +* Defines the configuration function for the dynamic api separately, if one * wants to use it. */ #define IA_CSS_TRACE_DYNAMIC_DEFINE_CONFIG_FUNC(module) \ diff --git a/modules/ia_css/ipu6ep/include/ipu_device_acb_devices.h b/modules/ia_css/ipu6ep/include/ipu_device_acb_devices.h index 30b9f67d..cec120df 100644 --- a/modules/ia_css/ipu6ep/include/ipu_device_acb_devices.h +++ b/modules/ia_css/ipu6ep/include/ipu_device_acb_devices.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/ipu_device_gp_devices.h b/modules/ia_css/ipu6ep/include/ipu_device_gp_devices.h index 5aa3cd14..fceb72fa 100644 --- a/modules/ia_css/ipu6ep/include/ipu_device_gp_devices.h +++ b/modules/ia_css/ipu6ep/include/ipu_device_gp_devices.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/math_support.h b/modules/ia_css/ipu6ep/include/math_support.h index 05180a3b..6682d4d0 100644 --- a/modules/ia_css/ipu6ep/include/math_support.h +++ b/modules/ia_css/ipu6ep/include/math_support.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/misc_support.h b/modules/ia_css/ipu6ep/include/misc_support.h index c7b2debe..1265a37d 100644 --- a/modules/ia_css/ipu6ep/include/misc_support.h +++ b/modules/ia_css/ipu6ep/include/misc_support.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/pg_control_init_framework.h b/modules/ia_css/ipu6ep/include/pg_control_init_framework.h index 8c7a6e1b..8cd88b88 100644 --- a/modules/ia_css/ipu6ep/include/pg_control_init_framework.h +++ b/modules/ia_css/ipu6ep/include/pg_control_init_framework.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/platform_support.h b/modules/ia_css/ipu6ep/include/platform_support.h index 4f779ef5..058e71ec 100644 --- a/modules/ia_css/ipu6ep/include/platform_support.h +++ b/modules/ia_css/ipu6ep/include/platform_support.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/print_support.h b/modules/ia_css/ipu6ep/include/print_support.h index 9ddffb4b..b48eecce 100644 --- a/modules/ia_css/ipu6ep/include/print_support.h +++ b/modules/ia_css/ipu6ep/include/print_support.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/psys_system_global_impl.h b/modules/ia_css/ipu6ep/include/psys_system_global_impl.h index 72eb0cf5..75c62439 100644 --- a/modules/ia_css/ipu6ep/include/psys_system_global_impl.h +++ b/modules/ia_css/ipu6ep/include/psys_system_global_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/type_support.h b/modules/ia_css/ipu6ep/include/type_support.h index 57fea545..29539886 100644 --- a/modules/ia_css/ipu6ep/include/type_support.h +++ b/modules/ia_css/ipu6ep/include/type_support.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/vied_nci_acb_route_type.h b/modules/ia_css/ipu6ep/include/vied_nci_acb_route_type.h index 3ceb0c70..edbe8984 100644 --- a/modules/ia_css/ipu6ep/include/vied_nci_acb_route_type.h +++ b/modules/ia_css/ipu6ep/include/vied_nci_acb_route_type.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/include/vied_nci_psys_resource_model.h b/modules/ia_css/ipu6ep/include/vied_nci_psys_resource_model.h index 08e8bb49..cddb5542 100644 --- a/modules/ia_css/ipu6ep/include/vied_nci_psys_resource_model.h +++ b/modules/ia_css/ipu6ep/include/vied_nci_psys_resource_model.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include "type_support.h" #include "storage_class.h" +#include "vied_nci_psys_resource_model_common.h" #define HAS_DFM 1 #define HAS_DMA_INTERNAL 1 @@ -32,16 +33,6 @@ #define VIED_NCI_RBM_MAX_TERMINAL_DESC_COUNT 4 #define N_PADDING_UINT8_IN_RBM_MANIFEST 2 -/* The amount of padding bytes needed to make - * ia_css_process_s/ia_css_process_ext_s/ - * ia_css_program_manifest_s/ia_css_program_manifest_ext_s - * structures 32 bit aligned (source files have check on this) - */ -#define N_PADDING_UINT8_IN_PROCESS_STRUCT 0 -#define N_PADDING_UINT8_IN_PROCESS_EXT_STRUCT 0 -#define N_PADDING_UINT8_IN_PROGRAM_MANIFEST 0 -#define N_PADDING_UINT8_IN_PROGRAM_MANIFEST_EXT 2 - /* * Cell IDs */ @@ -291,10 +282,6 @@ typedef uint32_t vied_nci_resource_bitmap_t; #define IA_CSS_PROCESS_INVALID_DEPENDENCY ((vied_nci_resource_id_t)(-1)) #define IA_CSS_PROCESS_INVALID_OFFSET ((vied_nci_resource_size_t)(-1)) -#define IA_CSS_PROCESS_MAX_CELLS 1 - -#define IA_CSS_MAX_INPUT_DEC_RESOURCES 4 -#define IA_CSS_MAX_OUTPUT_DEC_RESOURCES 4 /* * Resource specifications * Note that the FAS uses the terminology local/remote memory. In the PSYS API, diff --git a/modules/ia_css/ipu6ep/include/vied_nci_psys_resource_model_common.h b/modules/ia_css/ipu6ep/include/vied_nci_psys_resource_model_common.h new file mode 100644 index 00000000..fa7478a9 --- /dev/null +++ b/modules/ia_css/ipu6ep/include/vied_nci_psys_resource_model_common.h @@ -0,0 +1,50 @@ +/* +* INTEL CONFIDENTIAL +* +* Copyright (C) 2023 Intel Corporation. +* All Rights Reserved. +* +* The source code contained or described herein and all documents +* related to the source code ("Material") are owned by Intel Corporation +* or licensors. Title to the Material remains with Intel +* Corporation or its licensors. The Material contains trade +* secrets and proprietary and confidential information of Intel or its +* licensors. The Material is protected by worldwide copyright +* and trade secret laws and treaty provisions. No part of the Material may +* be used, copied, reproduced, modified, published, uploaded, posted, +* transmitted, distributed, or disclosed in any way without Intel's prior +* express written permission. +* +* No License under any patent, copyright, trade secret or other intellectual +* property right is granted to or conferred upon you by disclosure or +* delivery of the Materials, either expressly, by implication, inducement, +* estoppel or otherwise. Any license under such intellectual property rights +* must be express and approved by Intel in writing. +*/ + +#ifndef __VIED_NCI_PSYS_RESOURCE_MODEL_COMMON_H +#define __VIED_NCI_PSYS_RESOURCE_MODEL_COMMON_H + +/*max sizes*/ +#define VIED_NCI_DEV_DFM_LB_EMPTY_PORT_ID_MAX 5 +#define VIED_NCI_N_DEV_DFM_ID_MAX (VIED_NCI_DEV_DFM_LB_EMPTY_PORT_ID_MAX+1) +#define VIED_NCI_N_DATA_MEM_TYPE_ID_MAX 6 +#define VIED_NCI_DEV_CHN_DMA_ISA_ID_MAX 4 +#define VIED_NCI_N_DEV_CHN_ID_MAX (VIED_NCI_DEV_CHN_DMA_ISA_ID_MAX+1) + +#define IA_CSS_MAX_INPUT_DEC_RESOURCES 4 +#define IA_CSS_MAX_OUTPUT_DEC_RESOURCES 4 + +#define IA_CSS_PROCESS_MAX_CELLS 1 + +/* The amount of padding bytes needed to make + * ia_css_process_s/ia_css_process_ext_s/ + * ia_css_program_manifest_s/ia_css_program_manifest_ext_s + * structures 32 bit aligned (source files have check on this) + */ +#define N_PADDING_UINT8_IN_PROCESS_EXT_STRUCT 0 +#define N_PADDING_UINT8_IN_PROCESS_STRUCT 0 +#define N_PADDING_UINT8_IN_PROGRAM_MANIFEST_EXT 2 +#define N_PADDING_UINT8_IN_PROGRAM_MANIFEST 0 + +#endif /* __VIED_NCI_PSYS_RESOURCE_MODEL_COMMON_H */ diff --git a/modules/ia_css/ipu6ep/include/vied_nci_psys_system_global.h b/modules/ia_css/ipu6ep/include/vied_nci_psys_system_global.h index 5597ab02..76b511c2 100644 --- a/modules/ia_css/ipu6ep/include/vied_nci_psys_system_global.h +++ b/modules/ia_css/ipu6ep/include/vied_nci_psys_system_global.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/src/ia_css_kernel_bitmap.c b/modules/ia_css/ipu6ep/src/ia_css_kernel_bitmap.c index 35a1dcc7..a7747032 100644 --- a/modules/ia_css/ipu6ep/src/ia_css_kernel_bitmap.c +++ b/modules/ia_css/ipu6ep/src/ia_css_kernel_bitmap.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ ia_css_kernel_bitmap_t ia_css_kernel_bitmap_create_from_uint64( #ifndef IA_CSS_KERNEL_BITMAP_DO_NOT_USE_ELEMS result = ia_css_kernel_bitmap_clear(); for (i = 0; i < MIN(nof_elems_bits64, IA_CSS_KERNEL_BITMAP_NOF_ELEMS); i++) { - /* masking is done implictly, the MSB bits of casting will bel chopped off */ + /* masking is done implicitly, the MSB bits of casting will be chopped off */ result.data[i] = (IA_CSS_KERNEL_BITMAP_ELEM_TYPE) (value >> (i * IA_CSS_KERNEL_BITMAP_ELEM_BITS)); } diff --git a/modules/ia_css/ipu6ep/src/ia_css_program_group_param.c b/modules/ia_css/ipu6ep/src/ia_css_program_group_param.c index e4ab5b90..90883754 100644 --- a/modules/ia_css/ipu6ep/src/ia_css_program_group_param.c +++ b/modules/ia_css/ipu6ep/src/ia_css_program_group_param.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/src/ia_css_psys_process.c b/modules/ia_css/ipu6ep/src/ia_css_psys_process.c index a05e1075..6184ac87 100644 --- a/modules/ia_css/ipu6ep/src/ia_css_psys_process.c +++ b/modules/ia_css/ipu6ep/src/ia_css_psys_process.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/src/ia_css_psys_process_group.c b/modules/ia_css/ipu6ep/src/ia_css_psys_process_group.c index 5b3c6502..bf1bd22f 100644 --- a/modules/ia_css/ipu6ep/src/ia_css_psys_process_group.c +++ b/modules/ia_css/ipu6ep/src/ia_css_psys_process_group.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/src/ia_css_psys_process_group_cmd_impl.c b/modules/ia_css/ipu6ep/src/ia_css_psys_process_group_cmd_impl.c index 07c42c7c..ad458c40 100644 --- a/modules/ia_css/ipu6ep/src/ia_css_psys_process_group_cmd_impl.c +++ b/modules/ia_css/ipu6ep/src/ia_css_psys_process_group_cmd_impl.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/src/ia_css_psys_program_group_manifest.c b/modules/ia_css/ipu6ep/src/ia_css_psys_program_group_manifest.c index c8f33b2b..9eda49ff 100644 --- a/modules/ia_css/ipu6ep/src/ia_css_psys_program_group_manifest.c +++ b/modules/ia_css/ipu6ep/src/ia_css_psys_program_group_manifest.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -156,7 +156,7 @@ size_t ia_css_sizeof_program_group_manifest( * does not fit the exact model as is being asserted on in * ia_css_is_program_group_manifest_valid. We therefore disable some checks. * Further investigation is needed to determine whether *_pregdc program group - * can be canged or that the model must be changed. + * can be changed or that the model must be changed. * #define USE_SIMPLIFIED_GRAPH_MODEL 1 allows multiple programs to be * connected to the same terminal, and it allows a kernel be mapped over * multiple programs. @@ -485,7 +485,7 @@ bool ia_css_is_program_group_manifest_valid( * That must be equal for * parallel subnodes, * must be unequal for - * exlusive and virtual subnodes + * exclusive and virtual subnodes */ verifexit( ((is_j_subset_i && is_i_subset_j) ^ diff --git a/modules/ia_css/ipu6ep/src/ia_css_psys_program_manifest.c b/modules/ia_css/ipu6ep/src/ia_css_psys_program_manifest.c index 185baec0..d49ddad9 100644 --- a/modules/ia_css/ipu6ep/src/ia_css_psys_program_manifest.c +++ b/modules/ia_css/ipu6ep/src/ia_css_psys_program_manifest.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/src/ia_css_psys_terminal.c b/modules/ia_css/ipu6ep/src/ia_css_psys_terminal.c index c7121954..2809050a 100644 --- a/modules/ia_css/ipu6ep/src/ia_css_psys_terminal.c +++ b/modules/ia_css/ipu6ep/src/ia_css_psys_terminal.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6ep/src/ia_css_psys_terminal_manifest.c b/modules/ia_css/ipu6ep/src/ia_css_psys_terminal_manifest.c index dcb58a91..99a1b3b9 100644 --- a/modules/ia_css/ipu6ep/src/ia_css_psys_terminal_manifest.c +++ b/modules/ia_css/ipu6ep/src/ia_css_psys_terminal_manifest.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/ia_css/ipu6epadln/readme.txt b/modules/ia_css/ipu6epadln/readme.txt new file mode 100644 index 00000000..385d38f2 --- /dev/null +++ b/modules/ia_css/ipu6epadln/readme.txt @@ -0,0 +1 @@ +create folder for libcamhal adln diff --git a/modules/sandboxing/IPCCommon.cpp b/modules/sandboxing/IPCCommon.cpp index fba1137e..59447a70 100644 --- a/modules/sandboxing/IPCCommon.cpp +++ b/modules/sandboxing/IPCCommon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,20 +25,16 @@ const char* IntelAlgoIpcCmdToString(IPC_CMD cmd) { "IPC_FD_INIT", "IPC_FD_RUN", "IPC_FD_DEINIT", "IPC_GRAPH_ADD_KEY", "IPC_GRAPH_PARSE", "IPC_GRAPH_RELEASE_NODES", "IPC_GRAPH_QUERY_GRAPH_SETTINGS", "IPC_GRAPH_CONFIG_STREAMS", "IPC_GRAPH_GET_CONFIG_DATA", "IPC_GRAPH_GET_CONNECTION", "IPC_GRAPH_GET_PG_ID", - "IPC_CCA_CONSTRUCT", "IPC_CCA_DESTRUCT", "IPC_CCA_INIT", "IPC_CCA_SET_STATS", + "IPC_CCA_CONSTRUCT", "IPC_CCA_DESTRUCT", "IPC_CCA_INIT", "IPC_CCA_RUN_AEC", "IPC_CCA_RUN_AIQ", "IPC_CCA_RUN_LTM", "IPC_CCA_UPDATE_ZOOM", - "IPC_CCA_RUN_DVS", "IPC_CCA_GET_CMC", "IPC_CCA_GET_MKN", "IPC_CCA_GET_AIQD", + "IPC_CCA_RUN_DVS", "IPC_CCA_GET_CMC", "IPC_CCA_GET_AIQD", "IPC_CCA_UPDATE_TUNING", "IPC_CCA_DEINIT", "IPC_CCA_RUN_AIC", "IPC_CCA_GET_PAL_SIZE", - "IPC_CCA_DECODE_STATS", "IPC_PG_PARAM_INIT", "IPC_PG_PARAM_PREPARE", + "IPC_PG_PARAM_INIT", "IPC_PG_PARAM_PREPARE", "IPC_PG_PARAM_ALLOCATE_PG", "IPC_PG_PARAM_GET_FRAG_DESCS", "IPC_PG_PARAM_PREPARE_PROGRAM", "IPC_PG_PARAM_REGISTER_PAYLOADS", "IPC_PG_PARAM_ENCODE", "IPC_PG_PARAM_DECODE", "IPC_PG_PARAM_DEINIT", "IPC_GPU_TNR_INIT", "IPC_GPU_TNR_GET_SURFACE_INFO", "IPC_GPU_TNR_PREPARE_SURFACE", "IPC_GPU_TNR_RUN_FRAME", "IPC_GPU_TNR_PARAM_UPDATE", "IPC_GPU_TNR_DEINIT", - // ENABLE_EVCP_S - "IPC_EVCP_INIT", "IPC_EVCP_UPDCONF", "IPC_EVCP_SETCONF", "IPC_EVCP_RUN_FRAME", - "IPC_EVCP_DEINIT", - // ENABLE_EVCP_E // LEVEL0_ICBM_S "IPC_ICBM_INIT", "IPC_ICBM_RUN_FRAME", "IPC_ICBM_DEINIT", // LEVEL0_ICBM_E @@ -55,8 +51,6 @@ IPC_GROUP IntelAlgoIpcCmdToGroup(IPC_CMD cmd) { group = IPC_GROUP_AIQ; } else if (cmd >= IPC_CCA_RUN_AIC && cmd <= IPC_CCA_GET_PAL_SIZE) { group = IPC_GROUP_PAL; - } else if (cmd == IPC_CCA_DECODE_STATS) { - group = IPC_GROUP_STATS; } else if (cmd >= IPC_PG_PARAM_INIT && cmd <= IPC_PG_PARAM_DEINIT) { group = IPC_GROUP_PSYS; } else if (cmd >= IPC_FD_INIT && cmd <= IPC_FD_DEINIT) { @@ -65,10 +59,6 @@ IPC_GROUP IntelAlgoIpcCmdToGroup(IPC_CMD cmd) { group = IPC_GROUP_GPU; } else if (cmd >= IPC_GPU_TNR_THREAD2_RUN_FRAME && cmd <= IPC_GPU_TNR_THREAD2_PARAM_UPDATE) { group = IPC_GROUP_GPU_THREAD2; - // ENABLE_EVCP_S - } else if (cmd >= IPC_EVCP_INIT && cmd <= IPC_EVCP_DEINIT) { - group = IPC_GROUP_GPU_EVCP; - // ENABLE_EVCP_E // LEVEL0_ICBM_S } else if (cmd >= IPC_ICBM_INIT && cmd <= IPC_ICBM_DEINIT) { group = IPC_GROUP_GPU_ICBM; @@ -84,14 +74,11 @@ const char* IntelAlgoServerThreadName(int index) { int count = 0; #ifndef GPU_ALGO_SERVER static const char* gIpcCmdMapping[IPC_CPU_GROUP_NUM] = { - "AiqCPUAlgoServer", "PalCPUAlgoServer", "StatsCPUAlgoServer", - "PsysCPUAlgoServer", "FdCPUAlgoServer", "OtherCPUAlgoServer"}; + "AiqCPUAlgoServer", "PalCPUAlgoServer", "PsysCPUAlgoServer", + "FdCPUAlgoServer", "OtherCPUAlgoServer"}; count = IPC_CPU_GROUP_NUM; #else static const char* gIpcCmdMapping[IPC_GPU_GROUP_NUM] = {"GPUAlgoServer", - // ENABLE_EVCP_S - "GPUEvcpServer", - // ENABLE_EVCP_E // LEVEL0_ICBM_S "GPUICBMServer", // LEVEL0_ICBM_E diff --git a/modules/sandboxing/IPCCommon.h b/modules/sandboxing/IPCCommon.h index 3793f913..4c73ad3b 100644 --- a/modules/sandboxing/IPCCommon.h +++ b/modules/sandboxing/IPCCommon.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,20 +43,17 @@ enum IPC_CMD { IPC_CCA_CONSTRUCT, IPC_CCA_DESTRUCT, IPC_CCA_INIT, - IPC_CCA_SET_STATS, IPC_CCA_RUN_AEC, IPC_CCA_RUN_AIQ, IPC_CCA_RUN_LTM, IPC_CCA_UPDATE_ZOOM, IPC_CCA_RUN_DVS, IPC_CCA_GET_CMC, - IPC_CCA_GET_MKN, IPC_CCA_GET_AIQD, IPC_CCA_UPDATE_TUNING, IPC_CCA_DEINIT, IPC_CCA_RUN_AIC, IPC_CCA_GET_PAL_SIZE, - IPC_CCA_DECODE_STATS, IPC_PG_PARAM_INIT, IPC_PG_PARAM_PREPARE, IPC_PG_PARAM_ALLOCATE_PG, @@ -73,14 +70,6 @@ enum IPC_CMD { IPC_GPU_TNR_RUN_FRAME, IPC_GPU_TNR_PARAM_UPDATE, IPC_GPU_TNR_DEINIT, - // ENABLE_EVCP_S - // GPU EVCP COMMANDS - IPC_EVCP_INIT, - IPC_EVCP_UPDCONF, - IPC_EVCP_GETCONF, - IPC_EVCP_RUN_FRAME, - IPC_EVCP_DEINIT, - // ENABLE_EVCP_E // LEVEL0_ICBM_S IPC_ICBM_INIT, IPC_ICBM_RUN_FRAME, @@ -102,16 +91,11 @@ enum IPC_GROUP { // IPC command group for cpu IPC_GROUP_AIQ, IPC_GROUP_PAL, - IPC_GROUP_STATS, IPC_GROUP_PSYS, IPC_GROUP_FD, IPC_GROUP_CPU_OTHER, // IPU command group for gpu IPC_GROUP_GPU, - // ENABLE_EVCP_S - // IPC Command group for Evcp using GPU. - IPC_GROUP_GPU_EVCP, - // ENABLE_EVCP_E // LEVEL0_ICBM_S IPC_GROUP_GPU_ICBM, // LEVEL0_ICBM_E diff --git a/modules/sandboxing/IPCIntelCca.h b/modules/sandboxing/IPCIntelCca.h index 385f915c..0159ffb7 100644 --- a/modules/sandboxing/IPCIntelCca.h +++ b/modules/sandboxing/IPCIntelCca.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation. + * Copyright (C) 2020-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,11 +32,16 @@ struct intel_cca_init_data { cca::cca_init_params inParams; }; -struct intel_cca_set_stats_data { +struct intel_cca_decode_stats_data { int cameraId; TuningMode tuningMode; - cca::cca_stats_params inParams; + ia_binary_data statsBuffer; + int32_t statsHandle; + uint32_t bitmap; + cca::cca_out_stats outStats; + + ia_isp_bxt_statistics_query_results_t results; }; struct intel_cca_run_aec_data { @@ -46,6 +51,12 @@ struct intel_cca_run_aec_data { uint64_t frameId; cca::cca_ae_input_params inParams; + bool hasStats; + cca::cca_stats_params inStatsParams; + + bool hasDecodeStats; + intel_cca_decode_stats_data decodeStatsParams; + cca::cca_ae_results results; }; @@ -56,7 +67,13 @@ struct intel_cca_run_aiq_data { uint64_t frameId; cca::cca_aiq_params inParams; - cca::cca_aiq_results results; + cca::cca_aiq_results* results; + int32_t aiqResultHandle; + + ia_mkn_trg type; + + cca::cca_mkn* mknResults; + int32_t mknResultsHandle; }; struct intel_cca_run_ltm_data { @@ -98,6 +115,7 @@ struct intel_cca_run_aic_data { struct intel_cca_get_cmc_data { int cameraId; TuningMode tuningMode; + cca::cca_cpf cpf; cca::cca_cmc results; }; @@ -109,16 +127,6 @@ struct intel_cca_get_aiqd_data { cca::cca_aiqd results; }; -struct intel_cca_mkn_data { - int cameraId; - TuningMode tuningMode; - - ia_mkn_trg type; - - cca::cca_mkn* results; - int32_t resultsHandle; -}; - struct intel_cca_update_tuning_data { int cameraId; TuningMode tuningMode; @@ -134,18 +142,6 @@ struct intel_cca_deinit_data { TuningMode tuningMode; }; -struct intel_cca_decode_stats_data { - int cameraId; - TuningMode tuningMode; - - ia_binary_data statsBuffer; - int32_t statsHandle; - uint32_t bitmap; - cca::cca_out_stats outStats; - - ia_isp_bxt_statistics_query_results_t results; -}; - struct intel_cca_get_pal_data_size { int cameraId; TuningMode tuningMode; diff --git a/modules/sandboxing/IPCIntelPGParam.cpp b/modules/sandboxing/IPCIntelPGParam.cpp index a9740182..0d27a091 100644 --- a/modules/sandboxing/IPCIntelPGParam.cpp +++ b/modules/sandboxing/IPCIntelPGParam.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation. + * Copyright (C) 2019-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -496,7 +496,7 @@ bool IPCIntelPGParam::serverFlattenDecode(void* pData, int dataSize, CheckAndLogError(!pData || dataSize < sizeof(pg_param_decode_params), false, "@%s, Wrong parameters, pData: %p, dataSize: %d", __func__, pData, dataSize); pg_param_decode_params* params = static_cast(pData); - params->clientStatsSize = statistics.size; + params->statsSize = statistics.size; return true; } @@ -506,7 +506,7 @@ bool IPCIntelPGParam::clientUnflattenDecode(void* pData, int dataSize, ia_binary pData, statistics, dataSize); pg_param_decode_params* params = static_cast(pData); - statistics->size = params->clientStatsSize; + statistics->size = params->statsSize; return true; } diff --git a/modules/sandboxing/IPCIntelPGParam.h b/modules/sandboxing/IPCIntelPGParam.h index 737e92a6..c783920c 100644 --- a/modules/sandboxing/IPCIntelPGParam.h +++ b/modules/sandboxing/IPCIntelPGParam.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation. + * Copyright (C) 2019-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,9 @@ #include "modules/sandboxing/IPCCommon.h" #include "src/core/psysprocessor/PGUtils.h" +#include "CameraTypes.h" +#include "modules/sandboxing/IPCIntelCca.h" + namespace icamera { #define MAX_PROCESS_GROUP_SIZE 8192 @@ -96,11 +99,14 @@ struct pg_param_decode_params { uintptr_t client; int32_t payloadCount; ia_binary_data payloads[IPU_MAX_TERMINAL_COUNT]; // save payloads of client - uint32_t clientStatsSize; int32_t clientStatsHandle; // Output uint32_t statsSize; + + // For stats decoding together + intel_cca_decode_stats_data decodeStatsParams; + bool hasStatsDecode; }; struct pg_param_deinit_params { diff --git a/modules/sandboxing/client/IntelAlgoClient.cpp b/modules/sandboxing/client/IntelAlgoClient.cpp index 602f70d5..6257bd8e 100644 --- a/modules/sandboxing/client/IntelAlgoClient.cpp +++ b/modules/sandboxing/client/IntelAlgoClient.cpp @@ -77,10 +77,10 @@ int IntelAlgoClient::initialize() { CheckAndLogError(!mMojoManagerToken, UNKNOWN_ERROR, "@%s, mMojoManagerToken is nullptr", __func__); - mCallback = base::Bind(&IntelAlgoClient::callbackHandler, base::Unretained(this)); + mCallback = base::BindRepeating(&IntelAlgoClient::callbackHandler, base::Unretained(this)); IntelAlgoClient::return_callback = returnCallback; - mNotifyCallback = base::Bind(&IntelAlgoClient::notifyHandler, base::Unretained(this)); + mNotifyCallback = base::BindRepeating(&IntelAlgoClient::notifyHandler, base::Unretained(this)); IntelAlgoClient::notify = notifyCallback; mBridge = cros::CameraAlgorithmBridge::CreateInstance(cros::CameraAlgorithmBackend::kVendorCpu, diff --git a/modules/sandboxing/client/IntelAlgoClient.h b/modules/sandboxing/client/IntelAlgoClient.h index 28bcfb79..30c57e85 100644 --- a/modules/sandboxing/client/IntelAlgoClient.h +++ b/modules/sandboxing/client/IntelAlgoClient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation. + * Copyright (C) 2019-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,8 +25,8 @@ #include "CameraLog.h" #include "Parameters.h" -#include "base/bind.h" -#include "base/callback.h" +#include "base/functional/bind.h" +#include "base/functional/callback.h" #include "cros-camera/camera_algorithm_bridge.h" #include "iutils/Thread.h" #include "modules/sandboxing/IPCCommon.h" @@ -99,8 +99,8 @@ class IntelAlgoClient : public camera_algorithm_callback_ops_t { std::unique_ptr mBridge; std::unique_ptr mGpuBridge; - base::Callback mCallback; - base::Callback mNotifyCallback; + base::RepeatingCallback mCallback; + base::RepeatingCallback mNotifyCallback; bool mIPCStatus; // true: no error happens, false: error happens std::mutex mIPCStatusMutex; // the mutex for mIPCStatus diff --git a/modules/sandboxing/client/IntelCcaClient.cpp b/modules/sandboxing/client/IntelCcaClient.cpp index ee730586..31795180 100644 --- a/modules/sandboxing/client/IntelCcaClient.cpp +++ b/modules/sandboxing/client/IntelCcaClient.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include +#include "PlatformData.h" #include "iutils/CameraLog.h" #include "iutils/Utils.h" @@ -71,14 +72,16 @@ void IntelCca::releaseAllInstances() { } } -IntelCca::IntelCca(int cameraId, TuningMode mode) : mCameraId(cameraId), mTuningMode(mode) { +IntelCca::IntelCca(int cameraId, TuningMode mode) + : mCameraId(cameraId), + mTuningMode(mode), + mHasMknData(false) { LOG1(" @%s, tuningMode:%d", cameraId, __func__, mode); std::string number = std::to_string(cameraId) + std::to_string(mode) + std::to_string(reinterpret_cast(this)); std::string structName = "/ccaStruct" + number + SHM_NAME; std::string initName = "/ccaInit" + number + SHM_NAME; - std::string statsName = "/ccaStats" + number + SHM_NAME; std::string aecName = "/ccaAec" + number + SHM_NAME; std::string aiqName = "/ccaAiq" + number + SHM_NAME; std::string ltmName = "/ccaLtm" + number + SHM_NAME; @@ -86,7 +89,6 @@ IntelCca::IntelCca(int cameraId, TuningMode mode) : mCameraId(cameraId), mTuning std::string dvsName = "/ccaDvs" + number + SHM_NAME; std::string aicName = "/ccaAic" + number + SHM_NAME; std::string cmcName = "/ccaCmc" + number + SHM_NAME; - std::string mknName = "/ccaMkn" + number + SHM_NAME; std::string aiqdName = "/ccaAiqd" + number + SHM_NAME; std::string tuningName = "/ccaTuning" + number + SHM_NAME; std::string deinitName = "/ccaDeinit" + number + SHM_NAME; @@ -96,7 +98,6 @@ IntelCca::IntelCca(int cameraId, TuningMode mode) : mCameraId(cameraId), mTuning mMems = { {structName.c_str(), sizeof(intel_cca_struct_data), &mMemStruct, false}, {initName.c_str(), sizeof(intel_cca_init_data), &mMemInit, false}, - {statsName.c_str(), sizeof(intel_cca_set_stats_data), &mMemStats, false}, {aecName.c_str(), sizeof(intel_cca_run_aec_data), &mMemAEC, false}, {aiqName.c_str(), sizeof(intel_cca_run_aiq_data), &mMemAIQ, false}, {ltmName.c_str(), sizeof(intel_cca_run_ltm_data), &mMemLTM, false}, @@ -104,7 +105,6 @@ IntelCca::IntelCca(int cameraId, TuningMode mode) : mCameraId(cameraId), mTuning {dvsName.c_str(), sizeof(intel_cca_run_dvs_data), &mMemDVS, false}, {aicName.c_str(), sizeof(intel_cca_run_aic_data), &mMemAIC, false}, {cmcName.c_str(), sizeof(intel_cca_get_cmc_data), &mMemCMC, false}, - {mknName.c_str(), sizeof(intel_cca_mkn_data), &mMemMKN, false}, {aiqdName.c_str(), sizeof(intel_cca_get_aiqd_data), &mMemAIQD, false}, {tuningName.c_str(), sizeof(intel_cca_update_tuning_data), &mMemTuning, false}, {deinitName.c_str(), sizeof(intel_cca_deinit_data), &mMemDeinit, false}, @@ -160,19 +160,39 @@ ia_err IntelCca::init(const cca::cca_init_params& initParams) { return ret; } +ia_err IntelCca::decodeStats(uint64_t statsPointer, uint32_t statsSize, uint32_t bitmap, + ia_isp_bxt_statistics_query_results_t* results, + cca::cca_out_stats* outStats) { + LOG2(" @%s, tuningMode:%d, statsPointer:0x%lx, statsSize:%d, bitmap:0x%x", mCameraId, + __func__, mTuningMode, statsPointer, statsSize, bitmap); + + if (results) return ia_err_none; + + intel_cca_run_aec_data* aecParams = static_cast(mMemAEC.mAddr); + intel_cca_decode_stats_data* params = &aecParams->decodeStatsParams; + + params->cameraId = mCameraId; + params->tuningMode = mTuningMode; + params->statsHandle = mCommon.getShmMemHandle(reinterpret_cast(statsPointer)); + params->statsBuffer.data = nullptr; + params->statsBuffer.size = statsSize; + params->bitmap = bitmap; + params->outStats.get_rgbs_stats = false; + aecParams->hasDecodeStats = true; + + return ia_err_none; +} + ia_err IntelCca::setStatsParams(const cca::cca_stats_params& params) { LOG2(" @%s, tuningMode:%d, in params size:%zu", mCameraId, __func__, mTuningMode, sizeof(cca::cca_stats_params)); - intel_cca_set_stats_data* statsParams = static_cast(mMemStats.mAddr); - statsParams->cameraId = mCameraId; - statsParams->tuningMode = mTuningMode; - statsParams->inParams = params; - - ia_err ret = mCommon.requestSyncCca(IPC_CCA_SET_STATS, mMemStats.mHandle); - CheckAndLogError(ret != ia_err_none, ia_err_general, "@%s, requestSyncCca fails", __func__); + // Set stats when running AEC + intel_cca_run_aec_data* aecParams = static_cast(mMemAEC.mAddr); + aecParams->inStatsParams = params; + aecParams->hasStats = true; - return ret; + return ia_err_none; } ia_err IntelCca::runAEC(uint64_t frameId, const cca::cca_ae_input_params& params, @@ -190,15 +210,24 @@ ia_err IntelCca::runAEC(uint64_t frameId, const cca::cca_ae_input_params& params aecParams->inParams = params; ia_err ret = mCommon.requestSyncCca(IPC_CCA_RUN_AEC, mMemAEC.mHandle); - CheckAndLogError(ret != ia_err_none, ia_err_general, "@%s, requestSyncCca fails", __func__); + aecParams->hasStats = false; + + if (aecParams->hasDecodeStats) { + LOG2("%s, query results: rgbs_grid(%d), af_grid(%d), dvs_stats(%d)", __func__, + aecParams->decodeStatsParams.results.rgbs_grid, + aecParams->decodeStatsParams.results.af_grid, + aecParams->decodeStatsParams.results.dvs_stats); + aecParams->hasDecodeStats = false; + } + CheckAndLogError(ret != ia_err_none, ia_err_general, "@%s, requestSyncCca fails", __func__); *results = aecParams->results; return ret; } ia_err IntelCca::runAIQ(uint64_t frameId, const cca::cca_aiq_params& params, - cca::cca_aiq_results* results) { + cca::cca_aiq_results* results, camera_makernote_mode_t mode) { LOG2(" @%s, tuningMode:%d, in params size:%zu, results size:%zu", mCameraId, frameId, __func__, mTuningMode, sizeof(cca::cca_aiq_params), sizeof(cca::cca_aiq_results)); CheckAndLogError(!results, ia_err_argument, "@%s, results is nullptr", __func__); @@ -209,10 +238,23 @@ ia_err IntelCca::runAIQ(uint64_t frameId, const cca::cca_aiq_params& params, aiqParams->frameId = frameId; aiqParams->inParams = params; + aiqParams->mknResultsHandle = -1; + bool dump = false; + void* ptr = PlatformData::getMakernoteBuf(mCameraId, mode, dump); + if (ptr) { + aiqParams->mknResults = static_cast(ptr); + aiqParams->type = + ((mode == MAKERNOTE_MODE_JPEG) || dump ? ia_mkn_trg_section_1 : ia_mkn_trg_section_2); + aiqParams->mknResultsHandle = mCommon.getShmMemHandle(aiqParams->mknResults); + } + + aiqParams->aiqResultHandle = mCommon.getShmMemHandle(results); + CheckAndLogError(aiqParams->aiqResultHandle < 0, ia_err_nomemory, "Failed to get result buf"); + ia_err ret = mCommon.requestSyncCca(IPC_CCA_RUN_AIQ, mMemAIQ.mHandle); CheckAndLogError(ret != ia_err_none, ia_err_general, "@%s, requestSyncCca fails", __func__); - *results = aiqParams->results; + if (aiqParams->mknResultsHandle >= 0) mHasMknData = true; return ret; } @@ -291,12 +333,18 @@ ia_err IntelCca::runAIC(uint64_t frameId, cca::cca_pal_input_params* params, ia_ return ret; } -ia_err IntelCca::getCMC(cca::cca_cmc* cmc) { +ia_err IntelCca::getCMC(cca::cca_cmc* cmc, const cca::cca_cpf* cpf) { CheckAndLogError(!cmc, ia_err_argument, "@%s, cmc is nullptr", __func__); intel_cca_get_cmc_data* params = static_cast(mMemCMC.mAddr); params->cameraId = mCameraId; params->tuningMode = mTuningMode; + if (cpf && cpf->size) { + MEMCPY_S(params->cpf.buf, cca::MAX_CPF_LEN, cpf->buf, cpf->size); + params->cpf.size = cpf->size; + } else { + params->cpf.size = 0; + } ia_err ret = mCommon.requestSyncCca(IPC_CCA_GET_CMC, mMemCMC.mHandle); CheckAndLogError(ret != ia_err_none, ia_err_general, "@%s, requestSyncCca fails", __func__); @@ -307,19 +355,14 @@ ia_err IntelCca::getCMC(cca::cca_cmc* cmc) { } ia_err IntelCca::getMKN(ia_mkn_trg type, cca::cca_mkn* mkn) { - CheckAndLogError(!mkn, ia_err_argument, "@%s, mkn is nullptr", __func__); + UNUSED(type); + UNUSED(mkn); - intel_cca_mkn_data* params = static_cast(mMemMKN.mAddr); - params->cameraId = mCameraId; - params->tuningMode = mTuningMode; - params->type = type; - params->results = mkn; - params->resultsHandle = mCommon.getShmMemHandle(mkn); - - ia_err ret = mCommon.requestSyncCca(IPC_CCA_GET_MKN, mMemMKN.mHandle); - CheckAndLogError(ret != ia_err_none, ia_err_general, "@%s, requestSyncCca fails", __func__); + // get MKN when calling runAIQ API + if (!mHasMknData) return ia_err_general; + mHasMknData = false; - return ret; + return ia_err_none; } ia_err IntelCca::getAiqd(cca::cca_aiqd* aiqd) { @@ -441,39 +484,6 @@ void IntelCca::deinit() { CheckAndLogError(ret != ia_err_none, VOID_VALUE, "@%s, requestSyncCca fails", __func__); } -ia_err IntelCca::decodeStats(uint64_t statsPointer, uint32_t statsSize, uint32_t bitmap, - ia_isp_bxt_statistics_query_results_t* results, - cca::cca_out_stats* outStats) { - LOG2(" @%s, tuningMode:%d, statsPointer:0x%lx, statsSize:%d, bitmap:0x%x", mCameraId, - __func__, mTuningMode, statsPointer, statsSize, bitmap); - CheckAndLogError(!results, ia_err_argument, "@%s, results is nullptr", __func__); - - intel_cca_decode_stats_data* params = - static_cast(mMemDecodeStats.mAddr); - - params->cameraId = mCameraId; - params->tuningMode = mTuningMode; - params->statsHandle = mCommon.getShmMemHandle(reinterpret_cast(statsPointer)); - params->statsBuffer.data = nullptr; - params->statsBuffer.size = statsSize; - params->bitmap = bitmap; - params->outStats.get_rgbs_stats = false; - if (outStats) { - params->outStats.get_rgbs_stats = outStats->get_rgbs_stats; - } - - ia_err ret = mCommon.requestSyncCca(IPC_CCA_DECODE_STATS, mMemDecodeStats.mHandle); - CheckAndLogError(ret != ia_err_none, ia_err_general, "@%s, requestSyncCca fails", __func__); - - *results = params->results; - if (outStats && params->outStats.get_rgbs_stats) { - *outStats = params->outStats; - outStats->rgbs_grid.blocks_ptr = outStats->rgbs_blocks; - } - - return ret; -} - uint32_t IntelCca::getPalDataSize(const cca::cca_program_group& programGroup) { intel_cca_get_pal_data_size* params = static_cast(mMemPalSize.mAddr); diff --git a/modules/sandboxing/client/IntelCcaClient.h b/modules/sandboxing/client/IntelCcaClient.h index 948e0f44..b36d0117 100644 --- a/modules/sandboxing/client/IntelCcaClient.h +++ b/modules/sandboxing/client/IntelCcaClient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation. + * Copyright (C) 2020-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ class IntelCca { ia_err runAEC(uint64_t frameId, const cca::cca_ae_input_params& params, cca::cca_ae_results* results); ia_err runAIQ(uint64_t frameId, const cca::cca_aiq_params& params, - cca::cca_aiq_results* results); + cca::cca_aiq_results* results, camera_makernote_mode_t mode = MAKERNOTE_MODE_OFF); ia_err runLTM(uint64_t frameId, const cca::cca_ltm_input_params& params); @@ -53,7 +53,7 @@ class IntelCca { ia_err runAIC(uint64_t frameId, cca::cca_pal_input_params* params, ia_binary_data* pal); - ia_err getCMC(cca::cca_cmc* cmc); + ia_err getCMC(cca::cca_cmc* cmc, const cca::cca_cpf* cpf = nullptr); ia_err getMKN(ia_mkn_trg type, cca::cca_mkn* mkn); ia_err getAiqd(cca::cca_aiqd* aiqd); ia_err updateTuning(uint8_t lardTags, const ia_lard_input_params& lardParams, @@ -66,8 +66,10 @@ class IntelCca { void deinit(); + // No decoding here because decoding should be done + // in IPC_CCA_RUN_AEC or IPC_PG_PARAM_DECODE if it is required. ia_err decodeStats(uint64_t statsPointer, uint32_t statsSize, uint32_t bitmap, - ia_isp_bxt_statistics_query_results_t* results, + ia_isp_bxt_statistics_query_results_t* results = nullptr, cca::cca_out_stats* outStats = nullptr); uint32_t getPalDataSize(const cca::cca_program_group& programGroup); @@ -82,12 +84,12 @@ class IntelCca { private: int mCameraId; TuningMode mTuningMode; + bool mHasMknData; IntelAlgoCommon mCommon; ShmMemInfo mMemStruct; ShmMemInfo mMemInit; - ShmMemInfo mMemStats; ShmMemInfo mMemAEC; ShmMemInfo mMemAIQ; ShmMemInfo mMemLTM; @@ -95,7 +97,6 @@ class IntelCca { ShmMemInfo mMemDVS; ShmMemInfo mMemAIC; ShmMemInfo mMemCMC; - ShmMemInfo mMemMKN; ShmMemInfo mMemAIQD; ShmMemInfo mMemTuning; ShmMemInfo mMemDeinit; diff --git a/modules/sandboxing/client/IntelICBMClient.cpp b/modules/sandboxing/client/IntelICBMClient.cpp index fe9231b4..e63ca1e7 100644 --- a/modules/sandboxing/client/IntelICBMClient.cpp +++ b/modules/sandboxing/client/IntelICBMClient.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,16 +25,20 @@ namespace icamera { -void IntelICBM::shutdown() { - bool ret = mCommon.requestSync(IPC_ICBM_DEINIT); +int IntelICBM::shutdown(const ICBMReqInfo& reqInfo) { + ICBMReqInfo* runInfo = reinterpret_cast(mRunInfoMem.mAddr); + *runInfo = reqInfo; + + bool ret = mCommon.requestSync(IPC_ICBM_DEINIT, mRunInfoMem.mHandle); if (!ret) LOGE("%s, Intel ICBM shutdown failed", __func__); mCommon.freeShmMem(mRunInfoMem, GPU_ALGO_SHM); + return ret; } -Result IntelICBM::setup(ICBMInitInfo* initParam) { +int IntelICBM::setup(ICBMInitInfo* initParam) { auto ret = initRunInfoBuffer(); - if (ret != Result::OK) return ret; + if (ret != OK) return ret; ShmMemInfo initMems; initMems.mName = "/IntelICBMInitMem"; @@ -46,7 +50,7 @@ Result IntelICBM::setup(ICBMInitInfo* initParam) { initMems.mSize = sizeof(*initParam); auto re = mCommon.allocShmMem(initMems.mName, initMems.mSize, &initMems, GPU_ALGO_SHM); - CheckAndLogError(!re, Result::SHMError, "%s, Alloc init allocShmMem failed", __func__); + CheckAndLogError(!re, UNKNOWN_ERROR, "%s, Alloc init allocShmMem failed", __func__); ICBMInitInfo* im = reinterpret_cast(initMems.mAddr); *im = *initParam; @@ -54,54 +58,58 @@ Result IntelICBM::setup(ICBMInitInfo* initParam) { re = mCommon.requestSync(IPC_ICBM_INIT, initMems.mHandle); mCommon.freeShmMem(initMems, GPU_ALGO_SHM); - return re ? Result::OK : Result::InternalError; + return re ? OK : UNKNOWN_ERROR; } -Result IntelICBM::initRunInfoBuffer() { +int IntelICBM::initRunInfoBuffer() { std::string name = "/IntelICBMRuninfo" + std::to_string(reinterpret_cast(this)) + SHM_NAME; mRunInfoMem.mName = name.c_str(); - mRunInfoMem.mSize = sizeof(ICBMRunInfo); + mRunInfoMem.mSize = sizeof(ICBMReqInfo); auto ret = mCommon.allocShmMem(mRunInfoMem.mName, mRunInfoMem.mSize, &mRunInfoMem, GPU_ALGO_SHM); - CheckAndLogError(!ret, Result::SHMError, "%s, RunInfo SHM alloc error!", __func__); + CheckAndLogError(!ret, UNKNOWN_ERROR, "%s, RunInfo SHM alloc error!", __func__); - return Result::OK; + return OK; } -Result IntelICBM::processFrame(const ImageInfo& iii, const ImageInfo& iio, - const ICBMReqInfo& reqInfo) { - ICBMRunInfo* runInfo = reinterpret_cast(mRunInfoMem.mAddr); - - runInfo->inHandle = mCommon.registerGbmBuffer(iii.gfxHandle, GPU_ALGO_SHM); - CheckAndLogError(runInfo->inHandle < 0, Result::GBMMappingError, - "%s, Cannot register in GBM buffers.", __func__); - - runInfo->outHandle = mCommon.registerGbmBuffer(iio.gfxHandle, GPU_ALGO_SHM); - CheckAndLogError(runInfo->outHandle < 0, Result::GBMMappingError, - "%s, Cannot register out GBM buffers.", __func__); +int IntelICBM::processFrame(const ICBMReqInfo& reqInfo) { + ICBMReqInfo* runInfo = reinterpret_cast(mRunInfoMem.mAddr); - runInfo->icbmReqInfo = reqInfo; + *runInfo = reqInfo; + runInfo->inHandle = mCommon.registerGbmBuffer(reqInfo.inII.gfxHandle, GPU_ALGO_SHM); + CheckAndLogError(runInfo->inHandle < 0, UNKNOWN_ERROR, "%s, Cannot register in GBM buffers.", + __func__); - runInfo->inII = iii; - runInfo->outII = iio; + runInfo->outHandle = mCommon.registerGbmBuffer(reqInfo.outII.gfxHandle, GPU_ALGO_SHM); + CheckAndLogError(runInfo->outHandle < 0, UNKNOWN_ERROR, "%s, Cannot register out GBM buffers.", + __func__); auto runInfoHandle = mCommon.getShmMemHandle(reinterpret_cast(runInfo), GPU_ALGO_SHM); if (runInfoHandle < 0) { LOGE("%s, Cannot get GBMSHM handle.", __func__); mCommon.deregisterGbmBuffer(runInfo->inHandle, GPU_ALGO_SHM); mCommon.deregisterGbmBuffer(runInfo->outHandle, GPU_ALGO_SHM); - return Result::GBMMappingError; + return UNKNOWN_ERROR; } bool ret = mCommon.requestSync(IPC_ICBM_RUN_FRAME, runInfoHandle); mCommon.deregisterGbmBuffer(runInfo->inHandle, GPU_ALGO_SHM); mCommon.deregisterGbmBuffer(runInfo->outHandle, GPU_ALGO_SHM); - CheckAndLogError(ret, Result::IPCError, "%s, Run frame IPC error!", __func__); - return Result::OK; + CheckAndLogError(!ret, UNKNOWN_ERROR, "%s, Run frame IPC error!", __func__); + return OK; +} + +int IntelICBM::runTnrFrame(const ICBMReqInfo& reqInfo) { + ICBMReqInfo* runInfo = reinterpret_cast(mRunInfoMem.mAddr); + *runInfo = reqInfo; + + runInfo->inHandle = reqInfo.inII.gfxHandle; + runInfo->outHandle = reqInfo.outII.gfxHandle; + return mCommon.requestSync(IPC_ICBM_RUN_FRAME, mRunInfoMem.mHandle); } } // namespace icamera diff --git a/modules/sandboxing/client/IntelICBMClient.h b/modules/sandboxing/client/IntelICBMClient.h index 38a33e67..30e5f078 100644 --- a/modules/sandboxing/client/IntelICBMClient.h +++ b/modules/sandboxing/client/IntelICBMClient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,12 +30,13 @@ class IntelICBM { IntelICBM() {} ~IntelICBM(){}; - Result setup(ICBMInitInfo* initParam); - void shutdown(); - Result processFrame(const ImageInfo& iii, const ImageInfo& iio, const ICBMReqInfo& reqInfo); + int setup(ICBMInitInfo* initParam); + int shutdown(const ICBMReqInfo& reqInfo); + int processFrame(const ICBMReqInfo& reqInfo); + int runTnrFrame(const ICBMReqInfo& reqInfo); private: - Result initRunInfoBuffer(); + int initRunInfoBuffer(); IntelAlgoCommon mCommon; ShmMemInfo mRunInfoMem; diff --git a/modules/sandboxing/client/IntelPGParamClient.cpp b/modules/sandboxing/client/IntelPGParamClient.cpp index 4fa47348..6b5a5de9 100644 --- a/modules/sandboxing/client/IntelPGParamClient.cpp +++ b/modules/sandboxing/client/IntelPGParamClient.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation. + * Copyright (C) 2019-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,17 +20,20 @@ #include +#include "AiqResultStorage.h" #include "iutils/CameraLog.h" #include "iutils/Utils.h" namespace icamera { -IntelPGParam::IntelPGParam(int pgId) +IntelPGParam::IntelPGParam(int pgId, int cameraId, TuningMode tuningMode) : mInitialized(false), mPgId(pgId), mClient(reinterpret_cast(this)), mPayloadCount(0), - mPGBuffer(nullptr) { + mPGBuffer(nullptr), + mCameraId(cameraId), + mTuningMode(tuningMode) { std::string initName = "/pgParamInit" + std::to_string(mClient) + SHM_NAME; std::string prepareName = "/pgParamPrepare" + std::to_string(mClient) + SHM_NAME; std::string getFragDescsName = "/pgParamGetFragDescs" + std::to_string(mClient) + SHM_NAME; @@ -64,6 +67,9 @@ IntelPGParam::IntelPGParam(int pgId) mMemStatistics.mSize = 0; mMaxStatsSize = 0; + mIntelCca = IntelCca::getInstance(mCameraId, mTuningMode); + CheckAndLogError(!mIntelCca, VOID_VALUE, "%s: Can't get IntelCca", __func__); + mInitialized = true; LOG1("@%s, Construct done", __func__); } @@ -266,7 +272,8 @@ int IntelPGParam::updatePALAndEncode(const ia_binary_data* ipuParameters, int pa return OK; } -int IntelPGParam::decode(int payloadCount, ia_binary_data* payloads, ia_binary_data* statistics) { +int IntelPGParam::decode(int payloadCount, ia_binary_data* payloads, ia_binary_data* statistics, + int64_t sequence) { CheckAndLogError(mInitialized == false, INVALID_OPERATION, "@%s, mInitialized is false", __func__); // Check shared memory of payloads @@ -287,10 +294,29 @@ int IntelPGParam::decode(int payloadCount, ia_binary_data* payloads, ia_binary_d CheckAndLogError(ret == false, UNKNOWN_ERROR, "@%s, alloc statsData fails", __func__); } statsHandle = mCommon.getShmMemHandle(mMemStatistics.mAddr); + statistics->data = mMemStatistics.mAddr; } else { statsHandle = mCommon.getShmMemHandle(statistics->data); } + cca::cca_out_stats* outStats = fetchOutStats(sequence); + pg_param_decode_params* params = static_cast(mMemDecode.mAddr); + intel_cca_decode_stats_data& decodeStatsParams = params->decodeStatsParams; + if (outStats && mIntelCca) { + params->hasStatsDecode = true; + decodeStatsParams.cameraId = mCameraId; + decodeStatsParams.tuningMode = mTuningMode; + decodeStatsParams.statsHandle = statsHandle; + decodeStatsParams.statsBuffer.data = nullptr; + decodeStatsParams.statsBuffer.size = 0; // not decode pg yet + decodeStatsParams.bitmap = cca::CCA_STATS_RGBS | cca::CCA_STATS_HIST | cca::CCA_STATS_AF | + cca::CCA_STATS_YV | cca::CCA_STATS_LTM | cca::CCA_STATS_DVS; + if (PlatformData::isPdafEnabled(mCameraId)) decodeStatsParams.bitmap |= cca::CCA_STATS_PDAF; + decodeStatsParams.outStats.get_rgbs_stats = outStats->get_rgbs_stats; + } else { + params->hasStatsDecode = false; + } + ret = mIpc.clientFlattenDecode(mMemDecode.mAddr, mMemDecode.mSize, mClient, payloadCount, payloads, statsHandle); CheckAndLogError(ret == false, UNKNOWN_ERROR, "@%s, clientFlattenDecode fails", __func__); @@ -300,10 +326,20 @@ int IntelPGParam::decode(int payloadCount, ia_binary_data* payloads, ia_binary_d ret = mIpc.clientUnflattenDecode(mMemDecode.mAddr, mMemDecode.mSize, statistics); CheckAndLogError(ret == false, UNKNOWN_ERROR, "@%s, clientUnflattenDecode fails", __func__); - if (!statistics->data) { - statistics->data = mMemStatistics.mAddr; - } + if (outStats && mIntelCca) { + // print query result: params->results + if (outStats && decodeStatsParams.outStats.get_rgbs_stats) { + *outStats = decodeStatsParams.outStats; + for (unsigned int i = 0; i < cca::MAX_NUM_EXPOSURE; ++i) { + outStats->rgbs_grid[i].blocks_ptr = outStats->rgbs_blocks[i]; + } + } + ia_isp_bxt_statistics_query_results_t& queryResults = decodeStatsParams.results; + LOG2("%s, query results: rgbs_grid(%d), af_grid(%d), dvs_stats(%d), paf_grid(%d)", __func__, + queryResults.rgbs_grid, queryResults.af_grid, queryResults.dvs_stats, + queryResults.paf_grid); + } return OK; } @@ -317,4 +353,23 @@ void IntelPGParam::deinit() { CheckAndLogError(ret == false, VOID_VALUE, "@%s, requestSync fails", __func__); } +cca::cca_out_stats* IntelPGParam::fetchOutStats(int64_t sequence) { + if (sequence < 0) return nullptr; + + AiqResult* aiqResult = + const_cast(AiqResultStorage::getInstance(mCameraId)->getAiqResult(sequence)); + // Check if the frame needs stats decoding together + if (aiqResult && aiqResult->mAiqParam.callbackRgbs) { + // Request decodeStats together when rgbCallback is enabled + aiqResult->mOutStats.get_rgbs_stats = true; + return &aiqResult->mOutStats; + } else if (aiqResult && !PlatformData::isStatsRunningRateSupport(mCameraId)) { + // Request decodeStats together when running rate is disabled + aiqResult->mOutStats.get_rgbs_stats = false; + return &aiqResult->mOutStats; + } + + return nullptr; +} + } // namespace icamera diff --git a/modules/sandboxing/client/IntelPGParamClient.h b/modules/sandboxing/client/IntelPGParamClient.h index 0ff43df9..f99917a1 100644 --- a/modules/sandboxing/client/IntelPGParamClient.h +++ b/modules/sandboxing/client/IntelPGParamClient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation. + * Copyright (C) 2019-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,17 @@ #include #include +#include "CameraTypes.h" #include "IntelAlgoCommonClient.h" #include "modules/sandboxing/IPCIntelPGParam.h" +#include "modules/sandboxing/client/IntelCcaClient.h" namespace icamera { class IntelPGParam { public: - explicit IntelPGParam(int pgId); + explicit IntelPGParam(int pgId, int cameraId = 0, + TuningMode tuningMode = TUNING_MODE_VIDEO); ~IntelPGParam(); int init(ia_p2p_platform_t platform, const PgConfiguration& Pgconfiguration); @@ -39,9 +42,13 @@ class IntelPGParam { int allocatePayloads(int payloadCount, ia_binary_data* payloads); int updatePALAndEncode(const ia_binary_data* ipuParams, int payloadCount, ia_binary_data* payloads); - int decode(int payloadCount, ia_binary_data* payload, ia_binary_data* statistics); + int decode(int payloadCount, ia_binary_data* payload, ia_binary_data* statistics, + int64_t sequence = -1); void deinit(); +private: + cca::cca_out_stats* fetchOutStats(int64_t sequence); + private: IPCIntelPGParam mIpc; IntelAlgoCommon mCommon; @@ -68,6 +75,10 @@ class IntelPGParam { ia_binary_data mPayloads[IPU_MAX_TERMINAL_COUNT]; // save sizes ia_css_process_group_t* mPGBuffer; uint32_t mMaxStatsSize; + + IntelCca* mIntelCca; + int mCameraId; + TuningMode mTuningMode; }; } // namespace icamera diff --git a/modules/sandboxing/client/IntelTNR7USClient.cpp b/modules/sandboxing/client/IntelTNR7USClient.cpp index d1b1692c..e046ff99 100644 --- a/modules/sandboxing/client/IntelTNR7USClient.cpp +++ b/modules/sandboxing/client/IntelTNR7USClient.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,20 +19,66 @@ #include "modules/sandboxing/client/IntelTNR7USClient.h" #include +#include #include "iutils/CameraLog.h" #include "iutils/Utils.h" - namespace icamera { -IntelTNR7US::IntelTNR7US(int cameraId) - : mCameraId(cameraId), +IntelTNR7US* IntelTNR7US::createIntelTNR(int cameraId) { + if (!PlatformData::isGpuTnrEnabled()) return nullptr; +#ifdef TNR7_CM + return new IntelC4mTNR(cameraId); +#else + return new IntelLevel0TNR(cameraId); +#endif +} + +Tnr7Param* IntelTNR7US::allocTnr7ParamBuf() { + uintptr_t personal = reinterpret_cast(this); + std::string initName = "/TnrParam" + std::to_string(personal) + "Shm"; + + mParamMems.mName = initName.c_str(); + mParamMems.mSize = sizeof(Tnr7Param); + bool ret = mCommon.allocShmMem(mParamMems.mName, mParamMems.mSize, &mParamMems, GPU_ALGO_SHM); + CheckAndLogError(!ret, nullptr, "@%s, allocShmMem fails", __func__); + + return reinterpret_cast(mParamMems.mAddr); +} + +void* IntelTNR7US::allocCamBuf(uint32_t bufSize, int id) { + uintptr_t personal = reinterpret_cast(this); + std::string initName = "/TnrCam" + std::to_string(personal) + std::to_string(id) + "Shm"; + ShmMemInfo shm; + shm.mName = initName.c_str(); + shm.mSize = bufSize; + bool ret = mCommon.allocShmMem(shm.mName, shm.mSize, &shm, GPU_ALGO_SHM); + CheckAndLogError(!ret, nullptr, "@%s, allocShmMem fails", __func__); + + mCamBufMems.push_back(shm); + return shm.mAddr; +} + +void IntelTNR7US::freeAllBufs() { + if (mParamMems.mAddr) { + mCommon.freeShmMem(mParamMems, GPU_ALGO_SHM); + } + for (auto& camBuf : mCamBufMems) { + if (camBuf.mAddr) { + mCommon.freeShmMem(camBuf, GPU_ALGO_SHM); + } + } +} + +#ifdef TNR7_CM +IntelC4mTNR::IntelC4mTNR(int cameraId) + : IntelTNR7US(cameraId), mTnrType(TNR_INSTANCE_MAX), mTnrRequestInfo(nullptr) { LOG1(" %s, Construct", cameraId, __func__); } -IntelTNR7US::~IntelTNR7US() { +IntelC4mTNR::~IntelC4mTNR() { // the instance not initialized, don't need to free if (mTnrType != TNR_INSTANCE_MAX) { mTnrRequestInfo->type = mTnrType; @@ -47,7 +93,7 @@ IntelTNR7US::~IntelTNR7US() { LOG1(" %s, Destroy", mCameraId, __func__); } -int IntelTNR7US::init(int width, int height, TnrType type) { +int IntelC4mTNR::init(int width, int height, TnrType type) { uintptr_t personal = reinterpret_cast(this); std::string initName = "/TnrRun" + std::to_string(personal) + "Shm"; mTnrRequestInfoMem.mName = initName.c_str(); @@ -83,7 +129,7 @@ int IntelTNR7US::init(int width, int height, TnrType type) { return ret ? OK : UNKNOWN_ERROR; } -int IntelTNR7US::runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, +int IntelC4mTNR::runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, uint32_t outBufSize, Tnr7Param* tnrParam, bool syncUpdate, int fd) { LOG2("%s, type: %d, syncUpdate: %d, fd: %d", __func__, mTnrType, syncUpdate, fd); CheckAndLogError(!inBufAddr || !outBufAddr || !tnrParam, UNKNOWN_ERROR, @@ -124,7 +170,7 @@ int IntelTNR7US::runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t i return OK; } -void* IntelTNR7US::allocCamBuf(uint32_t bufSize, int id) { +void* IntelC4mTNR::allocCamBuf(uint32_t bufSize, int id) { uintptr_t personal = reinterpret_cast(this); std::string initName = "/TnrCam" + std::to_string(personal) + std::to_string(id) + "Shm"; ShmMemInfo shm; @@ -148,30 +194,7 @@ void* IntelTNR7US::allocCamBuf(uint32_t bufSize, int id) { return shm.mAddr; } -void IntelTNR7US::freeAllBufs() { - if (mParamMems.mAddr) { - mCommon.freeShmMem(mParamMems, GPU_ALGO_SHM); - } - for (auto& camBuf : mCamBufMems) { - if (camBuf.mAddr) { - mCommon.freeShmMem(camBuf, GPU_ALGO_SHM); - } - } -} - -Tnr7Param* IntelTNR7US::allocTnr7ParamBuf() { - uintptr_t personal = reinterpret_cast(this); - std::string initName = "/TnrParam" + std::to_string(personal) + "Shm"; - - mParamMems.mName = initName.c_str(); - mParamMems.mSize = sizeof(Tnr7Param); - bool ret = mCommon.allocShmMem(mParamMems.mName, mParamMems.mSize, &mParamMems, GPU_ALGO_SHM); - CheckAndLogError(!ret, nullptr, "@%s, allocShmMem fails", __func__); - - return reinterpret_cast(mParamMems.mAddr); -} - -int IntelTNR7US::asyncParamUpdate(int gain, bool forceUpdate) { +int IntelC4mTNR::asyncParamUpdate(int gain, bool forceUpdate) { LOG2("%s, type: %d, gain: %d, forceUpdate: %d", __func__, mTnrType, gain, forceUpdate); mTnrRequestInfo->gain = gain; mTnrRequestInfo->type = mTnrType; @@ -189,7 +212,7 @@ int IntelTNR7US::asyncParamUpdate(int gain, bool forceUpdate) { return OK; } -int IntelTNR7US::getSurfaceInfo(int width, int height, uint32_t* size) { +int IntelC4mTNR::getTnrBufferSize(int width, int height, uint32_t* size) { mTnrRequestInfo->width = width; mTnrRequestInfo->height = height; mTnrRequestInfo->type = mTnrType; @@ -204,4 +227,67 @@ int IntelTNR7US::getSurfaceInfo(int width, int height, uint32_t* size) { if (size) *size = mTnrRequestInfo->surfaceSize; return OK; } +#elif defined(TNR7_LEVEL0) +IntelLevel0TNR::~IntelLevel0TNR() { + LOG1(" %s", mCameraId, __func__); + if (mIntelICBM) { + icamera::ICBMReqInfo reqInfo; + reqInfo.cameraId = mCameraId; + reqInfo.reqType = icamera::ICBMReqType::LEVEL0_TNR; + mIntelICBM->shutdown(reqInfo); + mIntelICBM = nullptr; + } +} + +int IntelLevel0TNR::init(int width, int height, TnrType type) { + LOG1(" %s %dx%d", mCameraId, __func__, width, height); + mWidth = width; + mHeight = height; + mIntelICBM = std::make_unique(); + icamera::ICBMInitInfo initParam = {.cameraId = mCameraId, + .reqType = icamera::ICBMReqType::LEVEL0_TNR}; + int ret = mIntelICBM->setup(&initParam); + CheckAndLogError(ret != OK, ret, "%s: Init failed", __func__); + + return ret; +} + +int IntelLevel0TNR::runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, + uint32_t outBufSize, Tnr7Param* tnrParam, bool syncUpdate, int fd) { + (void)syncUpdate; + ImageInfo input = {}; + input.width = mWidth; + input.height = mHeight; + input.size = inBufSize; + input.stride = mWidth; + input.gfxHandle = mCommon.getShmMemHandle(const_cast(inBufAddr), GPU_ALGO_SHM); + + ImageInfo output = {}; + output.width = mWidth; + output.height = mHeight; + output.size = outBufSize; + output.stride = mWidth; + + if (fd >= 0) { + output.gfxHandle = mCommon.registerGbmBuffer(fd, GPU_ALGO_SHM); + } else { + output.gfxHandle = mCommon.getShmMemHandle(static_cast(outBufAddr), GPU_ALGO_SHM); + } + + ICBMReqInfo reqInfo; + reqInfo.cameraId = mCameraId; + reqInfo.reqType = ICBMReqType::LEVEL0_TNR; + reqInfo.paramHandle = mParamMems.mHandle; + reqInfo.inII = input; + reqInfo.outII = output; + + int ret = mIntelICBM->runTnrFrame(reqInfo); + + if (fd >= 0) { + mCommon.deregisterGbmBuffer(output.gfxHandle, GPU_ALGO_SHM); + } + + return ret; +} +#endif } // namespace icamera diff --git a/modules/sandboxing/client/IntelTNR7USClient.h b/modules/sandboxing/client/IntelTNR7USClient.h index bc3b89c7..88ebe2e8 100644 --- a/modules/sandboxing/client/IntelTNR7USClient.h +++ b/modules/sandboxing/client/IntelTNR7USClient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,30 +23,81 @@ #include "Parameters.h" #include "PlatformData.h" #include "TNRCommon.h" +#ifdef TNR7_LEVEL0 +#include "src/icbm/ICBMTypes.h" +#include "modules/sandboxing/client/IntelICBMClient.h" +#endif namespace icamera { - class IntelTNR7US { public: - explicit IntelTNR7US(int cameraId); - ~IntelTNR7US(); - int init(int width, int height, TnrType type); - int runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, - uint32_t outBufSize, Tnr7Param* tnrParam, bool syncUpdate, int fd = -1); - Tnr7Param* allocTnr7ParamBuf(); - void* allocCamBuf(uint32_t bufSize, int id); - void freeAllBufs(); - int asyncParamUpdate(int gain, bool forceUpdate); - int getSurfaceInfo(int width, int height, uint32_t* size); + static IntelTNR7US* createIntelTNR(int cameraId); + virtual ~IntelTNR7US(){}; + virtual int init(int width, int height, TnrType type = TNR_INSTANCE0) = 0; + /** + * call tnr api to calc tnr result + * + * \param inBufAddr: input image buffer + * \param outBufAddr: tnr output + * \param tnrParam: tnr parameters from ISP + * \param fd: user output buffer file handle + */ + virtual int runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, + uint32_t outBufSize, Tnr7Param* tnrParam, bool syncUpdate = true, + int fd = -1) = 0; + virtual Tnr7Param* allocTnr7ParamBuf(); + virtual void* allocCamBuf(uint32_t bufSize, int id); + virtual void freeAllBufs(); + int prepareSurface(void* bufAddr, int size) { return OK; } + virtual int asyncParamUpdate(int gain, bool forceUpdate) { return OK; } + virtual int getTnrBufferSize(int width, int height, uint32_t* size) { return BAD_VALUE; } - private: + protected: int mCameraId; - TnrType mTnrType; IntelAlgoCommon mCommon; - TnrRequestInfo* mTnrRequestInfo; std::vector mCamBufMems; ShmMemInfo mParamMems; + explicit IntelTNR7US(int cameraId) : mCameraId(cameraId){}; +}; + +#ifdef TNR7_CM +class IntelC4mTNR : public IntelTNR7US { + public: + explicit IntelC4mTNR(int cameraId); + virtual ~IntelC4mTNR(); + virtual int init(int width, int height, TnrType type = TNR_INSTANCE0); + virtual int runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, + uint32_t outBufSize, Tnr7Param* tnrParam, bool syncUpdate = true, + int fd = -1); + virtual void* allocCamBuf(uint32_t bufSize, int id); + virtual int asyncParamUpdate(int gain, bool forceUpdate); + virtual int getTnrBufferSize(int width, int height, uint32_t* size); + + private: + TnrType mTnrType; + TnrRequestInfo* mTnrRequestInfo; ShmMemInfo mTnrRequestInfoMem; - DISALLOW_COPY_AND_ASSIGN(IntelTNR7US); + DISALLOW_COPY_AND_ASSIGN(IntelC4mTNR); }; + +#elif defined(TNR7_LEVEL0) +class IntelLevel0TNR : public IntelTNR7US { + public: + explicit IntelLevel0TNR(int cameraId) : IntelTNR7US(cameraId){}; + virtual ~IntelLevel0TNR(); + virtual int init(int width, int height, TnrType type = TNR_INSTANCE0); + virtual int runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, + uint32_t outBufSize, Tnr7Param* tnrParam, bool syncUpdate = true, + int fd = -1); + + private: + std::unique_ptr mIntelICBM; + int mWidth; + int mHeight; + + private: + DISALLOW_COPY_AND_ASSIGN(IntelLevel0TNR); +}; +#endif + } // namespace icamera diff --git a/modules/sandboxing/server/IntelAlgoServer.cpp b/modules/sandboxing/server/IntelAlgoServer.cpp index b91235d1..2ca29d54 100644 --- a/modules/sandboxing/server/IntelAlgoServer.cpp +++ b/modules/sandboxing/server/IntelAlgoServer.cpp @@ -158,7 +158,7 @@ void IntelAlgoServer::request(uint32_t req_id, const uint8_t req_header[], uint3 if (mThreads[threadId] && mThreads[threadId]->task_runner()) { mThreads[threadId]->task_runner()->PostTask( FROM_HERE, - base::Bind(&IntelAlgoServer::handleRequest, base::Unretained(this), msg)); + base::BindOnce(&IntelAlgoServer::handleRequest, base::Unretained(this), msg)); } } } diff --git a/modules/sandboxing/server/IntelAlgoServer.h b/modules/sandboxing/server/IntelAlgoServer.h index d7b7cf61..654689a7 100644 --- a/modules/sandboxing/server/IntelAlgoServer.h +++ b/modules/sandboxing/server/IntelAlgoServer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation. + * Copyright (C) 2019-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include diff --git a/modules/sandboxing/server/IntelCPUAlgoServer.cpp b/modules/sandboxing/server/IntelCPUAlgoServer.cpp index 437917f6..c8f112bd 100644 --- a/modules/sandboxing/server/IntelCPUAlgoServer.cpp +++ b/modules/sandboxing/server/IntelCPUAlgoServer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation. + * Copyright (C) 2020-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -139,17 +139,19 @@ void IntelCPUAlgoServer::handleRequest(const MsgReq& msg) { status = mCcas[key]->init(addr, requestSize); break; } - case IPC_CCA_SET_STATS: { - intel_cca_set_stats_data* p = static_cast(addr); - FUNCTION_PREPARED_RETURN - - status = mCcas[key]->setStats(addr, requestSize); - break; - } case IPC_CCA_RUN_AEC: { intel_cca_run_aec_data* p = static_cast(addr); FUNCTION_PREPARED_RETURN + if (p->hasDecodeStats) { + intel_cca_decode_stats_data* pDecodeStats = &p->decodeStatsParams; + status = decodeStats(pDecodeStats, key); + if (status != OK) { + LOGE("failed to decode stats in sandbox"); + break; + } + } + status = mCcas[key]->runAEC(addr, requestSize); break; } @@ -157,6 +159,26 @@ void IntelCPUAlgoServer::handleRequest(const MsgReq& msg) { intel_cca_run_aiq_data* p = static_cast(addr); FUNCTION_PREPARED_RETURN + if (p->mknResultsHandle >= 0) { + ShmInfo paramsInfo = {}; + status = getIntelAlgoServer()->getShmInfo(p->mknResultsHandle, ¶msInfo); + if (status != OK) { + LOGE("%s, the buffer handle for mknResultsHandle is invalid", __func__); + break; + } + p->mknResults = static_cast(paramsInfo.addr); + } + + if (p->aiqResultHandle >= 0) { + ShmInfo paramsInfo = {}; + status = getIntelAlgoServer()->getShmInfo(p->aiqResultHandle, ¶msInfo); + if (status != OK) { + LOGE("%s, the buffer handle for aiqResultsHandle is invalid", __func__); + break; + } + p->results = static_cast(paramsInfo.addr); + } + status = mCcas[key]->runAIQ(addr, requestSize); break; } @@ -214,22 +236,6 @@ void IntelCPUAlgoServer::handleRequest(const MsgReq& msg) { status = mCcas[key]->getCMC(addr, requestSize); break; } - case IPC_CCA_GET_MKN: { - intel_cca_mkn_data* p = static_cast(addr); - FUNCTION_PREPARED_RETURN - - if (p->resultsHandle >= 0) { - ShmInfo paramsInfo = {}; - status = getIntelAlgoServer()->getShmInfo(p->resultsHandle, ¶msInfo); - if (status != OK) { - LOGE("%s, the buffer handle for resultsHandle is invalid", __func__); - break; - } - p->results = static_cast(paramsInfo.addr); - } - status = mCcas[key]->getMKN(addr, requestSize); - break; - } case IPC_CCA_GET_AIQD: { intel_cca_get_aiqd_data* p = static_cast(addr); FUNCTION_PREPARED_RETURN @@ -251,19 +257,6 @@ void IntelCPUAlgoServer::handleRequest(const MsgReq& msg) { status = mCcas[key]->deinit(addr, requestSize); break; } - case IPC_CCA_DECODE_STATS: { - intel_cca_decode_stats_data* p = static_cast(addr); - FUNCTION_PREPARED_RETURN - - ShmInfo info = {}; - status = getIntelAlgoServer()->getShmInfo(p->statsHandle, &info); - if (status != OK) { - LOGE("%s, the buffer handle for stats data is invalid", __func__); - break; - } - status = mCcas[key]->decodeStats(addr, requestSize, info.addr); - break; - } case IPC_CCA_GET_PAL_SIZE: { intel_cca_get_pal_data_size* p = static_cast(addr); FUNCTION_PREPARED_RETURN @@ -317,6 +310,15 @@ void IntelCPUAlgoServer::handleRequest(const MsgReq& msg) { } else { LOGE("%s, the buffer handle for stats data is invalid", __func__); } + + if (decodeParams->hasStatsDecode) { + // Update stats bin size + intel_cca_decode_stats_data* p = &decodeParams->decodeStatsParams; + p->statsBuffer.size = decodeParams->statsSize; + FUNCTION_PREPARED_RETURN + status = decodeStats(p, key); + } + break; } case IPC_PG_PARAM_DEINIT: @@ -333,6 +335,14 @@ void IntelCPUAlgoServer::handleRequest(const MsgReq& msg) { getIntelAlgoServer()->returnCallback(req_id, status, buffer_handle); } +status_t IntelCPUAlgoServer::decodeStats(intel_cca_decode_stats_data* p, uint16_t key) { + ShmInfo info = {}; + status_t status = getIntelAlgoServer()->getShmInfo(p->statsHandle, &info); + CheckAndLogError(status != OK, status, "the handle for stats data is invalid"); + + return mCcas[key]->decodeStats(p, info.addr); +} + uint16_t IntelCPUAlgoServer::getKey(int cameraId, TuningMode mode) { return ((cameraId & 0xFF) << 8) + (mode & 0xFF); } diff --git a/modules/sandboxing/server/IntelCPUAlgoServer.h b/modules/sandboxing/server/IntelCPUAlgoServer.h index 5384dcd4..30b7fbeb 100644 --- a/modules/sandboxing/server/IntelCPUAlgoServer.h +++ b/modules/sandboxing/server/IntelCPUAlgoServer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2020-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include @@ -44,6 +44,7 @@ class IntelCPUAlgoServer : public RequestHandler { private: uint16_t getKey(int cameraId, TuningMode mode); + status_t decodeStats(intel_cca_decode_stats_data* p, uint16_t key); private: IntelFDServer mFaceDetection; diff --git a/modules/sandboxing/server/IntelCcaServer.cpp b/modules/sandboxing/server/IntelCcaServer.cpp index 0032dde9..53c721a6 100644 --- a/modules/sandboxing/server/IntelCcaServer.cpp +++ b/modules/sandboxing/server/IntelCcaServer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,18 +57,6 @@ status_t IntelCcaServer::init(void* pData, int dataSize) { return OK; } -status_t IntelCcaServer::setStats(void* pData, int dataSize) { - CheckAndLogError(pData == nullptr, UNKNOWN_ERROR, "@%s, pData is nullptr", __func__); - CheckAndLogError(mCca == nullptr, UNKNOWN_ERROR, "@%s, mCca is nullptr", __func__); - - intel_cca_set_stats_data* params = static_cast(pData); - - ia_err ret = mCca->setStatsParams(params->inParams); - CheckAndLogError(ret != ia_err_none, UNKNOWN_ERROR, "@%s, fails: %d", __func__, ret); - - return OK; -} - status_t IntelCcaServer::runAEC(void* pData, int dataSize) { PERF_CAMERA_ATRACE(); CheckAndLogError(pData == nullptr, UNKNOWN_ERROR, "@%s, pData is nullptr", __func__); @@ -76,6 +64,12 @@ status_t IntelCcaServer::runAEC(void* pData, int dataSize) { intel_cca_run_aec_data* params = static_cast(pData); + if (params->hasStats) { + ia_err ret = mCca->setStatsParams(params->inStatsParams); + CheckAndLogError(ret != ia_err_none, UNKNOWN_ERROR, "@%s, fails to set stats: %d", __func__, + ret); + } + ia_err ret = mCca->runAEC(params->frameId, params->inParams, ¶ms->results); CheckAndLogError(ret != ia_err_none, UNKNOWN_ERROR, "@%s, fails: %d", __func__, ret); @@ -89,9 +83,15 @@ status_t IntelCcaServer::runAIQ(void* pData, int dataSize) { intel_cca_run_aiq_data* params = static_cast(pData); - ia_err ret = mCca->runAIQ(params->frameId, params->inParams, ¶ms->results); + ia_err ret = mCca->runAIQ(params->frameId, params->inParams, params->results); CheckAndLogError(ret != ia_err_none, UNKNOWN_ERROR, "@%s, fails: %d", __func__, ret); + if (params->mknResultsHandle >= 0) { + ret = mCca->getMKN(params->type, params->mknResults); + CheckAndLogError(ret != ia_err_none, UNKNOWN_ERROR, "@%s, fails to get MKN: %d", __func__, + ret); + } + return OK; } @@ -161,19 +161,7 @@ status_t IntelCcaServer::getCMC(void* pData, int dataSize) { intel_cca_get_cmc_data* params = static_cast(pData); - ia_err ret = mCca->getCMC(¶ms->results); - CheckAndLogError(ret != ia_err_none, UNKNOWN_ERROR, "@%s, fails: %d", __func__, ret); - - return OK; -} - -status_t IntelCcaServer::getMKN(void* pData, int dataSize) { - CheckAndLogError(pData == nullptr, UNKNOWN_ERROR, "@%s, pData is nullptr", __func__); - CheckAndLogError(mCca == nullptr, UNKNOWN_ERROR, "@%s, mCca is nullptr", __func__); - - intel_cca_mkn_data* params = static_cast(pData); - - ia_err ret = mCca->getMKN(params->type, params->results); + ia_err ret = mCca->getCMC(¶ms->results, params->cpf.size ? ¶ms->cpf : nullptr); CheckAndLogError(ret != ia_err_none, UNKNOWN_ERROR, "@%s, fails: %d", __func__, ret); return OK; @@ -215,7 +203,7 @@ status_t IntelCcaServer::deinit(void* pData, int dataSize) { return OK; } -status_t IntelCcaServer::decodeStats(void* pData, int dataSize, void* statsAddr) { +status_t IntelCcaServer::decodeStats(void* pData, void* statsAddr) { PERF_CAMERA_ATRACE(); CheckAndLogError(pData == nullptr, UNKNOWN_ERROR, "@%s, pData is nullptr", __func__); CheckAndLogError(statsAddr == nullptr, UNKNOWN_ERROR, "@%s, statsAddr is nullptr", __func__); diff --git a/modules/sandboxing/server/IntelCcaServer.h b/modules/sandboxing/server/IntelCcaServer.h index 2b98cdb2..4d26d915 100644 --- a/modules/sandboxing/server/IntelCcaServer.h +++ b/modules/sandboxing/server/IntelCcaServer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation. + * Copyright (C) 2020-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ class IntelCcaServer { virtual ~IntelCcaServer(); status_t init(void* pData, int dataSize); - status_t setStats(void* pData, int dataSize); status_t runAEC(void* pData, int dataSize); status_t runAIQ(void* pData, int dataSize); status_t runLTM(void* pData, int dataSize); @@ -38,11 +37,10 @@ class IntelCcaServer { status_t runDVS(void* pData, int dataSize); status_t runAIC(void* pData, int dataSize); status_t getCMC(void* pData, int dataSize); - status_t getMKN(void* pData, int dataSize); status_t getAiqd(void* pData, int dataSize); status_t updateTuning(void* pData, int dataSize); status_t deinit(void* pData, int dataSize); - status_t decodeStats(void* pData, int dataSize, void* statsAddr); + status_t decodeStats(void* pData, void* statsAddr); status_t getPalDataSize(void* pData, int dataSize); private: diff --git a/modules/sandboxing/server/IntelGPUAlgoServer.cpp b/modules/sandboxing/server/IntelGPUAlgoServer.cpp index 19c9b6a2..15fcd4b9 100644 --- a/modules/sandboxing/server/IntelGPUAlgoServer.cpp +++ b/modules/sandboxing/server/IntelGPUAlgoServer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation. + * Copyright (C) 2020-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ void IntelGPUAlgoServer::handleRequest(const MsgReq& msg) { break; case IPC_GPU_TNR_GET_SURFACE_INFO: { TnrRequestInfo* requestInfo = static_cast(addr); - status = mTNR.getSurfaceInfo(requestInfo); + status = mTNR.getTnrBufferSize(requestInfo); break; } case IPC_GPU_TNR_PREPARE_SURFACE: { @@ -113,45 +113,15 @@ void IntelGPUAlgoServer::handleRequest(const MsgReq& msg) { break; } #endif - // ENABLE_EVCP_S - case IPC_EVCP_INIT: - status = mEvcp.init(addr, requestSize); - break; - case IPC_EVCP_UPDCONF: - status = mEvcp.updateEvcpParam(reinterpret_cast(addr)); - break; - case IPC_EVCP_GETCONF: - mEvcp.getEvcpParam(reinterpret_cast(addr)); - status = OK; - break; - case IPC_EVCP_RUN_FRAME: { - status = UNKNOWN_ERROR; - EvcpRunInfo* runInfo = static_cast(addr); - ShmInfo inBuffer = {}; - if (runInfo->inHandle < 0) break; - - status = getIntelAlgoServer()->getShmInfo(runInfo->inHandle, &inBuffer); - if (status != OK) { - LOGE("%s, the buffer handle for EVCP inBuffer data is invalid", __func__); - break; - } - status = mEvcp.runEvcpFrame(inBuffer.addr, inBuffer.size); - break; - } - case IPC_EVCP_DEINIT: - status = mEvcp.deInit(); - break; - // ENABLE_EVCP_E - - // LEVEL0_ICBM_S + // LEVEL0_ICBM_S case IPC_ICBM_INIT: (void) requestSize; status = mICBMServer.setup(reinterpret_cast(addr)); break; case IPC_ICBM_RUN_FRAME: { status = UNKNOWN_ERROR; - ICBMRunInfo* runInfo = reinterpret_cast(addr); + ICBMReqInfo* runInfo = reinterpret_cast(addr); ShmInfo inBuffer = {}; if (runInfo->inHandle < 0) break; ShmInfo outBuffer = {}; @@ -168,19 +138,31 @@ void IntelGPUAlgoServer::handleRequest(const MsgReq& msg) { LOGE("%s, the buffer handle for ICBM outBuffer data is invalid", __func__); break; } + if (runInfo->paramHandle >= 0) { + ShmInfo paramBuffer = {}; + status = getIntelAlgoServer()->getShmInfo(runInfo->paramHandle, ¶mBuffer); + if (status != OK) { + LOGE("%s, the buffer handle for parameter is invalid", __func__); + break; + } + runInfo->paramAddr = paramBuffer.addr; + } runInfo->inII.bufAddr = inBuffer.addr; runInfo->outII.bufAddr = outBuffer.addr; - status = mICBMServer.processFrame(runInfo->inII, runInfo->outII, runInfo->icbmReqInfo); + status = mICBMServer.processFrame(*runInfo); runInfo->inII.bufAddr = nullptr; runInfo->outII.bufAddr = nullptr; + runInfo->paramAddr = nullptr; break; } - case IPC_ICBM_DEINIT: - status = mICBMServer.shutdown(); + case IPC_ICBM_DEINIT: { + ICBMReqInfo* shutInfo = static_cast(addr); + status = mICBMServer.shutdown(*shutInfo); break; - // LEVEL0_ICBM_E + } + // LEVEL0_ICBM_E default: LOGE("@%s, req_id:%d is not defined", __func__, req_id); status = UNKNOWN_ERROR; @@ -189,6 +171,8 @@ void IntelGPUAlgoServer::handleRequest(const MsgReq& msg) { LOG1("@%s, req_id:%d:%s, status:%d", __func__, req_id, IntelAlgoIpcCmdToString(static_cast(req_id)), status); + (void)requestSize; + (void)addr; getIntelAlgoServer()->returnCallback(req_id, status, buffer_handle); } } /* namespace icamera */ diff --git a/modules/sandboxing/server/IntelGPUAlgoServer.h b/modules/sandboxing/server/IntelGPUAlgoServer.h index ee69ef73..98aeed68 100644 --- a/modules/sandboxing/server/IntelGPUAlgoServer.h +++ b/modules/sandboxing/server/IntelGPUAlgoServer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation. + * Copyright (C) 2020-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include @@ -33,10 +33,6 @@ #include "modules/sandboxing/server/IntelTNRServer.h" #endif -// ENABLE_EVCP_S -#include "modules/sandboxing/server/IntelEvcpServer.h" -// ENABLE_EVCP_E - // LEVEL0_ICBM_S #include "modules/sandboxing/server/IntelICBMServer.h" // LEVEL0_ICBM_E @@ -54,11 +50,6 @@ class IntelGPUAlgoServer : public RequestHandler { IntelTNRServer mTNR; #endif - // ENABLE_EVCP_S - private: - IntelEvcpServer mEvcp; - // ENABLE_EVCP_E - // LEVEL0_ICBM_S private: IntelICBMServer mICBMServer; diff --git a/modules/sandboxing/server/IntelICBMServer.cpp b/modules/sandboxing/server/IntelICBMServer.cpp index bfaac2e3..cf3c7381 100644 --- a/modules/sandboxing/server/IntelICBMServer.cpp +++ b/modules/sandboxing/server/IntelICBMServer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,19 +26,17 @@ namespace icamera { int IntelICBMServer::setup(ICBMInitInfo* initParam) { mIntelICBM = std::unique_ptr(new IntelICBM()); - return mIntelICBM->setup(initParam) == Result::OK ? OK : UNKNOWN_ERROR; + return mIntelICBM->setup(initParam); } -int IntelICBMServer::shutdown() { - mIntelICBM->shutdown(); - mIntelICBM = nullptr; +int IntelICBMServer::shutdown(const ICBMReqInfo& reqInfo) { + int ret = mIntelICBM->shutdown(reqInfo); - return OK; + return ret >= 0 ? OK : ret; } -int IntelICBMServer::processFrame(const ImageInfo& iii, const ImageInfo& iio, - const ICBMReqInfo& reqInfo) { - return mIntelICBM->processFrame(iii, iio, reqInfo) == Result::OK ? OK : UNKNOWN_ERROR; +int IntelICBMServer::processFrame(const ICBMReqInfo& reqInfo) { + return mIntelICBM->processFrame(reqInfo); } } // namespace icamera diff --git a/modules/sandboxing/server/IntelICBMServer.h b/modules/sandboxing/server/IntelICBMServer.h index bf22a418..0dbc15d3 100644 --- a/modules/sandboxing/server/IntelICBMServer.h +++ b/modules/sandboxing/server/IntelICBMServer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation. + * Copyright (C) 2022-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,9 +30,9 @@ class IntelICBMServer { ~IntelICBMServer(){}; int setup(ICBMInitInfo* initParam); - int shutdown(); + int shutdown(const ICBMReqInfo& reqInfo); - int processFrame(const ImageInfo& iii, const ImageInfo& iio, const ICBMReqInfo& reqInfo); + int processFrame(const ICBMReqInfo& reqInfo); private: std::unique_ptr mIntelICBM; diff --git a/modules/sandboxing/server/IntelTNRServer.cpp b/modules/sandboxing/server/IntelTNRServer.cpp index 6e306a43..c111e3cf 100644 --- a/modules/sandboxing/server/IntelTNRServer.cpp +++ b/modules/sandboxing/server/IntelTNRServer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,8 @@ int IntelTNRServer::init(void* pData, int dataSize) { int key = getIndex(initInfo->cameraId, initInfo->type); if (mIntelTNRMap.find(key) == mIntelTNRMap.end()) { - mIntelTNRMap[key] = std::unique_ptr(new IntelTNR7US(initInfo->cameraId)); + mIntelTNRMap[key] = + std::unique_ptr(IntelTNR7US::createIntelTNR(initInfo->cameraId)); } mLockMap[key] = std::unique_ptr(new std::mutex); @@ -130,7 +131,7 @@ int IntelTNRServer::asyncParamUpdate(TnrRequestInfo* requestInfo) { return mIntelTNRMap[key]->asyncParamUpdate(requestInfo->gain, requestInfo->isForceUpdate); } -int IntelTNRServer::getSurfaceInfo(TnrRequestInfo* requestInfo) { +int IntelTNRServer::getTnrBufferSize(TnrRequestInfo* requestInfo) { CheckAndLogError(requestInfo == nullptr, UNKNOWN_ERROR, "@%s, requestInfo is nullptr", __func__); int key = getIndex(requestInfo->cameraId, requestInfo->type); @@ -139,8 +140,8 @@ int IntelTNRServer::getSurfaceInfo(TnrRequestInfo* requestInfo) { requestInfo->type); std::unique_lock lock(*mLockMap[key]); - return mIntelTNRMap[key]->getSurfaceInfo(requestInfo->width, requestInfo->height, - &requestInfo->surfaceSize); + return mIntelTNRMap[key]->getTnrBufferSize(requestInfo->width, requestInfo->height, + &requestInfo->surfaceSize); } } // namespace icamera diff --git a/modules/sandboxing/server/IntelTNRServer.h b/modules/sandboxing/server/IntelTNRServer.h index c5e53169..6ea1be35 100644 --- a/modules/sandboxing/server/IntelTNRServer.h +++ b/modules/sandboxing/server/IntelTNRServer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation. + * Copyright (C) 2020-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ class IntelTNRServer { int runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t inBufSize, uint32_t outBufSize, void* tnrParam, TnrRequestInfo* requestInfo); int asyncParamUpdate(TnrRequestInfo* requestInfo); - int getSurfaceInfo(TnrRequestInfo* requestInfo); + int getTnrBufferSize(TnrRequestInfo* requestInfo); private: // the tnr instance of the id diff --git a/src/3a/AiqCore.cpp b/src/3a/AiqCore.cpp index ade025a3..5cf7b1ad 100644 --- a/src/3a/AiqCore.cpp +++ b/src/3a/AiqCore.cpp @@ -49,6 +49,7 @@ AiqCore::AiqCore(int cameraId) mLensShadingMapMode(LENS_SHADING_MAP_MODE_OFF), mLscGridRGGBLen(0), mLastEvShift(0.0f), + mAiqResults(nullptr), mAeAndAwbConverged(false), mRgbStatsBypassed(false), mAeBypassed(false), @@ -60,6 +61,8 @@ AiqCore::AiqCore(int cameraId) CLEAR(mFrameParams); CLEAR(mLastAeResult); + CLEAR(mLastAfResult); + CLEAR(mLastAwbResult); CLEAR(mGbceParams); CLEAR(mPaParams); @@ -78,7 +81,6 @@ AiqCore::AiqCore(int cameraId) std::fill(std::begin(mLscOffGrid), std::end(mLscOffGrid), 1.0f); mAiqParams = std::unique_ptr(new cca::cca_aiq_params); - mAiqResults = std::unique_ptr(new cca::cca_aiq_results); } AiqCore::~AiqCore() {} @@ -104,6 +106,13 @@ int AiqCore::initAiqPlusParams() { mGbceParams.athena_mode = PlatformData::getPLCEnable(mCameraId); LOG1("%s, gbce_on: %d, plc enable: %d", __func__, mGbceParams.gbce_on, mGbceParams.athena_mode); + // HDR_FEATURE_S + if (PlatformData::getSensorAeEnable(mCameraId)) { + LOG2("@%s, enable_gtm_desaturation for HDR sensor", __func__); + mPaParams.enable_gtm_desaturation = true; + } + // HDR_FEATURE_E + return OK; } @@ -120,7 +129,9 @@ int AiqCore::init() { int ret = mIntel3AParameter->init(); CheckAndLogError(ret != OK, ret, "@%s, Init 3a parameter failed ret: %d", __func__, ret); - CLEAR(mLastAeResult), mAeRunTime = 0; + CLEAR(mLastAeResult); + + mAeRunTime = 0; mAwbRunTime = 0; mAiqRunTime = 0; @@ -134,10 +145,36 @@ int AiqCore::deinit() { mAiqState = AIQ_NOT_INIT; + freeAiqResultMem(); + + return OK; +} + +int AiqCore::allocAiqResultMem() { + IntelCca* intelCca = IntelCca::getInstance(mCameraId, mTuningMode); + CheckAndLogError(!intelCca, UNKNOWN_ERROR, "Failed to get intelCca instance"); + + mAiqResults = + static_cast(intelCca->allocMem(0, "aiqResults", 0, + sizeof(cca::cca_aiq_results))); + CheckAndLogError(!mAiqResults, NO_MEMORY, "allocMem failed"); + return OK; } +void AiqCore::freeAiqResultMem() { + if (mTuningMode == TUNING_MODE_MAX || !mAiqResults) return; + + IntelCca* intelCca = IntelCca::getInstance(mCameraId, mTuningMode); + CheckAndLogError(!intelCca, VOID_VALUE, "Failed to get intelCca instance"); + + intelCca->freeMem(mAiqResults); + mAiqResults = nullptr; +} + int AiqCore::configure() { + freeAiqResultMem(); + if (mAiqState == AIQ_CONFIGURED) { return OK; } @@ -221,6 +258,10 @@ int AiqCore::updateParameter(const aiq_parameter_t& param) { mHyperFocalDistance = AiqUtils::calculateHyperfocalDistance(mIntel3AParameter->mCMC); mTuningMode = param.tuningMode; + + // Tuning Mode changed, reset AE/AWB run count + mAeRunTime = 0; + mAwbRunTime = 0; } mShadingMode = param.shadingMode; mLensShadingMapMode = param.lensShadingMapMode; @@ -248,6 +289,11 @@ int AiqCore::updateParameter(const aiq_parameter_t& param) { mRgbStatsBypassed = true; } + if (!mAiqResults) { + int ret = allocAiqResultMem(); + CheckAndLogError(ret != OK, NO_MEMORY, "alloc aiq result failed"); + } + return OK; } @@ -276,13 +322,10 @@ int AiqCore::setStatsParams(const cca::cca_stats_params& statsParams, AiqStatist unsigned int byteUsed = 0; void* pStatsData = intelCca->fetchHwStatsData(aiqStats->mSequence, &byteUsed); CheckAndLogError(!pStatsData, UNKNOWN_ERROR, "%s, pStatsData is nullptr", __func__); - ia_isp_bxt_statistics_query_results_t queryResults = {}; ia_err iaErr = intelCca->decodeStats(reinterpret_cast(pStatsData), byteUsed, - bitmap, &queryResults); + bitmap); CheckAndLogError(iaErr != ia_err_none, UNKNOWN_ERROR, "%s, Faield convert statistics", __func__); - LOG2("%s, query results: rgbs_grid(%d), af_grid(%d), dvs_stats(%d)", __func__, - queryResults.rgbs_grid, queryResults.af_grid, queryResults.dvs_stats); } { @@ -340,7 +383,7 @@ int AiqCore::runAiq(long requestId, AiqResult* aiqResult) { if (aaaRunType & IMAGING_ALGO_GBCE) { // run gbce with bypass level if AE lock if (mAeForceLock || mIntel3AParameter->mTestPatternMode != TEST_PATTERN_OFF || - mRgbStatsBypassed) { + mRgbStatsBypassed || mAeBypassed) { mGbceParams.is_bypass = true; } else { mGbceParams.is_bypass = false; @@ -370,7 +413,8 @@ int AiqCore::runAiq(long requestId, AiqResult* aiqResult) { { PERF_CAMERA_ATRACE_PARAM1_IMAGING("intelAiq->runAIQ", 1); - ia_err iaErr = intelCca->runAIQ(requestId, *mAiqParams.get(), mAiqResults.get()); + ia_err iaErr = intelCca->runAIQ(requestId, *mAiqParams.get(), mAiqResults, + aiqResult->mAiqParam.makernoteMode); mAiqRunTime++; ret = AiqUtils::convertError(iaErr); CheckAndLogError(ret != OK, ret, "@%s, runAIQ, ret: %d", __func__, ret); @@ -378,6 +422,7 @@ int AiqCore::runAiq(long requestId, AiqResult* aiqResult) { // handle awb result if (aaaRunType & IMAGING_ALGO_AWB) { + mLastAwbResult = mAiqResults->awb_output; cca::cca_awb_results* newAwbResults = &mAiqResults->awb_output; if (!PlatformData::isIsysEnabled(mCameraId)) { @@ -394,6 +439,7 @@ int AiqCore::runAiq(long requestId, AiqResult* aiqResult) { // handle af result if (aaaRunType & IMAGING_ALGO_AF) { + mLastAfResult = mAiqResults->af_output; focusDistanceResult(&mAiqResults->af_output, &aiqResult->mAfDistanceDiopters, &aiqResult->mFocusRange); aiqResult->mAfResults = mAiqResults->af_output; @@ -411,8 +457,19 @@ int AiqCore::runAiq(long requestId, AiqResult* aiqResult) { // handle pa result if (aaaRunType & IMAGING_ALGO_PA) { - mIntel3AParameter->updatePaResult(&mAiqResults->pa_output); + mIntel3AParameter->updatePaResult(&mAiqResults->pa_output, mAwbForceLock, + mLockedColorGain, mLockedColorTransform); aiqResult->mPaResults = mAiqResults->pa_output; + if (!mAwbForceLock) { + mLockedColorGain.color_gains_rggb[0] = aiqResult->mPaResults.color_gains.r; + mLockedColorGain.color_gains_rggb[1] = aiqResult->mPaResults.color_gains.gr; + mLockedColorGain.color_gains_rggb[2] = aiqResult->mPaResults.color_gains.gb; + mLockedColorGain.color_gains_rggb[3] = aiqResult->mPaResults.color_gains.b; + MEMCPY_S(&mLockedColorTransform.color_transform, + sizeof(mLockedColorTransform.color_transform), + aiqResult->mPaResults.color_conversion_matrix, + sizeof(aiqResult->mPaResults.color_conversion_matrix)); + } AiqUtils::dumpPaResults(aiqResult->mPaResults); } @@ -420,6 +477,7 @@ int AiqCore::runAiq(long requestId, AiqResult* aiqResult) { if (aaaRunType & IMAGING_ALGO_SA) { AiqUtils::dumpSaResults(mAiqResults->sa_output); ret |= processSAResults(&mAiqResults->sa_output, aiqResult->mLensShadingMap); + aiqResult->mLscUpdate = mAiqResults->sa_output.lsc_update; } CheckAndLogError(ret != OK, ret, "run3A failed, ret: %d", ret); @@ -434,7 +492,7 @@ int AiqCore::runAiq(long requestId, AiqResult* aiqResult) { if (PlatformData::isStatsRunningRateSupport(mCameraId)) { bool bothConverged = (mLastAeResult.exposures[0].converged && - mAiqResults->awb_output.distance_from_convergence < EPSILON); + mLastAwbResult.distance_from_convergence < EPSILON); if (!mAeAndAwbConverged && bothConverged) { mAeRunRateInfo.reset(); mAwbRunRateInfo.reset(); @@ -715,8 +773,8 @@ bool AiqCore::bypassAf(const aiq_parameter_t& param) { if (param.afMode == AF_MODE_OFF || param.powerMode != CAMERA_LOW_POWER) return false; - bool converged = mAiqResults->af_output.status == ia_aiq_af_status_success && - mAiqResults->af_output.final_lens_position_reached; + bool converged = mLastAfResult.status == ia_aiq_af_status_success && + mLastAfResult.final_lens_position_reached; return skipAlgoRunning(&mAfRunRateInfo, IMAGING_ALGO_AF, converged); } @@ -728,7 +786,7 @@ bool AiqCore::bypassAwb(const aiq_parameter_t& param) { if (param.awbMode != AWB_MODE_AUTO || param.powerMode != CAMERA_LOW_POWER) return false; - bool converged = mAiqResults->awb_output.distance_from_convergence < EPSILON; + bool converged = mLastAwbResult.distance_from_convergence < EPSILON; return skipAlgoRunning(&mAwbRunRateInfo, IMAGING_ALGO_AWB, converged); } diff --git a/src/3a/AiqCore.h b/src/3a/AiqCore.h index c6cb3b76..2597f4e1 100644 --- a/src/3a/AiqCore.h +++ b/src/3a/AiqCore.h @@ -103,6 +103,17 @@ class AiqCore { */ int runAiq(long requestId, AiqResult* aiqResult); + // PRIVACY_MODE_S + /** + * \brief Get the brightest index in histogram + * + * \param param: brightest index + * + * \return OK if succeed, other value indicates failed + */ + int getBrightestIndex(uint32_t& param); + // PRIVACY_MODE_E + private: // LSC data typedef struct ColorOrder { uint8_t r[2]; @@ -139,17 +150,6 @@ class AiqCore { int calculateDepthOfField(const cca::cca_af_results& afResults, camera_range_t* focusRange); int initAiqPlusParams(); - // PRIVACY_MODE_S - /** - * \brief Get the brightest index in histogram - * - * \param param: brightest index - * - * \return OK if succeed, other value indicates failed - */ - int getBrightestIndex(uint32_t& param); - // PRIVACY_MODE_E - struct RunRateInfo { int runCcaTime; // cca (like runAEC, runAIQ) running time after converged int runAlgoTime; // algo (like AE, AF ...) running time after converged @@ -169,6 +169,9 @@ class AiqCore { IntelCca* getIntelCca(TuningMode tuningMode); + int allocAiqResultMem(); + void freeAiqResultMem(); + private: int mCameraId; unsigned long long mTimestamp; // Latest statistics timestamp @@ -211,9 +214,11 @@ class AiqCore { float mLastEvShift; cca::cca_ae_results mLastAeResult; + cca::cca_af_results mLastAfResult; + cca::cca_awb_results mLastAwbResult; std::unique_ptr mAiqParams; - std::unique_ptr mAiqResults; + cca::cca_aiq_results* mAiqResults; bool mAeAndAwbConverged; bool mRgbStatsBypassed; @@ -228,6 +233,9 @@ class AiqCore { uint32_t mLockedExposureTimeUs; uint16_t mLockedIso; + camera_color_transform_t mLockedColorTransform; + camera_color_gains_t mLockedColorGain; + private: DISALLOW_COPY_AND_ASSIGN(AiqCore); }; diff --git a/src/3a/AiqEngine.cpp b/src/3a/AiqEngine.cpp index 46b87cec..38ab9b79 100644 --- a/src/3a/AiqEngine.cpp +++ b/src/3a/AiqEngine.cpp @@ -190,6 +190,20 @@ int AiqEngine::prepareStatsParams(cca::cca_stats_params* statsParams, AiqStatist int ret = OK; do { + // HDR_FEATURE_S + // Run 3A without statistics when switching pipe. + if (aiqResult->mAiqParam.tuningMode == TUNING_MODE_VIDEO_ULL && + aiqStatistics->mTuningMode == TUNING_MODE_VIDEO_HDR) { + LOG2("Switching from HDR to ULL pipe"); + ret = INVALID_OPERATION; + break; + } else if (aiqResult->mAiqParam.tuningMode == TUNING_MODE_VIDEO_HDR && + aiqStatistics->mTuningMode == TUNING_MODE_VIDEO_ULL) { + LOG2("Switching from ULL to HDR pipe"); + ret = INVALID_OPERATION; + break; + } + // HDR_FEATURE_E // The statistics timestamp is incorrect. If possible, use SOF timestamp instead. unsigned long long timestamp = mSensorManager->getSofTimestamp(aiqStatistics->mSequence); @@ -232,6 +246,19 @@ void AiqEngine::setAiqResult(AiqResult* aiqResult, bool skip) { LOG2("%s, skipping the frame", aiqResult->mSequence, __func__); } + // HDR_FEATURE_S + int64_t sequence = aiqResult->mSequence - PlatformData::getExposureLag(mCameraId); + mSensorManager->setWdrMode(aiqResult->mTuningMode, sequence); + + if (PlatformData::getSensorAwbEnable(mCameraId)) { + LOG2("%s, Set sensor awb %f %f", __func__, aiqResult->mAwbResults.accurate_r_per_g, + aiqResult->mAwbResults.accurate_b_per_g); + + mSensorManager->setAWB(aiqResult->mAwbResults.accurate_r_per_g, + aiqResult->mAwbResults.accurate_b_per_g); + } + // HDR_FEATURE_E + mLensManager->setLensResult(aiqResult->mAfResults, aiqResult->mSequence, aiqResult->mAiqParam); } @@ -293,6 +320,9 @@ AiqEngine::AiqState AiqEngine::prepareInputParam(AiqStatistics* aiqStats, AiqRes // Update sensor info for the first-run of AIQ if (mFirstAiqRunning) { + // CRL_MODULE_S + mSensorManager->setFrameRate(aiqResult->mAiqParam.fps); + // CRL_MODULE_E // set sensor info if needed ia_aiq_exposure_sensor_descriptor sensorDescriptor = {}; ia_aiq_frame_params frameParams = {}; @@ -304,7 +334,8 @@ AiqEngine::AiqState AiqEngine::prepareInputParam(AiqStatistics* aiqStats, AiqRes // update lens related parameters mLensManager->getLensInfo(aiqResult->mAiqParam); - mAiqCore->updateParameter(aiqResult->mAiqParam); + ret = mAiqCore->updateParameter(aiqResult->mAiqParam); + if (ret != OK) return AIQ_STATE_ERROR; if (aiqStats == nullptr) { LOG2("%s: run aiq without stats data", __func__); @@ -384,6 +415,13 @@ void AiqEngine::setSensorExposure(AiqResult* aiqResult, int64_t applyingSeq) { AiqEngine::AiqState AiqEngine::handleAiqResult(AiqResult* aiqResult) { LOG2("%s: aiqResult->mTuningMode = %d", __func__, aiqResult->mTuningMode); + // HDR_FEATURE_S + aec_scene_t aecScene = (aiqResult->mAeResults.multiframe == ia_aiq_bracket_mode_ull) ? + AEC_SCENE_ULL : + AEC_SCENE_HDR; + mAiqSetting->updateTuningMode(aecScene); + // HDR_FEATURE_E + aiqResult->mSceneMode = SCENE_MODE_AUTO; /* Use direct AE result to update sceneMode to reflect the actual mode AE want to have, * Besides needed by full pipe auto-switch, this is also necessary when user want to diff --git a/src/3a/AiqResult.cpp b/src/3a/AiqResult.cpp index 48a56bbe..01c0b122 100644 --- a/src/3a/AiqResult.cpp +++ b/src/3a/AiqResult.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ AiqResult::AiqResult(int cameraId) mSkip(false), mLensPosition(0), mSceneMode(SCENE_MODE_AUTO), + mLscUpdate(false), mFrameDuration(0), mRollingShutter(0) { CLEAR(mCustomControls); @@ -57,7 +58,7 @@ int AiqResult::init() { CLEAR(mAwbResults); CLEAR(mPaResults); CLEAR(mOutStats); - mOutStats.rgbs_grid.blocks_ptr = mOutStats.rgbs_blocks; + mOutStats.rgbs_grid[0].blocks_ptr = mOutStats.rgbs_blocks[0]; mAiqParam.reset(); @@ -74,37 +75,4 @@ int AiqResult::deinit() { return OK; } -AiqResult& AiqResult::operator=(const AiqResult& other) { - mCameraId = other.mCameraId; - mSequence = other.mSequence; - mFrameId = other.mFrameId; - mTimestamp = other.mTimestamp; - mTuningMode = other.mTuningMode; - mAfDistanceDiopters = other.mAfDistanceDiopters; - mSkip = other.mSkip; - mLensPosition = other.mLensPosition; - mSceneMode = other.mSceneMode; - mFocusRange = other.mFocusRange; - - mAeResults = other.mAeResults; - mAwbResults = other.mAwbResults; - mAfResults = other.mAfResults; - mGbceResults = other.mGbceResults; - mPaResults = other.mPaResults; - mOutStats = other.mOutStats; - mOutStats.rgbs_grid.blocks_ptr = mOutStats.rgbs_blocks; - - mCustomControls.count = other.mCustomControls.count; - for (int i = 0; i < mCustomControls.count; i++) { - mCustomControlsParams[i] = other.mCustomControlsParams[i]; - } - MEMCPY_S(mLensShadingMap, sizeof(mLensShadingMap), other.mLensShadingMap, - sizeof(other.mLensShadingMap)); - - mAiqParam = other.mAiqParam; - mFrameDuration = other.mFrameDuration; - mRollingShutter = other.mRollingShutter; - - return *this; -} } /* namespace icamera */ diff --git a/src/3a/AiqResult.h b/src/3a/AiqResult.h index 3fb75d9f..61068153 100644 --- a/src/3a/AiqResult.h +++ b/src/3a/AiqResult.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,8 +41,6 @@ class AiqResult { int init(); int deinit(); - AiqResult& operator=(const AiqResult& other); - public: int mCameraId; unsigned long long mTimestamp; @@ -61,6 +59,7 @@ class AiqResult { cca::cca_gbce_params mGbceResults; cca::cca_pa_params mPaResults; cca::cca_out_stats mOutStats; + bool mLscUpdate; ia_isp_custom_controls mCustomControls; diff --git a/src/3a/AiqResultStorage.cpp b/src/3a/AiqResultStorage.cpp index 6e55a96e..c82ed037 100644 --- a/src/3a/AiqResultStorage.cpp +++ b/src/3a/AiqResultStorage.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2022 Intel Corporation. + * Copyright (C) 2016-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -136,6 +136,32 @@ const AiqResult* AiqResultStorage::getAiqResult(int64_t sequence) { return nullptr; } +void AiqResultStorage::updateDvsRunMap(int64_t sequence) { + AutoWMutex wlock(mDataLock); + + mDvsRunMap[sequence] = true; + + if (mDvsRunMap.size() > kDvsRunMapSize) { + mDvsRunMap.erase(mDvsRunMap.begin()); + } +} + +void AiqResultStorage::clearDvsRunMap() { + AutoWMutex wlock(mDataLock); + + mDvsRunMap.clear(); +} + +bool AiqResultStorage::isDvsRun(int64_t sequence) { + AutoWMutex rlock(mDataLock); + + if (mDvsRunMap.find(sequence) != mDvsRunMap.end()) { + return true; + } + + return false; +} + /** * Private function with no lock in it, must be called with lock protection */ diff --git a/src/3a/AiqResultStorage.h b/src/3a/AiqResultStorage.h index 70c0af4c..a227270f 100644 --- a/src/3a/AiqResultStorage.h +++ b/src/3a/AiqResultStorage.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2022 Intel Corporation. + * Copyright (C) 2016-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -126,6 +126,10 @@ class AiqResultStorage { */ void resetAiqStatistics(); + void updateDvsRunMap(int64_t sequence); + void clearDvsRunMap(); + bool isDvsRun(int64_t sequence); + private: AiqResultStorage(int cameraId); ~AiqResultStorage(); @@ -147,6 +151,10 @@ class AiqResultStorage { static const int kAiqStatsStorageSize = 3; // Always use the latest, but may hold for long time int mCurrentAiqStatsIndex = -1; AiqStatistics mAiqStatistics[kAiqStatsStorageSize]; + + static const int kDvsRunMapSize = 15; + // first: sequence id, second: true + std::map mDvsRunMap; }; } // namespace icamera diff --git a/src/3a/AiqSetting.cpp b/src/3a/AiqSetting.cpp index e7523141..0b6d1bef 100644 --- a/src/3a/AiqSetting.cpp +++ b/src/3a/AiqSetting.cpp @@ -268,6 +268,38 @@ int AiqSetting::getAiqParameter(aiq_parameter_t& param) { return OK; } +// HDR_FEATURE_S +/* When multi-TuningModes supported in AUTO ConfigMode, TuningMode may be changed + based on AE result. Current it only has HDR and ULL mode switching case, + this maybe changed if more cases are supported. */ +void AiqSetting::updateTuningMode(aec_scene_t aecScene) { + if (!PlatformData::isEnableHDR(mCameraId) || mTuningModes.size() <= 1 || + mAiqParam.aeMode != AE_MODE_AUTO) { + return; + } + + TuningMode tuningMode = mAiqParam.tuningMode; + if (aecScene == AEC_SCENE_HDR) { + tuningMode = TUNING_MODE_VIDEO_HDR; + } else if (aecScene == AEC_SCENE_ULL) { + tuningMode = TUNING_MODE_VIDEO_ULL; + } + + bool found = false; + for (auto& tMode : mTuningModes) { + // Check tuningMode if support or not + if (tMode == tuningMode) { + found = true; + break; + } + } + if (!found) { + LOG1("%s, new tuningMode %d isn't supported", __func__, tuningMode); + return; + } +} +// HDR_FEATURE_E + void aiq_parameter_t::reset() { frameUsage = FRAME_USAGE_VIDEO; aeMode = AE_MODE_AUTO; diff --git a/src/3a/AiqSetting.h b/src/3a/AiqSetting.h index 21e1d945..015f0791 100644 --- a/src/3a/AiqSetting.h +++ b/src/3a/AiqSetting.h @@ -27,6 +27,10 @@ namespace icamera { #define DEFAULT_LSC_GRID_SIZE (64 * 64) #define DEFAULT_TONEMAP_CURVE_POINT_NUM 2048 +// HDR_FEATURE_S +typedef enum { AEC_SCENE_NONE, AEC_SCENE_HDR, AEC_SCENE_ULL } aec_scene_t; +// HDR_FEATURE_E + typedef struct { char data[MAX_CUSTOM_CONTROLS_PARAM_SIZE]; unsigned int length; @@ -133,6 +137,10 @@ class AiqSetting { int getAiqParameter(aiq_parameter_t& param); + // HDR_FEATURE_S + void updateTuningMode(aec_scene_t aecScene); + // HDR_FEATURE_E + private: void updateFrameUsage(const stream_config_t* streamList); diff --git a/src/3a/AiqUnit.cpp b/src/3a/AiqUnit.cpp index ffc71d7f..7fe74ea1 100644 --- a/src/3a/AiqUnit.cpp +++ b/src/3a/AiqUnit.cpp @@ -134,22 +134,23 @@ int AiqUnit::configure(const stream_config_t* streamList) { return BAD_VALUE; } - std::vector configModes; - PlatformData::getConfigModesByOperationMode(mCameraId, streamList->operation_mode, configModes); - int ret = initIntelCcaHandle(configModes); - CheckAndLogError(ret < 0, BAD_VALUE, "@%s failed to create intel cca handle", __func__); - - ret = mAiqSetting->configure(streamList); + int ret = mAiqSetting->configure(streamList); CheckAndLogError(ret != OK, ret, "configure AIQ settings error: %d", ret); ret = mAiqEngine->configure(); CheckAndLogError(ret != OK, ret, "configure AIQ engine error: %d", ret); + std::vector configModes; + PlatformData::getConfigModesByOperationMode(mCameraId, streamList->operation_mode, configModes); + ret = initIntelCcaHandle(configModes); + CheckAndLogError(ret < 0, BAD_VALUE, "@%s failed to create intel cca handle", __func__); + mAiqUnitState = AIQ_UNIT_CONFIGURED; return OK; } -int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { +void AiqUnit::resetIntelCcaHandle(const std::vector& configModes) { + bool reinit = false; if ((PlatformData::supportUpdateTuning() || PlatformData::isDvsSupported(mCameraId)) && !configModes.empty()) { std::shared_ptr graphConfig = @@ -159,15 +160,75 @@ int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { graphConfig->graphGetStreamIds(streamIds); if (streamIds.size() != mActiveStreamCount) { - LOG2("%s, the pipe count(%zu) changed, need to re-init CCA", __func__, + LOG1("%s, the pipe count(%zu) changed, need to re-init CCA", __func__, streamIds.size()); - deinitIntelCcaHandle(); mActiveStreamCount = streamIds.size(); + reinit = true; } } } - if (mCcaInitialized) return OK; + if (!mTuningModes.empty()) { + for (const auto& cfg : configModes) { + TuningMode tuningMode; + int ret = PlatformData::getTuningModeByConfigMode(mCameraId, cfg, tuningMode); + if (ret == OK) { + bool match = false; + for (auto mode : mTuningModes) { + if (tuningMode == mode) { + match = true; + break; + } + } + if (!match) { + LOG1("%s, tuning mode changed from %d to %d", __func__, mTuningModes[0], + tuningMode); + reinit = true; + break; + } + } + } + } + + if (reinit) deinitIntelCcaHandle(); +} + +int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { + resetIntelCcaHandle(configModes); + + if (mCcaInitialized) { + // INTEL_DVS_S + if (mDvs) { + for (auto& cfg : configModes) { + std::vector streamIds; + std::shared_ptr graphConfig = + IGraphConfigManager::getInstance(mCameraId)->getGraphConfig(cfg); + if (graphConfig != nullptr) { + graphConfig->graphGetStreamIds(streamIds); + } + DvsConfig dvsConfig; + dvsConfig.gdcConfigs.count = streamIds.size(); + for (size_t i = 0; i < streamIds.size(); ++i) { + dvsConfig.gdcConfigs.ids[i] = streamIds[i]; + } + int ret = mDvs->configure(cfg, &dvsConfig); + CheckAndLogError(ret != OK, UNKNOWN_ERROR, "%s, configure DVS error", __func__); + + TuningMode tuningMode; + ret = PlatformData::getTuningModeByConfigMode(mCameraId, cfg, tuningMode); + CheckAndLogError(ret != OK, ret, "Failed to get tuningMode, cfg: %d", cfg); + IntelCca* intelCca = IntelCca::getInstance(mCameraId, tuningMode); + CheckAndLogError(!intelCca, UNKNOWN_ERROR, "Failed to get cca. mode:%d cameraId:%d", + tuningMode, mCameraId); + cca::cca_dvs_init_param dvsInitParam = {dvsConfig.zoomRatio, dvsConfig.outputType}; + ia_err iaErr = intelCca->reconfigDvs(dvsInitParam, dvsConfig.gdcConfigs); + CheckAndLogError(iaErr != ia_err_none, UNKNOWN_ERROR, "Failed to reconfig DVS %d", + iaErr); + } + } + // INTEL_DVS_E + return OK; + } LOG1("@%s", mCameraId, __func__); mTuningModes.clear(); @@ -232,7 +293,17 @@ int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { // LOCAL_TONEMAP_S bool hasLtm = PlatformData::isLtmEnabled(mCameraId); + // HDR_FEATURE_S + if (PlatformData::isEnableHDR(mCameraId) && + !PlatformData::isMultiExposureCase(mCameraId, tuningMode)) { + hasLtm = false; + } + // HDR_FEATURE_E + // DOL_FEATURE_S + hasLtm |= (PlatformData::isDolShortEnabled(mCameraId) || + PlatformData::isDolMediumEnabled(mCameraId)); + // DOL_FEATURE_E if (hasLtm && mLtm) { params.bitmap |= cca::CCA_MODULE_LTM; ret = mLtm->configure(configModes, graphConfig, VIDEO_STREAM_ID); @@ -243,19 +314,53 @@ int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { // INTEL_DVS_S if (mDvs) { std::vector streamIds; + DvsConfig dvsConfig; if (graphConfig != nullptr) { graphConfig->graphGetStreamIds(streamIds); } - params.dvs_ids.count = streamIds.size(); + dvsConfig.gdcConfigs.count = streamIds.size(); for (size_t i = 0; i < streamIds.size(); ++i) { - params.dvs_ids.ids[i] = streamIds[i]; + dvsConfig.gdcConfigs.ids[i] = streamIds[i]; } - ret = mDvs->configure(cfg, ¶ms); + ret = mDvs->configure(cfg, &dvsConfig); CheckAndLogError(ret != OK, UNKNOWN_ERROR, "%s, configure DVS error", __func__); params.bitmap |= cca::CCA_MODULE_DVS; + params.dvsOutputType = dvsConfig.outputType; + params.dvsZoomRatio = dvsConfig.zoomRatio; + params.enableVideoStablization = dvsConfig.enableDvs; + params.gdcConfigs = dvsConfig.gdcConfigs; } // INTEL_DVS_E + // DOL_FEATURE_S + // Initialize Bcomp params + if (PlatformData::isDolShortEnabled(mCameraId) || + PlatformData::isDolMediumEnabled(mCameraId)) { + // Parse the DOL mode and CG ratio from sensor mode config + if (graphConfig != nullptr) { + std::string dol_mode_name; + graphConfig->getDolInfo(params.conversionGainRatio, dol_mode_name); + std::map dolModeNameMap; + dolModeNameMap["DOL_MODE_2_3_FRAME"] = ia_bcomp_dol_two_or_three_frame; + dolModeNameMap["DOL_MODE_DCG"] = ia_bcomp_dol_dcg; + dolModeNameMap["DOL_MODE_COMBINED_VERY_SHORT"] = ia_bcomp_dol_combined_very_short; + dolModeNameMap["DOL_MODE_DCG_VERY_SHORT"] = ia_bcomp_dol_dcg_very_short; + if (dolModeNameMap.count(dol_mode_name)) { + params.dolMode = dolModeNameMap[dol_mode_name]; + } + } + LOG2("conversionGainRatio: %f, dolMode: %d", params.conversionGainRatio, + params.dolMode); + params.bitmap = params.bitmap | cca::CCA_MODULE_BCOM; + } else if (PlatformData::getSensorAeEnable(mCameraId)) { + params.conversionGainRatio = 1; + params.dolMode = ia_bcomp_linear_hdr_mode; + LOG2("WA: conversionGainRatio: %f, dolMode: %d", params.conversionGainRatio, + params.dolMode); + params.bitmap = params.bitmap | cca::CCA_MODULE_BCOM; + } + // DOL_FEATURE_E + if (PlatformData::supportUpdateTuning()) { if (graphConfig != nullptr) { std::vector streamIds; @@ -417,11 +522,6 @@ EventSource* AiqUnit::get3AReadyEventSource() { int AiqUnit::setParameters(const Parameters& params) { AutoMutex l(mAiqUnitLock); -// INTEL_DVS_S - if (mDvs) { - mDvs->setParameter(params); - } -// INTEL_DVS_E return mAiqSetting->setParameters(params); } diff --git a/src/3a/AiqUnit.h b/src/3a/AiqUnit.h index dd54b61b..c4d74d12 100644 --- a/src/3a/AiqUnit.h +++ b/src/3a/AiqUnit.h @@ -158,6 +158,7 @@ class AiqUnit : public AiqUnitBase { DISALLOW_COPY_AND_ASSIGN(AiqUnit); private: + void resetIntelCcaHandle(const std::vector& configModes); int initIntelCcaHandle(const std::vector& configModes); void deinitIntelCcaHandle(); void dumpCcaInitParam(const cca::cca_init_params params); diff --git a/src/3a/AiqUtils.cpp b/src/3a/AiqUtils.cpp index b0f785c6..40945759 100644 --- a/src/3a/AiqUtils.cpp +++ b/src/3a/AiqUtils.cpp @@ -269,6 +269,29 @@ float AiqUtils::convertSpeedModeToTime(camera_converge_speed_t mode) { return convergenceTime; } +// HDR_FEATURE_S +float AiqUtils::convertSpeedModeToTimeForHDR(camera_converge_speed_t mode) { + float convergenceTime = -1; + /* + * The unit of manual_convergence_time is second, and 1.0 means 1 second. + * The default value can be changed based on customer requirement. + */ + switch (mode) { + case CONVERGE_MID: + convergenceTime = 0.6; + break; + case CONVERGE_LOW: + convergenceTime = 1.0; + break; + case CONVERGE_NORMAL: + default: + convergenceTime = -1; + break; + } + return convergenceTime; +} +// HDR_FEATURE_E + /* * Get ia_aiq_frame_use * diff --git a/src/3a/AiqUtils.h b/src/3a/AiqUtils.h index b7710a09..44810048 100644 --- a/src/3a/AiqUtils.h +++ b/src/3a/AiqUtils.h @@ -89,6 +89,9 @@ camera_window_t convertToIaWindow(const camera_coordinate_system_t& srcSystem, float normalizeAwbGain(int gain); int convertToUserAwbGain(float normalizedGain); float convertSpeedModeToTime(camera_converge_speed_t mode); +// HDR_FEATURE_S +float convertSpeedModeToTimeForHDR(camera_converge_speed_t mode); +// HDR_FEATURE_E ia_aiq_frame_use convertFrameUsageToIaFrameUsage(int frameUsage); diff --git a/src/3a/Dvs.cpp b/src/3a/Dvs.cpp index 5ba75db6..79f3a4e6 100644 --- a/src/3a/Dvs.cpp +++ b/src/3a/Dvs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2022 Intel Corporation. + * Copyright (C) 2017-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,16 +39,20 @@ const int DVS_OXDIM_UV = 64; const int DVS_OYDIM_UV = 16; const int DVS_MIN_ENVELOPE = 12; -Dvs::Dvs(int cameraId) : mCameraId(cameraId), mTuningMode(TUNING_MODE_VIDEO) {} +Dvs::Dvs(int cameraId) : + mCameraId(cameraId), mTuningMode(TUNING_MODE_VIDEO), mZoomRegion({ -1, -1, -1, -1 }) {} Dvs::~Dvs() {} -int Dvs::configure(const ConfigMode configMode, cca::cca_init_params* params) { - CheckAndLogError(!params, BAD_VALUE, "params is nullptr"); +int Dvs::configure(const ConfigMode configMode, DvsConfig* cfg) { + CheckAndLogError(!cfg, BAD_VALUE, "cfg is nullptr"); LOG2("@%s", __func__); - for (uint8_t i = 0; i < params->dvs_ids.count; i++) { - int ret = configCcaDvsData(params->dvs_ids.ids[i], configMode, params); + mZoomRegion = { -1, -1, -1, -1 }; + AiqResultStorage::getInstance(mCameraId)->clearDvsRunMap(); + + for (uint8_t i = 0; i < cfg->gdcConfigs.count; i++) { + auto ret = configCcaDvsData(cfg->gdcConfigs.ids[i], configMode, cfg); CheckAndLogError(ret != OK, UNKNOWN_ERROR, "%s, configure DVS data error", __func__); } @@ -58,11 +62,11 @@ int Dvs::configure(const ConfigMode configMode, cca::cca_init_params* params) { } mTuningMode = tuningMode; + dumpDvsConfiguration(*cfg); return OK; } -int Dvs::configCcaDvsData(int32_t streamId, const ConfigMode configMode, - cca::cca_init_params* params) { +int Dvs::configCcaDvsData(int32_t streamId, const ConfigMode configMode, DvsConfig* cfg) { // update GC std::shared_ptr gc = nullptr; if (PlatformData::getGraphConfigNodes(mCameraId)) { @@ -82,7 +86,16 @@ int Dvs::configCcaDvsData(int32_t streamId, const ConfigMode configMode, resolution.input_width, resolution.input_height, resolution.output_width, resolution.output_height); - cca::cca_gdc_configuration* gdcConfig = ¶ms->gdcConfig; + cca::cca_gdc_configuration* gdcConfig = nullptr; + for (size_t i = 0; i < cfg->gdcConfigs.count; ++i) { + if (cfg->gdcConfigs.ids[i] == static_cast(streamId)) { + gdcConfig = &cfg->gdcConfigs.configs[i]; + } + } + + CheckAndLogError(gdcConfig == nullptr, UNKNOWN_ERROR, + "%s, Cannot find correspond DVS GDC Config!", __func__); + CLEAR(*gdcConfig); gdcConfig->gdc_filter_width = DVS_MIN_ENVELOPE / 2; gdcConfig->gdc_filter_height = DVS_MIN_ENVELOPE / 2; @@ -128,13 +141,13 @@ int Dvs::configCcaDvsData(int32_t streamId, const ConfigMode configMode, float zoomHRatio = resolution.input_width / (resolution.input_width - envelope_bq.width * 2); float zoomVRatio = resolution.input_height / (resolution.input_height - envelope_bq.height * 2); - params->dvsZoomRatio = (zoomHRatio > zoomVRatio) ? zoomHRatio : zoomVRatio; - params->enableVideoStablization = VIDEO_STABILIZATION_MODE_OFF; + cfg->zoomRatio = (zoomHRatio > zoomVRatio) ? zoomHRatio : zoomVRatio; + cfg->enableDvs = VIDEO_STABILIZATION_MODE_OFF; int dvsType = PlatformData::getDVSType(mCameraId); if (dvsType == IMG_TRANS) { - params->dvsOutputType = cca::CCA_DVS_IMAGE_TRANSFORM; + cfg->outputType = cca::CCA_DVS_IMAGE_TRANSFORM; } else { - params->dvsOutputType = cca::CCA_DVS_MORPH_TABLE; + cfg->outputType = cca::CCA_DVS_MORPH_TABLE; } gdcConfig->gdc_resolution_history = gdcConfig->gdc_resolution_info; @@ -151,14 +164,10 @@ int Dvs::configCcaDvsData(int32_t streamId, const ConfigMode configMode, mZoomParamMap[streamId] = zoomParam; } - dumpDvsConfiguration(*params); return OK; } -void Dvs::setParameter(const Parameters& p) { - camera_zoom_region_t region; - if (p.getZoomRegion(®ion) != OK) return; - +void Dvs::setParameter(const camera_zoom_region_t& region) { // Convert active pixel array system to GDC system. camera_coordinate_system_t srcSystem = PlatformData::getActivePixelArray(mCameraId); std::lock_guard l(mLock); @@ -189,6 +198,19 @@ void Dvs::handleEvent(EventData eventData) { LOG2("@%s: eventData.type:%d", __func__, eventData.type); if (eventData.type != EVENT_DVS_READY) return; + if ((eventData.data.dvsRunReady.streamId == VIDEO_STREAM_ID) && + (eventData.data.dvsRunReady.region.left == mZoomRegion.left) && + (eventData.data.dvsRunReady.region.top == mZoomRegion.top) && + (eventData.data.dvsRunReady.region.right == mZoomRegion.right) && + (eventData.data.dvsRunReady.region.bottom == mZoomRegion.bottom)) return; + + int64_t sequence = eventData.data.dvsRunReady.sequence; + AiqResult* aiqResults = const_cast( + AiqResultStorage::getInstance(mCameraId)->getAiqResult(sequence)); + if (aiqResults == nullptr) return; + + setParameter(eventData.data.dvsRunReady.region); + int streamId = eventData.data.dvsRunReady.streamId; IntelCca* intelCcaHandle = IntelCca::getInstance(mCameraId, mTuningMode); @@ -205,7 +227,7 @@ void Dvs::handleEvent(EventData eventData) { } // Run DVS - LOG2("%s: Ready to run DVS", __func__); + LOG2("%s: Ready to run DVS, sequence %ld", __func__, sequence); cca::cca_dvs_zoom zp; memset(&zp, 0, sizeof(zp)); @@ -215,81 +237,64 @@ void Dvs::handleEvent(EventData eventData) { if (!ptzRegion.left && !ptzRegion.top && !ptzRegion.right && !ptzRegion.bottom) { zp.zoom_region = {gdcRegion.left, gdcRegion.top, gdcRegion.right, gdcRegion.bottom}; } else { - /* - SCALER_CROP_REGION can adjust to a small crop region if the aspect of active - pixel array is not same as the crop region aspect. Crop can only on either - horizontally or veritacl but never both. - If active pixel array's aspect ratio is wider than the crop region, the region - should be further cropped vertically. - */ - auto coord = PlatformData::getActivePixelArray(mCameraId); - int wpa = coord.right - coord.left; - int hpa = coord.bottom - coord.top; - - int width = ptzRegion.right - ptzRegion.left; - int height = ptzRegion.bottom - ptzRegion.top; - - float aspect0 = static_cast(wpa) / hpa; - float aspect1 = static_cast(width) / height; - - if (std::fabs(aspect0 - aspect1) < 0.00001) { - zp.zoom_region = {ptzRegion.left, ptzRegion.top, ptzRegion.right, ptzRegion.bottom}; - } else if (aspect0 > aspect1) { - auto croppedHeight = width / aspect0; - int diff = std::abs(height - croppedHeight) / 2; - zp.zoom_region = {ptzRegion.left, ptzRegion.top + diff, ptzRegion.right, - ptzRegion.bottom - diff}; - } else { - auto croppedWidth = height * aspect0; - int diff = std::abs(width - croppedWidth) / 2; - zp.zoom_region = {ptzRegion.left + diff, ptzRegion.top, ptzRegion.right - diff, - ptzRegion.bottom}; - } + zp.zoom_region = {ptzRegion.left, ptzRegion.top, ptzRegion.right, ptzRegion.bottom}; } intelCcaHandle->updateZoom(streamId, zp); - ia_err iaErr = intelCcaHandle->runDVS(streamId, eventData.data.statsReady.sequence); + ia_err iaErr = intelCcaHandle->runDVS(streamId, aiqResults->mFrameId); int ret = AiqUtils::convertError(iaErr); CheckAndLogError(ret != OK, VOID_VALUE, "Error running DVS: %d", ret); + + if (eventData.data.dvsRunReady.streamId == VIDEO_STREAM_ID) { + mZoomRegion = eventData.data.dvsRunReady.region; + AiqResultStorage::getInstance(mCameraId)->updateDvsRunMap(sequence); + } + return; } -void Dvs::dumpDvsConfiguration(const cca::cca_init_params& config) { +void Dvs::dumpDvsConfiguration(const DvsConfig& config) { if (!Log::isLogTagEnabled(GET_FILE_SHIFT(Dvs), CAMERA_DEBUG_LOG_LEVEL3)) return; - LOG3("config.dvsOutputType %d", config.dvsOutputType); - LOG3("config.enableVideoStablization %d", config.enableVideoStablization); - LOG3("config.dvsZoomRatio %f", config.dvsZoomRatio); - LOG3("config.gdcConfig.pre_gdc_top_padding %d", config.gdcConfig.pre_gdc_top_padding); - LOG3("config.gdcConfig.pre_gdc_bottom_padding %d", config.gdcConfig.pre_gdc_bottom_padding); - LOG3("config.gdcConfig.gdc_filter_width %d", config.gdcConfig.gdc_filter_width); - LOG3("config.gdcConfig.gdc_filter_height %d", config.gdcConfig.gdc_filter_height); - LOG3("config.gdcConfig.splitMetadata[0](oydim_uv) %d", config.gdcConfig.splitMetadata[0]); - LOG3("config.gdcConfig.splitMetadata[1](oxdim_uv) %d", config.gdcConfig.splitMetadata[1]); - LOG3("config.gdcConfig.splitMetadata[2](oydim_y) %d", config.gdcConfig.splitMetadata[2]); - LOG3("config.gdcConfig.splitMetadata[3](oxdim_y) %d", config.gdcConfig.splitMetadata[3]); - LOG3("config.gdcConfig.gdc_resolution_info.input_width %d, input_height %d", - config.gdcConfig.gdc_resolution_info.input_width, - config.gdcConfig.gdc_resolution_info.input_height); - LOG3("config.gdcConfig.gdc_resolution_info.output_width %d, output_height %d", - config.gdcConfig.gdc_resolution_info.output_width, - config.gdcConfig.gdc_resolution_info.output_height); - LOG3("config.gdcConfig.gdc_resolution_info.input_crop.left %d, top %d, right %d, bottom %d", - config.gdcConfig.gdc_resolution_info.input_crop.left, - config.gdcConfig.gdc_resolution_info.input_crop.top, - config.gdcConfig.gdc_resolution_info.input_crop.right, - config.gdcConfig.gdc_resolution_info.input_crop.bottom); - LOG3("config.gdcConfig.gdc_resolution_history.input_width %d, input_height %d", - config.gdcConfig.gdc_resolution_history.input_width, - config.gdcConfig.gdc_resolution_history.input_height); - LOG3("config.gdcConfig.gdc_resolution_history.output_width %d, output_height %d", - config.gdcConfig.gdc_resolution_history.output_width, - config.gdcConfig.gdc_resolution_history.output_height); - LOG3("config.gdcConfig.gdc_resolution_history.input_crop.left %d, top %d, right %d, bottom %d", - config.gdcConfig.gdc_resolution_history.input_crop.left, - config.gdcConfig.gdc_resolution_history.input_crop.top, - config.gdcConfig.gdc_resolution_history.input_crop.right, - config.gdcConfig.gdc_resolution_history.input_crop.bottom); + LOG3("config: dvsOutputType %d", config.outputType); + LOG3("config: enableVideoStablization %d", config.enableDvs); + LOG3("config: dvsZoomRatio %f", config.zoomRatio); + + for (size_t i = 0; i < config.gdcConfigs.count; ++i) { + LOG3("GDC Config for steeam: %d", config.gdcConfigs.ids[i]); + + auto gdcConfig = config.gdcConfigs.configs[i]; + LOG3("gdcConfig.pre_gdc_top_padding %d", gdcConfig.pre_gdc_top_padding); + LOG3("gdcConfig.pre_gdc_bottom_padding %d", gdcConfig.pre_gdc_bottom_padding); + LOG3("gdcConfig.gdc_filter_width %d", gdcConfig.gdc_filter_width); + LOG3("gdcConfig.gdc_filter_height %d", gdcConfig.gdc_filter_height); + LOG3("gdcConfig.splitMetadata[0](oydim_uv) %d", gdcConfig.splitMetadata[0]); + LOG3("gdcConfig.splitMetadata[1](oxdim_uv) %d", gdcConfig.splitMetadata[1]); + LOG3("gdcConfig.splitMetadata[2](oydim_y) %d", gdcConfig.splitMetadata[2]); + LOG3("gdcConfig.splitMetadata[3](oxdim_y) %d", gdcConfig.splitMetadata[3]); + LOG3("gdcConfig.gdc_resolution_info.input_width %d, input_height %d", + gdcConfig.gdc_resolution_info.input_width, + gdcConfig.gdc_resolution_info.input_height); + LOG3("gdcConfig.gdc_resolution_info.output_width %d, output_height %d", + gdcConfig.gdc_resolution_info.output_width, + gdcConfig.gdc_resolution_info.output_height); + LOG3("gdcConfig.gdc_resolution_info.input_crop.left %d, top %d, right %d, bottom %d", + gdcConfig.gdc_resolution_info.input_crop.left, + gdcConfig.gdc_resolution_info.input_crop.top, + gdcConfig.gdc_resolution_info.input_crop.right, + gdcConfig.gdc_resolution_info.input_crop.bottom); + LOG3("gdcConfig.gdc_resolution_history.input_width %d, input_height %d", + gdcConfig.gdc_resolution_history.input_width, + gdcConfig.gdc_resolution_history.input_height); + LOG3("gdcConfig.gdc_resolution_history.output_width %d, output_height %d", + gdcConfig.gdc_resolution_history.output_width, + gdcConfig.gdc_resolution_history.output_height); + LOG3("gdcConfig.gdc_resolution_history.input_crop.left %d, top %d, right %d, bottom %d", + gdcConfig.gdc_resolution_history.input_crop.left, + gdcConfig.gdc_resolution_history.input_crop.top, + gdcConfig.gdc_resolution_history.input_crop.right, + gdcConfig.gdc_resolution_history.input_crop.bottom); + } } } // namespace icamera diff --git a/src/3a/Dvs.h b/src/3a/Dvs.h index d7d3bcc2..a668a312 100644 --- a/src/3a/Dvs.h +++ b/src/3a/Dvs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2022 Intel Corporation + * Copyright (C) 2017-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,23 +37,31 @@ #include "Parameters.h" namespace icamera { + +typedef struct DvsConfig { + cca::cca_gdc_configurations gdcConfigs; + float zoomRatio; + cca::CCADVSOutputType outputType; + bool enableDvs; +} DvsConfig; + class Dvs : public EventListener { public: explicit Dvs(int cameraId); ~Dvs(); - int configure(const ConfigMode configMode, cca::cca_init_params* params); + int configure(const ConfigMode configMode, DvsConfig* cfg); void handleEvent(EventData eventData); - void setParameter(const Parameters& p); private: - int configCcaDvsData(int32_t streamId, const ConfigMode configMode, - cca::cca_init_params* params); - void dumpDvsConfiguration(const cca::cca_init_params& config); + int configCcaDvsData(int32_t streamId, const ConfigMode configMode, DvsConfig* cfg); + void dumpDvsConfiguration(const DvsConfig& config); + void setParameter(const camera_zoom_region_t& region); private: int mCameraId; TuningMode mTuningMode; + camera_zoom_region_t mZoomRegion; struct ZoomParam { camera_zoom_region_t ptzRegion; camera_zoom_region_t gdcRegion; diff --git a/src/3a/Ltm.cpp b/src/3a/Ltm.cpp index d911a009..ad1c61fb 100644 --- a/src/3a/Ltm.cpp +++ b/src/3a/Ltm.cpp @@ -113,6 +113,17 @@ int Ltm::configure(const std::vector& configModes, if (cfg == CAMERA_STREAM_CONFIGURATION_MODE_NORMAL) { tMode = TUNING_MODE_VIDEO; break; + // HDR_FEATURE_S + } else if (cfg == CAMERA_STREAM_CONFIGURATION_MODE_HLC) { + tMode = TUNING_MODE_VIDEO_HLC; + break; + } else if (cfg == CAMERA_STREAM_CONFIGURATION_MODE_HDR) { + tMode = TUNING_MODE_VIDEO_HDR; + break; + } else if (cfg == CAMERA_STREAM_CONFIGURATION_MODE_HDR2) { + tMode = TUNING_MODE_VIDEO_HDR2; + break; + // HDR_FEATURE_E } } diff --git a/src/3a/MakerNote.cpp b/src/3a/MakerNote.cpp index 0547efe0..6c3bf745 100644 --- a/src/3a/MakerNote.cpp +++ b/src/3a/MakerNote.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation. + * Copyright (C) 2018-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -117,6 +117,18 @@ int MakerNote::saveMakernoteData(int cameraId, camera_makernote_mode_t makernote return OK; } +void* MakerNote::getMakernoteBuf(camera_makernote_mode_t makernoteMode, bool& dump) { + LOG2("@%s", __func__); + dump = CameraDump::isDumpTypeEnable(DUMP_MAKER_NOTE); + if ((makernoteMode == MAKERNOTE_MODE_OFF) && !dump) return nullptr; + + AutoMutex lock(mMknLock); + CheckAndLogError(mMknState != INIT, nullptr, "@%s, mkn isn't initialized", __func__); + + MakernoteData data = mMakernoteDataList.front(); + return data.mknData; +} + void MakerNote::updateTimestamp(int64_t sequence, uint64_t timestamp) { LOG2("@%s, mMknState:%d", __func__, mMknState); AutoMutex lock(mMknLock); diff --git a/src/3a/MakerNote.h b/src/3a/MakerNote.h index 6b3361c3..eb3c4141 100644 --- a/src/3a/MakerNote.h +++ b/src/3a/MakerNote.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation. + * Copyright (C) 2018-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,6 +95,16 @@ class MakerNote { int saveMakernoteData(int cameraId, camera_makernote_mode_t makernoteMode, int64_t sequence, TuningMode tuningMode); + /** + * \brief Get makernote buffer + * + * param[in] camera_makernote_mode_t: makernote mode + * param[out] bool: return if in dump case + * + * return pointer of makernote buffer, otherwise return nullptr. + */ + void* getMakernoteBuf(camera_makernote_mode_t makernoteMode, bool& dump); + /** * \brief Update timestamp of frame. * diff --git a/src/3a/SensorManager.cpp b/src/3a/SensorManager.cpp index b795fbf2..99d89565 100644 --- a/src/3a/SensorManager.cpp +++ b/src/3a/SensorManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,9 +30,15 @@ namespace icamera { SensorManager::SensorManager(int cameraId, SensorHwCtrl* sensorHw) : mCameraId(cameraId), mSensorHwCtrl(sensorHw), + // HDR_FEATURE_S + mModeSwitched(false), + // HDR_FEATURE_E mLastSofSequence(-1), mAnalogGainDelay(0), mDigitalGainDelay(0) { + // HDR_FEATURE_S + CLEAR(mWdrModeSetting); + // HDR_FEATURE_E if (PlatformData::getAnalogGainLag(mCameraId) > 0) { mAnalogGainDelay = @@ -57,6 +63,12 @@ void SensorManager::reset() { mAnalogGainMap.clear(); mDigitalGainMap.clear(); + // HDR_FEATURE_S + mModeSwitched = false; + CLEAR(mWdrModeSetting); + mWdrModeSetting.tuningMode = TUNING_MODE_MAX; + // HDR_FEATURE_E + mSofEventInfo.clear(); } @@ -68,6 +80,10 @@ void SensorManager::handleSofEvent(EventData eventData) { mLastSofSequence = eventData.data.sync.sequence; handleSensorExposure(); + // HDR_FEATURE_S + handleSensorModeSwitch(eventData.data.sync.sequence); + // HDR_FEATURE_E + SofEventInfo info; info.sequence = eventData.data.sync.sequence; info.timestamp = ((long)eventData.data.sync.timestamp.tv_sec) * 1000000 + @@ -90,6 +106,66 @@ uint64_t SensorManager::getSofTimestamp(int64_t sequence) { return 0; } +// HDR_FEATURE_S +int SensorManager::convertTuningModeToWdrMode(TuningMode tuningMode) { + return ((tuningMode == TUNING_MODE_VIDEO_HDR) || (tuningMode == TUNING_MODE_VIDEO_HDR2)) ? 1 : + 0; +} + +void SensorManager::handleSensorModeSwitch(int64_t sequence) { + if (!PlatformData::isEnableHDR(mCameraId) || !mModeSwitched) { + return; + } + + if (mWdrModeSetting.sequence <= sequence) { + int wdrMode = convertTuningModeToWdrMode(mWdrModeSetting.tuningMode); + LOG2("@%s, tunning mode %d, set wdrMode %d sequence %ld", sequence, __func__, + wdrMode, mWdrModeSetting.sequence); + + if (mSensorHwCtrl->setWdrMode(wdrMode) == OK) { + mModeSwitched = false; + } + } +} + +int SensorManager::setWdrMode(TuningMode tuningMode, int64_t sequence) { + if (!PlatformData::isEnableHDR(mCameraId)) { + return OK; + } + + AutoMutex l(mLock); + LOG2("@%s, tuningMode %d, sequence %ld", __func__, tuningMode, sequence); + int ret = OK; + + // Set Wdr Mode after running AIQ first time. + if (mWdrModeSetting.tuningMode == TUNING_MODE_MAX) { + int wdrMode = convertTuningModeToWdrMode(tuningMode); + ret = mSensorHwCtrl->setWdrMode(wdrMode); + mWdrModeSetting.tuningMode = tuningMode; + return ret; + } + + if (mWdrModeSetting.tuningMode != tuningMode) { + // Save WDR mode and update this mode to driver in SOF event handler. + // So we know which frame is corrupted and we can skip the corrupted frames. + LOG2("@%s, tuningMode %d", sequence, __func__, tuningMode); + mWdrModeSetting.tuningMode = tuningMode; + mWdrModeSetting.sequence = sequence; + mModeSwitched = true; + } + + return ret; +} + +int SensorManager::setAWB(float r_per_g, float b_per_g) { + AutoMutex l(mLock); + LOG2("@%s, r_per_g %f, b_per_g %f", __func__, r_per_g, b_per_g); + + int ret = mSensorHwCtrl->setAWB(r_per_g, b_per_g); + return ret; +} +// HDR_FEATURE_E + void SensorManager::handleSensorExposure() { if (mExposureDataMap.find(mLastSofSequence) != mExposureDataMap.end()) { const ExposureData& exposureData = mExposureDataMap[mLastSofSequence]; @@ -119,8 +195,8 @@ int SensorManager::getCurrentExposureAppliedDelay() { uint32_t SensorManager::updateSensorExposure(SensorExpGroup sensorExposures, int64_t applyingSeq) { AutoMutex l(mLock); - int64_t effectSeq = - mLastSofSequence < 0 ? 0 : mLastSofSequence + PlatformData::getExposureLag(mCameraId); + int64_t effectSeq = mLastSofSequence < 0 ? PlatformData::getInitialSkipFrame(mCameraId) + : mLastSofSequence + PlatformData::getExposureLag(mCameraId); if (sensorExposures.empty()) { LOGW("%s: No exposure parameter", __func__); @@ -178,6 +254,11 @@ uint32_t SensorManager::updateSensorExposure(SensorExpGroup sensorExposures, int applyingSeq); return ((uint32_t)effectSeq); } +// CRL_MODULE_S +int SensorManager::setFrameRate(float fps) { + return mSensorHwCtrl->setFrameRate(fps); +} +// CRL_MODULE_E int SensorManager::getSensorInfo(ia_aiq_frame_params& frameParams, ia_aiq_exposure_sensor_descriptor& sensorDescriptor) { diff --git a/src/3a/SensorManager.h b/src/3a/SensorManager.h index ea49097f..8f9d55b2 100644 --- a/src/3a/SensorManager.h +++ b/src/3a/SensorManager.h @@ -65,6 +65,14 @@ class SensorManager { int getSensorInfo(ia_aiq_frame_params& frameParams, ia_aiq_exposure_sensor_descriptor& sensorDescriptor); + // HDR_FEATURE_S + int setWdrMode(TuningMode tuningMode, int64_t sequence); + + int setAWB(float r_per_g, float b_per_g); + // HDR_FEATURE_E + // CRL_MODULE_S + int setFrameRate(float fps); + // CRL_MODULE_E int getCurrentExposureAppliedDelay(); uint64_t getSofTimestamp(int64_t sequence); @@ -72,6 +80,10 @@ class SensorManager { DISALLOW_COPY_AND_ASSIGN(SensorManager); void handleSensorExposure(); + // HDR_FEATURE_S + void handleSensorModeSwitch(int64_t sequence); + int convertTuningModeToWdrMode(TuningMode tuningMode); + // HDR_FEATURE_E int getSensorModeData(ia_aiq_exposure_sensor_descriptor& sensorData); private: @@ -81,6 +93,11 @@ class SensorManager { int mCameraId; SensorHwCtrl* mSensorHwCtrl; + // HDR_FEATURE_S + bool mModeSwitched; // Whether the TuningMode get updated + WdrModeSetting mWdrModeSetting; + // HDR_FEATURE_E + int64_t mLastSofSequence; // Guard for SensorManager public API. diff --git a/src/3a/intel3a/Intel3AParameter.cpp b/src/3a/intel3a/Intel3AParameter.cpp index 6f967141..cabaff45 100644 --- a/src/3a/intel3a/Intel3AParameter.cpp +++ b/src/3a/intel3a/Intel3AParameter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -192,6 +192,14 @@ float Intel3AParameter::convertdBGainToISO(float sensitivityGain, int baseIso) { } void Intel3AParameter::setAeManualLimits(const aiq_parameter_t& param) { + // HDR_FEATURE_S + if (PlatformData::getSensorAeEnable(mCameraId)) { + LOG2("@%s, fix 2 auto exposure time to 11ms", __func__); + mAeParams.manual_exposure_time_us[0] = 11000; + mAeParams.manual_exposure_time_us[1] = 11000; + return; + } + // HDR_FEATURE_E ia_aiq_ae_manual_limits* limit = &mAeParams.manual_limits[0]; @@ -296,7 +304,7 @@ void Intel3AParameter::updateAeParameter(const aiq_parameter_t& param) { mAeMode = param.aeMode; mAeParams.frame_use = AiqUtils::convertFrameUsageToIaFrameUsage(param.frameUsage); mAeParams.num_exposures = PlatformData::getExposureNum( - mCameraId, CameraUtils::isMultiExposureCase(mCameraId, param.tuningMode)); + mCameraId, PlatformData::isMultiExposureCase(mCameraId, param.tuningMode)); setAeManualLimits(param); @@ -349,6 +357,12 @@ void Intel3AParameter::updateAeParameter(const aiq_parameter_t& param) { mAePerTicks = 1; mAeParams.manual_convergence_time = AiqUtils::convertSpeedModeToTime(param.aeConvergeSpeed); + // HDR_FEATURE_S + if (PlatformData::isMultiExposureCase(mCameraId, param.tuningMode)) { + mAeParams.manual_convergence_time = + AiqUtils::convertSpeedModeToTimeForHDR(param.aeConvergeSpeed); + } + // HDR_FEATURE_E } else { mAeParams.manual_convergence_time = -1; @@ -409,25 +423,37 @@ void Intel3AParameter::updateAeParameter(const aiq_parameter_t& param) { } } -void Intel3AParameter::updatePaResult(cca::cca_pa_params* paResult) { +void Intel3AParameter::updatePaResult(cca::cca_pa_params* paResult, bool awbLocked, + const camera_color_gains_t& colorGains, + const camera_color_transform_t& colorMatrix) { CheckAndLogError((paResult == nullptr), VOID_VALUE, "No Pa result provided."); paResult->enable_manual_settings = false; - if (!mUseManualColorMatrix) return; + if (mUseManualColorMatrix) { + if (VALID_COLOR_GAINS(mColorGains.color_gains_rggb)) { + paResult->color_gains.r = mColorGains.color_gains_rggb[0]; + paResult->color_gains.gr = mColorGains.color_gains_rggb[1]; + paResult->color_gains.gb = mColorGains.color_gains_rggb[2]; + paResult->color_gains.b = mColorGains.color_gains_rggb[3]; + } - if (VALID_COLOR_GAINS(mColorGains.color_gains_rggb)) { - paResult->color_gains.r = mColorGains.color_gains_rggb[0]; - paResult->color_gains.gr = mColorGains.color_gains_rggb[1]; - paResult->color_gains.gb = mColorGains.color_gains_rggb[2]; - paResult->color_gains.b = mColorGains.color_gains_rggb[3]; - } + // Override color_conversion_matrix and color_gains + // when application requires manual color transform. + MEMCPY_S(&paResult->color_conversion_matrix, sizeof(paResult->color_conversion_matrix), + &mColorMatrix.color_transform, sizeof(mColorMatrix.color_transform)); + + paResult->enable_manual_settings = true; + } else if (awbLocked) { + paResult->color_gains.r = colorGains.color_gains_rggb[0]; + paResult->color_gains.gr = colorGains.color_gains_rggb[1]; + paResult->color_gains.gb = colorGains.color_gains_rggb[2]; + paResult->color_gains.b = colorGains.color_gains_rggb[3]; - // Override color_conversion_matrix and color_gains - // when application requires manual color transform. - MEMCPY_S(&paResult->color_conversion_matrix, sizeof(paResult->color_conversion_matrix), - &mColorMatrix.color_transform, sizeof(mColorMatrix.color_transform)); + MEMCPY_S(&paResult->color_conversion_matrix, sizeof(paResult->color_conversion_matrix), + &colorMatrix.color_transform, sizeof(colorMatrix.color_transform)); - paResult->enable_manual_settings = true; + paResult->enable_manual_settings = true; + } } /** diff --git a/src/3a/intel3a/Intel3AParameter.h b/src/3a/intel3a/Intel3AParameter.h index 08523f5d..859e2b2c 100644 --- a/src/3a/intel3a/Intel3AParameter.h +++ b/src/3a/intel3a/Intel3AParameter.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,9 @@ class Intel3AParameter { int updateParameter(aiq_parameter_t param); void updateAeResult(cca::cca_ae_results* aeResult); void updateAwbResult(cca::cca_awb_results* awbResult); - void updatePaResult(cca::cca_pa_params* paResult); + void updatePaResult(cca::cca_pa_params* paResult, bool awbLocked, + const camera_color_gains_t& colorGains, + const camera_color_transform_t& colorMatrix); void fillAfTriggerResult(cca::cca_af_results* afResults); diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 0f97a6aa..13584ace 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -39,6 +39,22 @@ set(CORE_SRCS ) # FRAME_SYNC_E +# CSI_META_S + set(CORE_SRCS + ${CORE_SRCS} + ${CORE_DIR}/CsiMetaDevice.cpp + CACHE INTERNAL "core sources" + ) +# CSI_META_E + +# FILE_SOURCE_S + set(CORE_SRCS + ${CORE_SRCS} + ${CORE_DIR}/FileSource.cpp + CACHE INTERNAL "core sources" + ) +# FILE_SOURCE_E + set(CORE_SRCS ${CORE_SRCS} ${CORE_DIR}/psysprocessor/PolicyManager.cpp diff --git a/src/core/CameraBuffer.cpp b/src/core/CameraBuffer.cpp index ad720e00..03a0b048 100644 --- a/src/core/CameraBuffer.cpp +++ b/src/core/CameraBuffer.cpp @@ -317,20 +317,6 @@ void CameraBuffer::freeMmap() { } } -void* CameraBuffer::mapDmaBufferAddr() { - if (getAddr() != nullptr) - return getAddr(); - - return CameraBuffer::mapDmaBufferAddr(getFd(), getBufferSize()); -} - -void CameraBuffer::unmapDmaBufferAddr(void* addr) { - if (getAddr() == addr) - return; - - return CameraBuffer::unmapDmaBufferAddr(addr, getBufferSize()); -} - void* CameraBuffer::mapDmaBufferAddr(int fd, unsigned int bufferSize) { CheckAndLogError(fd < 0 || !bufferSize, nullptr, "%s, fd:0x%x, bufferSize:%u", __func__, fd, bufferSize); @@ -401,4 +387,27 @@ int CameraBuffer::getFd(int plane) { return mV.Fd(plane); } +ScopeMapping::ScopeMapping(const std::shared_ptr& cameraBuf) + : mCameraBuf(cameraBuf), + mUserPtr(nullptr) { +} + +ScopeMapping::~ScopeMapping() { + if (mUserPtr && (mCameraBuf->getMemory() == V4L2_MEMORY_DMABUF)) { + CameraBuffer::unmapDmaBufferAddr(mUserPtr, mCameraBuf->getBufferSize()); + } +} + +void* ScopeMapping::getUserPtr() { + if (mCameraBuf->getBufferAddr() || mCameraBuf->getMemory() != V4L2_MEMORY_DMABUF) { + return mCameraBuf->getBufferAddr(); + } + + if (!mUserPtr) { + mUserPtr = CameraBuffer::mapDmaBufferAddr(mCameraBuf->getFd(), mCameraBuf->getBufferSize()); + } + + return mUserPtr; +} + } // namespace icamera diff --git a/src/core/CameraBuffer.h b/src/core/CameraBuffer.h index 2b72d6f9..524fca6f 100644 --- a/src/core/CameraBuffer.h +++ b/src/core/CameraBuffer.h @@ -136,9 +136,6 @@ class CameraBuffer { // Buffers are allocated the buffers by Camera int allocateMemory(V4L2VideoNode* vDevice = nullptr); - void* mapDmaBufferAddr(); - void unmapDmaBufferAddr(void* addr); - public: static void* mapDmaBufferAddr(int fd, unsigned int bufferSize); static void unmapDmaBufferAddr(void* addr, unsigned int bufferSize); @@ -180,4 +177,16 @@ class CameraBuffer { typedef std::vector > CameraBufVector; typedef std::queue > CameraBufQ; +class ScopeMapping { + public: + explicit ScopeMapping(const std::shared_ptr& cameraBuf); + ~ScopeMapping(); + + void* getUserPtr(); + + private: + std::shared_ptr mCameraBuf; + void* mUserPtr; +}; + } // namespace icamera diff --git a/src/core/CameraDevice.cpp b/src/core/CameraDevice.cpp index 26f888b9..90e8054e 100644 --- a/src/core/CameraDevice.cpp +++ b/src/core/CameraDevice.cpp @@ -31,6 +31,9 @@ #include "ICamera.h" #include "PlatformData.h" #include "V4l2DeviceFactory.h" +// FILE_SOURCE_S +#include "FileSource.h" +// FILE_SOURCE_E #include "CaptureUnit.h" using std::vector; @@ -50,6 +53,10 @@ CameraDevice::CameraDevice(int cameraId) CLEAR(mInputConfig); mInputConfig.format = -1; + // CSI_META_S + mCsiMetaDevice = new CsiMetaDevice(mCameraId); + // CSI_META_E + mProducer = createBufferProducer(); mSofSource = new SofSource(mCameraId); @@ -108,6 +115,9 @@ CameraDevice::~CameraDevice() { delete mParamGenerator; delete mSofSource; delete mProducer; + // CSI_META_S + delete mCsiMetaDevice; + // CSI_META_E delete mRequestThread; V4l2DeviceFactory::releaseDeviceFactory(mCameraId); @@ -122,6 +132,11 @@ int CameraDevice::init() { int ret = mProducer->init(); CheckAndLogError(ret < 0, ret, "%s: Init capture unit failed", __func__); + // CSI_META_S + ret = mCsiMetaDevice->init(); + CheckAndLogError(ret != OK, ret, "@%s: init csi meta device failed", __func__); + // CSI_META_E + ret = mSofSource->init(); CheckAndLogError(ret != OK, ret, "@%s: init sync manager failed", __func__); @@ -130,9 +145,6 @@ int CameraDevice::init() { ret = m3AControl->init(); CheckAndLogError((ret != OK), ret, "%s: Init 3A Unit falied", __func__); - ret = mLensCtrl->init(); - CheckAndLogError((ret != OK), ret, "%s: Init Lens falied", __func__); - // PRIVACY_MODE_S if (PlatformData::getSupportPrivacy(mCameraId) == CVF_BASED_PRIVACY_MODE) { ret = mCvfPrivacyChecker->init(); @@ -183,6 +195,10 @@ void CameraDevice::deinit() { mSofSource->deinit(); + // CSI_META_S + mCsiMetaDevice->deinit(); + // CSI_META_E + mProducer->deinit(); mState = DEVICE_UNINIT; @@ -190,9 +206,21 @@ void CameraDevice::deinit() { void CameraDevice::callbackRegister(const camera_callback_ops_t* callback) { mCallback = const_cast(callback); + mParamGenerator->callbackRegister(mCallback); } StreamSource* CameraDevice::createBufferProducer() { + // FILE_SOURCE_S + if (PlatformData::isFileSourceEnabled()) { + return new FileSource(mCameraId); + } + // FILE_SOURCE_E + + // DUMMY_SOURCE_S + if (!PlatformData::isIsysEnabled(mCameraId)) { + return new DummySource; + } + // DUMMY_SOURCE_E return new CaptureUnit(mCameraId); } @@ -214,11 +242,32 @@ void CameraDevice::bindListeners() { vector sofListenerList = m3AControl->getSofEventListener(); for (auto sofListener : sofListenerList) { mSofSource->registerListener(EVENT_ISYS_SOF, sofListener); + // FILE_SOURCE_S + if (PlatformData::isFileSourceEnabled()) { + // File source needs to produce SOF event as well when it's enabled. + mProducer->registerListener(EVENT_ISYS_SOF, sofListener); + } + // FILE_SOURCE_E } - if (PlatformData::psysAlignWithSof(mCameraId)) { + // CSI_META_S + // Listen to meta data when enabled + if (mCsiMetaDevice->isEnabled()) { + for (auto& item : mProcessors) { + mCsiMetaDevice->registerListener(EVENT_META, item); + } + } + // CSI_META_E + + if (PlatformData::psysAlignWithSof(mCameraId) || PlatformData::isSchedulerEnabled(mCameraId)) { for (auto& item : mProcessors) { mSofSource->registerListener(EVENT_ISYS_SOF, item); + // FILE_SOURCE_S + if (PlatformData::isFileSourceEnabled()) { + // File source needs to produce SOF event as well when it's enabled. + mProducer->registerListener(EVENT_ISYS_SOF, item); + } + // FILE_SOURCE_E } } @@ -235,6 +284,12 @@ void CameraDevice::bindListeners() { } mSofSource->registerListener(EVENT_ISYS_SOF, mRequestThread); + // FILE_SOURCE_S + if (PlatformData::isFileSourceEnabled()) { + // File source needs to produce SOF event as well when it's enabled. + mProducer->registerListener(EVENT_ISYS_SOF, mRequestThread); + } + // FILE_SOURCE_E // INTEL_DVS_S auto dvsListener = m3AControl->getDVSEventListener(); @@ -271,11 +326,29 @@ void CameraDevice::unbindListeners() { vector sofListenerList = m3AControl->getSofEventListener(); for (auto sofListener : sofListenerList) { mSofSource->removeListener(EVENT_ISYS_SOF, sofListener); + // FILE_SOURCE_S + if (PlatformData::isFileSourceEnabled()) { + mProducer->removeListener(EVENT_ISYS_SOF, sofListener); + } + // FILE_SOURCE_E } - if (PlatformData::psysAlignWithSof(mCameraId)) { + // CSI_META_S + if (mCsiMetaDevice->isEnabled()) { + for (auto& item : mProcessors) { + mCsiMetaDevice->removeListener(EVENT_META, item); + } + } + // CSI_META_E + + if (PlatformData::psysAlignWithSof(mCameraId) || PlatformData::isSchedulerEnabled(mCameraId)) { for (auto& item : mProcessors) { mSofSource->removeListener(EVENT_ISYS_SOF, item); + // FILE_SOURCE_S + if (PlatformData::isFileSourceEnabled()) { + mProducer->removeListener(EVENT_ISYS_SOF, item); + } + // FILE_SOURCE_E } } @@ -292,6 +365,12 @@ void CameraDevice::unbindListeners() { } mSofSource->removeListener(EVENT_ISYS_SOF, mRequestThread); + // FILE_SOURCE_S + if (PlatformData::isFileSourceEnabled()) { + // File source needs to produce SOF event as well when it's enabled. + mProducer->removeListener(EVENT_ISYS_SOF, mRequestThread); + } + // FILE_SOURCE_E // INTEL_DVS_S auto dvsListener = m3AControl->getDVSEventListener(); @@ -371,9 +450,23 @@ int CameraDevice::configure(stream_config_t* streamList) { vector configModes; PlatformData::getConfigModesByOperationMode(mCameraId, streamList->operation_mode, configModes); + for (auto cfg : configModes) { + PlatformData::reorderSupportedTuningConfig(mCameraId, cfg); + } + ret = mProducer->configure(producerConfigs, configModes); CheckAndLogError(ret < 0, BAD_VALUE, "@%s Device Configure failed", __func__); + // CSI_META_S + ret = mCsiMetaDevice->configure(); + CheckAndLogError(ret != OK, ret, "@%s failed to configure CSI meta device", __func__); + // CSI_META_E + + // CRL_MODULE_S + ret = mSensorCtrl->configure(); + CheckAndLogError(ret != OK, ret, "@%s failed to configure sensor HW", __func__); + // CRL_MODULE_E + ret = mSofSource->configure(); CheckAndLogError(ret != OK, ret, "@%s failed to configure SOF source device", __func__); @@ -485,6 +578,13 @@ std::map CameraDevice::selectProducerConfig(const stream_config_ mainConfig.width = producerRes.width; mainConfig.height = CameraUtils::getInterlaceHeight(mainConfig.field, producerRes.height); + // DOL_FEATURE_S + // In DOL case isys scale must be disabled, and 2 ports have same + if (PlatformData::isDolShortEnabled(mCameraId)) producerConfigs[SECOND_PORT] = mainConfig; + + if (PlatformData::isDolMediumEnabled(mCameraId)) producerConfigs[THIRD_PORT] = mainConfig; + // DOL_FEATURE_E + // configuration with main port producerConfigs[MAIN_PORT] = mainConfig; @@ -621,6 +721,12 @@ int CameraDevice::analyzeStream(stream_config_t* streamList) { } bool checkInput = !PlatformData::isIsysEnabled(mCameraId); + // FILE_SOURCE_S + if (PlatformData::isFileSourceEnabled()) { + // In file source case, PSYS can work without ISYS, so don't check raw input. + checkInput = false; + } + // FILE_SOURCE_E if (checkInput) { CheckAndLogError(inputStreamId < 0, BAD_VALUE, "Input stream was missing"); } @@ -697,6 +803,7 @@ int CameraDevice::stop() { mRequestThread->clearRequests(); m3AControl->stop(); + mLensCtrl->stop(); if (mState == DEVICE_START) stopLocked(); @@ -730,6 +837,13 @@ int CameraDevice::dqbuf(int streamId, camera_buffer_t** ubuffer, Parameters* set LOG2("@%s, stream id:%d", mCameraId, __func__, streamId); int ret = mRequestThread->waitFrame(streamId, ubuffer); + + if ((ret == TIMED_OUT) && (PlatformData::getReqWaitTimeout(mCameraId) > 0)) { + LOG1("@%s, reqWaitTimeoutNs (%lld).", mCameraId, __func__, + PlatformData::getReqWaitTimeout(mCameraId)); + return ret; + } + while (ret == TIMED_OUT) ret = mRequestThread->waitFrame(streamId, ubuffer); if (ret == NO_INIT) return ret; @@ -817,7 +931,10 @@ int CameraDevice::qbuf(camera_buffer_t** ubuffer, int bufferNum, const Parameter AutoMutex m(mDeviceLock); if (mState == DEVICE_CONFIGURE || mState == DEVICE_STOP) { // Start 3A here then the HAL can run 3A for request - int ret = m3AControl->start(); + int ret = mLensCtrl->start(); + CheckAndLogError((ret != OK), ret, "%s: Start Lens falied", __func__); + + ret = m3AControl->start(); CheckAndLogError((ret != OK), BAD_VALUE, "Start 3a unit failed with ret:%d.", ret); mState = DEVICE_BUFFER_READY; @@ -925,6 +1042,11 @@ int CameraDevice::startLocked() { ret = mProducer->start(); CheckAndLogError((ret < 0), BAD_VALUE, "Start capture unit failed with ret:%d.", ret); + // CSI_META_S + ret = mCsiMetaDevice->start(); + CheckAndLogError((ret != OK), BAD_VALUE, "Start CSI meta failed with ret:%d.", ret); + // CSI_META_E + ret = mSofSource->start(); CheckAndLogError((ret != OK), BAD_VALUE, "Start SOF event source failed with ret:%d.", ret); @@ -942,6 +1064,10 @@ int CameraDevice::stopLocked() { mSofSource->stop(); + // CSI_META_S + mCsiMetaDevice->stop(); + // CSI_META_E + // Stop the CaptureUnit for streamon mProducer->stop(); @@ -961,17 +1087,12 @@ void CameraDevice::handleEvent(EventData eventData) { switch (eventData.type) { case EVENT_PROCESS_REQUEST: { const EventRequestData& request = eventData.data.request; - if (request.param) { - // Set test pattern mode - camera_test_pattern_mode_t testPatternMode = TEST_PATTERN_OFF; - if (PlatformData::isTestPatternSupported(mCameraId) && - request.param->getTestPatternMode(testPatternMode) == OK) { - int32_t sensorTestPattern = - PlatformData::getSensorTestPattern(mCameraId, testPatternMode); - if (sensorTestPattern >= 0) { - if (mSensorCtrl->setTestPatternMode(sensorTestPattern) < 0) { - LOGE("%s, set testPatternMode failed", __func__); - } + if (PlatformData::isTestPatternSupported(mCameraId)) { + int32_t sensorTestPattern = + PlatformData::getSensorTestPattern(mCameraId, request.testPatternMode); + if (sensorTestPattern >= 0) { + if (mSensorCtrl->setTestPatternMode(sensorTestPattern) < 0) { + LOGE("%s, set testPatternMode failed", __func__); } } } diff --git a/src/core/CameraDevice.h b/src/core/CameraDevice.h index 75186b82..83565c9a 100644 --- a/src/core/CameraDevice.h +++ b/src/core/CameraDevice.h @@ -25,6 +25,9 @@ #include "SensorHwCtrl.h" #include "SofSource.h" #include "StreamSource.h" +// CSI_META_S +#include "CsiMetaDevice.h" +// CSI_META_E // PRIVACY_MODE_S #include "CvfPrivacyChecker.h" // PRIVACY_MODE_E @@ -77,6 +80,9 @@ class CameraDevice : public EventListener { * \brief Camera device class init * * 1.Related classes init: StreamSource, SofSource, 3AControl, lensCtrl + // CSI_META_S + * CsiMeta + // CSI_META_E * 2.Register listener if enable AIQ * 3.Set the defualt parameters * @@ -247,6 +253,9 @@ class CameraDevice : public EventListener { SensorHwCtrl* mSensorCtrl; SofSource* mSofSource; AiqUnitBase* m3AControl; + // CSI_META_S + CsiMetaDevice* mCsiMetaDevice; + // CSI_META_E // Internal used variable int mCameraId; diff --git a/src/core/CameraEventType.h b/src/core/CameraEventType.h index 92ff1e94..def348d6 100644 --- a/src/core/CameraEventType.h +++ b/src/core/CameraEventType.h @@ -31,6 +31,9 @@ enum EventType { EVENT_PSYS_STATS_SIS_BUF_READY, EVENT_ISYS_FRAME, EVENT_PSYS_FRAME, + // CSI_META_S + EVENT_META, + // CSI_META_E EVENT_PROCESS_REQUEST, EVENT_FRAME_AVAILABLE, EVENT_PSYS_REQUEST_BUF_READY, @@ -62,12 +65,15 @@ struct EventDataFrame { struct EventDataMeta { timeval timestamp; int64_t sequence; + // DOL_FEATURE_S + short vbp; + // DOL_FEATURE_E }; struct EventRequestData { int bufferNum; camera_buffer_t** buffer; - Parameters* param; + camera_test_pattern_mode_t testPatternMode; int64_t settingSeq; }; @@ -89,6 +95,8 @@ struct EventRequestReady { // INTEL_DVS_S struct EventDVSRunReady { int streamId; + int64_t sequence; + camera_zoom_region_t region; }; // INTEL_DVS_E diff --git a/src/core/CameraStream.cpp b/src/core/CameraStream.cpp index d2ac8458..c3d2897f 100644 --- a/src/core/CameraStream.cpp +++ b/src/core/CameraStream.cpp @@ -140,6 +140,7 @@ void CameraStream::setBufferProducer(BufferProducer* producer) { if (producer != nullptr) producer->addFrameAvailableListener(this); } +// PRIVACY_MODE_S shared_ptr CameraStream::getPrivacyBuffer() { AutoMutex l(mBufferPoolLock); shared_ptr buf = nullptr; @@ -149,31 +150,31 @@ shared_ptr CameraStream::getPrivacyBuffer() { } return buf; } +// PRIVACY_MODE_E int CameraStream::onFrameAvailable(Port port, const shared_ptr& camBuffer) { + // Ignore if the buffer is not for this stream. if (mPort != port) return OK; if (camBuffer->getStreamId() != mStreamId) return OK; - std::shared_ptr buf; - { + + LOG2("@%s: mStreamId:%d, CameraBuffer:%p for port:%d", mCameraId, __func__, mStreamId, + camBuffer.get(), port); + + std::shared_ptr buf = camBuffer; + // PRIVACY_MODE_S + if (PlatformData::getSupportPrivacy(mCameraId) != NO_PRIVACY_MODE) { AutoMutex l(mBufferPoolLock); mPrivacyBuffer.push(camBuffer); - if (mPrivacyBuffer.size() <= 1) { - return OK; - } + if (mPrivacyBuffer.size() <= 1) return OK; + buf = mPrivacyBuffer.front(); mPrivacyBuffer.pop(); } + // PRIVACY_MODE_E return doFrameAvailable(port, buf); } int CameraStream::doFrameAvailable(Port port, const shared_ptr& camBuffer) { - // Ignore if the buffer is not for this stream. - if (mPort != port) return OK; - if (camBuffer->getStreamId() != mStreamId) return OK; - - LOG2("@%s: mStreamId:%d, CameraBuffer:%p for port:%d", mCameraId, __func__, mStreamId, - camBuffer.get(), port); - // Update the user buffer info before return back camBuffer->updateUserBuffer(); @@ -201,5 +202,4 @@ int CameraStream::doFrameAvailable(Port port, const shared_ptr& ca return OK; } - } // namespace icamera diff --git a/src/core/CameraStream.h b/src/core/CameraStream.h index b537595d..730dd6bb 100644 --- a/src/core/CameraStream.h +++ b/src/core/CameraStream.h @@ -80,20 +80,20 @@ class CameraStream : public BufferConsumer, public EventSource { virtual void setBufferProducer(BufferProducer* producer); /** - * \brief The notify when polled or processed one frame buffer + * \brief receive one frame buffer as consumer */ virtual int onFrameAvailable(Port port, const std::shared_ptr& camBuffer); - // PRIVACY_MODE_S /** - * \brief Return a privacy buffer + * \brief notify EVENT_FRAME_AVAILABLE event to its listener */ - virtual std::shared_ptr getPrivacyBuffer(); + virtual int doFrameAvailable(Port port, const std::shared_ptr& camBuffer); + // PRIVACY_MODE_S /** - * \brief Special function to send last frame after privacy on + * \brief Return a privacy buffer */ - virtual int doFrameAvailable(Port port, const std::shared_ptr& camBuffer); + virtual std::shared_ptr getPrivacyBuffer(); // PRIVACY_MODE_E private: diff --git a/src/core/CaptureUnit.cpp b/src/core/CaptureUnit.cpp index 2bc96b23..5240977d 100644 --- a/src/core/CaptureUnit.cpp +++ b/src/core/CaptureUnit.cpp @@ -111,6 +111,18 @@ int CaptureUnit::createDevices() { vector targetPorts; targetPorts.push_back(portOfMainDevice); + // DOL_FEATURE_S + if (PlatformData::isDolShortEnabled(mCameraId)) { + mDevices.push_back(new DolCaptureDevice(mCameraId, VIDEO_GENERIC_SHORT_EXPO)); + targetPorts.push_back(SECOND_PORT); + } + + if (PlatformData::isDolMediumEnabled(mCameraId)) { + mDevices.push_back(new DolCaptureDevice(mCameraId, VIDEO_GENERIC_MEDIUM_EXPO)); + targetPorts.push_back(THIRD_PORT); + } + // DOL_FEATURE_E + // Open and configure the devices. The stream and port that are used by the device is // decided by whether consumer has provided such info, use the default one if not. for (uint8_t i = 0; i < mDevices.size(); i++) { diff --git a/src/core/CsiMetaDevice.cpp b/src/core/CsiMetaDevice.cpp new file mode 100644 index 00000000..495a850d --- /dev/null +++ b/src/core/CsiMetaDevice.cpp @@ -0,0 +1,442 @@ +/* + * Copyright (C) 2016-2021 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG CsiMetaDevice + +#include "CsiMetaDevice.h" + +#include + +#include "PlatformData.h" +#include "iutils/CameraDump.h" +#include "iutils/CameraLog.h" +#include "iutils/Utils.h" +#include "linux/ipu-isys.h" + +using std::map; +using std::shared_ptr; +using std::vector; + +namespace icamera { + +CsiMetaDevice::CsiMetaDevice(int cameraId) + : mCameraId(cameraId), + mCsiMetaDevice(nullptr), + mIsCsiMetaEnabled(false), + mCsiMetaBufferDQIndex(0), + mBuffersInCsiMetaDevice(0), + mState(CSI_META_DEVICE_UNINIT), + mExitPending(false) { + mPollThread = new PollThread(this); + CLEAR(mEmbeddedMetaData); +} + +CsiMetaDevice::~CsiMetaDevice() { + delete mPollThread; +} + +int CsiMetaDevice::init() { + return OK; +} + +void CsiMetaDevice::deinit() { + AutoMutex l(mCsiMetaDeviceLock); + if (!mIsCsiMetaEnabled) { + return; + } + deinitLocked(); +} + +void CsiMetaDevice::deinitLocked() { + LOG1("@%s", __func__); + + mCsiMetaCameraBuffers.clear(); + deinitDev(); + mPollThread->join(); + mState = CSI_META_DEVICE_UNINIT; +} + +int CsiMetaDevice::resetState() { + LOG1("@%s", __func__); + + mExitPending = false; + mCsiMetaBufferDQIndex = 0; + mBuffersInCsiMetaDevice = 0; + mCsiMetaCameraBuffers.reserve(CSI_META_BUFFER_NUM); + mState = CSI_META_DEVICE_INIT; + + return OK; +} + +int CsiMetaDevice::initDev() { + // close the previous device if any + deinitDev(); + + std::string devName; + int ret = PlatformData::getDevNameByType(mCameraId, VIDEO_CSI_META, devName); + CheckAndLogError(ret != OK, BAD_VALUE, "failed to init device node"); + + mCsiMetaDevice = new V4L2VideoNode(devName); + ret = mCsiMetaDevice->Open(O_RDWR); + if (ret != OK) { + delete mCsiMetaDevice; + mCsiMetaDevice = nullptr; + + LOGE("open csi meta dev failed. ret %d", ret); + return BAD_VALUE; + } + + mConfiguredDevices.push_back(mCsiMetaDevice); + + return OK; +} + +void CsiMetaDevice::deinitDev() { + mConfiguredDevices.clear(); + if (mCsiMetaDevice) { + // Release V4L2 buffers + mCsiMetaDevice->Stop(true); + mCsiMetaDevice->Close(); + delete mCsiMetaDevice; + mCsiMetaDevice = nullptr; + } +} + +int CsiMetaDevice::initEmdMetaData() { + // initialize mEmbeddedMetaData + std::string videoNodeName; + int ret = PlatformData::getVideoNodeNameByType(mCameraId, VIDEO_ISYS_RECEIVER, videoNodeName); + CheckAndLogError(ret != OK, ret, "failed to get device node name"); + + McFormat format; + + ret = PlatformData::getFormatByDevName(mCameraId, videoNodeName, format); + CheckAndLogError(ret != OK, ret, "failed to get format, sub Dev name = %s", + videoNodeName.c_str()); + + int bpp = CameraUtils::getBpp(format.pixelCode); + CheckAndLogError(bpp < 0, BAD_VALUE, "failed to get bpp (%d)", bpp); + + int bpl = format.width * bpp / 8; + + mEmbeddedMetaData.csiMetaFormat = V4L2_FMT_IPU_ISYS_META; + // for embedded meta data, width is equal with bytes per line + mEmbeddedMetaData.width = bpl; + // for compatible, set 1 as default, if the *.xml have configed it, use the config value repalce + mEmbeddedMetaData.height = 1; + ret = PlatformData::getVideoNodeNameByType(mCameraId, VIDEO_CSI_META, videoNodeName); + if (ret == OK) { + ret = PlatformData::getFormatByDevName(mCameraId, videoNodeName, format); + if (ret == OK) mEmbeddedMetaData.height = format.height; + } + + mEmbeddedMetaData.bpl = bpl; + mEmbeddedMetaData.planesNum = CameraUtils::getNumOfPlanes(V4L2_FMT_IPU_ISYS_META); + + return OK; +} + +int CsiMetaDevice::configure() { + LOG1("@%s", __func__); + AutoMutex l(mCsiMetaDeviceLock); + + CheckAndLogError(mState == CSI_META_DEVICE_START, BAD_VALUE, "@%s: Configure in wrong state %d", + __func__, mState); + + deinitLocked(); + if (PlatformData::isCsiMetaEnabled(mCameraId)) mIsCsiMetaEnabled = true; + + int ret = resetState(); + CheckAndLogError(ret != OK, ret, "@%s: init csi meta device failed", __func__); + + if (!mIsCsiMetaEnabled) { + return OK; + } + + ret = initDev(); + CheckAndLogError(ret != 0, BAD_VALUE, "init CSI meta device failed. ret %d", ret); + + ret = initEmdMetaData(); + CheckAndLogError(ret != 0, BAD_VALUE, "init embedded metadata failed. ret %d", ret); + + ret = setFormat(); + CheckAndLogError(ret != 0, BAD_VALUE, "set format failed, ret = %d", ret); + + ret = allocCsiMetaBuffers(); + CheckAndLogError(ret != 0, BAD_VALUE, "failed to alloc CSI buffer, ret = %d", ret); + + mState = CSI_META_DEVICE_CONFIGURED; + + return OK; +} + +int CsiMetaDevice::start() { + LOG1("@%s", __func__); + AutoMutex l(mCsiMetaDeviceLock); + if (!mIsCsiMetaEnabled) { + return OK; + } + + CheckWarning(mState != CSI_META_DEVICE_CONFIGURED && mState != CSI_META_DEVICE_STOP, OK, + "%s: start in wrong state: %d", __func__, mState); + + int ret = mCsiMetaDevice->Start(); + CheckAndLogError(ret < 0, ret, "failed to stream on csi meta device, ret = %d", ret); + + mExitPending = false; + mPollThread->run("CsiMetaDevice", PRIORITY_URGENT_AUDIO); + mState = CSI_META_DEVICE_START; + + return OK; +} + +int CsiMetaDevice::stop() { + LOG1("@%s", __func__); + AutoMutex l(mCsiMetaDeviceLock); + if (!mIsCsiMetaEnabled) { + return OK; + } + + CheckWarning(mState != CSI_META_DEVICE_START, OK, "%s: device not started", __func__); + + mExitPending = true; + mPollThread->requestExit(); + + int ret = mCsiMetaDevice->Stop(false); + + CheckAndLogError(ret < 0, ret, "failed to stream off csi meta device, ret = %d", ret); + + mPollThread->requestExitAndWait(); + + mState = CSI_META_DEVICE_STOP; + return OK; +} + +int CsiMetaDevice::poll() { + const int poll_timeout_count = 10; + const int poll_timeout = 1000; + + std::vector pollDevs; + + int ret = 0; + int timeOutCount = poll_timeout_count; + + LOG2("@%s before poll number buffer in devices: %d", __func__, mBuffersInCsiMetaDevice.load()); + + if (!hasBufferIndevice()) { + LOG2("@%s there is no buffers in device, skip this poll", __func__); + return OK; + } + + for (const auto& device : mConfiguredDevices) { + pollDevs.push_back(device); + } + + std::vector readyDevices; + while (timeOutCount-- && ret == 0) { + V4L2DevicePoller poller{pollDevs, -1}; + ret = poller.Poll(poll_timeout, POLLPRI | POLLIN | POLLOUT | POLLERR, &readyDevices); + + LOG2("@%s ing poll number buffer in devices: %d", __func__, mBuffersInCsiMetaDevice.load()); + if (mExitPending) { + return NO_INIT; + } + } + + if (mExitPending) { + // Exiting, no error + return NO_INIT; + } + + // handle the poll error + CheckAndLogError(ret < 0, ret, "%s: Poll error", __func__); + + if (ret > 0) { + handleCsiMetaBuffer(); + } + + LOG2("@%s after poll number buffer in devices: %d", __func__, mBuffersInCsiMetaDevice.load()); + return OK; +} + +int CsiMetaDevice::hasBufferIndevice() { + return mBuffersInCsiMetaDevice.load(); +} + +int CsiMetaDevice::queueCsiMetaBuffer(const shared_ptr& camBuffer) { + int ret = mCsiMetaDevice->PutFrame(&camBuffer->getV4L2Buffer()); + CheckAndLogError(ret < 0, BAD_VALUE, "%s: Failed to queue CSI meta buffer, ret=%d", __func__, + ret); + + LOG2("%s: queue CSI meta buffer, camBuffer index: %d", __func__, camBuffer->getIndex()); + + mBuffersInCsiMetaDevice++; + + return OK; +} + +void CsiMetaDevice::handleCsiMetaBuffer() { + AutoMutex l(mCsiMetaBuffersLock); + + shared_ptr camBuffer = mCsiMetaCameraBuffers[mCsiMetaBufferDQIndex]; + CheckAndLogError(!camBuffer, VOID_VALUE, "Csi meta camera buffer %d is null", + mCsiMetaBufferDQIndex); + + V4L2Buffer& vbuf = camBuffer->getV4L2Buffer(); + int index = mCsiMetaDevice->GrabFrame(&vbuf); + + if (mExitPending) return; + CheckAndLogError(index < 0, VOID_VALUE, "grab frame failed. index %d", index); + + LOG2("%s: grab meta data buffer sequence %ld timestamp %ld", __func__, camBuffer->getSequence(), + TIMEVAL2USECS(camBuffer->getTimestamp())); + PERF_CAMERA_ATRACE_PARAM3("grabFrame SeqID", camBuffer->getSequence(), "csi2_port", + camBuffer->getCsi2Port(), "virtual_channel", + camBuffer->getVirtualChannel()); + + mBuffersInCsiMetaDevice--; + mCsiMetaBufferDQIndex = (mCsiMetaBufferDQIndex + 1) % mCsiMetaCameraBuffers.size(); + + if (CameraDump::isDumpTypeEnable(DUMP_EMBEDDED_METADATA)) { + BinParam_t bParam; + bParam.bType = BIN_TYPE_SENSOR_METADATA; + bParam.mType = M_ISYS; + bParam.sequence = camBuffer->getSequence(); + bParam.mParam.width = mEmbeddedMetaData.width; + bParam.mParam.height = mEmbeddedMetaData.height; + bParam.mParam.metaFormat = mEmbeddedMetaData.csiMetaFormat; + for (int i = 0; i < mEmbeddedMetaData.planesNum; i++) { + bParam.mParam.planeIdx = i; + LOG2("@%s, dump sensor meta data, addr = %p, w:%d, h:%d, len:%d", __func__, + camBuffer->getBufferAddr(i), mEmbeddedMetaData.width, mEmbeddedMetaData.height, + camBuffer->getBufferSize(i)); + CameraDump::dumpBinary(mCameraId, camBuffer->getBufferAddr(i), + camBuffer->getBufferSize(i), &bParam); + } + } + + EventData eventData; + EventDataMeta metaData; + CLEAR(metaData); + metaData.timestamp = camBuffer->getTimestamp(); + metaData.sequence = camBuffer->getSequence(); + + // DOL_FEATURE_S + int status = decodeMetaData(metaData, camBuffer); + if (status == OK) { + eventData.type = EVENT_META; + eventData.buffer = nullptr; + eventData.data.meta = metaData; + + notifyListeners(eventData); + } + // DOL_FEATURE_E + + queueCsiMetaBuffer(camBuffer); +} + +// DOL_FEATURE_S +int CsiMetaDevice::decodeMetaData(EventDataMeta& metaData, + const shared_ptr& camBuffer) { + vector vbpOffset; + PlatformData::getDolVbpOffset(mCameraId, vbpOffset); + + if (vbpOffset.size() == 0) { + LOG2("%s: skip vbp meta data decode, no vbpOffset set.", __func__); + return INVALID_OPERATION; + } else if (vbpOffset.size() != 2) { + LOGE("Invalid vbpOffset value size %lu, skip vpb meta data decode.", vbpOffset.size()); + return BAD_VALUE; + } + + if (mEmbeddedMetaData.planesNum > 0) { + char* metaPtr = reinterpret_cast(camBuffer->getBufferAddr(0)); + metaData.vbp = metaPtr[vbpOffset[0]] | (metaPtr[vbpOffset[1]] << 8); + LOG2("%s: offset %d/%d, value is %d", metaData.sequence, __func__, vbpOffset[0], + vbpOffset[1], metaData.vbp); + } + + return OK; +} +// DOL_FEATURE_E + +int CsiMetaDevice::setFormat() { + struct v4l2_format v4l2fmt; + CLEAR(v4l2fmt); + + v4l2fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + v4l2fmt.fmt.pix_mp.width = mEmbeddedMetaData.width; + v4l2fmt.fmt.pix_mp.height = mEmbeddedMetaData.height; + v4l2fmt.fmt.pix_mp.num_planes = mEmbeddedMetaData.planesNum; + v4l2fmt.fmt.pix_mp.pixelformat = mEmbeddedMetaData.csiMetaFormat; + for (int i = 0; i < v4l2fmt.fmt.pix_mp.num_planes; i++) { + v4l2fmt.fmt.pix_mp.plane_fmt[i].bytesperline = mEmbeddedMetaData.bpl; + v4l2fmt.fmt.pix_mp.plane_fmt[i].sizeimage = 0; + } + v4l2fmt.fmt.pix_mp.field = V4L2_FIELD_NONE; + + V4L2Format tmpbuf{v4l2fmt}; + int ret = mCsiMetaDevice->SetFormat(tmpbuf); + v4l2fmt = *tmpbuf.Get(); + + CheckAndLogError(ret != OK, ret, "set v4l2 format failed ret=%d", ret); + + for (int i = 0; i < v4l2fmt.fmt.pix_mp.num_planes; i++) { + mEmbeddedMetaData.size[i] = v4l2fmt.fmt.pix_mp.plane_fmt[i].sizeimage; + } + + LOG2("VIDIOC_S_FMT type %d : width: %d, height: %d, bpl: %d, fourcc: %d, field: %d", + v4l2fmt.type, v4l2fmt.fmt.pix.width, v4l2fmt.fmt.pix.height, v4l2fmt.fmt.pix.bytesperline, + v4l2fmt.fmt.pix.pixelformat, v4l2fmt.fmt.pix.field); + + return OK; +} + +int CsiMetaDevice::allocCsiMetaBuffers() { + AutoMutex l(mCsiMetaBuffersLock); + + mCsiMetaCameraBuffers.clear(); + + std::vector bufs; + int bufNum = mCsiMetaDevice->SetupBuffers(MAX_BUFFER_COUNT, false, V4L2_MEMORY_MMAP, &bufs); + + CheckAndLogError(bufNum < 0, bufNum, "request CSI meta buffers failed return=%d", bufNum); + + for (int i = 0; i < bufNum; i++) { + shared_ptr camBuffer = std::make_shared( + mCameraId, BUFFER_USAGE_METADATA, V4L2_MEMORY_MMAP, 0, i, V4L2_FMT_IPU_ISYS_META); + CheckAndLogError(!camBuffer, NO_MEMORY, "@%s: fail to alloc CameraBuffer", __func__); + + for (int j = 0; j < mEmbeddedMetaData.planesNum; j++) { + LOG2("@%s, buffer size [%d] = %d", __func__, j, mEmbeddedMetaData.size[j]); + camBuffer->setBufferSize(mEmbeddedMetaData.size[j], j); + } + + // MMap user space buffer + camBuffer->allocateMemory(mCsiMetaDevice); + mCsiMetaCameraBuffers.push_back(camBuffer); + + // Enqueue CSI meta buffer to ISP + queueCsiMetaBuffer(camBuffer); + + LOG2("%s: store csi meta, index: %d, vbuff index: %d camBuffer->getBufferAddr() = %p", + __func__, i, camBuffer->getIndex(), camBuffer->getBufferAddr()); + } + + return OK; +} + +} /* namespace icamera */ diff --git a/src/core/CsiMetaDevice.h b/src/core/CsiMetaDevice.h new file mode 100644 index 00000000..dfaafb89 --- /dev/null +++ b/src/core/CsiMetaDevice.h @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2016-2021 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#ifdef CAL_BUILD +#include +#else +#include +#endif + +#include +#include + +#include "CameraBuffer.h" +#include "CameraEvent.h" +#include "iutils/Errors.h" +#include "iutils/Thread.h" + +namespace icamera { + +/** + * \struct EmbeddedMetaData: sensor and csi meta device info + * + * EmbeddedMetaData is used to carray embedded meta data info. + */ +struct EmbeddedMetaData { + int csiMetaFormat; + int width; + int height; + int bpl; + int planesNum; + int size[VIDEO_MAX_PLANES]; +}; + +/** + * \class CsiMetaDevice + * + * \brief + * Manage CSI meta device, and provide sensor metadata for other class. + * + * This class is used to control CSI meta device, and grabs embedded sensor + * metadata and supplies sensor metadata for other class. + * + */ +class CsiMetaDevice : public EventSource { + public: + explicit CsiMetaDevice(int cameraId); + ~CsiMetaDevice(); + + int init(); + void deinit(); + int configure(); + int start(); + int stop(); + bool isEnabled() { return mIsCsiMetaEnabled; } + + void deinitLocked(); + int resetState(); + int initDev(); + void deinitDev(); + int initEmdMetaData(); + int poll(); + int hasBufferIndevice(); + void handleCsiMetaBuffer(); + int setFormat(); + int allocCsiMetaBuffers(); + int queueCsiMetaBuffer(const std::shared_ptr& camBuffer); + // DOL_FEATURE_S + int decodeMetaData(EventDataMeta& metaData, const std::shared_ptr& camBuffer); + // DOL_FEATURE_E + + private: + static const int CSI_META_BUFFER_NUM = 10; + + class PollThread : public Thread { + CsiMetaDevice* mCsiMetaDevice; + + public: + explicit PollThread(CsiMetaDevice* csiMetaDevice) : mCsiMetaDevice(csiMetaDevice) {} + virtual ~PollThread() {} + virtual bool threadLoop() { + int ret = mCsiMetaDevice->poll(); + return ret == OK; + } + }; + + PollThread* mPollThread; + int mCameraId; + V4L2VideoNode* mCsiMetaDevice; + std::vector mConfiguredDevices; + EmbeddedMetaData mEmbeddedMetaData; + + // Guard for CsiMetaDevice public API + Mutex mCsiMetaDeviceLock; + + bool mIsCsiMetaEnabled; + + Mutex mCsiMetaBuffersLock; + int mCsiMetaBufferDQIndex; + CameraBufVector mCsiMetaCameraBuffers; + std::atomic mBuffersInCsiMetaDevice; + + enum { + CSI_META_DEVICE_UNINIT, + CSI_META_DEVICE_INIT, + CSI_META_DEVICE_CONFIGURED, + CSI_META_DEVICE_START, + CSI_META_DEVICE_STOP, + } mState; + + bool mExitPending; + + private: + DISALLOW_COPY_AND_ASSIGN(CsiMetaDevice); +}; + +} /* namespace icamera */ diff --git a/src/core/DeviceBase.cpp b/src/core/DeviceBase.cpp index 557a6306..d10c6adb 100644 --- a/src/core/DeviceBase.cpp +++ b/src/core/DeviceBase.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation. + * Copyright (C) 2018-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,7 +86,6 @@ void DeviceBase::closeDevice() { AutoMutex l(mBufferLock); mPendingBuffers.clear(); mBuffersInDevice.clear(); - mAllocatedBuffers.clear(); } mDevice->Close(); } @@ -209,9 +208,6 @@ void DeviceBase::resetBuffers() { mBuffersInDevice.clear(); mPendingBuffers.clear(); - for (const auto& buffer : mAllocatedBuffers) { - mPendingBuffers.push_back(buffer); - } } bool DeviceBase::hasPendingBuffer() { @@ -436,4 +432,73 @@ bool MainDevice::needQueueBack(shared_ptr buffer) { return needSkipFrame; } +// DOL_FEATURE_S +DolCaptureDevice::DolCaptureDevice(int cameraId, VideoNodeType nodeType) + : DeviceBase(cameraId, nodeType, INPUT_VIDEO_NODE) { + LOG1("%s, device:%s", mCameraId, __func__, mName); +} + +DolCaptureDevice::~DolCaptureDevice() {} + +int DolCaptureDevice::createBufferPool(const stream_t& config) { + LOG1("%s, fmt:%s(%dx%d) field:%d", mCameraId, __func__, + CameraUtils::pixelCode2String(config.format), config.width, config.height, config.field); + + CheckAndLogError(mPort == INVALID_PORT, NO_MEMORY, "@%s: consumer does not provide DOL buffers", + __func__); + + struct v4l2_format v4l2fmt; + v4l2fmt.fmt.pix.width = config.width; + v4l2fmt.fmt.pix.height = config.height; + v4l2fmt.fmt.pix.pixelformat = config.format; + v4l2fmt.fmt.pix.bytesperline = config.width; + v4l2fmt.fmt.pix.sizeimage = 0; + v4l2fmt.fmt.pix_mp.field = 0; + + v4l2fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + V4L2Format tmpbuf{v4l2fmt}; + int ret = mDevice->SetFormat(tmpbuf); + CheckAndLogError(ret != OK, ret, "set DOL v4l2 format failed ret=%d", ret); + v4l2fmt = *tmpbuf.Get(); + + std::vector bufs; + int bufNum = mDevice->SetupBuffers(mMaxBufferNumber, false, + static_cast(config.memType), &bufs); + CheckAndLogError(bufNum < 0, bufNum, "request DOL buffers failed return=%d", bufNum); + + return OK; +} + +int DolCaptureDevice::onDequeueBuffer(shared_ptr buffer) { + if (mNeedSkipFrame) { + return OK; // Do nothing if the buffer needs to be skipped. + } + + for (auto& consumer : mConsumers) { + consumer->onFrameAvailable(mPort, buffer); + } + + dumpFrame(buffer); + return OK; +} + +bool DolCaptureDevice::needQueueBack(shared_ptr buffer) { + /** + * needNotifyBufferDone is used to check if the buffer needs to be returned to its consumer. + * It is only true when: 1. ISA raw buffers are queued from its consumer; + * 2. there is no frame needs to be skipped; + * 3. there is no STR2MMIOErr happened. + * needNotifyBufferDone is false means the buffer needs to be queued back immediately. + */ + bool needNotifyBufferDone = (mPort != INVALID_PORT); + if ((buffer->getV4L2Buffer().Flags() & V4L2_BUF_FLAG_ERROR) && + PlatformData::isSkipFrameOnSTR2MMIOErr(mCameraId)) { + needNotifyBufferDone = false; + } else if (mFrameSkipNum > 0) { + needNotifyBufferDone = false; + } + + return !needNotifyBufferDone; +} +// DOL_FEATURE_E } // namespace icamera diff --git a/src/core/DeviceBase.h b/src/core/DeviceBase.h index 7e4afc7c..94774254 100644 --- a/src/core/DeviceBase.h +++ b/src/core/DeviceBase.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation. + * Copyright (C) 2018-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -136,16 +136,14 @@ class DeviceBase : public EventSource { std::set mConsumers; /** - * Each device has below three structures to manager its buffers. + * Each device has below two structures to manager its buffers. * And please note that: - * 1. If the buffer is not allocated inside CaptureUnit, mAllocatedBuffers will be empty. - * 2. Buffer to be queued into drive comes from mPendingBuffers. - * 3. Buffer to be dequeued from driver comes from mBuffersInDevice. - * 4. To make code clean, no null CameraBuffer is allowed to be put into these structures. - * 5. The buffer cannot be in both mPendingBuffers and mBuffersInDevice. + * 1. Buffer to be queued into drive comes from mPendingBuffers. + * 2. Buffer to be dequeued from driver comes from mBuffersInDevice. + * 3. To make code clean, no null CameraBuffer is allowed to be put into these structures. + * 4. The buffer cannot be in both mPendingBuffers and mBuffersInDevice. * We must make the data consistent. */ - std::vector> mAllocatedBuffers; // Save all buffers allocated internally. std::list> mPendingBuffers; // The buffers that are going to be queued. @@ -174,4 +172,19 @@ class MainDevice : public DeviceBase { bool needQueueBack(std::shared_ptr buffer); }; +// DOL_FEATURE_S +/** + * DolCaptureDevice is used for producing DOL HDR frames. + */ +class DolCaptureDevice : public DeviceBase { + public: + DolCaptureDevice(int cameraId, VideoNodeType nodeType); + ~DolCaptureDevice(); + + private: + int createBufferPool(const stream_t& config); + int onDequeueBuffer(std::shared_ptr buffer); + bool needQueueBack(std::shared_ptr buffer); +}; +// DOL_FEATURE_E } // namespace icamera diff --git a/src/core/FileSource.cpp b/src/core/FileSource.cpp new file mode 100644 index 00000000..4b58d7b0 --- /dev/null +++ b/src/core/FileSource.cpp @@ -0,0 +1,641 @@ +/* + * Copyright (C) 2017-2022 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG FileSource + +#include "FileSource.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "PlatformData.h" +#include "iutils/CameraLog.h" +#include "iutils/Utils.h" + +using std::map; +using std::shared_ptr; +using std::string; +using std::vector; + +namespace icamera { + +FileSource::FileSource(int cameraId) + : StreamSource(V4L2_MEMORY_USERPTR), + mCameraId(cameraId), + mExitPending(false), + mFps(30.0), + mSequence(-1), + mOutputPort(INVALID_PORT) { + LOG1("%s: FileSource is created for debugging.", __func__); + + const char* injectedFile = PlatformData::getInjectedFile(); + + // Pnp test mode, the inject file may invalid + if (injectedFile) { + // Check if a xml config file is used or use frame file directly or use injection path. + struct stat statBuf; + if (injectedFile && stat(injectedFile, &statBuf) == 0) { + mInjectedFile = std::string(injectedFile); + } + LOG1("@%s, Injected file path: %s", __func__, mInjectedFile.c_str()); + + string suffix = ".xml"; + size_t fullSize = mInjectedFile.size(); + size_t suffixSize = suffix.size(); + + // If mInjectedFile is ended with ".xml", it means we're using config file mode. + // If mInjectedFile is a directory, it means we're using injection path. + // If mInjectedFile is a frame file name, it means we're using frame file. + if ((fullSize > suffixSize) && + (mInjectedFile.compare(fullSize - suffixSize, suffixSize, suffix) == 0)) { + mInjectionWay = USING_CONFIG_FILE; + } else if (S_ISDIR(statBuf.st_mode)) { + mInjectionWay = USING_INJECTION_PATH; + } else { + mInjectionWay = USING_FRAME_FILE; + } + } + + CLEAR(mStreamConfig); + + mProduceThread = new ProduceThread(this); +} + +FileSource::~FileSource() { + delete mProduceThread; +} + +int FileSource::init() { + return OK; +} + +void FileSource::deinit() {} + +int FileSource::configure(const map& outputFrames, + const vector& configModes) { + CheckAndLogError(outputFrames.size() != 1, BAD_VALUE, "Support one port of input only."); + + mOutputPort = outputFrames.begin()->first; + mStreamConfig = outputFrames.begin()->second; + LOG1("%s, w:%d, h:%d, f:%s", mCameraId, __func__, mStreamConfig.width, + mStreamConfig.height, CameraUtils::format2string(mStreamConfig.format).c_str()); + return OK; +} + +int FileSource::allocateSourceBuffer() { + int fmt = mStreamConfig.format; + int width = mStreamConfig.width; + int height = mStreamConfig.height; + // Get frame size with aligned height taking in count for internal buffers. + uint32_t size = CameraUtils::getFrameSize(fmt, width, height, true); + map frameFileName; + if (mInjectionWay == USING_CONFIG_FILE) { + FileSourceProfile profile(mInjectedFile); + int ret = profile.getFrameFiles(mCameraId, frameFileName); + CheckAndLogError(ret != OK, BAD_VALUE, "Cannot find the frame files"); + for (const auto& item : frameFileName) + frameFileName[item.first] = profile.getFrameFile(mCameraId, item.first); + } else if (mInjectionWay == USING_INJECTION_PATH) { + int ret = access(mInjectedFile.c_str(), 0); + CheckAndLogError(ret != OK, BAD_VALUE, "Cannot access: %s", mInjectedFile.c_str()); + FileSourceFromDir fSource(mInjectedFile); + ret = fSource.getInjectionFileInfo(&frameFileName); + CheckAndLogError(ret != OK, BAD_VALUE, "Cannot find the frame files"); + } else if (mInjectionWay == USING_FRAME_FILE) { + frameFileName[0] = mInjectedFile; + } else { + CheckAndLogError( + (mInjectionWay < USING_FRAME_FILE || mInjectionWay >= UNKNOWN_INJECTED_WAY), BAD_VALUE, + "Invalid Injected Way"); + } + + for (const auto& item : frameFileName) { + string fileName = item.second; + // Prepare the buffers to read the files for frame + shared_ptr buf = CameraBuffer::create( + mCameraId, BUFFER_USAGE_GENERAL, V4L2_MEMORY_USERPTR, size, 0, fmt, width, height); + CheckAndLogError(!buf, BAD_VALUE, "@%s: Allocate producer buffer failed", __func__); + fillFrameBuffer(fileName, buf); + mFrameFileBuffers[fileName] = buf; + } + return OK; +} + +int FileSource::start() { + LOG1("%s", __func__); + + AutoMutex l(mLock); + + allocateSourceBuffer(); + mSequence = -1; + mExitPending = false; + mProduceThread->run("FileSource", PRIORITY_URGENT_AUDIO); + + return OK; +} + +int FileSource::stop() { + LOG1("%s", __func__); + + { + AutoMutex l(mLock); + mExitPending = true; + mProduceThread->requestExit(); + mBufferSignal.signal(); + } + + mProduceThread->requestExitAndWait(); + mFrameFileBuffers.clear(); + + return OK; +} + +int FileSource::qbuf(Port port, const shared_ptr& camBuffer) { + CheckAndLogError(!camBuffer, BAD_VALUE, "Camera buffer is null"); + + AutoMutex l(mLock); + + bool needSignal = mBufferQueue.empty(); + mBufferQueue.push(camBuffer); + if (needSignal) { + mBufferSignal.signal(); + } + + return OK; +} + +/** + * The thread loop function that's used to produce frame buffers regularly. + */ +bool FileSource::produce() { + LOG2("%s", __func__); + + mSequence++; + struct timespec start, end; + clock_gettime(CLOCK_MONOTONIC, &start); + + static const nsecs_t kWaitDuration = 40000000000; // 40s + shared_ptr qBuffer; + + { + // Find a buffer which needs to be filled. + ConditionLock lock(mLock); + while (mBufferQueue.empty()) { + if (mExitPending) { + return false; + } + int ret = mBufferSignal.waitRelative(lock, kWaitDuration); + if (mExitPending || ret == TIMED_OUT) { + return false; + } + } + + qBuffer = mBufferQueue.front(); + mBufferQueue.pop(); + } + + notifySofEvent(); + + fillFrameBuffer(qBuffer); + + clock_gettime(CLOCK_MONOTONIC, &end); + long seconds = end.tv_sec - start.tv_sec; + long nSeconds = end.tv_nsec - start.tv_nsec; + // Check how long to sleep to meet the specified FPS requirement. + long sleepTime = static_cast(1000000.0 / mFps) - (seconds * 1000000 + nSeconds / 1000); + LOG2("Need to sleep: %ld us", sleepTime); + // No need sleep if it takes too long to prepare the buffer. + if (sleepTime > 0) { + usleep(sleepTime); + } + + struct timespec stampTime; + clock_gettime(CLOCK_MONOTONIC, &stampTime); + + timeval stamp; + stamp.tv_sec = stampTime.tv_sec; + stamp.tv_usec = stampTime.tv_nsec / 1000; + + qBuffer->setSequence(mSequence); + qBuffer->setTimestamp(stamp); + + notifyFrame(qBuffer); + + return !mExitPending; +} + +void FileSource::fillFrameBuffer(string fileName, shared_ptr& buffer) { + CheckAndLogError(fileName.empty(), VOID_VALUE, "Invalid frame file."); + LOG2("Read frame from frame file:%s", fileName.c_str()); + + std::ifstream file(fileName.c_str(), std::ios::in | std::ios::binary | std::ios::ate); + CheckAndLogError(!file.is_open(), VOID_VALUE, "Cannot open frame file:%s", fileName.c_str()); + + size_t fileSize = file.tellg(); + file.seekg(0, std::ios::beg); + + CheckWarningNoReturn(fileSize < buffer->getBufferSize(), + "The size of file:%s is less than buffer's requirement.", + fileName.c_str()); + file.read(reinterpret_cast(buffer->getBufferAddr()), + std::min(fileSize, (size_t)buffer->getBufferSize())); +} + +void FileSource::fillFrameBuffer(shared_ptr& buffer) { + string fileName; + + if (mInjectionWay == USING_CONFIG_FILE) { + FileSourceProfile profile(mInjectedFile); + fileName = profile.getFrameFile(mCameraId, mSequence); + mFps = profile.getFps(mCameraId); + } else if (mInjectionWay == USING_INJECTION_PATH) { + if (access(mInjectedFile.c_str(), 0) != 0) { + LOGE("Cannot access: %s for fillFrameBuffer", mInjectedFile.c_str()); + } + map frameFileName; + FileSourceFromDir fSource(mInjectedFile); + int ret = fSource.getInjectionFileInfo(&frameFileName); + if (ret != OK) { + LOGE("Cannot find the frame files for fillFrameBuffer"); + } + fileName = fSource.getFrameFile(frameFileName, mSequence); + } else if (mInjectionWay == USING_FRAME_FILE) { + fileName = mInjectedFile; + } else { + LOGE("Invalid Injected Way for fillFrameBuffer"); + } + + CheckAndLogError(fileName.empty(), VOID_VALUE, "Invalid frame file."); + LOG2("Frame uses frame file:%s, buffer %p", mSequence, fileName.c_str(), + buffer->getBufferAddr()); + + for (auto& item : mFrameFileBuffers) { + if (fileName.compare(item.first) == 0) { + MEMCPY_S((buffer->getBufferAddr()), buffer->getBufferSize(), + (item.second->getBufferAddr()), item.second->getBufferSize()); + return; + } + } + LOGE("Not find the framefile: %s", fileName.c_str()); +} + +void FileSource::notifyFrame(const shared_ptr& buffer) { + EventData frameData; + frameData.type = EVENT_ISYS_FRAME; + frameData.buffer = nullptr; + frameData.data.frame.sequence = mSequence; + frameData.data.frame.timestamp = buffer->getV4L2Buffer().Get()->timestamp; + notifyListeners(frameData); + + for (auto& consumer : mBufferConsumerList) { + consumer->onFrameAvailable(mOutputPort, buffer); + } +} + +void FileSource::notifySofEvent() { + timeval timestamp; + gettimeofday(×tamp, nullptr); + + EventDataSync syncData; + syncData.sequence = mSequence; + syncData.timestamp = timestamp; + EventData eventData; + eventData.type = EVENT_ISYS_SOF; + eventData.buffer = nullptr; + eventData.data.sync = syncData; + notifyListeners(eventData); +} + +void FileSource::addFrameAvailableListener(BufferConsumer* listener) { + AutoMutex l(mLock); + mBufferConsumerList.push_back(listener); +} + +void FileSource::removeFrameAvailableListener(BufferConsumer* listener) { + AutoMutex l(mLock); + for (auto it = mBufferConsumerList.begin(); it != mBufferConsumerList.end(); ++it) { + if ((*it) == listener) { + mBufferConsumerList.erase(it); + return; + } + } +} + +void FileSource::removeAllFrameAvailableListener() { + AutoMutex l(mLock); + mBufferConsumerList.clear(); +} + +void FileSource::registerListener(EventType eventType, EventListener* eventListener) { + EventSource::registerListener(eventType, eventListener); +} + +void FileSource::removeListener(EventType eventType, EventListener* eventListener) { + EventSource::removeListener(eventType, eventListener); +} + +FileSourceProfile::FileSourceProfile(string configFile) : mCurrentDataField(FIELD_INVALID) { + parseXmlFile(configFile); + mergeCommonConfig(); + + for (auto& item : mConfigs) { + // The first frame, that is the frame for sequence 0 MUST be provided. + if (item.second.mFrameFiles.find(0) == item.second.mFrameFiles.end()) { + LOGE("Sensor:%s, frame file for sequence 0 MUST be provided", item.first.c_str()); + } + } +} + +float FileSourceProfile::getFps(int cameraId) { + const char* sensorName = PlatformData::getSensorName(cameraId); + if (mConfigs.find(sensorName) != mConfigs.end()) { + return mConfigs[sensorName].mFps; + } + + return mCommon.mFps; +} + +int FileSourceProfile::getFrameFiles(int cameraId, map& framefiles) { + const char* sensorName = PlatformData::getSensorName(cameraId); + CheckAndLogError(mConfigs.find(sensorName) == mConfigs.end(), BAD_VALUE, + "Failed to find the sensor: %s.", sensorName); + + FileSourceConfig& config = mConfigs[sensorName]; + framefiles = config.mFrameFiles; + return OK; +} + +string FileSourceProfile::getFrameFile(int cameraId, int64_t sequence) { + const char* sensorName = PlatformData::getSensorName(cameraId); + CheckAndLogError(mConfigs.find(sensorName) == mConfigs.end(), "", + "Failed to find the sensor: %s.", sensorName); + + // Find the frame file which is the equal or most closest to the given sequence. + FileSourceConfig& config = mConfigs[sensorName]; + int64_t targetSequence = -1; + for (const auto& item : config.mFrameFiles) { + if (item.first == sequence) { + targetSequence = sequence; + break; + } + + if (item.first < sequence && item.first > targetSequence) { + targetSequence = item.first; + } + } + CheckAndLogError(targetSequence == -1, "", "Cannot find the frame file for sequence:%ld", + sequence); + + string fullName = config.mFrameDir + "/" + config.mFrameFiles[targetSequence]; + return fullName; +} + +/** + * Merge the common config into sensor specific configs. + */ +void FileSourceProfile::mergeCommonConfig() { + LOG2("Common fps:%f, frame dir:%s", mCommon.mFps, mCommon.mFrameDir.c_str()); + + for (auto& item : mConfigs) { + // If one item isn't set in a particular sensor, then we just fill it with common settings. + if (item.second.mFps == 0) { + item.second.mFps = mCommon.mFps; + } + if (item.second.mFrameDir.empty()) { + item.second.mFrameDir = mCommon.mFrameDir; + } + LOG2("Sensor:%s, fps:%f frame dir:%s", item.first.c_str(), item.second.mFps, + item.second.mFrameDir.c_str()); + + for (const auto& sequenceFile : item.second.mFrameFiles) { + LOG2("Sequence:%d -> frame file:%s", sequenceFile.first, sequenceFile.second.c_str()); + } + } +} + +/** + * This function will check which field that the parser parses to. + * + * The field is set to 3 types. + * FIELD_INVALID FIELD_COMMON FIELD_SENSOR + * + * \param name: The element's name. + * \param atts: The element's attribute. + */ +void FileSourceProfile::checkField(const char* name, const char** atts) { + LOG2("@%s, name:%s", __func__, name); + + if (strcmp(name, "FileSource") == 0) { + mCurrentDataField = FIELD_INVALID; + } else if (strcmp(name, "Sensor") == 0) { + mCurrentSensor = atts[1]; + mConfigs[mCurrentSensor] = FileSourceConfig(); + mCurrentDataField = FIELD_SENSOR; + } else if (strcmp(name, "Common") == 0) { + mCurrentDataField = FIELD_COMMON; + } else { + LOGE("@%s, name:%s, atts[0]:%s, xml format wrong", __func__, name, atts[0]); + } +} + +/** + * the callback function of the libexpat for handling of one element start + * + * When it comes to the start of one element. This function will be called. + * + * \param userData: the pointer we set by the function XML_SetUserData. + * \param name: the element's name. + */ +void FileSourceProfile::startElement(void* userData, const char* name, const char** atts) { + LOG2("@%s %s", __func__, name); + + FileSourceProfile* profile = reinterpret_cast(userData); + + switch (profile->mCurrentDataField) { + case FIELD_INVALID: + profile->checkField(name, atts); + break; + case FIELD_COMMON: + if (strcmp(name, "fps") == 0) { + profile->mCommon.mFps = std::stof(atts[1]); + } else if (strcmp(name, "frameDir") == 0) { + profile->mCommon.mFrameDir = atts[1]; + } + break; + case FIELD_SENSOR: { + FileSourceConfig& config = profile->mConfigs[profile->mCurrentSensor]; + if (strcmp(name, "fps") == 0) { + config.mFps = std::stof(atts[1]); + } else if (strcmp(name, "frameDir") == 0) { + config.mFrameDir = atts[1]; + } else if (strcmp(name, "frameFile") == 0) { + config.mFrameFiles[std::stoi(atts[1])] = atts[3]; + } + break; + } + default: + LOGE("Invalid field to handle"); + break; + } +} + +/** + * the callback function of the libexpat for handling of one element end + * + * When it comes to the end of one element. This function will be called. + * + * \param userData: the pointer we set by the function XML_SetUserData. + * \param name: the element's name. + */ +void FileSourceProfile::endElement(void* userData, const char* name) { + LOG2("@%s %s", __func__, name); + + FileSourceProfile* profile = reinterpret_cast(userData); + + if (strcmp(name, "Sensor") == 0) { + profile->mCurrentSensor = ""; + profile->mCurrentDataField = FIELD_INVALID; + } else if (strcmp(name, "Common") == 0) { + profile->mCurrentDataField = FIELD_INVALID; + } +} + +void FileSourceProfile::parseXmlFile(const string& xmlFile) { + LOG2("@%s, parsing profile: %s", __func__, xmlFile.c_str()); + + if (xmlFile.empty()) return; + + FILE* fp = fopen(xmlFile.c_str(), "r"); + CheckAndLogError(!fp, VOID_VALUE, "Can not open profile file %s", xmlFile.c_str()); + + XML_Parser parser = XML_ParserCreate(nullptr); + if (parser == nullptr) { + LOGE("Create XML parser failed."); + fclose(fp); + return; + } + + XML_SetUserData(parser, this); + XML_SetElementHandler(parser, startElement, endElement); + + static const int kBufSize = 1024; + char pTmpBuf[kBufSize]; + bool done = false; + + while (!done) { + int len = fread(pTmpBuf, 1, kBufSize, fp); + if (!len && ferror(fp)) { + clearerr(fp); + break; + } + done = len < kBufSize; + if (XML_Parse(parser, pTmpBuf, len, done) == XML_STATUS_ERROR) { + LOGE("@%s, XML_Parse error", __func__); + break; + } + } + + XML_ParserFree(parser); + fclose(fp); +} + +FileSourceFromDir::FileSourceFromDir(const string& injectionPath) : mInjectionPath(injectionPath) { + LOG1("%s: InjectionPath of FileSourceFromDir is %s.", __func__, mInjectionPath.c_str()); + struct dirent* fileDirent = nullptr; + struct stat statBuf; + + DIR* dirInfo = opendir(mInjectionPath.c_str()); + CheckAndLogError(!dirInfo, VOID_VALUE, "Invalid injection path: %s.", mInjectionPath.c_str()); + + while ((fileDirent = readdir(dirInfo))) { + if (strcmp(fileDirent->d_name, ".") == 0 || strcmp(fileDirent->d_name, "..") == 0) { + continue; + } + + if (stat(fileDirent->d_name, &statBuf) == 0 && S_ISDIR(statBuf.st_mode)) { + continue; + } + + mInjectionFiles.push_back(fileDirent->d_name); + } + + closedir(dirInfo); + + CheckAndLogError(!mInjectionFiles.size(), VOID_VALUE, "No Injection files"); + sort(mInjectionFiles.begin(), mInjectionFiles.end()); +} + +FileSourceFromDir::~FileSourceFromDir() {} + +int FileSourceFromDir::getInjectionFileInfo(map* frameFilesInfo) { + for (unsigned int seqId = 0; seqId < mInjectionFiles.size(); seqId++) { + if (mInjectionPath.back() == '/') { + string fullPath = mInjectionPath + mInjectionFiles[seqId]; + frameFilesInfo->insert(std::pair(seqId, fullPath)); + } else { + string fullPath = mInjectionPath + "/" + mInjectionFiles[seqId]; + frameFilesInfo->insert(std::pair(seqId, fullPath)); + } + } + + return OK; +} + +string FileSourceFromDir::getFrameFile(const map& frameFilesInfo, int64_t sequence) { + int64_t targetSequence = -1; + + for (const auto& item : frameFilesInfo) { + if (item.first == sequence) { + targetSequence = sequence; + break; + } + + if (item.first < sequence && item.first > targetSequence) { + targetSequence = item.first; + } + } + + CheckAndLogError(targetSequence == -1, "", "Cannot find the frame file for sequence:%ld", + sequence); + + return frameFilesInfo.at(targetSequence); +} + +void FileSourceFromDir::fillFrameBuffer(void* addr, size_t bufferSize, uint32_t sequence) { + if (mInjectionFiles.size() == 0 || !addr) return; + + uint32_t index = sequence % mInjectionFiles.size(); + string fileName; + if (mInjectionPath.back() == '/') { + fileName = mInjectionPath + mInjectionFiles[index]; + } else { + fileName = mInjectionPath + "/" + mInjectionFiles[index]; + } + std::ifstream file(fileName.c_str(), std::ios::in | std::ios::binary | std::ios::ate); + CheckAndLogError(!file.is_open(), VOID_VALUE, "Cannot open frame file:%s", fileName.c_str()); + + size_t fileSize = file.tellg(); + file.seekg(0, std::ios::beg); + file.read(reinterpret_cast(addr), std::min(fileSize, bufferSize)); +} + +} // end of namespace icamera diff --git a/src/core/FileSource.h b/src/core/FileSource.h new file mode 100644 index 00000000..e708cdaa --- /dev/null +++ b/src/core/FileSource.h @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2017-2021 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "StreamSource.h" +#include "iutils/Thread.h" + +namespace icamera { + +/** + * \class FileSource + * + * It's a buffer producer that's used to produce frame buffer via provided files + * instead of from real sensor. + * + * There are three working mode: + * 1. The first mode which only provides one same frame for all sequences. + * How to enable: export cameraInjectFile="FrameFileName" + * 2. The second mode which can configure which file is used for any sequence or FPS. + * How to enable: export cameraInjectFile="ConfigFileName.xml" + * The value of cameraInjectFile MUST be ended with ".xml". + * 3. The third mode which can inject files in sequence by specifying injection folder path. + * How to enable: export cameraInjectFile="Injection Folder" + * ("Injection Folder" is the specifyed injection folder path you want to run file injection) + */ +class FileSource : public StreamSource { + public: + explicit FileSource(int cameraId); + ~FileSource(); + + int init(); + void deinit(); + int configure(const std::map& outputFrames, + const std::vector& configModes); + int start(); + int stop(); + + virtual int qbuf(Port port, const std::shared_ptr& camBuffer); + + virtual void addFrameAvailableListener(BufferConsumer* listener); + virtual void removeFrameAvailableListener(BufferConsumer* listener); + void removeAllFrameAvailableListener(); + int allocateMemory(Port port, const std::shared_ptr& camBuffer) { return OK; } + + // Overwrite EventSource APIs to avoid calling its parent's implementation. + void registerListener(EventType eventType, EventListener* eventListener); + void removeListener(EventType eventType, EventListener* eventListener); + + private: + bool produce(); + int allocateSourceBuffer(); + void fillFrameBuffer(std::shared_ptr& buffer); + void fillFrameBuffer(std::string fileName, std::shared_ptr& buffer); + void notifyFrame(const std::shared_ptr& buffer); + void notifySofEvent(); + + private: + class ProduceThread : public Thread { + FileSource* mFileSrc; + + public: + explicit ProduceThread(FileSource* fileSource) : mFileSrc(fileSource) {} + + virtual bool threadLoop() { return mFileSrc->produce(); } + }; + + ProduceThread* mProduceThread; + int mCameraId; + bool mExitPending; + + float mFps; + int64_t mSequence; + std::string mInjectedFile; // The injected file can be a actual frame or a XML config file. + enum { + USING_FRAME_FILE = + 0, // If mInjectedFile is a frame file name, it means we're using frame file. + USING_CONFIG_FILE, // If mInjectedFile ends with ".xml", it means we're using config file. + USING_INJECTION_PATH, // If mInjectedFile is a directory, it means we're using injection + // path. + UNKNOWN_INJECTED_WAY // Error way + } mInjectionWay; + + stream_t mStreamConfig; + Port mOutputPort; + + std::vector mBufferConsumerList; + std::map> mFrameFileBuffers; + CameraBufQ mBufferQueue; + Condition mBufferSignal; + // Guard for FileSource Public API + Mutex mLock; +}; + +/** + * \class FileSourceProfile + * + * It's used to parse file source config file, and provide such fps and frame file name etc + * information for FileSource to use. + */ +class FileSourceProfile { + public: + explicit FileSourceProfile(std::string configFile); + ~FileSourceProfile() {} + + float getFps(int cameraId); + std::string getFrameFile(int cameraId, int64_t sequence); + int getFrameFiles(int cameraId, std::map& framefiles); + + static void startElement(void* userData, const char* name, const char** atts); + static void endElement(void* userData, const char* name); + + void checkField(const char* name, const char** atts); + void parseXmlFile(const std::string& xmlFile); + void mergeCommonConfig(); + + private: + struct CommonConfig { + CommonConfig() : mFps(30.0), mFrameDir(".") {} + float mFps; + std::string mFrameDir; + }; + + struct FileSourceConfig { + FileSourceConfig() : mFps(0) {} + float mFps; + std::string mFrameDir; + std::map mFrameFiles; + }; + + enum { + FIELD_INVALID = 0, + FIELD_SENSOR, + FIELD_COMMON, + } mCurrentDataField; + + std::string mCurrentSensor; + CommonConfig mCommon; + std::map mConfigs; + + private: + DISALLOW_COPY_AND_ASSIGN(FileSourceProfile); +}; + +/** + * \class FileSourceFromDir + * + * It's used to parse file source from injection file directory, and provide such frame file name + * etc information for FileSource to use. + */ +class FileSourceFromDir { + public: + explicit FileSourceFromDir(const std::string& injectionPath); + ~FileSourceFromDir(); + + int getInjectionFileInfo(std::map* frameFilesInfo); + std::string getFrameFile(const std::map& frameFilesInfo, int64_t sequence); + void fillFrameBuffer(void* addr, size_t bufferSize, uint32_t sequence); + + private: + std::string mInjectionPath; + std::vector mInjectionFiles; +}; + +} // namespace icamera diff --git a/src/core/IspParamAdaptor.cpp b/src/core/IspParamAdaptor.cpp index 2a61aeb8..782331d2 100644 --- a/src/core/IspParamAdaptor.cpp +++ b/src/core/IspParamAdaptor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2022 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,6 +42,8 @@ IspParamAdaptor::IspParamAdaptor(int cameraId) mCameraId(cameraId), mTuningMode(TUNING_MODE_VIDEO), mIpuOutputFormat(V4L2_PIX_FMT_NV12), + mLastLscSequece(-1), + mLastGdcSequence(-1), mGraphConfig(nullptr), mIntelCca(nullptr), mGammaTmOffset(-1) { @@ -50,7 +52,8 @@ IspParamAdaptor::IspParamAdaptor(int cameraId) PalRecord palRecordArray[] = {{ia_pal_uuid_isp_call_info, -1}, {ia_pal_uuid_isp_bnlm_3_2, -1}, - {ia_pal_uuid_isp_lsc_1_1, -1}}; + {ia_pal_uuid_isp_lsc_1_1, -1}, + {ia_pal_uuid_isp_gdc5, -1}}; for (uint32_t i = 0; i < sizeof(palRecordArray) / sizeof(PalRecord); i++) { mPalRecords.push_back(palRecordArray[i]); } @@ -208,6 +211,8 @@ int IspParamAdaptor::configure(const stream_t& stream, ConfigMode configMode, Tu LOG2("%s, configMode: %x, PSys output format 0x%x", __func__, configMode, mIpuOutputFormat); mTuningMode = tuningMode; CLEAR(mLastPalDataForVideoPipe); + mLastLscSequece = -1; + mLastGdcSequence = -1; for (uint32_t i = 0; i < mPalRecords.size(); i++) { mPalRecords[i].offset = -1; } @@ -245,8 +250,12 @@ int IspParamAdaptor::configure(const stream_t& stream, ConfigMode configMode, Tu // Use the tuning mode in graph to update the isp tuning data if (ispTuningIndex != -1) { uint8_t lardTag = cca::CCA_LARD_ISP; - ia_lard_input_params lardParam = {}; - lardParam.isp_mode_index = ispTuningIndex; + ia_lard_input_params lardParam = { + IA_MKN_CHTOUL('D', 'F', 'L', 'T'), + IA_MKN_CHTOUL('D', 'F', 'L', 'T'), + static_cast(ispTuningIndex), + IA_MKN_CHTOUL('D', 'F', 'L', 'T') + }; cca::cca_nvm tmpNvm = {}; ia_err iaErr = @@ -269,6 +278,7 @@ int IspParamAdaptor::configure(const stream_t& stream, ConfigMode configMode, Tu inputParams->seq_id = -1; initInputParams(inputParams); inputParams->stream_id = ispParamIt.first; + inputParams->dvs_id = inputParams->stream_id; ia_isp_bxt_program_group* pgPtr = mGraphConfig->getProgramGroup(ispParamIt.first); CheckAndLogError(!pgPtr, UNKNOWN_ERROR, @@ -355,9 +365,6 @@ int IspParamAdaptor::decodeStatsData(TuningMode tuningMode, hwStatsData->size, bitmap, &queryResults, outStats); CheckAndLogError(iaErr != ia_err_none, UNKNOWN_ERROR, "%s, Faield convert statistics", __func__); - LOG2("%s, query results: rgbs_grid(%d), af_grid(%d), dvs_stats(%d), paf_grid(%d)", __func__, - queryResults.rgbs_grid, queryResults.af_grid, queryResults.dvs_stats, - queryResults.paf_grid); return OK; } @@ -401,8 +408,12 @@ void IspParamAdaptor::updateKernelToggles(cca::cca_program_group* programGroup) * but currently a ring buffer is used in HAL, which caused logic mismatching issue. * So temporarily copy latest PAL data into PAL output buffer. */ -void IspParamAdaptor::updatePalDataForVideoPipe(ia_binary_data dest) { - if (mLastPalDataForVideoPipe.data == nullptr || mLastPalDataForVideoPipe.size == 0) return; +void IspParamAdaptor::updatePalDataForVideoPipe(ia_binary_data dest, int64_t bufSeq, + int64_t settingSeq) { + if (mLastPalDataForVideoPipe.data == nullptr || mLastPalDataForVideoPipe.size == 0) { + mLastGdcSequence = settingSeq; + return; + } if (mPalRecords.empty()) return; @@ -437,6 +448,26 @@ void IspParamAdaptor::updatePalDataForVideoPipe(ia_binary_data dest) { headerSrc = header; } + if (ia_pal_uuid_isp_lsc_1_1 == header->uuid) { + if (isLscCopy(bufSeq, settingSeq)) { + LOG2("settingSeq %ld, copy LSC for buf %ld", settingSeq, bufSeq); + updateLscSeqMap(bufSeq); + } else { + LOG2("settingSeq %ld, not copy LSC for buf %ld", settingSeq, bufSeq); + continue; + } + } + + if (ia_pal_uuid_isp_gdc5 == header->uuid) { + if (isGdcCopy(bufSeq, settingSeq)) { + LOG2("settingSeq %ld, copy GDC for buf %ld", settingSeq, bufSeq); + updateGdcSeqMap(bufSeq); + } else { + LOG2("settingSeq %ld, not copy GDC for buf %ld", settingSeq, bufSeq); + continue; + } + } + if (!headerSrc) { LOGW("Failed to find PAL recorder header %d", mPalRecords[i].uuid); continue; @@ -465,6 +496,60 @@ void IspParamAdaptor::updateIspParameterMap(IspParameter* ispParam, int64_t data ispParam->mSequenceToDataId[settingSeq] = dataSeq; } +bool IspParamAdaptor::isLscCopy(int64_t bufSeq, int64_t settingSeq) { + AiqResult* aiqResults = const_cast( + AiqResultStorage::getInstance(mCameraId)->getAiqResult(settingSeq)); + if (aiqResults == nullptr) return true; + + if (aiqResults->mLscUpdate) { + mLastLscSequece = settingSeq; + LOG2("%s, LSC update %ld", __func__, settingSeq); + return false; + } else { + if (mSeqIdToLscSeqIdMap.find(bufSeq) != mSeqIdToLscSeqIdMap.end()) { + if (mLastLscSequece >= 0 && mSeqIdToLscSeqIdMap[bufSeq] == mLastLscSequece) { + return false; + } + } + } + + return true; +} + +void IspParamAdaptor::updateLscSeqMap(int64_t settingSeq) { + mSeqIdToLscSeqIdMap[settingSeq] = mLastLscSequece; + + if (mSeqIdToLscSeqIdMap.size() > ISP_PARAM_QUEUE_SIZE) { + mSeqIdToLscSeqIdMap.erase(mSeqIdToLscSeqIdMap.begin()); + } +} + +bool IspParamAdaptor::isGdcCopy(int64_t bufSeq, int64_t settingSeq) { + if (!PlatformData::isDvsSupported(mCameraId)) return false; + + if (AiqResultStorage::getInstance(mCameraId)->isDvsRun(settingSeq)) { + mLastGdcSequence = settingSeq; + LOG2("%s, GDC update %ld", __func__, settingSeq); + return false; + } else { + if (mSeqIdToGdcSeqIdMap.find(bufSeq) != mSeqIdToGdcSeqIdMap.end()) { + if (mLastGdcSequence >= 0 && mSeqIdToGdcSeqIdMap[bufSeq] == mLastGdcSequence) { + return false; + } + } + } + + return true; +} + +void IspParamAdaptor::updateGdcSeqMap(int64_t settingSeq) { + mSeqIdToGdcSeqIdMap[settingSeq] = mLastGdcSequence; + + if (mSeqIdToGdcSeqIdMap.size() > ISP_PARAM_QUEUE_SIZE) { + mSeqIdToGdcSeqIdMap.erase(mSeqIdToGdcSeqIdMap.begin()); + } +} + /** * runIspAdapt * Convert the results of the 3A algorithms and parse with P2P. @@ -510,7 +595,7 @@ int IspParamAdaptor::runIspAdapt(const IspSettings* ispSettings, int64_t setting // Update some PAL data to latest PAL result if (it.first == VIDEO_STREAM_ID) { - updatePalDataForVideoPipe(binaryData); + updatePalDataForVideoPipe(binaryData, dataIt->first, settingSequence); } ia_isp_bxt_program_group* pgPtr = mGraphConfig->getProgramGroup(it.first); @@ -537,6 +622,8 @@ int IspParamAdaptor::runIspAdapt(const IspSettings* ispSettings, int64_t setting if (it.first == VIDEO_STREAM_ID) { mLastPalDataForVideoPipe = binaryData; updateResultFromAlgo(&binaryData, settingSequence); + updateLscSeqMap(settingSequence); + updateGdcSeqMap(settingSequence); } } } @@ -643,7 +730,6 @@ void IspParamAdaptor::applyMediaFormat(const AiqResult* aiqResult, ia_media_form bool* useLinearGamma) { CheckAndLogError(!mediaFormat || !aiqResult, VOID_VALUE, "mediaFormat or aiqResult is nullptr"); - *mediaFormat = media_format_legacy; if (aiqResult->mAiqParam.tonemapMode == TONEMAP_MODE_GAMMA_VALUE) { if (aiqResult->mAiqParam.tonemapGamma == 1.0) { *useLinearGamma = true; @@ -713,6 +799,7 @@ int IspParamAdaptor::runIspAdaptL(ia_isp_bxt_program_group* pgPtr, ia_isp_bxt_gd inputParams->seq_id = settingSequence; bool useLinearGamma = false; + inputParams->media_format = PlatformData::getMediaFormat(mCameraId); applyMediaFormat(aiqResults, &inputParams->media_format, &useLinearGamma); LOG2("%s, media format: 0x%x, gamma lut size: %d", __func__, inputParams->media_format, aiqResults->mGbceResults.gamma_lut_size); @@ -850,7 +937,7 @@ int IspParamAdaptor::runIspAdaptL(ia_isp_bxt_program_group* pgPtr, ia_isp_bxt_gd } LOG2("%s: set digital gain for ULL pipe: %f", __func__, inputParams->manual_digital_gain); - } else if (CameraUtils::isMultiExposureCase(mCameraId, mTuningMode) && + } else if (PlatformData::isMultiExposureCase(mCameraId, mTuningMode) && PlatformData::getSensorGainType(mCameraId) == ISP_DG_AND_SENSOR_DIRECT_AG) { inputParams->manual_digital_gain = aiqResults->mAeResults.exposures[0].exposure[0].digital_gain; @@ -864,6 +951,12 @@ int IspParamAdaptor::runIspAdaptL(ia_isp_bxt_program_group* pgPtr, ia_isp_bxt_gd { PERF_CAMERA_ATRACE_PARAM1_IMAGING("ia_isp_bxt_run", 1); + // HDR_FEATURE_S + if (PlatformData::getSensorAeEnable(mCameraId)) { + inputParams->gain_id_gaic = 1; + } + // HDR_FEATURE_E + iaErr = mIntelCca->runAIC(aiqResults->mFrameId, inputParams, binaryData); } CheckAndLogError(iaErr != ia_err_none && iaErr != ia_err_not_run, UNKNOWN_ERROR, diff --git a/src/core/IspParamAdaptor.h b/src/core/IspParamAdaptor.h index 31aea19f..bc4bc920 100644 --- a/src/core/IspParamAdaptor.h +++ b/src/core/IspParamAdaptor.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2022 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,6 +51,9 @@ extern "C" { #include "ia_isp_bxt_types.h" #include "ia_isp_bxt_statistics_types.h" #include "ia_isp_bxt.h" +// DOL_FEATURE_S +#include "ia_bcomp.h" +// DOL_FEATURE_E #include "ia_bcomp_types.h" #include "gc/IGraphConfigManager.h" #include "IspSettings.h" @@ -89,7 +92,7 @@ class IspParamAdaptor { int initProgramGroupForAllStreams(ConfigMode configMode); void initInputParams(cca::cca_pal_input_params* params); - void updatePalDataForVideoPipe(ia_binary_data dest); + void updatePalDataForVideoPipe(ia_binary_data dest, int64_t bufSeq, int64_t settingSeq); struct IspParameter { /* @@ -124,6 +127,12 @@ class IspParamAdaptor { void updateResultFromAlgo(ia_binary_data* binaryData, int64_t sequence); uint32_t getRequestedStats(); + bool isLscCopy(int64_t bufSeq, int64_t settingSeq); + void updateLscSeqMap(int64_t settingSeq); + + bool isGdcCopy(int64_t bufSeq, int64_t settingSeq); + void updateGdcSeqMap(int64_t settingSeq); + private: enum IspAdaptorState { ISP_ADAPTOR_NOT_INIT, @@ -142,6 +151,13 @@ class IspParamAdaptor { static const int ISP_PARAM_QUEUE_SIZE = MAX_SETTING_COUNT; std::map mStreamIdToIspParameterMap; // map from stream id to IspParameter ia_binary_data mLastPalDataForVideoPipe; + + int64_t mLastLscSequece; + std::map mSeqIdToLscSeqIdMap; + + int64_t mLastGdcSequence; + std::map mSeqIdToGdcSeqIdMap; + // Guard lock for ipu parameter Mutex mIpuParamLock; std::unordered_map mStreamIdToPalInputParamsMap; diff --git a/src/core/IspSettings.h b/src/core/IspSettings.h index 98e42f5c..f9ebc649 100644 --- a/src/core/IspSettings.h +++ b/src/core/IspSettings.h @@ -37,6 +37,9 @@ struct IspSettings { bool videoStabilization; IspImageEnhancement manualSettings; ia_binary_data* palOverride; + // DOL_FEATURE_S + short vbp; // Used for DOL camera + // DOL_FEATURE_E float zoom; camera_mount_type_t sensorMountType; IspSettings() { diff --git a/src/core/LensHw.cpp b/src/core/LensHw.cpp index 7d21bedc..8943f96b 100644 --- a/src/core/LensHw.cpp +++ b/src/core/LensHw.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2021 Intel Corporation + * Copyright (C) 2016-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,10 @@ #define LOG_TAG LensHw -#include "LensHw.h" +#include "src/core/LensHw.h" + +#include + #include "iutils/CameraLog.h" #include "V4l2DeviceFactory.h" #include "PlatformData.h" @@ -31,7 +34,7 @@ LensHw::LensHw(int cameraId) LensHw::~LensHw() {} -int LensHw::init() { +int LensHw::start() { std::string lensName = PlatformData::getLensName(mCameraId); if (lensName.empty()) { LOG1("@%s No HW Lens", mCameraId, __func__); @@ -51,6 +54,18 @@ int LensHw::init() { return OK; } +void LensHw::stop() { + if (!mLensSubdev) return; + + // close the lens sub device + std::string subDevName; + CameraUtils::getSubDeviceName(mLensName.c_str(), subDevName); + if (!subDevName.empty()) { + V4l2DeviceFactory::releaseSubDev(mCameraId, subDevName); + mLensSubdev = nullptr; + } +} + /** * focus with absolute value */ diff --git a/src/core/LensHw.h b/src/core/LensHw.h index eab0c166..b289b253 100644 --- a/src/core/LensHw.h +++ b/src/core/LensHw.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2021 Intel Corporation + * Copyright (C) 2016-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,8 @@ class LensHw { LensHw(int cameraId); ~LensHw(); - int init(); + int start(); + void stop(); const char* getLensName(void); diff --git a/src/core/PSysProcessor.cpp b/src/core/PSysProcessor.cpp index 5dd04823..351a16d1 100644 --- a/src/core/PSysProcessor.cpp +++ b/src/core/PSysProcessor.cpp @@ -70,9 +70,14 @@ PSysProcessor::~PSysProcessor() { mProcessThread->join(); delete mProcessThread; - // Delete PSysDAG before Scheduler because ~PSysDAG() needs Scheduler + /* PipeExecutor is shared between Scheduler and PSysDAG, so need to delete Scheduler + * before delete PipeExecutor in PSysDAG. + */ + if (mScheduler) { + mPSysDAGs[mCurConfigMode]->unregisterNode(); + delete mScheduler; + } mPSysDAGs.clear(); - if (mScheduler) delete mScheduler; } int PSysProcessor::configure(const std::vector& configModes) { @@ -107,7 +112,8 @@ int PSysProcessor::configure(const std::vector& configModes) { } // Hold raw for SDV case with GPU TNR enabled - if (PlatformData::isGpuTnrEnabled() && videoStream.width > 0 && stillStream.width > 0) { + if (PlatformData::isGpuTnrEnabled(mCameraId) && videoStream.width > 0 && + stillStream.width > 0) { // hold raw buffer for running TNR in still pipe mHoldRawBuffers = true; } @@ -176,11 +182,20 @@ int PSysProcessor::start() { */ bool needProducerBuffer = PlatformData::isIsysEnabled(mCameraId); + // FILE_SOURCE_S + needProducerBuffer = needProducerBuffer || PlatformData::isFileSourceEnabled(); + // FILE_SOURCE_E + if (needProducerBuffer) { int ret = allocProducerBuffers(mCameraId, rawBufferNum); CheckAndLogError(ret != OK, NO_MEMORY, "Allocating producer buffer failed:%d", ret); } + { + AutoMutex lock(mBufferMapLock); + mRawBufferMap.clear(); + } + mThreadRunning = true; CLEAR(mSofTimestamp); mProcessThread->run("PsysProcessor", PRIORITY_NORMAL); @@ -422,14 +437,28 @@ bool PSysProcessor::needSwitchPipe(int64_t sequence) { void PSysProcessor::handleEvent(EventData eventData) { // Process registered events switch (eventData.type) { + // CSI_META_S + case EVENT_META: + // DOL_FEATURE_S + if (PlatformData::needHandleVbpInMetaData(mCameraId, mCurConfigMode)) { + AutoMutex l(mMetaQueueLock); + mMetaQueue.push(eventData.data.meta); + LOG2("%s: received meta data, current queue size %lu", __func__, mMetaQueue.size()); + mMetaAvailableSignal.signal(); + } + // DOL_FEATURE_E + break; + // CSI_META_E case EVENT_ISYS_SOF: { AutoMutex l(mSofLock); mSofSequence = eventData.data.sync.sequence; - gettimeofday(&mSofTimestamp, nullptr); - LOG2("%s, received SOF event sequence: %ld, timestamp: %ld", __func__, - eventData.data.sync.sequence, TIMEVAL2USECS(mSofTimestamp)); - mSofCondition.signal(); + if (PlatformData::psysAlignWithSof(mCameraId)) { + gettimeofday(&mSofTimestamp, nullptr); + LOG2("%s, received SOF event sequence: %ld, timestamp: %ld", __func__, + eventData.data.sync.sequence, TIMEVAL2USECS(mSofTimestamp)); + mSofCondition.signal(); + } break; } default: @@ -438,6 +467,52 @@ void PSysProcessor::handleEvent(EventData eventData) { } } +// DOL_FEATURE_S +int PSysProcessor::setVbpToIspParam(int64_t sequence, timeval timestamp) { + // Check fixed VBP firstly. + int fixedVbp = PlatformData::getFixedVbp(mCameraId); + if (fixedVbp >= 0) { + AutoWMutex wl(mIspSettingsLock); + LOG2("%s: set fixed vbp %d", __func__, fixedVbp); + mIspSettings.vbp = fixedVbp; + return OK; + } + + // Check dynamic VBP. + ConditionLock lock(mMetaQueueLock); + + // Remove all older meta data + while (!mMetaQueue.empty() && mMetaQueue.front().sequence < sequence) { + LOG2("%s: remove older meta data for sequence %ld", __func__, mMetaQueue.front().sequence); + mMetaQueue.pop(); + } + + while (mMetaQueue.empty()) { + int ret = mMetaAvailableSignal.waitRelative(lock, kWaitDuration * SLOWLY_MULTIPLIER); + + if (!mThreadRunning) { + LOG2("@%s: Processor is not active while waiting for meta data.", __func__); + return UNKNOWN_ERROR; + } + + CheckAndLogError(ret == TIMED_OUT, ret, "@%s: dqbuf MetaQueue timed out", __func__); + } + + if (mMetaQueue.front().sequence == sequence) { + AutoWMutex l(mIspSettingsLock); + mIspSettings.vbp = mMetaQueue.front().vbp; + mMetaQueue.pop(); + LOG2("%s: found vbp %d for frame sequence %ld", __func__, mIspSettings.vbp, sequence); + return OK; + } + + LOGW("Missing meta data for seq %ld, timestamp %ld, Cur meta seq %ld, timestamp %ld", sequence, + TIMEVAL2USECS(timestamp), mMetaQueue.front().sequence, + TIMEVAL2USECS(mMetaQueue.front().timestamp)); + return UNKNOWN_ERROR; +} +// DOL_FEATURE_E + // PSysProcessor ThreadLoop int PSysProcessor::processNewFrame() { LOG2("@%s", mCameraId, __func__); @@ -449,8 +524,10 @@ int PSysProcessor::processNewFrame() { if (mScheduler) { { ConditionLock lock(mBufferQueueLock); - // Wait input buffer, use TRIGGER_MAX_MARGIN to ensure Scheduler is triggered in time - bool bufReady = waitBufferQueue(lock, mInputQueue, TRIGGER_MAX_MARGIN); + // Wait input buffer, use TRIGGER_MAX_MARGIN to ensure Scheduler is triggered in time. + // Reduce wait time for the first 10 frames for better performance. + int64_t delay = mSofSequence < 10 ? TRIGGER_MARGIN : TRIGGER_MAX_MARGIN; + bool bufReady = waitBufferQueue(lock, mInputQueue, delay); // Already stopped if (!mThreadRunning) return -1; @@ -569,6 +646,10 @@ void PSysProcessor::prepareIpuForNextFrame(int64_t sequence) { mSequencesInflight.find(sequence) == mSequencesInflight.end()) return; } + // HDR_FEATURE_S + if (mTuningMode == TUNING_MODE_VIDEO_HDR || mTuningMode == TUNING_MODE_VIDEO_HDR2) return; + // HDR_FEATURE_E + int32_t userRequestId = -1; // Check if next sequence is used or not if (mParameterGenerator && @@ -611,12 +692,9 @@ void PSysProcessor::handleRawReprocessing(CameraBufferPortMap* srcBuffers, return; } - Parameters params; + raw_data_output_t rawDataOutput = CAMERA_RAW_DATA_OUTPUT_OFF; if (mParameterGenerator && - mParameterGenerator->getParameters(inputSequence, ¶ms, true, false) == OK) { - raw_data_output_t rawDataOutput = CAMERA_RAW_DATA_OUTPUT_OFF; - params.getRawDataOutput(rawDataOutput); - + mParameterGenerator->getRawOutputMode(inputSequence, rawDataOutput) == OK) { if (rawDataOutput == CAMERA_RAW_DATA_OUTPUT_ON) { uint32_t srcBufferSize = mainBuf->getBufferSize(); @@ -656,7 +734,7 @@ void PSysProcessor::handleRawReprocessing(CameraBufferPortMap* srcBuffers, sendPsysRequestEvent(dstBuffers, settingSequence, timestamp, EVENT_PSYS_REQUEST_BUF_READY); // only one video buffer is supported - if (PlatformData::isGpuTnrEnabled() && videoBuf.size() == 1) { + if (PlatformData::isGpuTnrEnabled(mCameraId) && videoBuf.size() == 1) { shared_ptr buf = videoBuf.begin()->second; bool handled = mPSysDAGs[mCurConfigMode]->fetchTnrOutBuffer(settingSequence, buf); if (handled) { @@ -785,6 +863,25 @@ status_t PSysProcessor::prepareTask(CameraBufferPortMap* srcBuffers, uint64_t timestamp = TIMEVAL2NSECS(mainBuf->getTimestamp()); LOG2("%s: input buffer sequence %ld timestamp %ld", __func__, inputSequence, timestamp); + // DOL_FEATURE_S + if (PlatformData::needSetVbp(mCameraId, mCurConfigMode)) { + int vbpStatus = setVbpToIspParam(inputSequence, mainBuf->getTimestamp()); + + // Skip input frame and return buffer if no matching vbp set to ISP params + if (vbpStatus != OK) { + AutoMutex l(mBufferQueueLock); + for (auto& input : mInputQueue) { + input.second.pop(); + } + + for (const auto& item : *srcBuffers) { + mBufferProducer->qbuf(item.first, item.second); + } + return OK; + } + } + // DOL_FEATURE_E + // Output raw image if (mRawPort != INVALID_PORT) { shared_ptr dstBuf = nullptr; @@ -832,7 +929,7 @@ status_t PSysProcessor::prepareTask(CameraBufferPortMap* srcBuffers, sendPsysRequestEvent(dstBuffers, settingSequence, timestamp, EVENT_PSYS_REQUEST_BUF_READY); } - if (PlatformData::isGpuTnrEnabled()) { + if (PlatformData::isGpuTnrEnabled(mCameraId)) { handleStillPipeForTnr(inputSequence, dstBuffers); } @@ -954,9 +1051,28 @@ void PSysProcessor::dispatchTask(CameraBufferPortMap& inBuf, CameraBufferPortMap // Handle per-frame settings if output buffer requires if (settingSequence > -1 && mParameterGenerator) { Parameters params; - if (mParameterGenerator->getParameters(currentSequence, ¶ms, true, false) == OK) { + if (mParameterGenerator->getIspParameters(currentSequence, ¶ms) == OK) { setParameters(params); + // Apply HAL tuning parameters + float hdrRatio = 0; + EdgeNrSetting edgeNrSetting; + CLEAR(edgeNrSetting); + + int ret = params.getHdrRatio(hdrRatio); + if (ret == OK) { + auto* res = AiqResultStorage::getInstance(mCameraId)->getAiqResult(currentSequence); + if (res != nullptr) { + auto exposure = res->mAeResults.exposures[0].exposure[0]; + float totalGain = exposure.analog_gain * exposure.digital_gain; + PlatformData::getEdgeNrSetting(mCameraId, totalGain, hdrRatio, edgeNrSetting); + mIspSettings.eeSetting.strength += edgeNrSetting.edgeStrength; + mIspSettings.nrSetting.strength += edgeNrSetting.nrStrength; + LOG2("edgeStrength %d, nrStrength %d", edgeNrSetting.edgeStrength, + edgeNrSetting.nrStrength); + } + } + bool hasStill = false; for (const auto& item : outBuf) { if (item.second && item.second->getStreamUsage() == CAMERA_STREAM_STILL_CAPTURE) { @@ -992,9 +1108,6 @@ void PSysProcessor::registerListener(EventType eventType, EventListener* eventLi // Only delegate stats event registration to deeper layer DAG and PipeExecutor if ((eventType != EVENT_PSYS_STATS_BUF_READY) && (eventType != EVENT_PSYS_STATS_SIS_BUF_READY) - // INTEL_DVS_S - && eventType != EVENT_DVS_READY - // INTEL_DVS_E ) { BufferQueue::registerListener(eventType, eventListener); return; @@ -1132,6 +1245,22 @@ void PSysProcessor::onStatsDone(int64_t sequence, const CameraBufferPortMap& out sendPsysRequestEvent(&outBuf, sequence, 0, EVENT_REQUEST_METADATA_READY); } +// INTEL_DVS_S +void PSysProcessor::onDvsPrepare(int64_t sequence, int32_t streamId) { + LOG2("%s stream Id %d", __func__, streamId); + + camera_zoom_region_t region; + if (mParameterGenerator && mParameterGenerator->getZoomRegion(sequence, region) == OK) { + EventData eventData; + eventData.type = EVENT_DVS_READY; + eventData.data.dvsRunReady.streamId = streamId; + eventData.data.dvsRunReady.sequence = sequence; + eventData.data.dvsRunReady.region = region; + notifyListeners(eventData); + } +} +// INTEL_DVS_E + void PSysProcessor::outputRawImage(shared_ptr& srcBuf, shared_ptr& dstBuf) { if ((srcBuf == nullptr) || (dstBuf == nullptr)) { @@ -1140,24 +1269,15 @@ void PSysProcessor::outputRawImage(shared_ptr& srcBuf, // Copy from source buffer int srcBufferSize = srcBuf->getBufferSize(); - int srcMemoryType = srcBuf->getMemory(); - void* pSrcBuf = (srcMemoryType == V4L2_MEMORY_DMABUF) ? - srcBuf->mapDmaBufferAddr() : srcBuf->getBufferAddr(); + ScopeMapping mapperSrc(srcBuf); + void* pSrcBuf = mapperSrc.getUserPtr(); int dstBufferSize = dstBuf->getBufferSize(); - int dstMemoryType = dstBuf->getMemory(); - void* pDstBuf = (dstMemoryType == V4L2_MEMORY_DMABUF) ? - dstBuf->mapDmaBufferAddr() : dstBuf->getBufferAddr(); + ScopeMapping mapperDst(dstBuf); + void* pDstBuf = mapperDst.getUserPtr(); MEMCPY_S(pDstBuf, dstBufferSize, pSrcBuf, srcBufferSize); - if (srcMemoryType == V4L2_MEMORY_DMABUF) { - srcBuf->unmapDmaBufferAddr(pSrcBuf); - } - if (dstMemoryType == V4L2_MEMORY_DMABUF) { - dstBuf->unmapDmaBufferAddr(pDstBuf); - } - // Send output buffer to its consumer for (auto& it : mBufferConsumerList) { it->onFrameAvailable(mRawPort, dstBuf); diff --git a/src/core/PSysProcessor.h b/src/core/PSysProcessor.h index f8ff7107..595485b8 100644 --- a/src/core/PSysProcessor.h +++ b/src/core/PSysProcessor.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2022 Intel Corporation. + * Copyright (C) 2017-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,6 +60,9 @@ class PSysProcessor : public BufferQueue, public PSysDagCallback { void onFrameDone(const PSysTaskData& result); void onBufferDone(int64_t sequence, Port port, const std::shared_ptr& camBuffer); void onStatsDone(int64_t sequence, const CameraBufferPortMap& outBuf); +// INTEL_DVS_S + void onDvsPrepare(int64_t sequence, int32_t streamId); +// INTEL_DVS_E private: DISALLOW_COPY_AND_ASSIGN(PSysProcessor); @@ -74,6 +77,9 @@ class PSysProcessor : public BufferQueue, public PSysDagCallback { bool fakeTask = false, bool callbackRgbs = false); void handleEvent(EventData eventData); + // DOL_FEATURE_S + int setVbpToIspParam(int64_t sequence, timeval timestamp); + // DOL_FEATURE_E int64_t getSettingSequence(const CameraBufferPortMap& outBuf); bool needSkipOutputFrame(int64_t sequence); diff --git a/src/core/RequestThread.cpp b/src/core/RequestThread.cpp index 2c12859d..07fd212a 100644 --- a/src/core/RequestThread.cpp +++ b/src/core/RequestThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,19 +41,21 @@ RequestThread::RequestThread(int cameraId, AiqUnitBase* a3AControl, ParameterGen mLastAppliedSeq(-1), mLastSofSeq(-1), mBlockRequest(true), - mSofEnabled(false) { + mSofEnabled(false), + mWaitFrameDurationOverride(0) { CLEAR(mFakeReqBuf); mPerframeControlSupport = PlatformData::isFeatureSupported(mCameraId, PER_FRAME_CONTROL); mSofEnabled = PlatformData::isIsysEnabled(cameraId); + // FILE_SOURCE_S + mSofEnabled = mSofEnabled || PlatformData::isFileSourceEnabled(); + // FILE_SOURCE_E + mWaitFrameDurationOverride = PlatformData::getReqWaitTimeout(cameraId); + LOG1("%s: Set mWaitFrameDurationOverride: %lld", __func__, mWaitFrameDurationOverride); } -RequestThread::~RequestThread() { - while (!mReqParamsPool.empty()) { - mReqParamsPool.pop(); - } -} +RequestThread::~RequestThread() {} void RequestThread::requestExit() { clearRequests(); @@ -167,7 +169,7 @@ int RequestThread::processRequest(int bufferNum, camera_buffer_t** ubuffer, mBlockRequest = false; } - request.mParams = copyRequestParams(params); + request.mRequestParam = copyRequestParams(params); mPendingRequests.push_back(request); if (!mActive) { @@ -179,19 +181,13 @@ int RequestThread::processRequest(int bufferNum, camera_buffer_t** ubuffer, return OK; } -shared_ptr RequestThread::copyRequestParams(const Parameters* srcParams) { +shared_ptr RequestThread::copyRequestParams(const Parameters* srcParams) { if (srcParams == nullptr) return nullptr; - if (mReqParamsPool.empty()) { - shared_ptr sParams = std::make_shared(); - CheckAndLogError(!sParams, nullptr, "%s: no memory!", __func__); - mReqParamsPool.push(sParams); - } + std::shared_ptr requestParam = mParamGenerator->getRequestParamBuf(); - shared_ptr sParams = mReqParamsPool.front(); - mReqParamsPool.pop(); - *sParams = *srcParams; - return sParams; + requestParam->param = *srcParams; + return requestParam; } int RequestThread::waitFrame(int streamId, camera_buffer_t** ubuffer) { @@ -201,7 +197,8 @@ int RequestThread::waitFrame(int streamId, camera_buffer_t** ubuffer) { if (!mActive) return NO_INIT; while (frameQueue.mFrameQueue.empty()) { int ret = frameQueue.mFrameAvailableSignal.waitRelative( - lock, kWaitFrameDuration * SLOWLY_MULTIPLIER); + lock, (mWaitFrameDurationOverride > 0) ? mWaitFrameDurationOverride : + (kWaitFrameDuration * SLOWLY_MULTIPLIER)); if (!mActive) return NO_INIT; CheckWarning(ret == TIMED_OUT, ret, "@%s, time out happens, wait recovery", mCameraId, @@ -327,9 +324,11 @@ bool RequestThread::threadLoop() { if (blockRequest()) { int ret = mRequestSignal.waitRelative(lock, kWaitDuration * SLOWLY_MULTIPLIER); - CheckWarning(ret == TIMED_OUT, true, - "wait event time out, %d requests processing, %zu requests in HAL", - mRequestsInProcessing, mPendingRequests.size()); + if (ret == TIMED_OUT) { + LOG2("wait event time out, %d requests processing, %zu requests in HAL", + mRequestsInProcessing, mPendingRequests.size()); + return true; + } if (blockRequest()) { LOG2("Pending request processing, mBlockRequest %d, Req in processing %d", @@ -389,8 +388,8 @@ void RequestThread::handleRequest(CameraRequest& request, int64_t applyingSeq) { // Raw reprocessing case, don't run 3A. if (request.mBuffer[0]->sequence >= 0 && request.mBuffer[0]->timestamp > 0) { effectSeq = request.mBuffer[0]->sequence; - if (request.mParams.get()) { - mParamGenerator->updateParameters(effectSeq, request.mParams.get()); + if (request.mRequestParam) { + mParamGenerator->updateParameters(effectSeq, &request.mRequestParam->param); } LOG2("%s: Reprocess request: seq %ld, out buffer %d", __func__, effectSeq, request.mBufferNum); @@ -400,8 +399,8 @@ void RequestThread::handleRequest(CameraRequest& request, int64_t applyingSeq) { AutoMutex l(mPendingReqLock); if (mActive) { requestId = ++mLastRequestId; - if (request.mParams.get()) { - m3AControl->setParameters(*request.mParams); + if (request.mRequestParam) { + m3AControl->setParameters(request.mRequestParam->param); } } } @@ -412,24 +411,18 @@ void RequestThread::handleRequest(CameraRequest& request, int64_t applyingSeq) { { AutoMutex l(mPendingReqLock); - if (!mActive) { - // Recycle params buffer for re-using - if (request.mParams) { - mReqParamsPool.push(request.mParams); - } - return; - } + if (!mActive) return; // Check the final prediction value from 3A if (effectSeq <= mLastEffectSeq) { LOG2("predict effectSeq %ld, last effect %ld", effectSeq, mLastEffectSeq); } - mParamGenerator->saveParameters(effectSeq, mLastRequestId, request.mParams.get()); + mParamGenerator->saveParameters(effectSeq, mLastRequestId, request.mRequestParam); mLastEffectSeq = effectSeq; LOG2("%s: Process request: %ld:%ld, out buffer %d, param? %s", __func__, mLastRequestId, - effectSeq, request.mBufferNum, request.mParams.get() ? "true" : "false"); + effectSeq, request.mBufferNum, request.mRequestParam.get() ? "true" : "false"); } } @@ -437,19 +430,17 @@ void RequestThread::handleRequest(CameraRequest& request, int64_t applyingSeq) { EventRequestData requestData; requestData.bufferNum = request.mBufferNum; requestData.buffer = request.mBuffer; - requestData.param = request.mParams.get(); + camera_test_pattern_mode_t testPatternMode = TEST_PATTERN_OFF; + if (request.mRequestParam) { + request.mRequestParam->param.getTestPatternMode(testPatternMode); + } + requestData.testPatternMode = testPatternMode; requestData.settingSeq = effectSeq; EventData eventData; eventData.type = EVENT_PROCESS_REQUEST; eventData.data.request = requestData; notifyListeners(eventData); - // Recycle params buffer for re-using - if (request.mParams) { - AutoMutex l(mPendingReqLock); - mReqParamsPool.push(request.mParams); - } - { AutoMutex l(mFirstRequestLock); if (mFirstRequest) { diff --git a/src/core/RequestThread.h b/src/core/RequestThread.h index ca27780a..466415a4 100644 --- a/src/core/RequestThread.h +++ b/src/core/RequestThread.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2020 Intel Corporation. + * Copyright (C) 2016-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,14 +77,14 @@ class RequestThread : public Thread, public EventSource, public EventListener { std::shared_ptr mFakeBuffer; struct CameraRequest { - CameraRequest() : mBufferNum(0), mParams(nullptr) { CLEAR(mBuffer); } + CameraRequest() : mBufferNum(0), mRequestParam(nullptr) { CLEAR(mBuffer); } int mBufferNum; camera_buffer_t* mBuffer[MAX_STREAM_NUMBER]; - std::shared_ptr mParams; + std::shared_ptr mRequestParam; }; - std::shared_ptr copyRequestParams(const Parameters* params); + std::shared_ptr copyRequestParams(const Parameters* params); /** * \Fetch one request from pending request Q for processing. @@ -104,7 +104,6 @@ class RequestThread : public Thread, public EventSource, public EventListener { Mutex mPendingReqLock; Condition mRequestSignal; std::deque mPendingRequests; - std::queue > mReqParamsPool; int mRequestsInProcessing; // Guard for the first request. @@ -136,6 +135,7 @@ class RequestThread : public Thread, public EventSource, public EventListener { bool mBlockRequest; // Process the 2nd or 3th request after the 1st 3A event // to avoid unstable AWB at the beginning of stream on bool mSofEnabled; + int64_t mWaitFrameDurationOverride; }; } // namespace icamera diff --git a/src/core/SensorHwCtrl.cpp b/src/core/SensorHwCtrl.cpp index 3e4e35a1..2ebf9cf4 100644 --- a/src/core/SensorHwCtrl.cpp +++ b/src/core/SensorHwCtrl.cpp @@ -19,6 +19,9 @@ #include #include #include +// CRL_MODULE_S +#include +// CRL_MODULE_E #include "PlatformData.h" #include "SensorHwCtrl.h" @@ -32,14 +35,35 @@ namespace icamera { SensorHwCtrl::SensorHwCtrl(int cameraId, V4L2Subdevice* pixelArraySubdev, V4L2Subdevice* sensorOutputSubdev) : mPixelArraySubdev(pixelArraySubdev), + // CRL_MODULE_S + mSensorOutputSubdev(sensorOutputSubdev), + // CRL_MODULE_E mCameraId(cameraId), mHorzBlank(0), mVertBlank(0), mCropWidth(0), mCropHeight(0), + // HDR_FEATURE_S + mWdrMode(0), + // HDR_FEATURE_E mCurFll(0), mCalculatingFrameDuration(true) { LOG1(" @%s", mCameraId, __func__); + // CRL_MODULE_S + /** + * Try to call V4L2_CID_LINE_LENGTH_PIXELS, if failed, it means llp can't + * be read directly from sensor. Then calculate it with HBlank. + * fll will be in the same case. + */ + if (mPixelArraySubdev) { + int llp = 0; + int status = mPixelArraySubdev->GetControl(V4L2_CID_LINE_LENGTH_PIXELS, &llp); + if (status == OK) { + LOG1("%s, some sensors can get llp directly, don't calculate it", __func__); + mCalculatingFrameDuration = false; + } + } + // CRL_MODULE_E } SensorHwCtrl* SensorHwCtrl::createSensorCtrl(int cameraId) { @@ -82,6 +106,20 @@ SensorHwCtrl* SensorHwCtrl::createSensorCtrl(int cameraId) { return sensorCtrl; } +// CRL_MODULE_S +int SensorHwCtrl::configure() { + // DOL_FEATURE_S + int rhs1 = PlatformData::getFixedVbp(mCameraId); // VBP is rhs1 register value + if (rhs1 >= 0) { // Fixed VBP enabled + LOG1("%s: set fixed VBP %d", __func__, rhs1); + int status = mPixelArraySubdev->SetControl(CRL_CID_EXPOSURE_RHS1, rhs1); + CheckAndLogError(status != OK, status, "%s failed to o set exposure RHS1.", __func__); + } + // DOL_FEATURE_E + return OK; +} +// CRL_MODULE_E + int SensorHwCtrl::getActivePixelArraySize(int& width, int& height, int& pixelCode) { HAL_TRACE_CALL(CAMERA_DEBUG_LOG_LEVEL2); CheckAndLogError(!mPixelArraySubdev, NO_INIT, "pixel array sub device is not set"); @@ -120,16 +158,198 @@ int SensorHwCtrl::setExposure(const vector& coarseExposures, CheckAndLogError((coarseExposures.empty() || fineExposures.empty()), BAD_VALUE, "No exposure data!"); + // CRL_MODULE_S + if (coarseExposures.size() > 1) { + // DOL_FEATURE_S + if (PlatformData::getSensorExposureType(mCameraId) == SENSOR_RELATIVE_MULTI_EXPOSURES) { + return setShutterAndReadoutTiming(coarseExposures, fineExposures); + } + // DOL_FEATURE_E + if (PlatformData::getSensorExposureType(mCameraId) == SENSOR_MULTI_EXPOSURES) { + return setMultiExposures(coarseExposures, fineExposures); + } else if (PlatformData::getSensorExposureType(mCameraId) == + SENSOR_DUAL_EXPOSURES_DCG_AND_VS) { + return setDualExposuresDCGAndVS(coarseExposures, fineExposures); + } + } + // CRL_MODULE_E + LOG2("%s coarseExposure=%d fineExposure=%d", __func__, coarseExposures[0], fineExposures[0]); LOG2("SENSORCTRLINFO: exposure_value=%d", coarseExposures[0]); return mPixelArraySubdev->SetControl(V4L2_CID_EXPOSURE, coarseExposures[0]); } +// CRL_MODULE_S +int SensorHwCtrl::setMultiExposures(const vector& coarseExposures, + const vector& fineExposures) { + int status = BAD_VALUE; + int shortExp = coarseExposures[0]; + int longExp = coarseExposures[1]; + + if (coarseExposures.size() > 2) { + LOG2("coarseExposure[0]=%d fineExposure[0]=%d", coarseExposures[0], fineExposures[0]); + // The first exposure is very short exposure if larger than 2 exposures. + status = mPixelArraySubdev->SetControl(CRL_CID_EXPOSURE_SHS2, coarseExposures[0]); + CheckAndLogError(status != OK, status, "failed to set exposure SHS2 %d.", + coarseExposures[0]); + + shortExp = coarseExposures[1]; + longExp = coarseExposures[2]; + + LOG2("SENSORCTRLINFO: exposure_long=%d", coarseExposures[2]); // long + LOG2("SENSORCTRLINFO: exposure_med=%d", coarseExposures[1]); // short + LOG2("SENSORCTRLINFO: exposure_short=%d", coarseExposures[0]); // very short + } + + LOG2("shortExp=%d longExp=%d", shortExp, longExp); + status = mPixelArraySubdev->SetControl(CRL_CID_EXPOSURE_SHS1, shortExp); + CheckAndLogError(status != OK, status, "failed to set exposure SHS1 %d.", shortExp); + + status = mPixelArraySubdev->SetControl(V4L2_CID_EXPOSURE, longExp); + CheckAndLogError(status != OK, status, "failed to set long exposure %d.", longExp); + LOG2("SENSORCTRLINFO: exposure_value=%d", longExp); + + return status; +} + +int SensorHwCtrl::setDualExposuresDCGAndVS(const vector& coarseExposures, + const vector& fineExposures) { + int status = BAD_VALUE; + int longExp = coarseExposures[1]; + + if (coarseExposures.size() > 2) { + LOG2("coarseExposure[0]=%d fineExposure[0]=%d", coarseExposures[0], fineExposures[0]); + // The first exposure is very short exposure for DCG + VS case. + status = mPixelArraySubdev->SetControl(CRL_CID_EXPOSURE_SHS1, coarseExposures[0]); + CheckAndLogError(status != OK, status, "failed to set exposure SHS1 %d.", + coarseExposures[0]); + + longExp = coarseExposures[2]; + LOG2("SENSORCTRLINFO: exposure_long=%d", coarseExposures[2]); // long + } + + status = mPixelArraySubdev->SetControl(V4L2_CID_EXPOSURE, longExp); + CheckAndLogError(status != OK, status, "failed to set long exposure %d.", longExp); + LOG2("SENSORCTRLINFO: exposure_value=%d", longExp); + + return status; +} + +// DOL_FEATURE_S +int SensorHwCtrl::setShutterAndReadoutTiming(const vector& coarseExposures, + const vector& fineExposures) { + // DOL sensor exposure setting + CheckAndLogError(!mSensorOutputSubdev, NO_INIT, "sensor output sub device is not set"); + + int width, height = 0; + int pixelCode = 0; + int status = mSensorOutputSubdev->GetPadFormat(SENSOR_OUTPUT_PAD, &width, &height, &pixelCode); + CheckAndLogError(status != OK, status, "%s failed to get sensor output resolution.", __func__); + LOG2("%s Sensor output width=%d height=%d", __func__, width, height); + + vector ExpRanges = PlatformData::getMultiExpRanges(mCameraId); + for (auto range : ExpRanges) { + if (range.Resolution.width == width && range.Resolution.height == height) { + int shs1, rhs1, shs2 = 0; + + if (coarseExposures.size() > 2) { + // LEF(coarseExposures[2]) = SHS3.max + SHS3.upperBound - SHS3 - OFFSET + int shs3 = range.SHS3.max + range.SHS3.upperBound - coarseExposures[2] - 1; + // SHS3 range [RHS2 + RHS2.upperBound ~ SHS3.max] + CheckWarning((shs3 < range.SHS3.min || shs3 > range.SHS3.max), NO_INIT, + "%s : SHS3 not match %d [%d ~ %d]", __func__, shs3, range.SHS3.min, + range.SHS3.max); + status = mPixelArraySubdev->SetControl(CRL_CID_EXPOSURE_SHS3, shs3); + CheckAndLogError(status != OK, status, "%s failed to set exposure SHS3.", __func__); + + // RHS2 range [SHS2 + upperBound ~ SHS3 - lowerBound] and should = min + n * step + int rhs2 = shs3 - range.RHS2.upperBound - + ((shs3 - range.RHS2.upperBound) % range.RHS2.step); + CheckWarning((rhs2 < range.RHS2.min || rhs2 > range.RHS2.max), NO_INIT, + "%s : RHS2 not match %d [%d ~ %d]", __func__, rhs2, range.RHS2.min, + range.RHS2.max); + status = mPixelArraySubdev->SetControl(CRL_CID_EXPOSURE_RHS2, rhs2); + CheckAndLogError(status != OK, status, "%s failed to set exposure RHS2.", __func__); + + // SEF2(coarseExposures[1]) = RHS2 - SHS2 - OFFSET + shs2 = rhs2 - coarseExposures[1] - 1; + } else { + // LEF(coarseExposures[2]) = FLL + SHS2.upperBound - SHS2 - OFFSET + shs2 = mCurFll + range.SHS2.upperBound - coarseExposures[1] - 1; + } + + // SHS2 range [RHS1 + RHS1.upperBound ~ SHS2.max] + CheckWarningNoReturn(shs2 < range.SHS2.min || shs2 > std::max(range.SHS2.max, mCurFll), + "%s : SHS2 not match %d [%d ~ %d]", __func__, shs2, range.SHS2.min, + std::max(range.SHS2.max, mCurFll)); + shs2 = CLIP(shs2, std::max(range.SHS2.max, mCurFll), range.SHS2.min); + status = mPixelArraySubdev->SetControl(CRL_CID_EXPOSURE_SHS2, shs2); + CheckAndLogError(status != OK, status, "%s failed to set exposure SHS2.", __func__); + + // RHS1 range [SHS1 + upperBound ~ SHS2 - lowerBound] and should = min + n * step + rhs1 = + shs2 - range.RHS1.upperBound - ((shs2 - range.RHS1.upperBound) % range.RHS1.step); + + // Set RHS1(VBP) when fixed VBP is not enabled + int fixedVbp = PlatformData::getFixedVbp(mCameraId); + if (fixedVbp < 0) { + CheckWarningNoReturn((rhs1 < range.RHS1.min || rhs1 > range.RHS1.max), + "%s : RHS1 not match %d [%d ~ %d]", __func__, rhs1, + range.RHS1.min, range.RHS1.max); + rhs1 = CLIP(rhs1, range.RHS1.max, range.RHS1.min); + // Set RHS1 if not using fixed VBP + LOG2("%s: set dynamic VBP %d", __func__, rhs1); + status = mPixelArraySubdev->SetControl(CRL_CID_EXPOSURE_RHS1, rhs1); + CheckAndLogError(status != OK, status, "%s failed to set exposure RHS1.", __func__); + } else { + // Use fixed VBP for RHS1 value + LOG2("%s: calculated RHS1 vs. fixed VBP [%d vs. %d], use fixed VBP for RHS1 value", + __func__, rhs1, fixedVbp); + rhs1 = fixedVbp; + CheckWarning((rhs1 < range.RHS1.min || rhs1 > range.RHS1.max), NO_INIT, + "%s : RHS1 not match %d [%d ~ %d]", __func__, rhs1, range.RHS1.min, + range.RHS1.max); + CheckWarning(((shs2 - range.RHS1.upperBound) % range.RHS1.step != 0), NO_INIT, + "%s: fixed VBP(RHS1) do not devided by RHS1 step", __func__); + } + + // SEF1(coarseExposures[0]) = RHS1 - SHS1 - OFFSET + shs1 = rhs1 - coarseExposures[0] - 1; + // SHS1 range [min ~ max] + CheckWarningNoReturn((shs1 < range.SHS1.min || shs1 > range.SHS1.max), + "%s : SHS1 not match %d [%d ~ %d]", __func__, shs1, range.SHS1.min, + range.SHS1.max); + shs1 = CLIP(shs1, range.SHS1.max, range.SHS1.min); + status = mPixelArraySubdev->SetControl(CRL_CID_EXPOSURE_SHS1, shs1); + CheckAndLogError(status != OK, status, "%s failed to set exposure SHS1.", __func__); + + LOG2("%s: set exposures done.", __func__); + return status; + } + } + + LOGE("%s No matching resolution for exposure range", __func__); + return NO_INIT; +} +// DOL_FEATURE_E +// CRL_MODULE_E + int SensorHwCtrl::setAnalogGains(const vector& analogGains) { HAL_TRACE_CALL(CAMERA_DEBUG_LOG_LEVEL2); CheckAndLogError(!mPixelArraySubdev, NO_INIT, "pixel array sub device is not set"); CheckAndLogError(analogGains.empty(), BAD_VALUE, "No analog gain data!"); + // CRL_MODULE_S + if (analogGains.size() > 1) { + if (PlatformData::getSensorGainType(mCameraId) == SENSOR_MULTI_DG_AND_CONVERTION_AG) { + return setConversionGain(analogGains); + } else if (PlatformData::getSensorGainType(mCameraId) == SENSOR_MULTI_DG_AND_DIRECT_AG) { + LOG2("sensor multi conversion gain"); + return setMultiAnalogGain(analogGains); + } + } + // CRL_MODULE_E + LOG2("%s analogGain=%d", __func__, analogGains[0]); int status = mPixelArraySubdev->SetControl(V4L2_CID_ANALOGUE_GAIN, analogGains[0]); CheckAndLogError(status != OK, status, "failed to set analog gain %d.", analogGains[0]); @@ -149,10 +369,101 @@ int SensorHwCtrl::setDigitalGains(const vector& digitalGains) { CheckAndLogError(!mPixelArraySubdev, NO_INIT, "pixel array sub device is not set"); CheckAndLogError(digitalGains.empty(), BAD_VALUE, "No digital gain data!"); + // CRL_MODULE_S + if (digitalGains.size() > 1) { + if (PlatformData::getSensorGainType(mCameraId) == SENSOR_MULTI_DG_AND_CONVERTION_AG) { + return setMultiDigitalGain(digitalGains); + } else if (PlatformData::getSensorGainType(mCameraId) == SENSOR_MULTI_DG_AND_DIRECT_AG) { + LOG2("sensor multi conversion gain"); + return setMultiDigitalGain(digitalGains); + } + } + + if (mWdrMode && PlatformData::getSensorGainType(mCameraId) == ISP_DG_AND_SENSOR_DIRECT_AG) { + LOG2("%s: WDR mode, skip sensor DG, all digital gain is passed to ISP", __func__); + } else if (PlatformData::isUsingSensorDigitalGain(mCameraId)) { + if (mPixelArraySubdev->SetControl(V4L2_CID_GAIN, digitalGains[0]) != OK) { + LOGW("set digital gain failed"); + } + } + // CRL_MODULE_E + LOG2("%s digitalGain=%d", __func__, digitalGains[0]); return mPixelArraySubdev->SetControl(V4L2_CID_DIGITAL_GAIN, digitalGains[0]); } +// CRL_MODULE_S +int SensorHwCtrl::setMultiDigitalGain(const vector& digitalGains) { + int status = BAD_VALUE; + int shortDg = digitalGains[0]; + int longDg = digitalGains[1]; + + if (digitalGains.size() > 2) { + LOG2("digitalGains[0]=%d", digitalGains[0]); + status = mPixelArraySubdev->SetControl(CRL_CID_DIGITAL_GAIN_VS, digitalGains[0]); + CheckAndLogError(status != OK, status, "failed to set very short DG %d.", digitalGains[0]); + + shortDg = digitalGains[1]; + longDg = digitalGains[2]; + } + + LOG2("shortDg=%d longDg=%d", shortDg, longDg); + status = mPixelArraySubdev->SetControl(CRL_CID_DIGITAL_GAIN_S, shortDg); + CheckAndLogError(status != OK, status, "failed to set short DG %d.", shortDg); + + status = mPixelArraySubdev->SetControl(V4L2_CID_GAIN, longDg); + CheckAndLogError(status != OK, status, "failed to set long DG %d.", longDg); + + return status; +} + +int SensorHwCtrl::setMultiAnalogGain(const vector& analogGains) { + int status = BAD_VALUE; + int shortAg = analogGains[0]; + int longAg = analogGains[1]; + + if (analogGains.size() > 2) { + LOG2("VS AG %d", analogGains[0]); + int status = mPixelArraySubdev->SetControl(CRL_CID_ANALOG_GAIN_VS, analogGains[0]); + CheckAndLogError(status != OK, status, "failed to set VS AG %d", analogGains[0]); + + shortAg = analogGains[1]; + longAg = analogGains[2]; + + LOG2("SENSORCTRLINFO: gain_long=%d", analogGains[2]); // long + LOG2("SENSORCTRLINFO: gain_med=%d", analogGains[1]); // short + LOG2("SENSORCTRLINFO: gain_short=%d", analogGains[0]); // very short + } + + LOG2("shortAg=%d longAg=%d", shortAg, longAg); + status = mPixelArraySubdev->SetControl(CRL_CID_ANALOG_GAIN_S, shortAg); + CheckAndLogError(status != OK, status, "failed to set short AG %d.", shortAg); + + status = mPixelArraySubdev->SetControl(V4L2_CID_ANALOGUE_GAIN, longAg); + CheckAndLogError(status != OK, status, "failed to set long AG %d.", longAg); + + return status; +} + +int SensorHwCtrl::setConversionGain(const vector& analogGains) { + CheckAndLogError(analogGains.size() < 2, BAD_VALUE, "Gain data error!"); + + /* [0, 1] bits are long AG, [2, 3] bits are short AG, [4, 5] bits are very short AG. + [6] bit is long conversion gain, [7] bit is very short conversion gain. + Long AG: 0x0X0000XX + Short AG: 0x0000XX00 + Very Short AG: 0xX0XX0000 */ + int value = analogGains[0] | analogGains[1] | analogGains[2]; + LOG2("very short AG %d, short AG %d, long AG %d, conversion value %d", analogGains[0], + analogGains[1], analogGains[2], value); + + int status = mPixelArraySubdev->SetControl(V4L2_CID_ANALOGUE_GAIN, value); + CheckAndLogError(status != OK, status, "failed to set AG %d", value); + + return OK; +} +// CRL_MODULE_E + int SensorHwCtrl::setLineLengthPixels(int llp) { int status = OK; LOG2("@%s, llp:%d", __func__, llp); @@ -162,6 +473,10 @@ int SensorHwCtrl::setLineLengthPixels(int llp) { if (mHorzBlank != horzBlank) { status = mPixelArraySubdev->SetControl(V4L2_CID_HBLANK, horzBlank); } + // CRL_MODULE_S + } else { + status = mPixelArraySubdev->SetControl(V4L2_CID_LINE_LENGTH_PIXELS, llp); + // CRL_MODULE_E } CheckAndLogError(status != OK, status, "failed to set llp."); @@ -179,6 +494,10 @@ int SensorHwCtrl::setFrameLengthLines(int fll) { if (mVertBlank != vertBlank) { status = mPixelArraySubdev->SetControl(V4L2_CID_VBLANK, vertBlank); } + // CRL_MODULE_S + } else { + status = mPixelArraySubdev->SetControl(V4L2_CID_FRAME_LENGTH_LINES, fll); + // CRL_MODULE_E } mCurFll = fll; @@ -218,6 +537,13 @@ int SensorHwCtrl::getLineLengthPixels(int& llp) { mHorzBlank = horzBlank; llp = horzBlank + mCropWidth; } + // CRL_MODULE_S + } else { + status = mPixelArraySubdev->GetControl(V4L2_CID_LINE_LENGTH_PIXELS, &llp); + if (status == OK) { + mHorzBlank = llp - mCropWidth; + } + // CRL_MODULE_E } LOG2("@%s, llp:%d", __func__, llp); @@ -236,6 +562,13 @@ int SensorHwCtrl::getFrameLengthLines(int& fll) { mVertBlank = vertBlank; fll = vertBlank + mCropHeight; } + // CRL_MODULE_S + } else { + status = mPixelArraySubdev->GetControl(V4L2_CID_FRAME_LENGTH_LINES, &fll); + if (status == OK) { + mVertBlank = fll - mCropHeight; + } + // CRL_MODULE_E } LOG2("@%s, fll:%d", __func__, fll); @@ -292,4 +625,70 @@ int SensorHwCtrl::getExposureRange(int& exposureMin, int& exposureMax, int& expo return status; } +// HDR_FEATURE_S +int SensorHwCtrl::setWdrMode(int mode) { + HAL_TRACE_CALL(CAMERA_DEBUG_LOG_LEVEL2); + CheckAndLogError(!mSensorOutputSubdev, NO_INIT, "sensor output sub device is not set"); + + LOG2("%s WDR Mode=%d", __func__, mode); + int ret = OK; + + mWdrMode = mode; + + if (PlatformData::getSensorExposureType(mCameraId) != SENSOR_RELATIVE_MULTI_EXPOSURES && + PlatformData::getSensorExposureType(mCameraId) != SENSOR_DUAL_EXPOSURES_DCG_AND_VS) { + LOG2("%s: set WDR mode", __func__); + ret = mSensorOutputSubdev->SetControl(V4L2_CID_WDR_MODE, mode); + } + + return ret; +} + +int SensorHwCtrl::setAWB(float r_per_g, float b_per_g) { + HAL_TRACE_CALL(CAMERA_DEBUG_LOG_LEVEL2); + CheckAndLogError(!mPixelArraySubdev, NO_INIT, "pixel array sub device is not set"); + + LOG2("%s set AWB r_per_g=%f, b_per_g=%f", __func__, r_per_g, b_per_g); + + int ret = mPixelArraySubdev->SetControl(V4L2_CID_RED_BALANCE, static_cast(r_per_g * 256)); + ret |= mPixelArraySubdev->SetControl(V4L2_CID_BLUE_BALANCE, static_cast(b_per_g * 256)); + + return ret; +} +// HDR_FEATURE_E + +// CRL_MODULE_S +int SensorHwCtrl::setFrameRate(float fps) { + HAL_TRACE_CALL(CAMERA_DEBUG_LOG_LEVEL2); + CheckAndLogError(!mSensorOutputSubdev, NO_INIT, "sensor output sub device is not set"); + + struct v4l2_queryctrl query; + CLEAR(query); + query.id = V4L2_CID_LINK_FREQ; + int status = mSensorOutputSubdev->QueryControl(&query); + CheckAndLogError(status != OK, status, "Couldn't get V4L2_CID_LINK_FREQ, status:%d", status); + + LOG2("@%s, query V4L2_CID_LINK_FREQ:, default_value:%d, maximum:%d, minimum:%d, step:%d", + __func__, query.default_value, query.maximum, query.minimum, query.step); + + int mode = 0; + if (query.maximum == query.minimum) { + mode = query.default_value; + } else { + /*********************************************************************************** + * WA: This heavily depends on sensor driver implementation, need to find a graceful + * solution. + * imx185: + * When fps larger than 30, should switch to high speed mode, currently only + * 0, 1, 2 are available. 0 means 720p 30fps, 1 means 2M 30fps, and 2 means 2M 60fps. + * imx290: + * 0 and 1 available, for 30 and higher FPS. + ***********************************************************************************/ + mode = (fps > 30) ? query.maximum : (query.maximum - 1); + } + LOG2("@%s, set V4L2_CID_LINK_FREQ to %d, fps %f", __func__, mode, fps); + return mSensorOutputSubdev->SetControl(V4L2_CID_LINK_FREQ, mode); +} +// CRL_MODULE_E + } // namespace icamera diff --git a/src/core/SensorHwCtrl.h b/src/core/SensorHwCtrl.h index 6b85e4a4..a4ef8122 100644 --- a/src/core/SensorHwCtrl.h +++ b/src/core/SensorHwCtrl.h @@ -38,6 +38,9 @@ class SensorHwCtrl { SensorHwCtrl(int cameraId, V4L2Subdevice* pixelArraySubdev, V4L2Subdevice* sensorOutputSubdev); virtual ~SensorHwCtrl() {} + // CRL_MODULE_S + virtual int configure(); + // CRL_MODULE_E virtual int setTestPatternMode(int32_t testPatternMode); virtual int getPixelRate(int& pixelRate); virtual int setExposure(const std::vector& coarseExposures, @@ -50,19 +53,70 @@ class SensorHwCtrl { virtual int getActivePixelArraySize(int& width, int& height, int& pixelCode); virtual int getExposureRange(int& exposureMin, int& exposureMax, int& exposureStep); + // HDR_FEATURE_S + /** + * Set WDR mode to sensor which is used to select WDR sensor settings or none-WDR settings. + * If 1 is set, WDR sensor settings will be used, + * while if 0 is set, none-WDR sensor settings will be used. + * + * \param[IN] mode: WDR mode + * + *\return OK if successfully. + */ + virtual int setWdrMode(int mode); + + /** + * Set awb result to sensor for bypass awb kernel. + * + * \param[IN] awb result: float r_per_g, float b_per_g + * + *\return OK if successfully. + */ + virtual int setAWB(float r_per_g, float b_per_g); + // HDR_FEATURE_E + + // CRL_MODULE_S + virtual int setFrameRate(float fps); + // CRL_MODULE_E private: int setLineLengthPixels(int llp); int getLineLengthPixels(int& llp); int setFrameLengthLines(int fll); int getFrameLengthLines(int& fll); + // CRL_MODULE_S + int setMultiExposures(const std::vector& coarseExposures, + const std::vector& fineExposures); + int setDualExposuresDCGAndVS(const std::vector& coarseExposures, + const std::vector& fineExposures); + // DOL_FEATURE_S + int setShutterAndReadoutTiming(const std::vector& coarseExposures, + const std::vector& fineExposures); + // DOL_FEATURE_E + int setConversionGain(const std::vector& analogGains); + int setMultiDigitalGain(const std::vector& digitalGains); + int setMultiAnalogGain(const std::vector& analogGains); + // CRL_MODULE_E + + // DOL_FEATURE_S + // DOL sensor sink pad + static const int SENSOR_OUTPUT_PAD = 1; + // DOL_FEATURE_E + V4L2Subdevice* mPixelArraySubdev; + // CRL_MODULE_S + V4L2Subdevice* mSensorOutputSubdev; + // CRL_MODULE_E int mCameraId; int mHorzBlank; int mVertBlank; int mCropWidth; int mCropHeight; + // HDR_FEATURE_S + int mWdrMode; + // HDR_FEATURE_E + // Current frame length lines int mCurFll; @@ -95,6 +149,12 @@ class DummySensor : public SensorHwCtrl { int getVBlank(int& vblank) { return OK; } int getActivePixelArraySize(int& width, int& height, int& code) { return OK; } int getExposureRange(int& exposureMin, int& exposureMax, int& exposureStep) { return OK; } + // HDR_FEATURE_S + int setWdrMode(int mode) { return OK; } + // HDR_FEATURE_E + // CRL_MODULE_S + int setFrameRate(float fps) { return OK; } + // CRL_MODULE_E }; } // namespace icamera diff --git a/src/core/SofSource.cpp b/src/core/SofSource.cpp index 41c08b40..823e8142 100644 --- a/src/core/SofSource.cpp +++ b/src/core/SofSource.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2022 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,12 @@ #include "SofSource.h" +#include #include +// VIRTUAL_CHANNEL_S +#include "linux/ipu-isys.h" +// VIRTUAL_CHANNEL_E #include "PlatformData.h" #include "V4l2DeviceFactory.h" #include "iutils/CameraLog.h" @@ -29,11 +33,18 @@ namespace icamera { SofSource::SofSource(int cameraId) : mPollThread(nullptr), mCameraId(cameraId), + // VIRTUAL_CHANNEL_S + mAggregatorSubDev(nullptr), + mFrameSyncId(-1), + // VIRTUAL_CHANNEL_E mIsysReceiverSubDev(nullptr), mExitPending(false) { LOG1("%s: SofSource is constructed", __func__); mSofDisabled = !PlatformData::isIsysEnabled(cameraId); + // FILE_SOURCE_S + mSofDisabled = mSofDisabled || PlatformData::isFileSourceEnabled(); + // FILE_SOURCE_E } SofSource::~SofSource() { @@ -79,6 +90,34 @@ int SofSource::initDev() { LOG1("%s: Using SOF event id 0 for sync", __func__); #else int id = 0; + // VIRTUAL_CHANNEL_S + /* The value of virtual channel sequence is 1, 2, 3, ... if virtual channel supported. + The value of SOF event id is 0, 1, 2, ... (sequence -1) when virtual channel supported. */ + int sequence = PlatformData::getVirtualChannelSequence(mCameraId); + if (sequence > 0) { + mFrameSyncId = sequence - 1; + } + + struct VcAggregator aggregator; + if (PlatformData::getVcAggregator(mCameraId, aggregator) == OK) { + std::string devName; + CameraUtils::getDeviceName(aggregator.mName.c_str(), devName, true); + if (!devName.empty()) { + LOG1("%s, found aggregator subdevice %s", __func__, devName); + mAggregatorSubDev = V4l2DeviceFactory::getSubDev(mCameraId, devName); + + struct v4l2_querymenu qm = {.id = V4L2_CID_IPU_QUERY_SUB_STREAM, }; + qm.index = aggregator.mIndex; + int ret = mAggregatorSubDev->QueryMenu(&qm); + if (ret == 0) { + #define SUB_STREAM_VC_ID(value) ((value) >> 56 & 0xFF) + mFrameSyncId = SUB_STREAM_VC_ID(qm.value); + } + } + } + if (mFrameSyncId >= 0) id = mFrameSyncId; + // VIRTUAL_CHANNEL_E + int status = mIsysReceiverSubDev->SubscribeEvent(V4L2_EVENT_FRAME_SYNC, id); CheckAndLogError(status != OK, status, "Failed to subscribe sync event %d", id); LOG1("%s: Using SOF event id %d for sync", __func__, id); @@ -100,6 +139,9 @@ int SofSource::deinitDev() { } #else int id = 0; + // VIRTUAL_CHANNEL_S + if (mFrameSyncId >= 0) id = mFrameSyncId; + // VIRTUAL_CHANNEL_E status = mIsysReceiverSubDev->UnsubscribeEvent(V4L2_EVENT_FRAME_SYNC, id); if (status == OK) { LOG1("%s: Unsubscribe SOF event id %d done", __func__, id); diff --git a/src/core/SofSource.h b/src/core/SofSource.h index 262166a6..737b2905 100644 --- a/src/core/SofSource.h +++ b/src/core/SofSource.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,6 +57,11 @@ class SofSource : public EventSource { }; PollThread* mPollThread; int mCameraId; + // VIRTUAL_CHANNEL_S + V4L2Subdevice* mAggregatorSubDev; + int mFrameSyncId; + // VIRTUAL_CHANNEL_E + V4L2Subdevice* mIsysReceiverSubDev; bool mExitPending; bool mSofDisabled; diff --git a/src/core/StreamSource.h b/src/core/StreamSource.h index 3996b9e8..1c771099 100644 --- a/src/core/StreamSource.h +++ b/src/core/StreamSource.h @@ -45,4 +45,26 @@ class StreamSource : public BufferProducer { virtual void removeAllFrameAvailableListener() = 0; }; +// DUMMY_SOURCE_S +class DummySource : public StreamSource { + public: + DummySource() : StreamSource(V4L2_MEMORY_USERPTR) {} + + int init() { return OK; } + void deinit() {} + int configure(const std::map& outputFrames, + const std::vector& configModes) { + return OK; + } + int start() { return OK; } + int stop() { return OK; } + void removeAllFrameAvailableListener() {} + + int qbuf(Port port, const std::shared_ptr& camBuffer) { return OK; } + int allocateMemory(Port port, const std::shared_ptr& camBuffer) { return OK; } + + void addFrameAvailableListener(BufferConsumer* listener) {} + void removeFrameAvailableListener(BufferConsumer* listener) {} +}; +// DUMMY_SOURCE_E } // namespace icamera diff --git a/src/core/TNRCommon.h b/src/core/TNRCommon.h index 13339727..747c8e47 100644 --- a/src/core/TNRCommon.h +++ b/src/core/TNRCommon.h @@ -17,16 +17,52 @@ #pragma once #include "ia_pal_types_isp_parameters_autogen.h" +#ifdef TNR7_CM #include "tnr7us_parameters_definition.h" +#endif namespace icamera { -typedef struct Tnr7Param { - tnr_scale_1_0_t scale; - tnr7_ims_1_0_t ims; - tnr7_bc_1_0_t bc; - tnr7_blend_1_0_t blend; -} Tnr7Param; +#ifdef TNR7_CM +typedef tnr_scale_1_0_t tnrScaleParam; +typedef tnr7_ims_1_0_t tnrImsParam; +typedef tnr7_bc_1_0_t tnrBCParam; +typedef tnr7_blend_1_0_t tnrBlendParam; +#else +typedef struct { + double is_first_frame; + double do_update; + double coeffs[3]; + double tune_sensitivity; + double global_protection; + double global_protection_sensitivity_lut_values[3]; + double global_protection_sensitivity_lut_slopes[2]; + double global_protection_inv_num_pixels; +} subway_tnr7_bc_1_1_t; + +typedef struct { + double max_recursive_similarity; +} subway_tnr7_blend_1_0_t; + +typedef struct { + double update_limit; + double update_coeff; + double d_ml[16]; + double d_slopes[16]; + double d_top[16]; + double outofbounds[16]; + double radial_start; + double radial_coeff; + double frame_center_y; + double frame_center_x; + double r_coeff; +} subway_tnr7_ims_1_1_t; + +typedef int32_t tnrScaleParam; +typedef subway_tnr7_ims_1_1_t tnrImsParam; +typedef subway_tnr7_bc_1_1_t tnrBCParam; +typedef subway_tnr7_blend_1_0_t tnrBlendParam; +#endif typedef enum TnrType { TNR_INSTANCE0 = 0, @@ -55,4 +91,11 @@ typedef struct TnrRequestInfo { int outBufFd; bool isForceUpdate; } TnrRequestInfo; + +typedef struct Tnr7Param { + tnrScaleParam scale; + tnrImsParam ims; + tnrBCParam bc; + tnrBlendParam blend; +} Tnr7Param; } // namespace icamera diff --git a/src/core/psysprocessor/GPUExecutor.cpp b/src/core/psysprocessor/GPUExecutor.cpp index c5daf99a..23cfbe9d 100644 --- a/src/core/psysprocessor/GPUExecutor.cpp +++ b/src/core/psysprocessor/GPUExecutor.cpp @@ -122,13 +122,15 @@ int GPUExecutor::start() { "Can't find TerminalDescriptor"); const FrameInfo& frameInfo = mTerminalsDesc[term].frameDesc; - mIntelTNR = std::unique_ptr(new IntelTNR7US(mCameraId)); + mIntelTNR = std::unique_ptr(IntelTNR7US::createIntelTNR(mCameraId)); TnrType type = mStreamId == VIDEO_STREAM_ID ? TNR_INSTANCE0 : TNR_INSTANCE1; - ret = mIntelTNR->init(frameInfo.mWidth, frameInfo.mHeight, type); - if (ret) { - mIntelTNR = nullptr; - // when failed to init tnr, executor will run without tnr effect - LOGW("Executor:%s init tnr failed", mName.c_str()); + if (mIntelTNR) { + ret = mIntelTNR->init(frameInfo.mWidth, frameInfo.mHeight, type); + if (ret) { + mIntelTNR = nullptr; + // when failed to init tnr, executor will run without tnr effect + LOGW("Executor:%s init tnr failed", mName.c_str()); + } } } AutoMutex l(mBufferQueueLock); @@ -169,11 +171,11 @@ int GPUExecutor::allocBuffers() { int srcWidth = mTerminalsDesc[term].frameDesc.mWidth; int srcHeight = mTerminalsDesc[term].frameDesc.mHeight; uint32_t size = 0; + int ret = NO_MEMORY; + + if (mIntelTNR) ret = mIntelTNR->getTnrBufferSize(srcWidth, srcHeight, &size); + if (ret) size = PGCommon::getFrameSize(srcFmt, srcWidth, srcHeight, true); - if (mIntelTNR) { - int ret = mIntelTNR->getSurfaceInfo(srcWidth, srcHeight, &size); - if (ret) size = PGCommon::getFrameSize(srcFmt, srcWidth, srcHeight, true); - } LOG1("@%s, Required GPU TNR buffer size %u", __func__, size); for (int i = 0; i < MAX_BUFFER_COUNT; i++) { @@ -223,14 +225,11 @@ bool GPUExecutor::fetchTnrOutBuffer(int64_t seq, std::shared_ptr b std::unique_lock lock(mTnrOutBufMapLock); if (mTnrOutBufMap.find(seq) != mTnrOutBufMap.end()) { - void* pSrcBuf = (buf->getMemory() == V4L2_MEMORY_DMABUF) ? - buf->mapDmaBufferAddr() : buf->getBufferAddr(); + ScopeMapping mapper(buf); + void* pSrcBuf = mapper.getUserPtr(); CheckAndLogError(!pSrcBuf, false, "pSrcBuf is nullptr"); LOG2("Sequence %ld is used for output", seq); MEMCPY_S(pSrcBuf, buf->getBufferSize(), mTnrOutBufMap[seq], mOutBufferSize); - if (buf->getMemory() == V4L2_MEMORY_DMABUF) { - buf->unmapDmaBufferAddr(pSrcBuf); - } return true; } @@ -243,10 +242,15 @@ int GPUExecutor::getStillTnrTriggerInfo(TuningMode mode) { CheckAndLogError(!intelCca, UNKNOWN_ERROR, "cca is nullptr, mode:%d", mode); cca::cca_cmc cmc; ia_err ret = intelCca->getCMC(&cmc); - CheckAndLogError(ret != OK, BAD_VALUE, "Get cmc data failed"); + CheckAndLogError(ret != ia_err_none, BAD_VALUE, "Get cmc data failed"); mStillTnrTriggerInfo = cmc.tnr7us_trigger_info; LOG1("%s still tnr trigger gain num: %d threshold: %f", mName.c_str(), mStillTnrTriggerInfo.num_gains, mStillTnrTriggerInfo.tnr7us_threshold_gain); + for (int i = 0; i < mStillTnrTriggerInfo.num_gains; i++) { + LOG1("%s threshold: %f, tnr frame count: %d", mName.c_str(), + mStillTnrTriggerInfo.trigger_infos[i].gain, + mStillTnrTriggerInfo.trigger_infos[i].frame_count); + } return OK; } @@ -270,10 +274,13 @@ int GPUExecutor::getTotalGain(int64_t seq, float* totalGain) { bool GPUExecutor::isBypassStillTnr(int64_t seq) { if (mStreamId != STILL_TNR_STREAM_ID) return true; +#ifdef IPU_SYSVER_ipu6v3 float totalGain = 0.0f; int ret = getTotalGain(seq, &totalGain); CheckAndLogError(ret, true, "Failed to get total gain"); if (totalGain <= mStillTnrTriggerInfo.tnr7us_threshold_gain) return true; +#endif + return false; } @@ -292,6 +299,8 @@ int GPUExecutor::getTnrExtraFrameCount(int64_t seq) { index = i; } /* the frame_count is total tnr7 frame count, already run 1 frame */ + LOG2("%s total gain %f with tnr frame count %d", __func__, totalGain, + mStillTnrTriggerInfo.trigger_infos[index].frame_count); return mStillTnrTriggerInfo.trigger_infos[index].frame_count - 1; } @@ -439,15 +448,14 @@ int GPUExecutor::updateTnrISPConfig(Tnr7Param* pbuffer, uint32_t sequence) { ret |= PalOutput.getKernelPublicOutput(ia_pal_uuid_isp_tnr7_ims_1_1, (void*&)pIms); CheckAndLogError(ret != ia_err_none, UNKNOWN_ERROR, "Can't read isp tnr7 parameters"); - tnr7_bc_1_0_t* tnr7_bc = &(pbuffer->bc); - tnr7_blend_1_0_t* tnr7_blend = &(pbuffer->blend); - tnr7_ims_1_0_t* tnr7_ims = &(pbuffer->ims); + tnrBCParam* tnr7_bc = &(pbuffer->bc); + tnrBlendParam* tnr7_blend = &(pbuffer->blend); + tnrImsParam* tnr7_ims = &(pbuffer->ims); + // common params for both c4m tnr and level0 tnr // tnr7 ims params - tnr7_ims->enable = pIms->enable; tnr7_ims->update_limit = pIms->update_limit; tnr7_ims->update_coeff = pIms->update_coeff; - tnr7_ims->gpu_mode = pIms->gpu_mode; for (int i = 0; i < sizeof(pIms->d_ml) / sizeof(int32_t); i++) { tnr7_ims->d_ml[i] = pIms->d_ml[i]; tnr7_ims->d_slopes[i] = pIms->d_slopes[i]; @@ -461,21 +469,17 @@ int GPUExecutor::updateTnrISPConfig(Tnr7Param* pbuffer, uint32_t sequence) { tnr7_ims->r_coeff = pIms->r_coeff; // tnr7 bc params - tnr7_bc->enable = pBc->enable; tnr7_bc->is_first_frame = pBc->is_first_frame; tnr7_bc->do_update = pBc->do_update; - tnr7_bc->gpu_mode = pBc->gpu_mode; tnr7_bc->tune_sensitivity = pBc->tune_sensitivity; for (int i = 0; i < sizeof(pBc->coeffs) / sizeof(int32_t); i++) { tnr7_bc->coeffs[i] = pBc->coeffs[i]; } - if (!icamera::PlatformData::useTnrGlobalProtection()) { tnr7_bc->global_protection = 0; } else { tnr7_bc->global_protection = pBc->global_protection; tnr7_bc->global_protection_inv_num_pixels = pBc->global_protection_inv_num_pixels; - tnr7_bc->global_protection_motion_level = pBc->global_protection_motion_level; } for (int i = 0; i < sizeof(pBc->global_protection_sensitivity_lut_values) / sizeof(int32_t); i++) { @@ -487,14 +491,24 @@ int GPUExecutor::updateTnrISPConfig(Tnr7Param* pbuffer, uint32_t sequence) { tnr7_bc->global_protection_sensitivity_lut_slopes[i] = pBc->global_protection_sensitivity_lut_slopes[i]; } + tnr7_blend->max_recursive_similarity = pBlend->max_recursive_similarity; + +#ifdef TNR7_CM + tnr7_ims->enable = pIms->enable; + tnr7_ims->gpu_mode = pIms->gpu_mode; + + tnr7_bc->enable = pBc->enable; + tnr7_bc->gpu_mode = pBc->gpu_mode; - // tnr7 blend params + if (icamera::PlatformData::useTnrGlobalProtection()) { + tnr7_bc->global_protection_motion_level = pBc->global_protection_motion_level; + } + // c4m tnr7 blend params tnr7_blend->enable = pBlend->enable; tnr7_blend->enable_main_output = pBlend->enable_main_output; tnr7_blend->enable_vision_output = pBlend->enable_vision_output; tnr7_blend->single_output_mode = pBlend->single_output_mode; tnr7_blend->spatial_weight_coeff = pBlend->spatial_weight_coeff; - tnr7_blend->max_recursive_similarity = pBlend->max_recursive_similarity; tnr7_blend->spatial_alpha = pBlend->spatial_alpha; tnr7_blend->max_recursive_similarity_vsn = pBlend->max_recursive_similarity_vsn; for (int i = 0; i < sizeof(pBlend->w_out_prev_LUT) / sizeof(int32_t); i++) { @@ -512,6 +526,7 @@ int GPUExecutor::updateTnrISPConfig(Tnr7Param* pbuffer, uint32_t sequence) { for (int i = 0; i < sizeof(pBlend->output_cu_x) / sizeof(int32_t); i++) { tnr7_blend->output_cu_x[i] = pBlend->output_cu_x[i]; } +#endif } return ret; @@ -529,15 +544,17 @@ int GPUExecutor::runTnrFrame(const std::shared_ptr& inBuf, struct timespec beginTime = {}; if (mIntelTNR) { - if (Log::isLogTagEnabled(ST_GPU_TNR)) clock_gettime(CLOCK_MONOTONIC, &beginTime); + if (Log::isLogTagEnabled(ST_GPU_TNR, CAMERA_DEBUG_LOG_LEVEL2)) { + clock_gettime(CLOCK_MONOTONIC, &beginTime); + } ret = updateTnrISPConfig(mTnr7usParam, sequence); - if (Log::isLogTagEnabled(ST_GPU_TNR)) { + if (Log::isLogTagEnabled(ST_GPU_TNR, CAMERA_DEBUG_LOG_LEVEL2)) { struct timespec endTime = {}; clock_gettime(CLOCK_MONOTONIC, &endTime); uint64_t timeUsedUs = (endTime.tv_sec - beginTime.tv_sec) * 1000000 + (endTime.tv_nsec - beginTime.tv_nsec) / 1000; - LOG2(ST_GPU_TNR, "%s executor name:%s, sequence: %u update param time %lu us", __func__, + LOG2(ST_GPU_TNR, "executor name:%s, sequence: %u update param time %lu us", mName.c_str(), inBuf->getSequence(), timeUsedUs); } CheckAndLogError(ret != OK, UNKNOWN_ERROR, "Failed to update TNR parameters"); @@ -551,6 +568,11 @@ int GPUExecutor::runTnrFrame(const std::shared_ptr& inBuf, bool paramSyncUpdate = (mStreamId == VIDEO_STREAM_ID) ? false : true; + // LEVEL0_ICBM_S + // no async param update in level0 tnr + paramSyncUpdate = true; + // LEVEL0_ICBM_E + if (!paramSyncUpdate && mIntelTNR) { // request update tnr parameters before wait float totalGain = 0.0f; @@ -565,16 +587,14 @@ int GPUExecutor::runTnrFrame(const std::shared_ptr& inBuf, int fd = outBuf->getFd(); int memoryType = outBuf->getMemory(); int bufferSize = outBuf->getBufferSize(); - void* outPtr = (memoryType == V4L2_MEMORY_DMABUF) ? - outBuf->mapDmaBufferAddr() : outBuf->getBufferAddr(); + + ScopeMapping mapper(outBuf); + void* outPtr = mapper.getUserPtr(); if (!outPtr) return UNKNOWN_ERROR; outBuf->setSequence(sequence); if (!mIntelTNR) { MEMCPY_S(outPtr, bufferSize, inBuf->getBufferAddr(), inBuf->getBufferSize()); - if (memoryType == V4L2_MEMORY_DMABUF) { - outBuf->unmapDmaBufferAddr(outPtr); - } return OK; } @@ -582,9 +602,6 @@ int GPUExecutor::runTnrFrame(const std::shared_ptr& inBuf, // when running still stream tnr, should skip video tnr to decrease still capture duration. if (mStreamId == VIDEO_STREAM_ID && !mGPULock.try_lock()) { MEMCPY_S(outPtr, bufferSize, inBuf->getBufferAddr(), inBuf->getBufferSize()); - if (memoryType == V4L2_MEMORY_DMABUF) { - outBuf->unmapDmaBufferAddr(outPtr); - } mLastSequence = UINT32_MAX; LOG2("Executor name:%s, skip frame sequence: %ld", mName.c_str(), inBuf->getSequence()); return OK; @@ -614,7 +631,9 @@ int GPUExecutor::runTnrFrame(const std::shared_ptr& inBuf, dstFd = -1; } - if (Log::isLogTagEnabled(ST_GPU_TNR)) clock_gettime(CLOCK_MONOTONIC, &beginTime); + if (Log::isLogTagEnabled(ST_GPU_TNR, CAMERA_DEBUG_LOG_LEVEL2)) { + clock_gettime(CLOCK_MONOTONIC, &beginTime); + } ret = mIntelTNR->runTnrFrame(inBuf->getBufferAddr(), dstBuf, inBuf->getBufferSize(), dstSize, mTnr7usParam, paramSyncUpdate, dstFd); if (ret == OK) { @@ -625,7 +644,7 @@ int GPUExecutor::runTnrFrame(const std::shared_ptr& inBuf, LOG2("Just copy source buffer if run TNR failed"); MEMCPY_S(outPtr, bufferSize, inBuf->getBufferAddr(), inBuf->getBufferSize()); } - if (Log::isLogTagEnabled(ST_GPU_TNR)) { + if (Log::isLogTagEnabled(ST_GPU_TNR, CAMERA_DEBUG_LOG_LEVEL2)) { struct timespec endTime; clock_gettime(CLOCK_MONOTONIC, &endTime); uint64_t timeUsedUs = (endTime.tv_sec - beginTime.tv_sec) * 1000000 + @@ -644,9 +663,6 @@ int GPUExecutor::runTnrFrame(const std::shared_ptr& inBuf, LOG2("outBuf->first %ld, outBuf->second %p", tnrOutBuf->first, tnrOutBuf->second); } - if (memoryType == V4L2_MEMORY_DMABUF) { - outBuf->unmapDmaBufferAddr(outPtr); - } CheckAndLogError(ret != OK, UNKNOWN_ERROR, "tnr7us run frame failed"); mLastSequence = sequence; @@ -660,9 +676,9 @@ int GPUExecutor::dumpTnrParameters(uint32_t sequence) { std::string("/home/tnr7-") + std::to_string(sequence) + std::string(".txt"); LOG1("Save tnr7 parameters to file %s", dumpFileName.c_str()); - tnr7_bc_1_0_t* tnr7_bc = &(mTnr7usParam->bc); - tnr7_blend_1_0_t* tnr7_blend = &(mTnr7usParam->blend); - tnr7_ims_1_0_t* tnr7_ims = &(mTnr7usParam->ims); + tnrBCParam* tnr7_bc = &(mTnr7usParam->bc); + tnrBlendParam* tnr7_blend = &(mTnr7usParam->blend); + tnrImsParam* tnr7_ims = &(mTnr7usParam->ims); char* dumpData = reinterpret_cast(malloc(DUMP_FILE_SIZE)); CheckAndLogError(dumpData == nullptr, NO_MEMORY, "failed to allocate memory for dump tnr7"); @@ -671,21 +687,21 @@ int GPUExecutor::dumpTnrParameters(uint32_t sequence) { int shift = 0; size_t length = snprintf(dumpData + shift, DUMP_FILE_SIZE - shift, "%s\n", "tnr7_bc"); shift += length; - for (int i = 0; i < sizeof(tnr7_bc_1_0_t) / sizeof(int32_t); i++) { + for (int i = 0; i < sizeof(tnrBCParam) / sizeof(int32_t); i++) { length = snprintf(dumpData + shift, DUMP_FILE_SIZE - shift, "%u\n", *(reinterpret_cast(tnr7_bc) + i)); shift += length; } length = snprintf(dumpData + shift, DUMP_FILE_SIZE - shift, "%s\n", "tnr7_blend"); shift += length; - for (int i = 0; i < sizeof(tnr7_blend_1_0_t) / sizeof(int32_t); i++) { + for (int i = 0; i < sizeof(tnrBlendParam) / sizeof(int32_t); i++) { length = snprintf(dumpData + shift, DUMP_FILE_SIZE - shift, "%u\n", *(reinterpret_cast(tnr7_blend) + i)); shift += length; } length = snprintf(dumpData + shift, DUMP_FILE_SIZE - shift, "%s\n", "tnr7_ims"); shift += length; - for (int i = 0; i < sizeof(tnr7_ims_1_0_t) / sizeof(int32_t); i++) { + for (int i = 0; i < sizeof(tnrImsParam) / sizeof(int32_t); i++) { length = snprintf(dumpData + shift, DUMP_FILE_SIZE - shift, "%u\n", *(reinterpret_cast(tnr7_ims) + i)); shift += length; @@ -699,4 +715,5 @@ int GPUExecutor::dumpTnrParameters(uint32_t sequence) { free(dumpData); return OK; } + } // namespace icamera diff --git a/src/core/psysprocessor/GPUExecutor.h b/src/core/psysprocessor/GPUExecutor.h index 7b693879..211e0f6d 100644 --- a/src/core/psysprocessor/GPUExecutor.h +++ b/src/core/psysprocessor/GPUExecutor.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/core/psysprocessor/PGCommon.cpp b/src/core/psysprocessor/PGCommon.cpp index c0648a6f..88390771 100644 --- a/src/core/psysprocessor/PGCommon.cpp +++ b/src/core/psysprocessor/PGCommon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation. + * Copyright (C) 2019-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,7 +95,7 @@ PGCommon::~PGCommon() {} int PGCommon::init() { mDisableDataTermials.clear(); - mPGParamAdapt = std::unique_ptr(new IntelPGParam(mPGId)); + mPGParamAdapt = std::unique_ptr(new IntelPGParam(mPGId, mCameraId, mTuningMode)); mCtx = new CIPR::Context(); CheckAndLogError(!(mCtx->isInitialized()), UNKNOWN_ERROR, "Failed to initialize Context"); @@ -168,6 +168,10 @@ void PGCommon::deInit() { mPGParamAdapt->deinit(); mRoutingBitmap.reset(); + + if (mIntelCca) { + mIntelCca->freeStatsDataMem(); + } } void PGCommon::setInputInfo(const TerminalFrameInfoMap& inputInfos, FrameInfo tnrFrameInfo) { @@ -762,6 +766,7 @@ int PGCommon::configureFrameDesc() { int cssBpp = PGUtils::getCssBpp(v4l2Fmt, true); int cssBpe = PGUtils::getCssBpe(v4l2Fmt, true); + int alignedBpl = PGUtils::getCssStride(v4l2Fmt, width, true); switch (dstFrameDesc->frame_format_type) { case IA_CSS_DATA_FORMAT_BAYER_GRBG: case IA_CSS_DATA_FORMAT_BAYER_RGGB: @@ -769,8 +774,6 @@ int PGCommon::configureFrameDesc() { case IA_CSS_DATA_FORMAT_BAYER_GBRG: { if (!PlatformData::getISYSCompression(mCameraId)) break; - int alignedBpl = width * 2; - alignedBpl = ALIGN(alignedBpl, ISYS_COMPRESSION_STRIDE_ALIGNMENT_BYTES); int alignedHeight = ALIGN(height, ISYS_COMPRESSION_HEIGHT_ALIGNMENT); int imageBufferSize = ALIGN(alignedBpl * alignedHeight, ISYS_COMPRESSION_PAGE_SIZE); @@ -786,8 +789,7 @@ int PGCommon::configureFrameDesc() { } case IA_CSS_DATA_FORMAT_YUV420: { if (!PlatformData::getPSACompression(mCameraId)) break; - // now the bpl of YUV420 format is width * 2 - int alignedBpl = ALIGN(width * 2, PSYS_COMPRESSION_PSA_Y_STRIDE_ALIGNMENT); + int alignedHeight = ALIGN(height, PSYS_COMPRESSION_PSA_HEIGHT_ALIGNMENT); int alignWidthUV = alignedBpl / 2; int alignHeightUV = alignedHeight / 2; @@ -829,20 +831,17 @@ int PGCommon::configureFrameDesc() { case IA_CSS_DATA_FORMAT_P010: { if (!PlatformData::getPSACompression(mCameraId)) break; - unsigned int bpl = 0, heightAlignment = 0, tsBit = 0, tileSize = 0; + unsigned int heightAlignment = 0, tsBit = 0, tileSize = 0; if (dstFrameDesc->frame_format_type == IA_CSS_DATA_FORMAT_NV12) { - bpl = width; heightAlignment = PSYS_COMPRESSION_TNR_LINEAR_HEIGHT_ALIGNMENT; tsBit = TILE_STATUS_BITS_TNR_NV12_TILE_Y; tileSize = TILE_SIZE_TNR_NV12_Y; } else { - bpl = width * 2; heightAlignment = PSYS_COMPRESSION_OFS_TILE_HEIGHT_ALIGNMENT; tsBit = TILE_STATUS_BITS_OFS_P010_TILE_Y; tileSize = TILE_SIZE_OFS10_12_TILEY; } - int alignedBpl = ALIGN(bpl, PSYS_COMPRESSION_TNR_STRIDE_ALIGNMENT); int alignedHeight = ALIGN(height, heightAlignment); int alignedHeightUV = ALIGN(height / UV_HEIGHT_DIVIDER, heightAlignment); int imageBufferSize = ALIGN(alignedBpl * (alignedHeight + alignedHeightUV), @@ -923,7 +922,7 @@ int PGCommon::iterate(CameraBufferMap& inBufs, CameraBufferMap& outBufs, ia_bina statistics->data = mIntelCca->getStatsDataBuffer(); if (statistics->data) useCcaBuf = true; } - ret = mPGParamAdapt->decode(mTerminalCount, mParamPayload, statistics); + ret = mPGParamAdapt->decode(mTerminalCount, mParamPayload, statistics, sequence); CheckAndLogError((ret != OK), ret, "%s, decode fail", getName()); if (mIntelCca && useCcaBuf) { mIntelCca->decodeHwStatsDone(sequence, statistics->size); diff --git a/src/core/psysprocessor/PGUtils.cpp b/src/core/psysprocessor/PGUtils.cpp index 838a3260..3683c57d 100644 --- a/src/core/psysprocessor/PGUtils.cpp +++ b/src/core/psysprocessor/PGUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation. + * Copyright (C) 2019-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,7 +108,7 @@ ia_css_frame_format_type getCssFmt(int v4l2Fmt) { return IA_CSS_N_FRAME_FORMAT_TYPES; } -int getCssStride(int v4l2Fmt, int width) { +int getCssStride(int v4l2Fmt, int width, bool compression) { int stride = width; ia_css_frame_format_type cssFmt = getCssFmt(v4l2Fmt); switch (v4l2Fmt) { @@ -122,6 +122,33 @@ int getCssStride(int v4l2Fmt, int width) { stride = getStride(cssFmt, width); break; } + + if (compression) { + switch (cssFmt) { + case IA_CSS_DATA_FORMAT_BAYER_GRBG: + case IA_CSS_DATA_FORMAT_BAYER_RGGB: + case IA_CSS_DATA_FORMAT_BAYER_BGGR: + case IA_CSS_DATA_FORMAT_BAYER_GBRG: + stride = ALIGN(width * 2, ISYS_COMPRESSION_STRIDE_ALIGNMENT_BYTES); + break; + case IA_CSS_DATA_FORMAT_YUV420: + if (v4l2Fmt == GET_FOURCC_FMT('I', 'Y', 'U', 'V')) + stride = ALIGN(width, PSYS_COMPRESSION_PSA_Y_STRIDE_ALIGNMENT); + else + stride = ALIGN(width * 2, PSYS_COMPRESSION_PSA_Y_STRIDE_ALIGNMENT); + break; + case IA_CSS_DATA_FORMAT_NV12: + stride = ALIGN(width, PSYS_COMPRESSION_TNR_STRIDE_ALIGNMENT); + break; + case IA_CSS_DATA_FORMAT_P010: + stride = ALIGN(width * 2, PSYS_COMPRESSION_TNR_STRIDE_ALIGNMENT); + break; + default: + LOGW("%s format %d compress not supported", __func__, v4l2Fmt); + break; + } + } + return stride; } diff --git a/src/core/psysprocessor/PGUtils.h b/src/core/psysprocessor/PGUtils.h index 2cda1f1a..efff94b0 100644 --- a/src/core/psysprocessor/PGUtils.h +++ b/src/core/psysprocessor/PGUtils.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation. + * Copyright (C) 2019-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ namespace PGUtils { ia_css_frame_format_type getCssFmt(int v4l2Fmt); int getCssBpp(int v4l2Fmt, bool compression = false); int getCssBpe(int v4l2Fmt, bool compression = false); -int getCssStride(int v4l2Fmt, int width); +int getCssStride(int v4l2Fmt, int width, bool compression = false); bool isCompressionTerminal(int terminalId); /* ************************************************************ diff --git a/src/core/psysprocessor/PSysDAG.cpp b/src/core/psysprocessor/PSysDAG.cpp index 5686586e..82f4c08e 100644 --- a/src/core/psysprocessor/PSysDAG.cpp +++ b/src/core/psysprocessor/PSysDAG.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2022 Intel Corporation. + * Copyright (C) 2017-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ #include "iutils/CameraLog.h" #include "iutils/Utils.h" -#ifdef TNR7_CM +#if defined(TNR7_CM) || defined(TNR7_LEVEL0) #include "GPUExecutor.h" #endif #include "CameraScheduler.h" @@ -72,10 +72,16 @@ void PSysDAG::setFrameInfo(const std::map& inputInfo, } } } +void PSysDAG::unregisterNode() { + if (!mScheduler) return; + + for (auto& executor : mExecutorsPool) { + mScheduler->unregisterNode(executor); + } +} void PSysDAG::releasePipeExecutors() { for (auto& executor : mExecutorsPool) { - if (mScheduler) mScheduler->unregisterNode(executor); delete executor; } mExecutorsPool.clear(); @@ -137,7 +143,7 @@ int PSysDAG::createPipeExecutors(bool useTnrOutBuffer) { if (!hasVideoPipe) hasVideoPipe = (streamId == VIDEO_STREAM_ID); if (!hasStillPipe) hasStillPipe = (streamId == STILL_STREAM_ID || streamId == STILL_TNR_STREAM_ID); -#ifdef TNR7_CM +#if defined(TNR7_CM) || defined(TNR7_LEVEL0) PipeExecutor* executor; if (strstr(item.exeName.c_str(), "gputnr") != nullptr) { executor = @@ -619,6 +625,11 @@ void PSysDAG::addTask(PSysTaskData taskParam) { // It's too early to runIspAdapt here, and the ipu parameters // may be incorrect when runPipe. bool runIspAdaptor = true; + // HDR_FEATURE_S + if (mTuningMode == TUNING_MODE_VIDEO_HDR || mTuningMode == TUNING_MODE_VIDEO_HDR2) { + runIspAdaptor = false; + } + // HDR_FEATURE_E int64_t sequence = taskParam.mInputBuffers.at(mDefaultMainInputPort)->getSequence(); if (runIspAdaptor) { @@ -774,6 +785,10 @@ int PSysDAG::prepareIpuParams(int64_t sequence, bool forceUpdate, TaskInfo* task } } +// INTEL_DVS_S + mPSysDagCB->onDvsPrepare(sequence, id); +// INTEL_DVS_E + int ret = mIspParamAdaptor->runIspAdapt(&task->mTaskData.mIspSettings, sequence, id); CheckAndLogError(ret != OK, UNKNOWN_ERROR, "%s, Failed to run AIC: streamId: %d", __func__, sequence, id); @@ -830,7 +845,7 @@ void PSysDAG::tuningReconfig(TuningMode newTuningMode) { } void PSysDAG::dumpExternalPortMap() { - if (!Log::isLogTagEnabled(GET_FILE_SHIFT(PSysDAG))) return; + if (!Log::isLogTagEnabled(GET_FILE_SHIFT(PSysDAG), CAMERA_DEBUG_LOG_LEVEL2)) return; for (auto& inputMap : mInputMaps) { if (inputMap.mExecutor) { diff --git a/src/core/psysprocessor/PSysDAG.h b/src/core/psysprocessor/PSysDAG.h index 378173ea..3009a036 100644 --- a/src/core/psysprocessor/PSysDAG.h +++ b/src/core/psysprocessor/PSysDAG.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2022 Intel Corporation + * Copyright (C) 2017-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,6 +68,9 @@ class PSysDagCallback { virtual void onBufferDone(int64_t sequence, Port port, const std::shared_ptr& camBuffer) {} virtual void onStatsDone(int64_t sequence, const CameraBufferPortMap& outBuf) {} +// INTEL_DVS_S + virtual void onDvsPrepare(int64_t sequence, int32_t streamId) {} +// INTEL_DVS_E }; class PSysDAG { @@ -83,6 +86,8 @@ class PSysDAG { int resume(); int pause(); + void unregisterNode(); + int registerInternalBufs(std::map& internalBufs); int registerUserOutputBufs(Port port, const std::shared_ptr& camBuffer); void stopProcessing(); diff --git a/src/core/psysprocessor/PipeLiteExecutor.cpp b/src/core/psysprocessor/PipeLiteExecutor.cpp index 6cfda4b0..54dd9f08 100644 --- a/src/core/psysprocessor/PipeLiteExecutor.cpp +++ b/src/core/psysprocessor/PipeLiteExecutor.cpp @@ -619,6 +619,14 @@ int PipeLiteExecutor::processNewFrame() { v4l2_buffer_t inV4l2Buf = *inBuf->getV4L2Buffer().Get(); TuningMode tuningMode = mPSysDag->getTuningMode(inBufSequence); + // HDR_FEATURE_S + // Prepare the ipu parameters before run pipe + // TODO remove it when 4k ull pipe run faster + if ((tuningMode == TUNING_MODE_VIDEO_HDR) || (tuningMode == TUNING_MODE_VIDEO_HDR2)) { + mPSysDag->prepareIpuParams(inBufSequence); + } + // HDR_FEATURE_E + LOG2("%s:Id:%d run pipe start for buffer:%ld", mName.c_str(), mCameraId, inBufSequence); // FRAME_SYNC_S @@ -872,19 +880,9 @@ int PipeLiteExecutor::notifyStatsDone(TuningMode tuningMode, const v4l2_buffer_t } int statsIndex = 0; - bool runDvs = false; for (auto statsBuf : outStatsBuffers) { if (!statsBuf) continue; - if (!runDvs) { - // DVS Zoom without STAT buffer. - EventData eventData; - eventData.type = EVENT_DVS_READY; - eventData.data.dvsRunReady.streamId = mStreamId; - notifyListeners(eventData); - runDvs = true; - } - if (mStreamId != VIDEO_STREAM_ID) { if (!PlatformData::isStillOnlyPipeEnabled(mCameraId)) { LOG2("%s: Drop still pipe statistics data", __func__); @@ -1130,7 +1128,7 @@ void PipeLiteExecutor::getTerminalBuffersFromExternal( } void PipeLiteExecutor::dumpPGs() const { - if (!Log::isLogTagEnabled(GET_FILE_SHIFT(PipeLiteExecutor))) return; + if (!Log::isLogTagEnabled(GET_FILE_SHIFT(PipeLiteExecutor), CAMERA_DEBUG_LOG_LEVEL3)) return; LOG3("============= dump PGs for executor %s =================", getName()); if (mIsInputEdge) { diff --git a/src/core/psysprocessor/PolicyManager.cpp b/src/core/psysprocessor/PolicyManager.cpp index 0b3f89b2..b87098a7 100644 --- a/src/core/psysprocessor/PolicyManager.cpp +++ b/src/core/psysprocessor/PolicyManager.cpp @@ -149,7 +149,10 @@ int PolicyManager::wait(std::string executorName, int64_t sequence) { LOG2("%s: need wait for other executors.", executorName.c_str()); const int64_t kWaitDuration = 66000000; // 66ms int ret = bundle->mCondition.waitRelative(lock, kWaitDuration * SLOWLY_MULTIPLIER); - CheckWarning(ret == TIMED_OUT, ret, "%s: wait executors timeout", executorName.c_str()); + if (ret == TIMED_OUT) { + LOG2("%s: wait executors timeout", executorName.c_str()); + return ret; + } } else { bundle->mWaitingCount = 0; bundle->mCondition.broadcast(); diff --git a/src/fd/FaceDetection.cpp b/src/fd/FaceDetection.cpp index a18f330b..50e23977 100644 --- a/src/fd/FaceDetection.cpp +++ b/src/fd/FaceDetection.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -141,7 +141,7 @@ bool FaceDetection::faceRunningByCondition() { } void FaceDetection::printfFDRunRate() { - if (!Log::isLogTagEnabled(ST_FPS)) return; + if (!Log::isLogTagEnabled(ST_FPS, CAMERA_DEBUG_LOG_LEVEL2)) return; mRunCount++; if (mRunCount % FPS_FD_COUNT != 0) return; diff --git a/src/fd/FaceDetection.h b/src/fd/FaceDetection.h index b6b9115d..4a26b778 100644 --- a/src/fd/FaceDetection.h +++ b/src/fd/FaceDetection.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/fd/facessd/FaceSSD.cpp b/src/fd/facessd/FaceSSD.cpp index 13c60ec1..60cbc72f 100644 --- a/src/fd/facessd/FaceSSD.cpp +++ b/src/fd/facessd/FaceSSD.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,52 +35,47 @@ FaceSSD::FaceSSD(int cameraId, unsigned int maxFaceNum, int32_t halStreamId, int int gfxFmt, int usage) : FaceDetection(cameraId, maxFaceNum, halStreamId, width, height) { CLEAR(mResult); - int ret = initFaceDetection(width, height, gfxFmt, usage); - CheckAndLogError(ret != OK, VOID_VALUE, "failed to init face detection, ret %d", ret); -} - -FaceSSD::~FaceSSD() { - LOG1(" @%s", mCameraId, __func__); - - if (!PlatformData::isFaceEngineSyncRunning(mCameraId)) { - requestExit(); - AutoMutex l(mRunBufQueueLock); - mRunCondition.notify_one(); - } - if (mBufferPool) { - mBufferPool->destroyBufferPool(); - } -} - -int FaceSSD::initFaceDetection(int width, int height, int gfxFmt, int usage) { - mBufferPool = std::unique_ptr(new camera3::Camera3BufferPool()); - // Create the buffer pool with DMA handle buffer - int ret = mBufferPool->createBufferPool(mCameraId, MAX_STORE_FACE_DATA_BUF_NUM, width, height, - gfxFmt, usage); - CheckAndLogError(ret != icamera::OK, NO_MEMORY, "[%p]@%s Failed to createBufferPool.", this, - __func__); mFaceDetector = cros::FaceDetector::Create(); - - if (!PlatformData::isFaceEngineSyncRunning(mCameraId)) { - /* start face engine pthread */ - ret = run("fdSSD" + std::to_string(mCameraId), PRIORITY_NORMAL); - CheckAndLogError(ret != OK, NO_INIT, "Camera thread failed to start, ret %d", ret); - } + CheckAndLogError(!mFaceDetector, VOID_VALUE, "mFaceDetector is nullptr"); mInitialized = true; - return OK; } -std::shared_ptr FaceSSD::acquireRunCCBuf() { - std::shared_ptr buf = mBufferPool->acquireBuffer(); - CheckAndLogError(buf == nullptr, nullptr, "@%s no available internal buffer", __func__); - - return buf; +FaceSSD::~FaceSSD() { + mFaceDetector = nullptr; } -void FaceSSD::returnRunBuf(std::shared_ptr gbmRunBuf) { - mBufferPool->returnBuffer(gbmRunBuf); +void FaceSSD::faceDetectResult(cros::FaceDetectResult ret, + std::vector faces) { + AutoMutex l(mFaceResultLock); + CLEAR(mResult); + + if (ret == cros::FaceDetectResult::kDetectOk) { + std::vector sortFaces = faces; + std::sort(sortFaces.begin(), sortFaces.end(), + [](const human_sensing::CrosFace& a, const human_sensing::CrosFace& b) { + auto area1 = (a.bounding_box.x2 - a.bounding_box.x1) * + (a.bounding_box.y2 - a.bounding_box.y1); + auto area2 = (b.bounding_box.x2 - b.bounding_box.x1) * + (b.bounding_box.y2 - b.bounding_box.y1); + return area1 > area2; + }); + + int faceCount = 0; + for (auto& face : sortFaces) { + if (faceCount >= mMaxFaceNum) break; + mResult.faceSsdResults[faceCount] = face; + faceCount++; + LOG2("face result: box: %f,%f,%f,%f", face.bounding_box.x1, face.bounding_box.y1, + face.bounding_box.x2, face.bounding_box.y2); + } + mResult.faceNum = faceCount; + mResult.faceUpdated = true; + LOG2("@%s, faceNum:%d", __func__, mResult.faceNum); + } else { + LOGE("@%s, Faile to detect face", __func__); + } } void FaceSSD::runFaceDetectionBySync(const std::shared_ptr& ccBuf) { @@ -88,85 +83,58 @@ void FaceSSD::runFaceDetectionBySync(const std::shared_ptr face_detection_result = - camera3::FaceDetectionResultCallbackManager::getInstance(). - getFaceDetectionResult(mCameraId); - - cros::FaceDetectResult ret = cros::FaceDetectResult::kDetectOk; - std::vector faces; - if (!face_detection_result) { - int input_stride = ccBuf->stride(); - cros::Size input_size = cros::Size(ccBuf->width(), ccBuf->height()); - const uint8_t* buffer_addr = static_cast(ccBuf->data()); - - ret = mFaceDetector->Detect(buffer_addr, input_stride, input_size, &faces); - LOG2("Run with a new cros::FaceDetector instance"); - } else { - faces = face_detection_result->faces; + camera3::FaceDetectionResultCallbackManager::getInstance().getFaceDetectionResult( + mCameraId); + + if (face_detection_result) { LOG2("FrameNum:%zu, run with the cros::FaceDetector from stream manipulator.", face_detection_result->frame_number); - } - printfFDRunRate(); - LOG2("@%s: It takes need %ums", __func__, - (unsigned)((CameraUtils::systemTime() - startTime) / 1000000)); - - { - AutoMutex l(mFaceResultLock); - CLEAR(mResult); - if (ret == cros::FaceDetectResult::kDetectOk) { - int faceCount = 0; - for (auto& face : faces) { - if (faceCount >= mMaxFaceNum) break; - mResult.faceSsdResults[faceCount] = face; - faceCount++; - LOG2("@%s, bounding_box: %f,%f,%f,%f", __func__, - face.bounding_box.x1, - face.bounding_box.y1, - face.bounding_box.x2, - face.bounding_box.y2); - } - mResult.faceNum = faceCount; - mResult.faceUpdated = true; - LOG2("@%s, faceNum:%d", __func__, mResult.faceNum); - } else { - LOGE("@%s, Faile to detect face", __func__); + auto array = PlatformData::getActivePixelArray(mCameraId); + camera_coordinate_system_t dst = {0, 0, mWidth, mHeight}; + int vCrop = 0; + int hCrop = 0; + int gap = (mWidth * (array.bottom - array.top) / (array.right - array.left)) - mHeight; + if (gap > 0) { + vCrop = gap; + } else if (gap < 0) { + hCrop = (mHeight * (array.right - array.left) / (array.bottom - array.top)) - mWidth; + } + + for (auto& face : face_detection_result->faces) { + camera_coordinate_t leftTop = {static_cast(face.bounding_box.x1) + hCrop / 2, + static_cast(face.bounding_box.y1) + vCrop / 2}; + leftTop = AiqUtils::convertCoordinateSystem(array, dst, leftTop); + face.bounding_box.x1 = leftTop.x; + face.bounding_box.y1 = leftTop.y; + camera_coordinate_t rightBottom = {static_cast(face.bounding_box.x2) + hCrop / 2, + static_cast(face.bounding_box.y2) + vCrop / 2}; + rightBottom = AiqUtils::convertCoordinateSystem(array, dst, rightBottom); + face.bounding_box.x2 = rightBottom.x; + face.bounding_box.y2 = rightBottom.y; } + + faceDetectResult(cros::FaceDetectResult::kDetectOk, face_detection_result->faces); + return; } + + int input_stride = ccBuf->stride(); + cros::Size input_size = cros::Size(ccBuf->width(), ccBuf->height()); + const uint8_t* buffer_addr = static_cast(ccBuf->data()); + + // base::Unretained is safe since 'this' joins 'face thread' in the destructor. + mFaceDetector->DetectAsync(buffer_addr, input_stride, input_size, std::nullopt, + base::BindOnce(&FaceSSD::faceDetectResult, base::Unretained(this))); } void FaceSSD::runFaceDetectionByAsync(const std::shared_ptr& ccBuf) { LOG2("@%s", __func__); CheckAndLogError(mInitialized == false, VOID_VALUE, "@%s, mInitialized is false", __func__); - std::shared_ptr bufferTmp = acquireRunCCBuf(); - CheckAndLogError(!bufferTmp || !bufferTmp->data(), VOID_VALUE, "No avalible buffer"); - MEMCPY_S(bufferTmp->data(), bufferTmp->size(), ccBuf->data(), ccBuf->size()); - - AutoMutex l(mRunBufQueueLock); - mRunGoogleBufQueue.push(bufferTmp); - mRunCondition.notify_one(); -} - -bool FaceSSD::threadLoop() { - std::shared_ptr faceParams = nullptr; - - { - ConditionLock lock(mRunBufQueueLock); - if (mRunGoogleBufQueue.empty()) { - mRunCondition.wait_for(lock, - std::chrono::nanoseconds(kMaxDuration * SLOWLY_MULTIPLIER)); - return true; - } - faceParams = mRunGoogleBufQueue.front(); - mRunGoogleBufQueue.pop(); - } - CheckAndLogError(!faceParams, false, "@%s, faceParams buffer is nullptr", __func__); - - runFaceDetectionBySync(faceParams); - returnRunBuf(faceParams); - return true; + runFaceDetectionBySync(ccBuf); } int FaceSSD::getFaceNum() { diff --git a/src/fd/facessd/FaceSSD.h b/src/fd/facessd/FaceSSD.h index 5a649c47..6e4d16d7 100644 --- a/src/fd/facessd/FaceSSD.h +++ b/src/fd/facessd/FaceSSD.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,7 @@ #include #include -#include -#include -#include "Camera3BufferPool.h" #include "FaceDetection.h" #include "IntelCCATypes.h" @@ -41,7 +38,6 @@ class FaceSSD : public FaceDetection { virtual void runFaceDetectionBySync(const std::shared_ptr& ccBuf); virtual void runFaceDetectionByAsync(const std::shared_ptr& ccBuf); - virtual bool threadLoop(); protected: virtual int getFaceNum(); @@ -49,18 +45,10 @@ class FaceSSD : public FaceDetection { virtual void getResultForApp(CVFaceDetectionAbstractResult* result); private: - int initFaceDetection(int width, int height, int gfxFmt, int usage); - std::shared_ptr acquireRunCCBuf(); - void returnRunBuf(std::shared_ptr gbmRunBuf); + void faceDetectResult(cros::FaceDetectResult ret, std::vector faces); - // Guard for running buffer queue of thread - std::queue> mRunGoogleBufQueue; - - std::unique_ptr mBufferPool; std::unique_ptr mFaceDetector; - FaceSSDResult mResult; - DISALLOW_COPY_AND_ASSIGN(FaceSSD); }; diff --git a/src/hal/CameraHal.cpp b/src/hal/CameraHal.cpp index 710d86a2..acbeb064 100644 --- a/src/hal/CameraHal.cpp +++ b/src/hal/CameraHal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,10 @@ CameraHal::CameraHal() : mInitTimes(0), mState(HAL_UNINIT), mCameraOpenNum(0) { LOG1("@%s", __func__); CLEAR(mCameraDevices); + // VIRTUAL_CHANNEL_S + CLEAR(mTotalVirtualChannelCamNum); + CLEAR(mConfigTimes); + // VIRTUAL_CHANNEL_E } CameraHal::~CameraHal() { @@ -65,6 +69,13 @@ int CameraHal::init() { int ret = PlatformData::init(); CheckAndLogError(ret != OK, NO_INIT, "PlatformData init failed"); + // VIRTUAL_CHANNEL_S + for (int i = 0; i < MAX_VC_GROUP_NUMBER; i++) { + mTotalVirtualChannelCamNum[i] = 0; + mConfigTimes[i] = 0; + } + // VIRTUAL_CHANNEL_E + mState = HAL_INIT; return OK; @@ -80,6 +91,13 @@ int CameraHal::deinit() { return OK; } + // VIRTUAL_CHANNEL_S + for (int i = 0; i < MAX_VC_GROUP_NUMBER; i++) { + mTotalVirtualChannelCamNum[i] = 0; + mConfigTimes[i] = 0; + } + // VIRTUAL_CHANNEL_E + // FRAME_SYNC_S // SyncManager is used to do synchronization with multi-devices. // Release it when the last device exit @@ -98,8 +116,8 @@ int CameraHal::deinit() { return OK; } -int CameraHal::deviceOpen(int cameraId) { - LOG1(" @%s", cameraId, __func__); +int CameraHal::deviceOpen(int cameraId, int vcNum) { + LOG1(" @%s SENSORCTRLINFO: vcNum %d", cameraId, __func__, vcNum); AutoMutex l(mLock); CheckAndLogError(mState == HAL_UNINIT, NO_INIT, "HAL is not initialized"); @@ -109,17 +127,36 @@ int CameraHal::deviceOpen(int cameraId) { return INVALID_OPERATION; } + if (mCameraShm.CameraDeviceOpen(cameraId) != OK) return INVALID_OPERATION; + mCameraDevices[cameraId] = new CameraDevice(cameraId); - mCameraOpenNum++; + // VIRTUAL_CHANNEL_S + camera_info_t info; + CLEAR(info); + PlatformData::getCameraInfo(cameraId, info); + int groupId = info.vc.group >= 0 ? info.vc.group : 0; + mTotalVirtualChannelCamNum[groupId] = vcNum; + // VIRTUAL_CHANNEL_E + + // The check is to handle dual camera cases + mCameraOpenNum = mCameraShm.cameraDeviceOpenNum(); + CheckAndLogError(mCameraOpenNum == 0, INVALID_OPERATION, "camera open num couldn't be 0"); if (mCameraOpenNum == 1) { MediaControl* mc = MediaControl::getInstance(); CheckAndLogError(!mc, UNKNOWN_ERROR, "MediaControl init failed"); + if (PlatformData::isResetLinkRoute(cameraId)) { int ret = mc->resetAllLinks(); CheckAndLogError(ret != OK, DEV_BUSY, "resetAllLinks failed"); } + // VIRTUAL_CHANNEL_S + if (info.vc.total_num) { + // when the sensor belongs to virtual channel, reset the routes + if (PlatformData::isResetLinkRoute(cameraId)) mc->resetAllRoutes(cameraId); + } + // VIRTUAL_CHANNEL_E } return mCameraDevices[cameraId]->init(); @@ -134,7 +171,7 @@ void CameraHal::deviceClose(int cameraId) { delete mCameraDevices[cameraId]; mCameraDevices[cameraId] = nullptr; - mCameraOpenNum--; + mCameraShm.CameraDeviceClose(cameraId); } } @@ -177,6 +214,19 @@ int CameraHal::deviceConfigStreams(int cameraId, stream_config_t* streamList) { return INVALID_OPERATION; } + // VIRTUAL_CHANNEL_S + camera_info_t info; + CLEAR(info); + PlatformData::getCameraInfo(cameraId, info); + int groupId = info.vc.group >= 0 ? info.vc.group : 0; + if (mTotalVirtualChannelCamNum[groupId] > 0) { + mConfigTimes[groupId]++; + LOG1(" @%s, mConfigTimes:%d, before signal", cameraId, __func__, + mConfigTimes[groupId]); + mVirtualChannelSignal[groupId].signal(); + } + // VIRTUAL_CHANNEL_E + return ret; } @@ -187,6 +237,27 @@ int CameraHal::deviceStart(int cameraId) { CameraDevice* device = mCameraDevices[cameraId]; checkCameraDevice(device, BAD_VALUE); + // VIRTUAL_CHANNEL_S + camera_info_t info; + CLEAR(info); + PlatformData::getCameraInfo(cameraId, info); + int groupId = info.vc.group >= 0 ? info.vc.group : 0; + LOG1(" @%s, mConfigTimes:%d, mTotalVirtualChannelCamNum:%d", cameraId, __func__, + mConfigTimes[groupId], mTotalVirtualChannelCamNum[groupId]); + + if (mTotalVirtualChannelCamNum[groupId] > 0) { + int timeoutCnt = 10; + while (mConfigTimes[groupId] < mTotalVirtualChannelCamNum[groupId]) { + mVirtualChannelSignal[groupId].waitRelative(lock, mWaitDuration * SLOWLY_MULTIPLIER); + LOG1(" @%s, mConfigTimes:%d, timeoutCnt:%d", cameraId, __func__, + mConfigTimes[groupId], timeoutCnt); + --timeoutCnt; + CheckAndLogError(!timeoutCnt, TIMED_OUT, " mConfigTimes:%d, wait time out", + cameraId, mConfigTimes[groupId]); + } + } + // VIRTUAL_CHANNEL_E + return device->start(); } diff --git a/src/hal/CameraHal.h b/src/hal/CameraHal.h index 6b3e5158..500cc04a 100644 --- a/src/hal/CameraHal.h +++ b/src/hal/CameraHal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ #include "CameraDevice.h" #include "Parameters.h" +#include "iutils/CameraShm.h" + namespace icamera { /** @@ -47,7 +49,7 @@ class CameraHal { virtual int deinit(); // Device API - virtual int deviceOpen(int cameraId); + virtual int deviceOpen(int cameraId, int vcNum = 0); virtual void deviceClose(int cameraId); virtual void deviceCallbackRegister(int cameraId, const camera_callback_ops_t* callback); @@ -71,9 +73,17 @@ class CameraHal { int mInitTimes; // Guard for CameraHal public API. Mutex mLock; + // VIRTUAL_CHANNEL_S + int mTotalVirtualChannelCamNum[MAX_VC_GROUP_NUMBER]; + int mConfigTimes[MAX_VC_GROUP_NUMBER]; + Condition mVirtualChannelSignal[MAX_VC_GROUP_NUMBER]; + static const nsecs_t mWaitDuration = 500000000; // 500ms + // VIRTUAL_CHANNEL_E enum { HAL_UNINIT, HAL_INIT } mState; + // Used to store variables in different process + CameraSharedMemory mCameraShm; int mCameraOpenNum; }; diff --git a/src/hal/ICamera.cpp b/src/hal/ICamera.cpp index 8f4e5b96..af599b56 100644 --- a/src/hal/ICamera.cpp +++ b/src/hal/ICamera.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -125,16 +125,17 @@ void camera_callback_register(int camera_id, const camera_callback_ops_t* callba * Open one camera device * * \param camera_id camera index + * \param vc_num total virtual channel camera number * * \return error code **/ -int camera_device_open(int camera_id) { +int camera_device_open(int camera_id, int vc_num) { HAL_TRACE_CALL(1); CheckAndLogError(!gCameraHal, INVALID_OPERATION, "camera hal is NULL."); CheckCameraId(camera_id, BAD_VALUE); - return gCameraHal->deviceOpen(camera_id); + return gCameraHal->deviceOpen(camera_id, vc_num); } /** @@ -330,6 +331,12 @@ int get_frame_size(int camera_id, int format, int width, int height, int field, __attribute__((constructor)) void initCameraHAL() { Log::setDebugLevel(); CameraDump::setDumpLevel(); + + if (CameraDump::isDumpTypeEnable(DUMP_THREAD)) { + CameraDump::setDumpThread(); + LOGI("Dynamic dump is enabled."); + } + gCameraHal = new CameraHal(); } diff --git a/src/hal/MockCameraHal.cpp b/src/hal/MockCameraHal.cpp index 8ee977a6..1f4f44f3 100644 --- a/src/hal/MockCameraHal.cpp +++ b/src/hal/MockCameraHal.cpp @@ -82,7 +82,7 @@ int MockCameraHal::deinit() { return OK; } -int MockCameraHal::deviceOpen(int cameraId) +int MockCameraHal::deviceOpen(int cameraId, int vcNum) { LOG1("@%s", cameraId, __func__); diff --git a/src/hal/MockCameraHal.h b/src/hal/MockCameraHal.h index cde53065..93772089 100644 --- a/src/hal/MockCameraHal.h +++ b/src/hal/MockCameraHal.h @@ -53,7 +53,7 @@ class MockCameraHal : public CameraHal, public Thread { // Device API public: - virtual int deviceOpen(int cameraId); + virtual int deviceOpen(int cameraId, int vcNum = 0); virtual void deviceClose(int cameraId); virtual void deviceCallbackRegister(int cameraId, const camera_callback_ops_t* callback); diff --git a/src/hal/hal_adaptor/CMakeLists.txt b/src/hal/hal_adaptor/CMakeLists.txt new file mode 100644 index 00000000..5a64ede7 --- /dev/null +++ b/src/hal/hal_adaptor/CMakeLists.txt @@ -0,0 +1,121 @@ +# +# Copyright (C) 2023 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +cmake_minimum_required(VERSION 2.8) +project(hal_adaptor) + +# Source directories +set(ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../) +set(METADATA_DIR ${ROOT_DIR}/src/metadata) +set(IUTILS_DIR ${ROOT_DIR}/src/iutils) +set(HAL_ADAPTOR_DIR ${ROOT_DIR}/src/hal/hal_adaptor) + +include_directories(${ROOT_DIR}/include + ${ROOT_DIR}/include/api + ${ROOT_DIR}/include/utils + ${ROOT_DIR}/src/metadata + ${ROOT_DIR}/src/iutils + ${ROOT_DIR}/src/core + ${ROOT_DIR}/src/platformdata + ${ROOT_DIR}/src/isp_control + ${ROOT_DIR}/src + ${ROOT_DIR}/modules/v4l2 + ${ROOT_DIR} + ) + +# Install directories +# CMAKE_INSTALL_PREFIX is defined when executing cmake. +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}" CACHE PATH "Target location for install command." FORCE) +endif() +message(STATUS "install prefix: " ${CMAKE_INSTALL_PREFIX}) + +include(GNUInstallDirs) + +# Set the aligned flag +set(CMAKE_POSITION_INDEPENDENT_CODE ON) +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG(-faligned-new COMPILER_SUPPORTS_ALIGNED_NEW) +if (COMPILER_SUPPORTS_ALIGNED_NEW) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -faligned-new") +endif() + +# Set the CXX to 11 +set (CMAKE_CXX_STANDARD 11) +add_compile_options(-Wall -Werror + -fstack-protector + -fPIE -fPIC + -D_FORTIFY_SOURCE=2 + -DDCHECK_ALWAYS_ON + -Wformat -Wformat-security + ) + +add_definitions(-D__STDC_FORMAT_MACROS + -DHAVE_PTHREADS + -DHAVE_LINUX_OS + ) + +set(HAL_ADAPTOR_LD_FLAGS "-fPIE -fPIC -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wl,-z,relro -Wl,-z,now") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${HAL_ADAPTOR_LD_FLAGS}") + +set(HAL_ADAPTOR_SRCS + ${METADATA_DIR}/icamera_metadata_base.cpp + ${METADATA_DIR}/CameraMetadata.cpp + ${METADATA_DIR}/Parameters.cpp + ${METADATA_DIR}/ParameterHelper.cpp + ${IUTILS_DIR}/CameraLog.cpp + ${IUTILS_DIR}/LogSink.cpp + ${IUTILS_DIR}/ModuleTags.cpp + ${IUTILS_DIR}/Trace.cpp + ${IUTILS_DIR}/Utils.cpp + ${IUTILS_DIR}/ScopedAtrace.cpp + ${HAL_ADAPTOR_DIR}/HalAdaptor.cpp + CACHE INTERNAL "hal adaptor sources" +) + +add_library(hal_adaptor SHARED ${HAL_ADAPTOR_SRCS}) + +#---------------------------- Link settings ---------------------------- +set (THREADS_PREFER_PTHREAD_FLAG ON) +find_package (Threads REQUIRED) +target_link_libraries(hal_adaptor ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(hal_adaptor ${CMAKE_DL_LIBS}) +target_link_libraries(hal_adaptor rt) + +# Install headers +install(DIRECTORY ${ROOT_DIR}/include/ DESTINATION include/hal_adaptor) +if (SUPPORT_LIVE_TUNING) + install(FILES ${ROOT_DIR}/modules/livetune/LiveTuning.h DESTINATION include/hal_adaptor/api) +endif() + +# Install libraries +if (${CMAKE_VERSION} VERSION_LESS 3.11) + install(TARGETS hal_adaptor + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +else() + install(TARGETS hal_adaptor DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif() + +# Install package config file +configure_file(${PROJECT_SOURCE_DIR}/hal_adaptor.pc.cmakein + ${PROJECT_SOURCE_DIR}/hal_adaptor.pc @ONLY) +install(FILES hal_adaptor.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + +set(CPACK_GENERATOR "RPM") +include(CPack) diff --git a/src/hal/hal_adaptor/HalAdaptor.cpp b/src/hal/hal_adaptor/HalAdaptor.cpp new file mode 100644 index 00000000..e14418a1 --- /dev/null +++ b/src/hal/hal_adaptor/HalAdaptor.cpp @@ -0,0 +1,216 @@ +/* + * Copyright (C) 2023 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#define LOG_TAG HalAdaptor + +#include "HalAdaptor.h" + +#include + +#include "iutils/CameraLog.h" +#include "iutils/Utils.h" +#include "iutils/Errors.h" + +extern "C" { +namespace icamera { + +static void* gCameraHalLib = nullptr; +static HalApiHandle gCameraHalAdaptor = {}; + +#define CheckFuncCall(function) \ + do { \ + if (((function) == nullptr)) { \ + LOGE("%s, function call is nullptr", __func__); \ + return -1; \ + } \ + } while (0) + +#define GET_FUNC_CALL(member, fnName) \ + do { \ + gCameraHalAdaptor.member = (HalApiHandle::pFn##member)dlsym(gCameraHalLib, #fnName); \ + if (gCameraHalAdaptor.member == nullptr) { \ + LOGE("@%s: LOADING: " #fnName "failed: %s", __func__, dlerror()); \ + return; \ + } \ + LOG2("@%s: LOADING: " #fnName "= %x", __func__, gCameraHalAdaptor.member); \ + } while (0) + +static void load_camera_hal_library() { + FILE* pciDevice = fopen("/sys/bus/pci/drivers/intel-ipu6/0000:00:05.0/device", "rt"); + CheckAndLogError(!pciDevice, VOID_VALUE, "%s, failed to open PCI device. error: %s", __func__, + dlerror()); + + fseek(pciDevice, 0, SEEK_END); + int idSize = static_cast(ftell(pciDevice)); + fseek(pciDevice, 0, SEEK_SET); + + char pciID[idSize] = {0}; + int ret = fread(pciID, idSize, 1, pciDevice); + fclose(pciDevice); + CheckAndLogError((strlen(pciID) == 0), VOID_VALUE, "%s, Failed to read PCI id. %d", __func__, + ret); + + std::string libName = "/usr/lib/"; + if (strstr(pciID, "0xa75d") != nullptr /* RPL */ || + strstr(pciID, "0x462e") != nullptr /* ADLN */ || + strstr(pciID, "0x465d") != nullptr /* ADLP */) { + libName += "ipu_adl"; + } else if (strstr(pciID, "0x7d19") != nullptr /* MTL */) { + libName += "ipu_mtl"; + } else if (strstr(pciID, "0x9a19") != nullptr /* TGL */) { + libName += "ipu_tgl"; + } else if (strstr(pciID, "0x4e19") != nullptr /* JSL */) { + libName += "ipu_jsl"; + } else { + LOGE("%s, Not support the PCI device %s for hal adaptor API", __func__, pciID); + return VOID_VALUE; + } + libName += "/libcamhal.so"; + LOGI("%s, the library name: %s", __func__, libName.c_str()); + + gCameraHalLib = dlopen(libName.c_str(), RTLD_NOW); + CheckAndLogError(!gCameraHalLib, VOID_VALUE, "%s, failed to open library: %s, error: %s", + __func__, libName.c_str(), dlerror()); + + GET_FUNC_CALL(getNumberOfCameras, get_number_of_cameras); + GET_FUNC_CALL(getCameraInfo, get_camera_info); + GET_FUNC_CALL(cameraHalInit, camera_hal_init); + GET_FUNC_CALL(cameraHalDeinit, camera_hal_deinit); + GET_FUNC_CALL(cameraCallbackRegister, camera_callback_register); + GET_FUNC_CALL(cameraDeviceOpen, camera_device_open); + GET_FUNC_CALL(cameraDeviceClose, camera_device_close); + GET_FUNC_CALL(cameraDeviceConfigSensorInput, camera_device_config_sensor_input); + GET_FUNC_CALL(cameraDeviceConfigStreams, camera_device_config_streams); + GET_FUNC_CALL(cameraDeviceStart, camera_device_start); + GET_FUNC_CALL(cameraDeviceStop, camera_device_stop); + GET_FUNC_CALL(cameraDeviceAllocateMemory, camera_device_allocate_memory); + GET_FUNC_CALL(cameraStreamQbuf, camera_stream_qbuf); + GET_FUNC_CALL(cameraStreamDqbuf, camera_stream_dqbuf); + GET_FUNC_CALL(cameraSetParameters, camera_set_parameters); + GET_FUNC_CALL(cameraGetParameters, camera_get_parameters); + GET_FUNC_CALL(getHalFrameSize, get_frame_size); +} + +static void close_camera_hal_library() { + if (gCameraHalLib) { + dlclose(gCameraHalLib); + gCameraHalLib = nullptr; + } +} + +int get_number_of_cameras() { + CheckFuncCall(gCameraHalAdaptor.getNumberOfCameras); + return gCameraHalAdaptor.getNumberOfCameras(); +} + +int get_camera_info(int camera_id, camera_info_t& info) { + CheckFuncCall(gCameraHalAdaptor.getCameraInfo); + return gCameraHalAdaptor.getCameraInfo(camera_id, info); +} +int camera_hal_init() { + CheckFuncCall(gCameraHalAdaptor.cameraHalInit); + return gCameraHalAdaptor.cameraHalInit(); +} + +int camera_hal_deinit() { + CheckFuncCall(gCameraHalAdaptor.cameraHalDeinit); + return gCameraHalAdaptor.cameraHalDeinit(); +} + +void camera_callback_register(int camera_id, const camera_callback_ops_t* callback) { + if (!gCameraHalAdaptor.cameraCallbackRegister) { + LOGE("%s, function call is nullptr", __func__); + return VOID_VALUE; + } + gCameraHalAdaptor.cameraCallbackRegister(camera_id, callback); +} + +int camera_device_open(int camera_id, int vc_num) { + CheckFuncCall(gCameraHalAdaptor.cameraDeviceOpen); + return gCameraHalAdaptor.cameraDeviceOpen(camera_id, vc_num); +} + +void camera_device_close(int camera_id) { + if (!gCameraHalAdaptor.cameraDeviceClose) { + LOGE("%s, function call is nullptr", __func__); + return VOID_VALUE; + } + gCameraHalAdaptor.cameraDeviceClose(camera_id); +} + +int camera_device_config_sensor_input(int camera_id, const stream_t* input_config) { + CheckFuncCall(gCameraHalAdaptor.cameraDeviceConfigSensorInput); + return gCameraHalAdaptor.cameraDeviceConfigSensorInput(camera_id, input_config); +} + +int camera_device_config_streams(int camera_id, stream_config_t* stream_list) { + CheckFuncCall(gCameraHalAdaptor.cameraDeviceConfigStreams); + return gCameraHalAdaptor.cameraDeviceConfigStreams(camera_id, stream_list); +} + +int camera_device_start(int camera_id) { + CheckFuncCall(gCameraHalAdaptor.cameraDeviceStart); + return gCameraHalAdaptor.cameraDeviceStart(camera_id); +} + +int camera_device_stop(int camera_id) { + CheckFuncCall(gCameraHalAdaptor.cameraDeviceStop); + return gCameraHalAdaptor.cameraDeviceStop(camera_id); +} + +int camera_device_allocate_memory(int camera_id, camera_buffer_t* buffer) { + CheckFuncCall(gCameraHalAdaptor.cameraDeviceAllocateMemory); + return gCameraHalAdaptor.cameraDeviceAllocateMemory(camera_id, buffer); +} + +int camera_stream_qbuf(int camera_id, camera_buffer_t** buffer, int num_buffers, + const Parameters* settings) { + CheckFuncCall(gCameraHalAdaptor.cameraStreamQbuf); + return gCameraHalAdaptor.cameraStreamQbuf(camera_id, buffer, num_buffers, settings); +} + +int camera_stream_dqbuf(int camera_id, int stream_id, camera_buffer_t** buffer, + Parameters* settings) { + CheckFuncCall(gCameraHalAdaptor.cameraStreamDqbuf); + return gCameraHalAdaptor.cameraStreamDqbuf(camera_id, stream_id, buffer, settings); +} + +int camera_set_parameters(int camera_id, const Parameters& param) { + CheckFuncCall(gCameraHalAdaptor.cameraSetParameters); + return gCameraHalAdaptor.cameraSetParameters(camera_id, param); +} + +int camera_get_parameters(int camera_id, Parameters& param, int64_t sequence) { + CheckFuncCall(gCameraHalAdaptor.cameraGetParameters); + return gCameraHalAdaptor.cameraGetParameters(camera_id, param, sequence); +} + +int get_frame_size(int camera_id, int format, int width, int height, int field, int* bpp) { + CheckFuncCall(gCameraHalAdaptor.getHalFrameSize); + return gCameraHalAdaptor.getHalFrameSize(camera_id, format, width, height, field, bpp); +} + +__attribute__((constructor)) void initHalAdaptor() { + Log::setDebugLevel(); + load_camera_hal_library(); +} + +__attribute__((destructor)) void deinitHalAdaptor() { + close_camera_hal_library(); + CLEAR(gCameraHalAdaptor); +} + +} // namespace icamera +} // extern "C" diff --git a/src/hal/hal_adaptor/HalAdaptor.h b/src/hal/hal_adaptor/HalAdaptor.h new file mode 100644 index 00000000..cca1dab0 --- /dev/null +++ b/src/hal/hal_adaptor/HalAdaptor.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2023 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "ICamera.h" + +extern "C" { +namespace icamera { + +struct HalApiHandle { +#define _DEF_HAL_FUNC(ret, name, ...) \ + typedef ret (*pFn##name)(__VA_ARGS__); \ + pFn##name name + + _DEF_HAL_FUNC(int, getNumberOfCameras); + _DEF_HAL_FUNC(int, getCameraInfo, int camera_id, camera_info_t& info); + _DEF_HAL_FUNC(int, cameraHalInit); + _DEF_HAL_FUNC(int, cameraHalDeinit); + _DEF_HAL_FUNC(void, cameraCallbackRegister, int camera_id, + const camera_callback_ops_t* callback); + _DEF_HAL_FUNC(int, cameraDeviceOpen, int camera_id, int vc_num); + _DEF_HAL_FUNC(void, cameraDeviceClose, int camera_id); + _DEF_HAL_FUNC(int, cameraDeviceConfigSensorInput, int camera_id, const stream_t* inputConfig); + _DEF_HAL_FUNC(int, cameraDeviceConfigStreams, int camera_id, stream_config_t* stream_list); + _DEF_HAL_FUNC(int, cameraDeviceStart, int camera_id); + _DEF_HAL_FUNC(int, cameraDeviceStop, int camera_id); + _DEF_HAL_FUNC(int, cameraDeviceAllocateMemory, int camera_id, camera_buffer_t* buffer); + _DEF_HAL_FUNC(int, cameraStreamQbuf, int camera_id, camera_buffer_t** buffer, + int num_buffers, const Parameters* settings); + _DEF_HAL_FUNC(int, cameraStreamDqbuf, int camera_id, int stream_id, camera_buffer_t** buffer, + Parameters* settings); + _DEF_HAL_FUNC(int, cameraSetParameters, int camera_id, const Parameters& param); + _DEF_HAL_FUNC(int, cameraGetParameters, int camera_id, Parameters& param, int64_t sequence); + _DEF_HAL_FUNC(int, getHalFrameSize, int camera_id, int format, int width, int height, + int field, int* bpp); +}; +} // namespace icamera +} // extern "C" + diff --git a/src/hal/hal_adaptor/hal_adaptor.pc.cmakein b/src/hal/hal_adaptor/hal_adaptor.pc.cmakein new file mode 100644 index 00000000..e77e7178 --- /dev/null +++ b/src/hal/hal_adaptor/hal_adaptor.pc.cmakein @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include/hal_adaptor + +Name: libhal_adaptor +Description: Camera HAL Adaptor Library +URL: +Version: @VERSION@ +Libs: -L${libdir} -lhal_adaptor +Cflags: -I${includedir} -I${includedir}/api -I${includedir}/utils diff --git a/src/icbm/ICBMBuilder.h b/src/icbm/ICBMBuilder.h new file mode 100644 index 00000000..122e3856 --- /dev/null +++ b/src/icbm/ICBMBuilder.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "IntelICBM.h" +#include "OnePunchIC2.h" + +namespace icamera { + +#define USE_INTEL_OPIC2 + +#ifdef USE_INTEL_OPIC2 +static inline IIntelICBM* createIntelICBM() { + return new IntelOPIC2; +} + +#else +static inline IIntelICBM* createIntelICBM() { + return nullptr; +} +#endif + +} // namespace icamera diff --git a/src/icbm/ICBMThread.cpp b/src/icbm/ICBMThread.cpp new file mode 100644 index 00000000..6d9ebb00 --- /dev/null +++ b/src/icbm/ICBMThread.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2023 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG ICBMThread + +#include "src/icbm/ICBMThread.h" + +#include + +#include "ICBMThread.h" +#include "CameraLog.h" + +namespace icamera { + +int ICBMThread::setup(ICBMInitInfo* initParams) { + LOG1("%s, Starting up...", __func__); + mIntelICBM = std::make_unique(); + + auto ret = mIntelICBM->setup(initParams); + CheckAndLogError(ret != OK, ret, "%s: Init failed", __func__); + + return OK; +} + +void ICBMThread::shutdown(const ICBMReqInfo& request) { + LOG1("%s, Shuting down...", __func__); + mIntelICBM->shutdown(request); +} + +int ICBMThread::processFrame(const camera_buffer_t& inBuffer, const camera_buffer_t& outBuffer, + ICBMReqInfo& request) { + LOG2("%s, Processing frame", __func__); + + request.inII.width = inBuffer.s.width; + request.inII.height = inBuffer.s.height; + request.inII.size = inBuffer.s.size; + request.inII.stride = inBuffer.s.stride; + + request.outII.width = outBuffer.s.width; + request.outII.height = outBuffer.s.height; + request.outII.size = outBuffer.s.size; + request.outII.stride = outBuffer.s.stride; + +#ifdef ENABLE_SANDBOXING + request.inII.gfxHandle = inBuffer.dmafd; + request.outII.gfxHandle = outBuffer.dmafd; + + auto ret = mIntelICBM->processFrame(request); +#else + void* pInBuf = (inBuffer.s.memType == V4L2_MEMORY_DMABUF) ? + CameraBuffer::mapDmaBufferAddr(inBuffer.dmafd, inBuffer.s.size) : + inBuffer.addr; + + void* pOutBuf = (outBuffer.s.memType == V4L2_MEMORY_DMABUF) ? + CameraBuffer::mapDmaBufferAddr(outBuffer.dmafd, outBuffer.s.size) : + outBuffer.addr; + + request.inII.bufAddr = pInBuf; + request.outII.bufAddr = pOutBuf; + auto ret = mIntelICBM->processFrame(request); + + if (inBuffer.s.memType == V4L2_MEMORY_DMABUF) { + CameraBuffer::unmapDmaBufferAddr(pInBuf, inBuffer.s.size); + } + + if (outBuffer.s.memType == V4L2_MEMORY_DMABUF) { + CameraBuffer::unmapDmaBufferAddr(pOutBuf, outBuffer.s.size); + } +#endif + + if (ret != OK) { + LOGE("%s Run frame fails", __func__); + return UNKNOWN_ERROR; + } + return OK; +} + +} // namespace icamera diff --git a/src/icbm/ICBMThread.h b/src/icbm/ICBMThread.h new file mode 100644 index 00000000..42d99632 --- /dev/null +++ b/src/icbm/ICBMThread.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2023 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "ICBMTypes.h" + +#include "core/CameraBuffer.h" +#include "iutils/Utils.h" +#include "Parameters.h" + +#ifdef ENABLE_SANDBOXING +#include "modules/sandboxing/client/IntelICBMClient.h" +#else +#include "modules/algowrapper/IntelICBM.h" +#endif + +namespace icamera { + +class ICBMThread { + public: + ICBMThread() {} + ~ICBMThread() {} + + int setup(ICBMInitInfo* initParams); + void shutdown(const ICBMReqInfo& request); + + int processFrame(const camera_buffer_t& inBuffer, const camera_buffer_t& outBuffer, + ICBMReqInfo& request); + + private: + std::unique_ptr mIntelICBM; +}; +} // namespace icamera \ No newline at end of file diff --git a/src/icbm/ICBMTypes.h b/src/icbm/ICBMTypes.h index b0f8f295..cb64d6a5 100644 --- a/src/icbm/ICBMTypes.h +++ b/src/icbm/ICBMTypes.h @@ -17,56 +17,74 @@ #pragma once #include +#include "src/iutils/Errors.h" +#include "subway_autogen.h" namespace icamera { -constexpr static uint32_t UF_MODE_OFF = 0; -constexpr static uint32_t UF_MODE_ON = 1; - -enum class ICBMResult { - OK, - InternalError, - FrameError, - GBMMappingError, - SHMError, - IPCError, -}; - -static inline const char* getResultStr(const ICBMResult r) { - switch (r) { - case ICBMResult::OK: return "OK"; - case ICBMResult::InternalError: return "InternalError"; - case ICBMResult::FrameError: return "FrameError"; - case ICBMResult::GBMMappingError: return "GBMMappingError"; - case ICBMResult::SHMError: return "SHMError"; - case ICBMResult::IPCError: return "IPCError"; - }; -} - struct ImageInfo { - uint32_t gfxHandle; + int32_t gfxHandle; void* bufAddr; uint32_t width; uint32_t height; uint32_t stride; uint32_t size; + ImageInfo() : gfxHandle(-1), bufAddr(nullptr), width(0), height(0), stride(0), size(0) {} }; -struct ICBMReqInfo { - uint32_t usrFrmEnabled; +#define ICBM_REQUEST_MAX_SHIFT 15 +enum ICBMFeatureType { + REQUEST_NONE = 0, + LEVEL0_TNR = 1 << 1, + USER_FRAMING = 1 << 2, + BC_MODE_BB = 1 << 3, + REQUEST_MAX = 1 << ICBM_REQUEST_MAX_SHIFT }; struct ICBMInitInfo { + int cameraId; + uint32_t sessionType; uint32_t height; uint32_t width; }; -struct ICBMRunInfo { +struct ICBMReqInfo { + int cameraId; + // all ICBM features supported by this ICBM session, used to identify session object + uint32_t sessionType; + // set per-frame, 1 or several features in sessionType list + uint32_t reqType; ImageInfo inII; ImageInfo outII; - uint32_t inHandle; - uint32_t outHandle; - ICBMReqInfo icbmReqInfo; + int32_t inHandle; + int32_t outHandle; + int32_t paramHandle; + void* paramAddr; + ICBMReqInfo() + : cameraId(-1), + sessionType(REQUEST_NONE), + reqType(REQUEST_NONE), + inHandle(-1), + outHandle(-1), + paramHandle(-1), + paramAddr(nullptr) {} +}; + +struct IC2ApiHandle { +#define _DEF_IC2_FUNC(ret, name, ...) \ + typedef ret (*pFn##name)(__VA_ARGS__); \ + pFn##name name + + _DEF_IC2_FUNC(void, query_version, int* major, int* minor, int* patch); + _DEF_IC2_FUNC(void, startup); + _DEF_IC2_FUNC(void, shutdown); + _DEF_IC2_FUNC(void, query_features, char* future_d, size_t* fsize); + _DEF_IC2_FUNC(void, set_loglevel, iaic_log_level leve); + _DEF_IC2_FUNC(void, create_session, iaic_session uid, const char* feature, iaic_options opt); + _DEF_IC2_FUNC(void, close_session, iaic_session uid, const char* feature); + _DEF_IC2_FUNC(bool, execute, iaic_session uid, iaic_memory in, iaic_memory out); + _DEF_IC2_FUNC(void, set_data, iaic_session uid, iaic_memory& data); + _DEF_IC2_FUNC(void, get_data, iaic_session uid, iaic_memory& data); }; } // namespace icamera diff --git a/src/icbm/IntelICBM.h b/src/icbm/IntelICBM.h index 3d3a69a2..69a53532 100644 --- a/src/icbm/IntelICBM.h +++ b/src/icbm/IntelICBM.h @@ -24,9 +24,9 @@ class IIntelICBM { public: virtual ~IIntelICBM() {} - virtual ICBMResult setup(void* initParams) = 0; + virtual int setup(void* initParams) = 0; virtual void shutdown() = 0; - virtual ICBMResult processFrame(const ImageInfo& iii, const ImageInfo& iio, + virtual int processFrame(const ImageInfo& iii, const ImageInfo& iio, const ICBMReqInfo& reqInfo) = 0; }; diff --git a/src/icbm/MemoryChain.cpp b/src/icbm/MemoryChain.cpp new file mode 100644 index 00000000..fe980532 --- /dev/null +++ b/src/icbm/MemoryChain.cpp @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "src/icbm/MemoryChain.h" + +namespace icamera { + +MemoryChainDescription::MemoryChainDescription(const ImageInfo& iii, const ImageInfo& iio) + : mInInfo(iii), + mOutInfo(iio) {} + +void MemoryChainDescription::linkIn(const char* featureName, const char* inPortName, + const char* outPortName) { + iaic_memory inMemory = createMemoryDesc(mInInfo); + iaic_memory outMemory = createMemoryDesc(mOutInfo); + + inMemory.p = mInInfo.bufAddr; + outMemory.p = mOutInfo.bufAddr; + + inMemory.feature_name = featureName; + inMemory.port_name = inPortName; + + outMemory.feature_name = featureName; + outMemory.port_name = outPortName; + + inMemory.media_type = iaic_nv12; + outMemory.media_type = iaic_nv12; + + mInChain.push_back(inMemory); + mOutChain.push_back(outMemory); + + if (mInChain.size() > 1) mInChain[mInChain.size() - 2].next = &mInChain[mInChain.size() - 1]; + if (mOutChain.size() > 1) + mOutChain[mOutChain.size() - 2].next = &mOutChain[mOutChain.size() - 1]; +} + +MemoryIOPort MemoryChainDescription::getIOPort() { + if (mInChain.empty() || mOutChain.empty()) + return {nullptr, nullptr}; + else + return {&mInChain[0], &mOutChain[0]}; +} + +iaic_memory MemoryChainDescription::createMemoryDesc(const ImageInfo& ii) { + iaic_memory mem = {}; + + mem.has_gfx = false; + mem.size[0] = ii.size; + mem.size[1] = ii.width; + mem.size[2] = ii.height; + mem.size[3] = ii.stride; + + return mem; +} +} // namespace icamera diff --git a/src/icbm/MemoryChain.h b/src/icbm/MemoryChain.h new file mode 100644 index 00000000..27c83912 --- /dev/null +++ b/src/icbm/MemoryChain.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "src/icbm/ICBMTypes.h" +#include "src/icbm/OPIC2Api.h" + +namespace icamera { +using MemoryChain = std::vector; +using MemoryIOPort = std::pair; + +class MemoryChainDescription { + public: + MemoryChainDescription(const ImageInfo& iii, const ImageInfo& iio); + ~MemoryChainDescription() = default; + MemoryChainDescription(MemoryChainDescription&& rhs) = default; + MemoryChainDescription& operator=(const MemoryChainDescription& rhs) = delete; + MemoryChainDescription(const MemoryChainDescription& rhs) = delete; + + void linkIn(const char* featureName, const char* inPortName, const char* outPortName); + MemoryIOPort getIOPort(); + + private: + ImageInfo mInInfo; + ImageInfo mOutInfo; + + MemoryChain mInChain; + MemoryChain mOutChain; + + iaic_memory createMemoryDesc(const ImageInfo& ii); +}; +} // namespace icamera diff --git a/src/icbm/OPIC2Api.h b/src/icbm/OPIC2Api.h index fde526a8..afae0143 100644 --- a/src/icbm/OPIC2Api.h +++ b/src/icbm/OPIC2Api.h @@ -18,79 +18,16 @@ #define IC2API_FOR_CHROME_H extern "C" { + #define KEYPOINTSCOUNT 40 struct FaceResult { - int x; - int y; - int width; - int height; - float keypoints[KEYPOINTSCOUNT][2]; - bool valid; + int x; + int y; + int width; + int height; + float keypoints[KEYPOINTSCOUNT][2]; + bool valid; }; - -enum iaic_media_format { iaic_nv12 }; -enum iaic_log_level { trace = 0, debug, info, warning, error, fatal }; - -enum class iaic_session_status { - uninitialized, - opening, - opened, - shutdown, - critical -}; - -struct iaic_memory { - const char* port_name; - const char* feature_name; - - union { - void* p; - void* r; - }; - - unsigned long long size[4]; - iaic_media_format media_type; - bool has_gfx; - struct iaic_memory* next; -}; - -struct iaic_options { - bool profiling = false; - bool blocked_init = false; - unsigned int threads = 1; - void* external_device = nullptr; -}; - -struct iaic_join_desc { - iaic_join_desc* next = nullptr; - const char* src_feature_name = nullptr; - const char* src_port_name = nullptr; - const char* dst_feature_name = nullptr; - const char* dst_port_name = nullptr; -}; - -typedef unsigned int iaic_session; - -extern void iaic_query_version(int* major, int* minor, int* patch); -extern void iaic_startup(); -extern void iaic_shutdown(); - -extern void iaic_query_features(char* future_d, size_t* fsize); -extern void iaic_startup(); -extern void iaic_shutdown(); - -extern void iaic_set_loglevel(iaic_log_level level); -extern void iaic_create_session(iaic_session uid, const char* feature, iaic_options opt); -extern void iaic_close_session(iaic_session uid, const char* feature); -extern void iaic_join_session(iaic_session uid, iaic_join_desc desc); -extern void iaic_disjoin_session(iaic_session uid, iaic_join_desc desc); -extern void iaic_pause_feature(iaic_session uid, const char* feature); -extern void iaic_resume_feature(iaic_session uid, const char* feature); -extern bool iaic_execute(iaic_session uid, iaic_memory in, iaic_memory out); -extern void iaic_set_data(iaic_session uid, iaic_memory& data); -extern void iaic_get_data(iaic_session uid, iaic_memory& data); -extern iaic_session_status iaic_get_status(iaic_session uid, const char* feature); - } #endif diff --git a/src/icbm/OnePunchIC2.cpp b/src/icbm/OnePunchIC2.cpp new file mode 100644 index 00000000..c20ddb5c --- /dev/null +++ b/src/icbm/OnePunchIC2.cpp @@ -0,0 +1,294 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG OnePunchIC2 + +#include "src/icbm/OnePunchIC2.h" + +#include +#include +#include + +#include "iutils/CameraLog.h" +#include "Utils.h" +#include "TNRCommon.h" + +namespace icamera { + +IntelOPIC2* IntelOPIC2::sInstance = nullptr; +std::mutex IntelOPIC2::sLock; + +void UserFramingBuilder::linkToMemoryChain(MemoryChainDescription& memoryChain) { + memoryChain.linkIn("user_framing", "source:source", "drain:drain"); +} + +void BackgroundBlurBuilder::linkToMemoryChain(MemoryChainDescription& memoryChain) { + memoryChain.linkIn("background_concealment", "in:source", "out:drain"); +} + +static const std::unordered_map gFeatureStrMapping = { + {ICBMFeatureType::USER_FRAMING, "user_framing"}, + {ICBMFeatureType::BC_MODE_BB, "background_concealment"}, + {ICBMFeatureType::LEVEL0_TNR, "tnr7us_l0"}, +}; + +IntelOPIC2* IntelOPIC2::getInstance() { + std::lock_guard lock(sLock); + if (!sInstance) { + sInstance = new IntelOPIC2(); + } + + return sInstance; +} + +void IntelOPIC2::releaseInstance() { + std::lock_guard lock(sLock); + if (sInstance) delete sInstance; + sInstance = nullptr; +} + +IntelOPIC2::IntelOPIC2() { + mLockMap.clear(); + mSessionMap.clear(); + mFeatureMap.clear(); +} + +IntelOPIC2::~IntelOPIC2() { + mLockMap.clear(); + mSessionMap.clear(); + mFeatureMap.clear(); +} + +int IntelOPIC2::setup(ICBMInitInfo* initParams, std::shared_ptr handle) { + CheckAndLogError(!handle, NAME_NOT_FOUND, "%s", __func__); + mIC2Api = handle; + + int ver[3]; + mIC2Api->query_version(&ver[0], &ver[1], &ver[2]); + LOG1("@%s, IC2 Version %d.%d.%d", __func__, ver[0], ver[1], ver[2]); + + size_t featureLen; + std::string supportedFeatures; + mIC2Api->query_features(nullptr, &featureLen); + supportedFeatures.resize(featureLen); + mIC2Api->query_features(supportedFeatures.data(), &featureLen); + LOG1("@%s, IC supported features: %s", __func__, supportedFeatures.c_str()); + + LOG1("<%d>@%s type %d", initParams->cameraId, __func__, initParams->sessionType); + int key = getIndexKey(initParams->cameraId, initParams->sessionType); + + CheckWarning((mSessionMap.find(key) != mSessionMap.end()), OK, + " @%s, request type: %d is already exist", initParams->cameraId, __func__, + initParams->sessionType); + + for (int feature = USER_FRAMING; feature < REQUEST_MAX; feature <<= 1) { + if (!(initParams->sessionType & feature)) continue; + const char* featureStr = gFeatureStrMapping.at(static_cast(feature)); + if (strstr(supportedFeatures.c_str(), featureStr) == nullptr) { + LOG1("<%d>@%s type %d not supported", initParams->cameraId, __func__, feature); + return OK; + } + } + + mLockMap[key] = std::unique_ptr(new std::mutex); + std::unique_lock lock(*mLockMap[key]); + + mFeatureMap[key] = std::vector(); + // we use the key value as the unique session id + mSessionMap[key] = static_cast(key); + if (initParams->sessionType & ICBMFeatureType::USER_FRAMING) { + iaic_options option{}; + option.profiling = false; + option.blocked_init = false; + const char* featureStr = gFeatureStrMapping.at(ICBMFeatureType::USER_FRAMING); + mIC2Api->create_session(mSessionMap[key], featureStr, option); + mFeatureMap[key].push_back(featureStr); + } + + if (initParams->sessionType & ICBMFeatureType::BC_MODE_BB) { + iaic_options option{}; + option.profiling = false; + option.blocked_init = false; + const char* featureStr = gFeatureStrMapping.at(ICBMFeatureType::BC_MODE_BB); + mIC2Api->create_session(mSessionMap[key], featureStr, option); + mFeatureMap[key].push_back(featureStr); + } + if (initParams->sessionType & ICBMFeatureType::LEVEL0_TNR) { + iaic_options option{}; + option.profiling = true; + option.blocked_init = true; + const char* featureStr = gFeatureStrMapping.at(ICBMFeatureType::LEVEL0_TNR); + mIC2Api->create_session(mSessionMap[key], featureStr, option); + mFeatureMap[key].push_back(featureStr); + } + + return OK; +} + +int IntelOPIC2::shutdown(const ICBMReqInfo& reqInfo) { + LOG1("<%d>@%s type %d", reqInfo.cameraId, __func__, reqInfo.sessionType); + int key = getIndexKey(reqInfo.cameraId, reqInfo.sessionType); + + CheckAndLogError((mSessionMap.find(key) == mSessionMap.end()), NAME_NOT_FOUND, + " @%s, request type: %d is not exist", reqInfo.cameraId, __func__, + reqInfo.sessionType); + int ret = -1; + { + std::unique_lock lock(*mLockMap[key]); + for (auto& feature : mFeatureMap[key]) { + mIC2Api->close_session(mSessionMap[key], feature); + } + mSessionMap.erase(key); + ret = mSessionMap.size(); + } + mLockMap.erase(key); + return ret; +} + +int IntelOPIC2::processFrame(const ICBMReqInfo& reqInfo) { + int key = getIndexKey(reqInfo.cameraId, reqInfo.sessionType); + + CheckAndLogError((mSessionMap.find(key) == mSessionMap.end()), BAD_VALUE, + " @%s, request type: %d is not exist", reqInfo.cameraId, __func__, + reqInfo.sessionType); + auto mcd = createMemoryChain(reqInfo); + auto mem = mcd.getIOPort(); + if (mem.first == nullptr) return OK; + + std::unique_lock lock(*mLockMap[key]); + bool res = mIC2Api->execute(mSessionMap[key], *mem.first, *mem.second); + mIC2Api->get_data(mSessionMap[key], *mem.second); + CheckAndLogError(res != true, UNKNOWN_ERROR, "%s, IC2 Internal Error on processing frame", + __func__); + + return OK; +} + +int IntelOPIC2::runTnrFrame(const ICBMReqInfo& reqInfo) { + LOG2("%s, ", __func__); + int key = getIndexKey(reqInfo.cameraId, reqInfo.sessionType); + + CheckAndLogError((mSessionMap.find(key) == mSessionMap.end()), BAD_VALUE, + " @%s, request type: %d is not exist", reqInfo.cameraId, __func__, + reqInfo.sessionType); + + const char* featureName = gFeatureStrMapping.at(ICBMFeatureType::LEVEL0_TNR); + iaic_memory inMem, outMem; + inMem.has_gfx = false; + inMem.size[0] = reqInfo.inII.size; + inMem.size[1] = reqInfo.inII.width; + inMem.size[2] = reqInfo.inII.height; + inMem.size[3] = reqInfo.inII.stride; + inMem.media_type = iaic_nv12; + inMem.p = reqInfo.inII.bufAddr; + inMem.feature_name = featureName; + inMem.port_name = "in:source"; + inMem.next = nullptr; + + outMem = inMem; + outMem.size[0] = reqInfo.outII.size; + outMem.size[1] = reqInfo.outII.width; + outMem.size[2] = reqInfo.outII.height; + outMem.size[3] = reqInfo.outII.stride; + outMem.port_name = "out:drain"; + outMem.p = reqInfo.outII.bufAddr; + + Tnr7Param* tnrParam = static_cast(reqInfo.paramAddr); + LOG2("%s, is first %f", __func__, tnrParam->bc.is_first_frame); + std::unique_lock lock(*mLockMap[key]); + setData(mSessionMap[key], &tnrParam->bc.is_first_frame, sizeof(tnrParam->bc.is_first_frame), + featureName, "tnr7us/pal:is_first_frame"); + setData(mSessionMap[key], &tnrParam->bc.do_update, sizeof(tnrParam->bc.do_update), featureName, + "tnr7us/pal:do_update"); + setData(mSessionMap[key], &tnrParam->bc.tune_sensitivity, sizeof(tnrParam->bc.tune_sensitivity), + featureName, "tnr7us/pal:tune_sensitivity"); + setData(mSessionMap[key], &tnrParam->bc.coeffs, sizeof(tnrParam->bc.coeffs), featureName, + "tnr7us/pal:coeffs"); + setData(mSessionMap[key], &tnrParam->bc.global_protection, + sizeof(tnrParam->bc.global_protection), featureName, "tnr7us/pal:global_protection"); + setData(mSessionMap[key], &tnrParam->bc.global_protection_inv_num_pixels, + sizeof(tnrParam->bc.global_protection_inv_num_pixels), featureName, + "tnr7us/pal:global_protection_inv_num_pixels"); + setData(mSessionMap[key], &tnrParam->bc.global_protection_sensitivity_lut_values, + sizeof(tnrParam->bc.global_protection_sensitivity_lut_values), featureName, + "tnr7us/pal:global_protection_sensitivity_lut_values"); + setData(mSessionMap[key], &tnrParam->bc.global_protection_sensitivity_lut_slopes, + sizeof(tnrParam->bc.global_protection_sensitivity_lut_slopes), featureName, + "tnr7us/pal:global_protection_sensitivity_lut_slopes"); + // tnr7 imTnrSession, ms params + setData(mSessionMap[key], &tnrParam->ims.update_limit, sizeof(tnrParam->ims.update_limit), + featureName, "tnr7us/pal:update_limit"); + setData(mSessionMap[key], &tnrParam->ims.update_coeff, sizeof(tnrParam->ims.update_coeff), + featureName, "tnr7us/pal:update_coeff"); + setData(mSessionMap[key], &tnrParam->ims.d_ml, sizeof(tnrParam->ims.d_ml), featureName, + "tnr7us/pal:d_ml"); + setData(mSessionMap[key], &tnrParam->ims.d_slopes, sizeof(tnrParam->ims.d_slopes), featureName, + "tnr7us/pal:d_slopes"); + setData(mSessionMap[key], &tnrParam->ims.d_top, sizeof(tnrParam->ims.d_top), featureName, + "tnr7us/pal:d_top"); + setData(mSessionMap[key], &tnrParam->ims.outofbounds, sizeof(tnrParam->ims.outofbounds), + featureName, "tnr7us/pal:outofbounds"); + setData(mSessionMap[key], &tnrParam->ims.radial_start, sizeof(tnrParam->ims.radial_start), + featureName, "tnr7us/pal:radial_start"); + setData(mSessionMap[key], &tnrParam->ims.radial_coeff, sizeof(tnrParam->ims.radial_coeff), + featureName, "tnr7us/pal:radial_coeff"); + setData(mSessionMap[key], &tnrParam->ims.frame_center_x, sizeof(tnrParam->ims.frame_center_x), + featureName, "tnr7us/pal:frame_center_x"); + setData(mSessionMap[key], &tnrParam->ims.frame_center_y, sizeof(tnrParam->ims.frame_center_y), + featureName, "tnr7us/pal:frame_center_y"); + setData(mSessionMap[key], &tnrParam->ims.r_coeff, sizeof(tnrParam->ims.r_coeff), featureName, + "tnr7us/pal:r_coeff"); + // tnr7 bmTnrSession, lend params + setData(mSessionMap[key], &tnrParam->blend.max_recursive_similarity, + sizeof(tnrParam->blend.max_recursive_similarity), featureName, + "tnr7us/pal:max_recursive_similarity"); + + int ret = mIC2Api->execute(mSessionMap[key], inMem, outMem); + mIC2Api->get_data(mSessionMap[key], outMem); + + return ret; +} + +void IntelOPIC2::setData(iaic_session uid, void* p, size_t size, const char* featureName, + const char* portName) { + iaic_memory setting{}; + setting.has_gfx = false; + setting.feature_name = featureName; + + setting.port_name = portName; + setting.p = p; + setting.size[0] = size; + mIC2Api->set_data(uid, setting); +} + +MemoryChainDescription IntelOPIC2::createMemoryChain(const ICBMReqInfo& reqInfo) { + MemoryChainDescription mCD(reqInfo.inII, reqInfo.outII); + + if (reqInfo.reqType & ICBMFeatureType::USER_FRAMING) { + UserFramingBuilder().linkToMemoryChain(mCD); + } + + if (reqInfo.reqType & ICBMFeatureType::BC_MODE_BB) { + BackgroundBlurBuilder().linkToMemoryChain(mCD); + } + if (reqInfo.reqType & ICBMFeatureType::LEVEL0_TNR) { + mCD.linkIn(gFeatureStrMapping.at(ICBMFeatureType::LEVEL0_TNR), "in:source", "out:drain"); + } + + return mCD; +} + +} // namespace icamera diff --git a/src/icbm/OnePunchIC2.h b/src/icbm/OnePunchIC2.h new file mode 100644 index 00000000..5fdad6db --- /dev/null +++ b/src/icbm/OnePunchIC2.h @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +#include "src/iutils/Utils.h" + +#include "src/icbm/ICBMTypes.h" +#include "src/icbm/OPIC2Api.h" +#include "src/icbm/MemoryChain.h" + +namespace icamera { + +struct IOPIC2Algorithm { + virtual ~IOPIC2Algorithm() = default; + virtual void linkToMemoryChain(MemoryChainDescription& memoryChain) = 0; +}; + +class UserFramingBuilder : public IOPIC2Algorithm { + public: + UserFramingBuilder() = default; + ~UserFramingBuilder() = default; + + void linkToMemoryChain(MemoryChainDescription& memoryChain) override; +}; + +class BackgroundBlurBuilder : public IOPIC2Algorithm { + public: + BackgroundBlurBuilder() = default; + ~BackgroundBlurBuilder() = default; + + void linkToMemoryChain(MemoryChainDescription& memoryChain) override; +}; + +class IntelOPIC2 { + public: + static IntelOPIC2* getInstance(); + static void releaseInstance(); + + /** + * \brief create level0 session according to the cameraID and request type + * + * \return 0 if succeed. + */ + int setup(ICBMInitInfo* initParam, std::shared_ptr handle); + + /** + * \brief shundown level0 session according to the cameraID and request type + * + * \return active session count(>=0) if succeed. <0 if failed + */ + int shutdown(const ICBMReqInfo& reqInfo); + + int processFrame(const ICBMReqInfo& reqInfo); + + /** + * \brief process tnr frame + * + * \return 0 if succeed + */ + int runTnrFrame(const ICBMReqInfo& reqInfo); + + private: + static IntelOPIC2* sInstance; + static std::mutex sLock; + std::shared_ptr mIC2Api; + + IntelOPIC2(); + ~IntelOPIC2(); + int loadIC2Library(); + // lock for each session, key is from getIndexKey() + std::unordered_map> mLockMap; + // session map, key is from getIndexKey() + std::unordered_map mSessionMap; + // feature vector of each session + std::unordered_map> mFeatureMap; + + // transfer cameraId and type to index of the mSessionMap and mLockMap + int getIndexKey(int cameraId, uint32_t type) { + return (cameraId << ICBM_REQUEST_MAX_SHIFT) + type; + } + + static MemoryChainDescription createMemoryChain(const ICBMReqInfo& reqInfo); + + // set parameters to the session before process + void setData(iaic_session uid, void* p, size_t size, const char* featureName, + const char* portName); + + DISALLOW_COPY_AND_ASSIGN(IntelOPIC2); +}; + +} // namespace icamera diff --git a/src/image_process/PostProcessorBase.cpp b/src/image_process/PostProcessorBase.cpp index e2d27a60..6955995a 100644 --- a/src/image_process/PostProcessorBase.cpp +++ b/src/image_process/PostProcessorBase.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation. + * Copyright (C) 2019-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -147,7 +147,8 @@ std::shared_ptr JpegProcess::cropAndDownscaleThumbnail( int format = camera3::HalV3Utils::V4l2FormatToHALFormat(inBuf->v4l2Fmt()); int usage = inBuf->usage(); - LOG2("%s, inputbuffer format:%d, usage:%d", __func__, format, usage); + LOG2("%s, inputbuffer format:%s(%d), usage:%d", __func__, + CameraUtils::format2string(inBuf->v4l2Fmt()).c_str(), format, usage); // Do crop first if needed if (IImageProcessor::isProcessingTypeSupported(POST_PROCESS_CROP) && diff --git a/src/iutils/CMakeLists.txt b/src/iutils/CMakeLists.txt index d39e7331..5d329207 100644 --- a/src/iutils/CMakeLists.txt +++ b/src/iutils/CMakeLists.txt @@ -24,6 +24,9 @@ set(IUTILS_SRCS ${IUTILS_DIR}/Thread.cpp ${IUTILS_DIR}/Utils.cpp ${IUTILS_DIR}/SwImageConverter.cpp +# SUPPORT_MULTI_PROCESS_S + ${IUTILS_DIR}/CameraShm.cpp +# SUPPORT_MULTI_PROCESS_E CACHE INTERNAL "iutils sources" ) diff --git a/src/iutils/CameraDump.cpp b/src/iutils/CameraDump.cpp index 7c977bd3..4376a22d 100644 --- a/src/iutils/CameraDump.cpp +++ b/src/iutils/CameraDump.cpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include @@ -42,6 +44,8 @@ using std::string; namespace icamera { +Thread* gDumpThread = nullptr; + int gDumpType = 0; int gDumpFormat = 0; uint32_t gDumpSkipNum = 0; @@ -83,9 +87,13 @@ void CameraDump::setDumpLevel(void) { } char* cameraDumpPath = getenv(PROP_CAMERA_HAL_DUMP_PATH); - snprintf(gDumpPath, sizeof(gDumpPath), "%s", "./"); + if (cameraDumpPath) { snprintf(gDumpPath, sizeof(gDumpPath), "%s", cameraDumpPath); + LOGI("User defined dump path %s", gDumpPath); + } else { + snprintf(gDumpPath, sizeof(gDumpPath), "%s", "./"); + LOG1("Default dump path %s", gDumpPath); } char* cameraDumpSkipNum = getenv(PROP_CAMERA_HAL_DUMP_SKIP_NUM); @@ -145,6 +153,15 @@ void CameraDump::setDumpLevel(void) { } } +void CameraDump::setDumpThread(void) { + if (!gDumpThread) { + // Default disable AIQDUMP when use dump thread + setenv("AIQDUMP", "disable", 1); + gDumpThread = new DumpThread(); + gDumpThread->run("DumpThread", PRIORITY_NORMAL); + } +} + bool CameraDump::isDumpTypeEnable(int dumpType) { return gDumpType & dumpType; } @@ -394,14 +411,12 @@ void CameraDump::dumpImage(int cameraId, const shared_ptr& camBuff int fd = camBuffer->getFd(); int bufferSize = camBuffer->getBufferSize(); int memoryType = camBuffer->getMemory(); - void* pBuf = (memoryType == V4L2_MEMORY_DMABUF) ? - camBuffer->mapDmaBufferAddr() : camBuffer->getBufferAddr(); + + ScopeMapping mapper(camBuffer); + void* pBuf = mapper.getUserPtr(); LOG1("@%s, fd:%d, buffersize:%d, buf:%p, memoryType:%d, fileName:%s", __func__, fd, bufferSize, pBuf, memoryType, fileName.c_str()); writeData(pBuf, bufferSize, fileName.c_str()); - if (memoryType == V4L2_MEMORY_DMABUF) { - camBuffer->unmapDmaBufferAddr(pBuf); - } } void CameraDump::dumpBinary(int cameraId, const void* data, int size, BinParam_t* binParam) { @@ -422,4 +437,89 @@ void CameraDump::dumpBinary(int cameraId, const void* data, int size, BinParam_t writeData(data, size, fileName.c_str()); } +namespace CameraDump { +DumpThread::DumpThread() {} +DumpThread::~DumpThread() {} + +#define FIFO_NAME "/tmp/cameraDump" +#define BUFFER_SIZE 4096 +bool DumpThread::threadLoop() { + int pipe_fd; + int res; + int open_mode = O_RDONLY; + int bytes_read = 0; + char buffer[BUFFER_SIZE + 1]; + char* equal = nullptr; + const char* PROP_CAMERA_HAL_DUMP = "cameraDump"; + const char* PROP_CAMERA_HAL_DUMP_FORMAT = "cameraDumpFormat"; + const char* PROP_CAMERA_HAL_DUMP_PATH = "cameraDumpPath"; + const char* PROP_CAMERA_HAL_DUMP_SKIP_NUM = "cameraDumpSkipNum"; + const char* PROP_CAMERA_HAL_DUMP_RANGE = "cameraDumpRange"; + const char* PROP_CAMERA_HAL_DUMP_FREQUENCY = "cameraDumpFrequency"; + const char* PROP_AIQDUMP = "AIQDUMP"; + + char fifo_name[BUFFER_SIZE + 1]; + + LOGI("DumpThread start"); + + memset(fifo_name, '\0', sizeof(fifo_name)); + snprintf(fifo_name, BUFFER_SIZE, "%s_%d", FIFO_NAME, getpid()); + if (access(fifo_name, F_OK) == -1) { + res = mkfifo(fifo_name, 0777); + if (res != 0) { + LOGI("Could not create fifo %s", fifo_name); + } + } + + memset(buffer, '\0', sizeof(buffer)); + + pipe_fd = open(fifo_name, open_mode); + LOGI("Process %d opened fd %d", getpid(), pipe_fd); + + if (pipe_fd != -1) { + do { + res = read(pipe_fd, buffer, BUFFER_SIZE); + bytes_read += res; + } while (0); + (void)close(pipe_fd); + } else { + return false; + } + + LOGI("Process %d finished, %s", getpid(), buffer); + equal = strchr(buffer, '='); + if (equal) { + *equal = '\0'; + } else { + return true; + } + + LOGI("%s, %d, %s", __func__, __LINE__, buffer); + if (!strncmp(PROP_CAMERA_HAL_DUMP, buffer, strlen(PROP_CAMERA_HAL_DUMP)) + && strlen(PROP_CAMERA_HAL_DUMP) == strlen(buffer)) { + setenv(PROP_CAMERA_HAL_DUMP, equal + 1, 1); + } else if (!strncmp(PROP_CAMERA_HAL_DUMP_FORMAT, buffer, + strlen(PROP_CAMERA_HAL_DUMP_FORMAT))) { + setenv(PROP_CAMERA_HAL_DUMP_FORMAT, equal + 1, 1); + } else if (!strncmp(PROP_CAMERA_HAL_DUMP_PATH, buffer, + strlen(PROP_CAMERA_HAL_DUMP_PATH))) { + setenv(PROP_CAMERA_HAL_DUMP_PATH, equal + 1, 1); + } else if (!strncmp(PROP_CAMERA_HAL_DUMP_SKIP_NUM, buffer, + strlen(PROP_CAMERA_HAL_DUMP_SKIP_NUM))) { + setenv(PROP_CAMERA_HAL_DUMP_SKIP_NUM, equal + 1, 1); + } else if (!strncmp(PROP_CAMERA_HAL_DUMP_RANGE, buffer, + strlen(PROP_CAMERA_HAL_DUMP_RANGE))) { + setenv(PROP_CAMERA_HAL_DUMP_RANGE, equal + 1, 1); + } else if (!strncmp(PROP_CAMERA_HAL_DUMP_FREQUENCY, buffer, + strlen(PROP_CAMERA_HAL_DUMP_FREQUENCY))) { + setenv(PROP_CAMERA_HAL_DUMP_FREQUENCY, equal + 1, 1); + } else if (!strncmp(PROP_AIQDUMP, buffer, strlen(PROP_AIQDUMP))) { + setenv(PROP_AIQDUMP, equal + 1, 1); + } + setDumpLevel(); + + return true; +} +} // namespace CameraDump + } // namespace icamera diff --git a/src/iutils/CameraDump.h b/src/iutils/CameraDump.h index cb8f583f..b3679914 100644 --- a/src/iutils/CameraDump.h +++ b/src/iutils/CameraDump.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include "iutils/Thread.h" #include "CameraBuffer.h" #include "CameraTypes.h" @@ -62,6 +63,9 @@ enum { DUMP_NVM_DATA = 1 << 16, DUMP_MAKER_NOTE = 1 << 17, DUMP_EMBEDDED_METADATA = 1 << 18, + + // Enable dump thread for dynamic control, export cameraDump=0x100000 + DUMP_THREAD = 1 << 20, }; enum { @@ -142,6 +146,7 @@ namespace CameraDump { * File dump control functions. */ void setDumpLevel(void); +void setDumpThread(void); bool isDumpTypeEnable(int dumpType); bool isDumpFormatEnable(int dumpFormat); void writeData(const void* data, int size, const char* fileName); @@ -155,6 +160,15 @@ void dumpImage(int cameraId, const std::shared_ptr& camBuffer, * Dump any buffer to binary file */ void dumpBinary(int cameraId, const void* data, int size, BinParam_t* binParam); + +class DumpThread : public Thread { +public: + DumpThread(); + ~DumpThread(); + + bool threadLoop(); +}; + } // namespace CameraDump } // namespace icamera diff --git a/src/iutils/CameraLog.cpp b/src/iutils/CameraLog.cpp index 876a27b3..84e23705 100644 --- a/src/iutils/CameraLog.cpp +++ b/src/iutils/CameraLog.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2022 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -291,6 +291,10 @@ void setDebugLevel(void) { // performance char* perfLevel = getenv(PROP_CAMERA_HAL_PERF); if (perfLevel) { +#ifndef GPU_ALGO_SERVER +#ifdef CAL_BUILD + initPerfettoTrace(); +#else gPerfLevel = strtoul(perfLevel, nullptr, 0); LOGI("Performance level is 0x%x", gPerfLevel); @@ -316,6 +320,8 @@ void setDebugLevel(void) { gIsDumpMediaInfo = true; } ScopedAtrace::setTraceLevel(gPerfLevel); +#endif +#endif } } diff --git a/src/iutils/CameraLog.h b/src/iutils/CameraLog.h index 00ce1526..4e8fe66d 100644 --- a/src/iutils/CameraLog.h +++ b/src/iutils/CameraLog.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2022 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +18,18 @@ #include -#include "utils/ScopedAtrace.h" #ifdef HAVE_ANDROID_OS #include #endif +#ifndef GPU_ALGO_SERVER +#ifdef CAL_BUILD +#include "src/iutils/PerfettoTrace.h" +#else +#include "utils/ScopedAtrace.h" +#endif +#endif + #ifdef CAMERA_TRACE #include "CameraTrace.h" #endif @@ -128,7 +135,7 @@ namespace Log { void setDebugLevel(void); void print_log(bool enable, const char* module, const int level, const char* format, ...); bool isDebugLevelEnable(int level); -bool isLogTagEnabled(int tag, int level = 0); +bool isLogTagEnabled(int tag, int level); // DUMP_ENTITY_TOPOLOGY_S bool isDumpMediaTopo(void); // DUMP_ENTITY_TOPOLOGY_E diff --git a/src/iutils/CameraShm.cpp b/src/iutils/CameraShm.cpp new file mode 100644 index 00000000..403402a8 --- /dev/null +++ b/src/iutils/CameraShm.cpp @@ -0,0 +1,274 @@ +/* + * Copyright (C) 2017-2021 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG CameraShm + +#include "CameraShm.h" + +#include +#include +#include + +#include "iutils/CameraLog.h" + +namespace icamera { + +static const int CAMERA_DEVICE_IDLE = 0; +static const int CAMERA_IPCKEY = 0x43414D; +static const int CAMERA_SHM_LOCK_TIME = 2; + +#define SEM_NAME "/camlock" + +CameraSharedMemory::CameraSharedMemory() + : mSemLock(nullptr), + mSharedMemId(-1), + mCameraSharedInfo(nullptr) { + PERF_CAMERA_ATRACE(); + + acquireSharedMemory(); +} + +CameraSharedMemory::~CameraSharedMemory() { + PERF_CAMERA_ATRACE(); + + releaseSharedMemory(); +} + +int CameraSharedMemory::CameraDeviceOpen(int cameraId) { + int ret = OK; + + CheckAndLogError(mCameraSharedInfo == nullptr, ret, "No attached camera shared memory!"); + + CheckAndLogError(lock() != OK, ret, "Fail to lock shared memory!"); + + // Check camera device status from the shared memory + pid_t pid = mCameraSharedInfo->camDevStatus[cameraId].pid; + char* name = mCameraSharedInfo->camDevStatus[cameraId].name; + if (pid != CAMERA_DEVICE_IDLE && processExist(pid, name)) { + LOG1("@%s(pid %d): device has been opened in another process(pid %d/%s)", __func__, + getpid(), pid, name); + ret = INVALID_OPERATION; + } else { + mCameraSharedInfo->camDevStatus[cameraId].pid = getpid(); + getNameByPid(getpid(), mCameraSharedInfo->camDevStatus[cameraId].name); + } + unlock(); + + return ret; +} + +void CameraSharedMemory::CameraDeviceClose(int cameraId) { + CheckAndLogError(mCameraSharedInfo == nullptr, VOID_VALUE, "No attached camera shared memory!"); + + CheckAndLogError(lock() != OK, VOID_VALUE, "Fail to lock shared memory!"); + if (mCameraSharedInfo->camDevStatus[cameraId].pid == getpid()) { + mCameraSharedInfo->camDevStatus[cameraId].pid = CAMERA_DEVICE_IDLE; + CLEAR(mCameraSharedInfo->camDevStatus[cameraId].name); + } else { + LOGW("@%s: The stored pid is not the pid of current process!", __func__); + } + unlock(); +} + +void CameraSharedMemory::acquireSharedMemory() { + openSemLock(); + + bool newCreated = false; + const size_t CAMERA_SM_SIZE = (sizeof(camera_shared_info) / getpagesize() + 1) * getpagesize(); + + CheckAndLogError(lock() != OK, VOID_VALUE, "Fail to lock shared memory!"); + // get the shared memory ID, create shared memory if not exist + mSharedMemId = shmget(CAMERA_IPCKEY, CAMERA_SM_SIZE, 0640); + if (mSharedMemId == -1) { + mSharedMemId = shmget(CAMERA_IPCKEY, CAMERA_SM_SIZE, IPC_CREAT | 0640); + if (mSharedMemId < 0) { + LOGE("Fail to allocate shared memory by shmget."); + unlock(); + return; + } + newCreated = true; + } + + // attach shared memory + mCameraSharedInfo = reinterpret_cast(shmat(mSharedMemId, nullptr, 0)); + if (mCameraSharedInfo == (void*)-1) { + LOGE("Fail to attach shared memory"); + mCameraSharedInfo = nullptr; + } else { + struct shmid_ds shmState; + int ret = shmctl(mSharedMemId, IPC_STAT, &shmState); + + // attach number is 1, current process is the only camera process + if (ret == 0 && shmState.shm_nattch == 1) { + if (newCreated) + LOG1("The shared memory is new created, init the values."); + else + LOG1("Some camera process exited abnormally. Reinit the values."); + + for (int i = 0; i < MAX_CAMERA_NUMBER; i++) { + mCameraSharedInfo->camDevStatus[i].pid = CAMERA_DEVICE_IDLE; + CLEAR(mCameraSharedInfo->camDevStatus[i].name); + } + } else { + // Check if the process stored in share memory is still running. + // Set the device status to IDLE if the stored process is not running. + for (int i = 0; i < MAX_CAMERA_NUMBER; i++) { + pid_t pid = mCameraSharedInfo->camDevStatus[i].pid; + char* name = mCameraSharedInfo->camDevStatus[i].name; + if (pid != CAMERA_DEVICE_IDLE && !processExist(pid, name)) { + LOG1("process %d(%s) opened the device but it's not running now.", pid, name); + mCameraSharedInfo->camDevStatus[i].pid = CAMERA_DEVICE_IDLE; + } + } + } + } + unlock(); +} + +void CameraSharedMemory::releaseSharedMemory() { + CheckAndLogError(mCameraSharedInfo == nullptr, VOID_VALUE, "No attached camera shared memory!"); + + // Make sure the camera device occupied info by current process is cleared + pid_t pid = getpid(); + CheckAndLogError(lock() != OK, VOID_VALUE, "Fail to lock shared memory!"); + for (int i = 0; i < MAX_CAMERA_NUMBER; i++) { + if (mCameraSharedInfo->camDevStatus[i].pid == pid) { + mCameraSharedInfo->camDevStatus[i].pid = CAMERA_DEVICE_IDLE; + LOGW("Seems camera device %d is not closed properly (pid %d).", i, pid); + } + } + + // detach shared memory + int ret = shmdt(mCameraSharedInfo); + if (ret != 0) { + LOGE("Fail to detach shared memory"); + } + + // delete shared memory if no one is attaching + struct shmid_ds shmState; + ret = shmctl(mSharedMemId, IPC_STAT, &shmState); + if (ret == 0 && shmState.shm_nattch == 0) { + LOG1("No attaches to the camera shared memory. Release it."); + shmctl(mSharedMemId, IPC_RMID, 0); + } + unlock(); + + closeSemLock(); +} + +int CameraSharedMemory::cameraDeviceOpenNum() { + CheckAndLogError(mCameraSharedInfo == nullptr, 0, "No attached camera shared memory!"); + + pid_t pid = getpid(); + int camOpenNum = 0; + + CheckAndLogError(lock() != OK, 0, "Fail to lock shared memory!"); + for (int i = 0; i < MAX_CAMERA_NUMBER; i++) { + if (mCameraSharedInfo->camDevStatus[i].pid != CAMERA_DEVICE_IDLE) { + LOG1("The camera device: %d is opened by pid: %d", i, pid); + camOpenNum++; + } + } + unlock(); + LOG1("Camera device is opened number: %d", camOpenNum); + + return camOpenNum; +} + +int CameraSharedMemory::getNameByPid(pid_t pid, char* name) { + const int BUF_SIZE = 1024; + char procPidPath[BUF_SIZE] = {'\0'}; + char buf[BUF_SIZE] = {'\0'}; + + snprintf(procPidPath, BUF_SIZE, "/proc/%d/status", static_cast(pid)); + FILE* fp = fopen(procPidPath, "r"); + CheckAndLogError(fp == nullptr, UNKNOWN_ERROR, "Fail to get the pid status!"); + + if (fgets(buf, BUF_SIZE - 1, fp) != nullptr) { + sscanf(buf, "%*s %64s", name); + } + fclose(fp); + + return OK; +} + +bool CameraSharedMemory::processExist(pid_t pid, const char* storedName) { + char name[MAX_PROCESS_NAME_LENGTH]; + return kill(pid, 0) == 0 && getNameByPid(pid, name) == OK && strcmp(storedName, name) == 0; +} + +void CameraSharedMemory::openSemLock() { + mSemLock = sem_open(SEM_NAME, O_CREAT | O_EXCL, 0777, 1); + if (mSemLock == SEM_FAILED) { + mSemLock = sem_open(SEM_NAME, O_RDWR); + if (mSemLock == SEM_FAILED) { + LOGE("failed to open sem lock, errno: %s\n", strerror(errno)); + return; + } else { + LOG1("Open the sem lock"); + } + } else { + LOG1("Create the sem lock"); + return; + } + + // Check if the semaphore is still available + int ret = OK; + struct timespec ts; + CLEAR(ts); + + // Wait the semaphore lock for 2 seconds + clock_gettime(CLOCK_REALTIME, &ts); + ts.tv_sec += CAMERA_SHM_LOCK_TIME; + while ((ret = sem_timedwait(mSemLock, &ts)) == -1 && errno == EINTR) { + } + if (ret == 0) { + sem_post(mSemLock); + return; + } + + if (ret != 0 && errno == ETIMEDOUT) { + LOG1("Lock timed out, process holding it may have crashed. Re-create the semaphore."); + sem_close(mSemLock); + sem_unlink(SEM_NAME); + mSemLock = sem_open(SEM_NAME, O_CREAT | O_EXCL, 0777, 1); + } +} + +void CameraSharedMemory::closeSemLock() { + sem_close(mSemLock); +} + +int CameraSharedMemory::lock() { + int ret = OK; + struct timespec ts; + CLEAR(ts); + + // Wait the semaphore lock for 2 seconds + clock_gettime(CLOCK_REALTIME, &ts); + ts.tv_sec += CAMERA_SHM_LOCK_TIME; + while (((ret = sem_timedwait(mSemLock, &ts)) == -1) && errno == EINTR) { + } + CheckAndLogError(ret != 0, UNKNOWN_ERROR, "Lock failed or timed out"); + + return OK; +} + +void CameraSharedMemory::unlock() { + sem_post(mSemLock); +} + +} // namespace icamera diff --git a/src/iutils/CameraShm.h b/src/iutils/CameraShm.h new file mode 100644 index 00000000..6f92872a --- /dev/null +++ b/src/iutils/CameraShm.h @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2017-2021 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#ifndef HAVE_ANDROID_OS +#include + +#include "PlatformData.h" +#endif + +namespace icamera { + +/** + * CameraSharedMemory : Maintain the camera shared memory for communication + * between camera applications running in different processes. + * + * camera device status: + * On camera device open, check the camera device status in shared memory. + * --IDLE, set the camera device status to "occupied" and open normally. + * --occupied, camera device has already been opened, and should not be + * opened again. + * On camera device close, set the camera device status to "IDLE" in shared memory. + * + * More infos that need to be shared between camera applications can be stored + * in the shared memory as well. + * + * This class is created along with cameraHal class. + */ +#ifdef HAVE_ANDROID_OS +// Shared memory is not necessary for Android since only single instance of HAL +// is supported. +class CameraSharedMemory { + public: + CameraSharedMemory() { mCameraDeviceOpenNum = 0; } + ~CameraSharedMemory() {} + int CameraDeviceOpen(int cameraId) { + mCameraDeviceOpenNum++; + return OK; + } + void CameraDeviceClose(int cameraId) { mCameraDeviceOpenNum--; } + int cameraDeviceOpenNum() { return mCameraDeviceOpenNum; } + + private: + int mCameraDeviceOpenNum; +}; + +#else +class CameraSharedMemory { + public: + CameraSharedMemory(); + ~CameraSharedMemory(); + /** + * \brief Check and update the camera device status in shared memory. + * + * On deviceOpen(), call this function to check the camera device status in + * shared memory. If the camera device has already been opened in another + * process, it should not be opened again. Otherwise, set the camera device + * to "occupied" in shared memory. Then it will not be opened again in + * another process. + * + * \return OK if succeed, other value indicates failed + */ + int CameraDeviceOpen(int cameraId); + + /** + * \brief Update the camera device status to "IDLE" in shared memory. + * + * On deviceClose(), call this function to set the camera device status to + * "IDLE" in shared memory. + * + */ + void CameraDeviceClose(int cameraId); + + /** + * \brief Get camera device open number. + * + * On cameraDeviceOpenNum()a call this function to get the camera device open times + * + */ + int cameraDeviceOpenNum(); + + private: + CameraSharedMemory(const CameraSharedMemory& copyClass); + CameraSharedMemory& operator=(const CameraSharedMemory& rightClass); + + void acquireSharedMemory(); + void releaseSharedMemory(); + + int getNameByPid(pid_t pid, char* name); + bool processExist(pid_t pid, const char* storedName); + void openSemLock(); + void closeSemLock(); + int lock(); + void unlock(); + + private: + static const int MAX_PROCESS_NAME_LENGTH = 64; + struct cameraDevStatus { + pid_t pid; + char name[MAX_PROCESS_NAME_LENGTH]; + }; + struct camera_shared_info { + cameraDevStatus camDevStatus[MAX_CAMERA_NUMBER]; + // Other static variables need to be stored should be added here + }; + + sem_t* mSemLock; + int mSharedMemId; + camera_shared_info* mCameraSharedInfo; +}; +#endif + +} // namespace icamera diff --git a/src/iutils/ModuleTags.cpp b/src/iutils/ModuleTags.cpp index 9747231e..bba451f5 100644 --- a/src/iutils/ModuleTags.cpp +++ b/src/iutils/ModuleTags.cpp @@ -83,7 +83,6 @@ const char* tagNames[] = { "Dvs", "EXIFMaker", "EXIFMetaData", - "EvcpManager", "ExifCreater", "FaceDetection", "FaceDetectionPVL", @@ -106,9 +105,11 @@ const char* tagNames[] = { "HAL_multi_streams_test", "HAL_rotation_test", "HAL_yuv", + "HalAdaptor", "HalV3Utils", "I3AControlFactory", "IA_CIPR_UTILS", + "ICBMThread", "ICamera", "IFaceDetection", "IPCIntelPGParam", @@ -127,14 +128,10 @@ const char* tagNames[] = { "IntelCca", "IntelCcaClient", "IntelCcaServer", - "IntelEVCPClient", - "IntelEVCPServer", - "IntelEvcp", "IntelFDServer", "IntelFaceDetection", "IntelFaceDetectionClient", "IntelGPUAlgoServer", - "IntelIC2", "IntelICBM", "IntelICBMClient", "IntelICBMServer", @@ -160,6 +157,7 @@ const char* tagNames[] = { "MockCameraHal", "MockSysCall", "MsgHandler", + "OnePunchIC2", "OpenSourceGFX", "PGCommon", "PGUtils", @@ -179,6 +177,7 @@ const char* tagNames[] = { "PostProcessor", "PostProcessorBase", "PostProcessorCore", + "PrivacyControl", "PrivateStream", "ProcessorManager", "RequestManager", @@ -202,7 +201,6 @@ const char* tagNames[] = { "Thread", "Trace", "TunningParser", - "UltraManEvcp", "Utils", "V4l2DeviceFactory", "V4l2_device_cc", diff --git a/src/iutils/ModuleTags.h b/src/iutils/ModuleTags.h index a1d363e7..e7aca700 100644 --- a/src/iutils/ModuleTags.h +++ b/src/iutils/ModuleTags.h @@ -91,141 +91,139 @@ enum ModuleTags { GENERATED_TAGS_Dvs = 61, GENERATED_TAGS_EXIFMaker = 62, GENERATED_TAGS_EXIFMetaData = 63, - GENERATED_TAGS_EvcpManager = 64, - GENERATED_TAGS_ExifCreater = 65, - GENERATED_TAGS_FaceDetection = 66, - GENERATED_TAGS_FaceDetectionPVL = 67, - GENERATED_TAGS_FaceDetectionResultCallbackManager = 68, - GENERATED_TAGS_FaceSSD = 69, - GENERATED_TAGS_FileSource = 70, - GENERATED_TAGS_GPUExecutor = 71, - GENERATED_TAGS_GenGfx = 72, - GENERATED_TAGS_GfxGen = 73, - GENERATED_TAGS_GraphConfig = 74, - GENERATED_TAGS_GraphConfigImpl = 75, - GENERATED_TAGS_GraphConfigImplClient = 76, - GENERATED_TAGS_GraphConfigManager = 77, - GENERATED_TAGS_GraphConfigPipe = 78, - GENERATED_TAGS_GraphConfigServer = 79, - GENERATED_TAGS_GraphUtils = 80, - GENERATED_TAGS_HAL_FACE_DETECTION_TEST = 81, - GENERATED_TAGS_HAL_basic = 82, - GENERATED_TAGS_HAL_jpeg = 83, - GENERATED_TAGS_HAL_multi_streams_test = 84, - GENERATED_TAGS_HAL_rotation_test = 85, - GENERATED_TAGS_HAL_yuv = 86, + GENERATED_TAGS_ExifCreater = 64, + GENERATED_TAGS_FaceDetection = 65, + GENERATED_TAGS_FaceDetectionPVL = 66, + GENERATED_TAGS_FaceDetectionResultCallbackManager = 67, + GENERATED_TAGS_FaceSSD = 68, + GENERATED_TAGS_FileSource = 69, + GENERATED_TAGS_GPUExecutor = 70, + GENERATED_TAGS_GenGfx = 71, + GENERATED_TAGS_GfxGen = 72, + GENERATED_TAGS_GraphConfig = 73, + GENERATED_TAGS_GraphConfigImpl = 74, + GENERATED_TAGS_GraphConfigImplClient = 75, + GENERATED_TAGS_GraphConfigManager = 76, + GENERATED_TAGS_GraphConfigPipe = 77, + GENERATED_TAGS_GraphConfigServer = 78, + GENERATED_TAGS_GraphUtils = 79, + GENERATED_TAGS_HAL_FACE_DETECTION_TEST = 80, + GENERATED_TAGS_HAL_basic = 81, + GENERATED_TAGS_HAL_jpeg = 82, + GENERATED_TAGS_HAL_multi_streams_test = 83, + GENERATED_TAGS_HAL_rotation_test = 84, + GENERATED_TAGS_HAL_yuv = 85, + GENERATED_TAGS_HalAdaptor = 86, GENERATED_TAGS_HalV3Utils = 87, GENERATED_TAGS_I3AControlFactory = 88, GENERATED_TAGS_IA_CIPR_UTILS = 89, - GENERATED_TAGS_ICamera = 90, - GENERATED_TAGS_IFaceDetection = 91, - GENERATED_TAGS_IPCIntelPGParam = 92, - GENERATED_TAGS_IPC_FACE_DETECTION = 93, - GENERATED_TAGS_IPC_GRAPH_CONFIG = 94, - GENERATED_TAGS_ImageProcessorCore = 95, - GENERATED_TAGS_ImageScalerCore = 96, - GENERATED_TAGS_Intel3AParameter = 97, - GENERATED_TAGS_IntelAEStateMachine = 98, - GENERATED_TAGS_IntelAFStateMachine = 99, - GENERATED_TAGS_IntelAWBStateMachine = 100, - GENERATED_TAGS_IntelAlgoClient = 101, - GENERATED_TAGS_IntelAlgoCommonClient = 102, - GENERATED_TAGS_IntelAlgoServer = 103, - GENERATED_TAGS_IntelCPUAlgoServer = 104, - GENERATED_TAGS_IntelCca = 105, - GENERATED_TAGS_IntelCcaClient = 106, - GENERATED_TAGS_IntelCcaServer = 107, - GENERATED_TAGS_IntelEVCPClient = 108, - GENERATED_TAGS_IntelEVCPServer = 109, - GENERATED_TAGS_IntelEvcp = 110, - GENERATED_TAGS_IntelFDServer = 111, - GENERATED_TAGS_IntelFaceDetection = 112, - GENERATED_TAGS_IntelFaceDetectionClient = 113, - GENERATED_TAGS_IntelGPUAlgoServer = 114, - GENERATED_TAGS_IntelIC2 = 115, - GENERATED_TAGS_IntelICBM = 116, - GENERATED_TAGS_IntelICBMClient = 117, - GENERATED_TAGS_IntelICBMServer = 118, - GENERATED_TAGS_IntelPGParam = 119, - GENERATED_TAGS_IntelPGParamClient = 120, - GENERATED_TAGS_IntelPGParamS = 121, - GENERATED_TAGS_IntelTNR7US = 122, - GENERATED_TAGS_IntelTNR7USClient = 123, - GENERATED_TAGS_IntelTNRServer = 124, - GENERATED_TAGS_IspControlUtils = 125, - GENERATED_TAGS_IspParamAdaptor = 126, - GENERATED_TAGS_JpegEncoderCore = 127, - GENERATED_TAGS_JpegMaker = 128, - GENERATED_TAGS_LensHw = 129, - GENERATED_TAGS_LensManager = 130, - GENERATED_TAGS_LiveTuning = 131, - GENERATED_TAGS_Ltm = 132, - GENERATED_TAGS_MANUAL_POST_PROCESSING = 133, - GENERATED_TAGS_MakerNote = 134, - GENERATED_TAGS_MediaControl = 135, - GENERATED_TAGS_MetadataConvert = 136, - GENERATED_TAGS_MockCamera3HAL = 137, - GENERATED_TAGS_MockCameraHal = 138, - GENERATED_TAGS_MockSysCall = 139, - GENERATED_TAGS_MsgHandler = 140, - GENERATED_TAGS_OpenSourceGFX = 141, - GENERATED_TAGS_PGCommon = 142, - GENERATED_TAGS_PGUtils = 143, - GENERATED_TAGS_PSysDAG = 144, - GENERATED_TAGS_PSysPipe = 145, - GENERATED_TAGS_PSysProcessor = 146, - GENERATED_TAGS_ParameterGenerator = 147, - GENERATED_TAGS_ParameterHelper = 148, - GENERATED_TAGS_ParameterResult = 149, - GENERATED_TAGS_Parameters = 150, - GENERATED_TAGS_ParserBase = 151, - GENERATED_TAGS_PipeExecutor = 152, - GENERATED_TAGS_PipeLiteExecutor = 153, - GENERATED_TAGS_PlatformData = 154, - GENERATED_TAGS_PnpDebugControl = 155, - GENERATED_TAGS_PolicyParser = 156, - GENERATED_TAGS_PostProcessor = 157, - GENERATED_TAGS_PostProcessorBase = 158, - GENERATED_TAGS_PostProcessorCore = 159, - GENERATED_TAGS_PrivateStream = 160, - GENERATED_TAGS_ProcessorManager = 161, - GENERATED_TAGS_RequestManager = 162, - GENERATED_TAGS_RequestThread = 163, - GENERATED_TAGS_ResultProcessor = 164, - GENERATED_TAGS_SWJpegEncoder = 165, - GENERATED_TAGS_SWPostProcessor = 166, - GENERATED_TAGS_SchedPolicy = 167, - GENERATED_TAGS_Scheduler = 168, - GENERATED_TAGS_SensorHwCtrl = 169, - GENERATED_TAGS_SensorManager = 170, - GENERATED_TAGS_SensorOB = 171, - GENERATED_TAGS_ShareRefer = 172, - GENERATED_TAGS_SofSource = 173, - GENERATED_TAGS_StreamBuffer = 174, - GENERATED_TAGS_SwImageConverter = 175, - GENERATED_TAGS_SwImageProcessor = 176, - GENERATED_TAGS_SyncManager = 177, - GENERATED_TAGS_SysCall = 178, - GENERATED_TAGS_TCPServer = 179, - GENERATED_TAGS_Thread = 180, - GENERATED_TAGS_Trace = 181, - GENERATED_TAGS_TunningParser = 182, - GENERATED_TAGS_UltraManEvcp = 183, - GENERATED_TAGS_Utils = 184, - GENERATED_TAGS_V4l2DeviceFactory = 185, - GENERATED_TAGS_V4l2_device_cc = 186, - GENERATED_TAGS_V4l2_subdevice_cc = 187, - GENERATED_TAGS_V4l2_video_node_cc = 188, - GENERATED_TAGS_VendorTags = 189, - GENERATED_TAGS_camera_metadata_tests = 190, - GENERATED_TAGS_icamera_metadata_base = 191, - GENERATED_TAGS_metadata_test = 192, - ST_FPS = 193, - ST_GPU_TNR = 194, - ST_STATS = 195, + GENERATED_TAGS_ICBMThread = 90, + GENERATED_TAGS_ICamera = 91, + GENERATED_TAGS_IFaceDetection = 92, + GENERATED_TAGS_IPCIntelPGParam = 93, + GENERATED_TAGS_IPC_FACE_DETECTION = 94, + GENERATED_TAGS_IPC_GRAPH_CONFIG = 95, + GENERATED_TAGS_ImageProcessorCore = 96, + GENERATED_TAGS_ImageScalerCore = 97, + GENERATED_TAGS_Intel3AParameter = 98, + GENERATED_TAGS_IntelAEStateMachine = 99, + GENERATED_TAGS_IntelAFStateMachine = 100, + GENERATED_TAGS_IntelAWBStateMachine = 101, + GENERATED_TAGS_IntelAlgoClient = 102, + GENERATED_TAGS_IntelAlgoCommonClient = 103, + GENERATED_TAGS_IntelAlgoServer = 104, + GENERATED_TAGS_IntelCPUAlgoServer = 105, + GENERATED_TAGS_IntelCca = 106, + GENERATED_TAGS_IntelCcaClient = 107, + GENERATED_TAGS_IntelCcaServer = 108, + GENERATED_TAGS_IntelFDServer = 109, + GENERATED_TAGS_IntelFaceDetection = 110, + GENERATED_TAGS_IntelFaceDetectionClient = 111, + GENERATED_TAGS_IntelGPUAlgoServer = 112, + GENERATED_TAGS_IntelICBM = 113, + GENERATED_TAGS_IntelICBMClient = 114, + GENERATED_TAGS_IntelICBMServer = 115, + GENERATED_TAGS_IntelPGParam = 116, + GENERATED_TAGS_IntelPGParamClient = 117, + GENERATED_TAGS_IntelPGParamS = 118, + GENERATED_TAGS_IntelTNR7US = 119, + GENERATED_TAGS_IntelTNR7USClient = 120, + GENERATED_TAGS_IntelTNRServer = 121, + GENERATED_TAGS_IspControlUtils = 122, + GENERATED_TAGS_IspParamAdaptor = 123, + GENERATED_TAGS_JpegEncoderCore = 124, + GENERATED_TAGS_JpegMaker = 125, + GENERATED_TAGS_LensHw = 126, + GENERATED_TAGS_LensManager = 127, + GENERATED_TAGS_LiveTuning = 128, + GENERATED_TAGS_Ltm = 129, + GENERATED_TAGS_MANUAL_POST_PROCESSING = 130, + GENERATED_TAGS_MakerNote = 131, + GENERATED_TAGS_MediaControl = 132, + GENERATED_TAGS_MetadataConvert = 133, + GENERATED_TAGS_MockCamera3HAL = 134, + GENERATED_TAGS_MockCameraHal = 135, + GENERATED_TAGS_MockSysCall = 136, + GENERATED_TAGS_MsgHandler = 137, + GENERATED_TAGS_OnePunchIC2 = 138, + GENERATED_TAGS_OpenSourceGFX = 139, + GENERATED_TAGS_PGCommon = 140, + GENERATED_TAGS_PGUtils = 141, + GENERATED_TAGS_PSysDAG = 142, + GENERATED_TAGS_PSysPipe = 143, + GENERATED_TAGS_PSysProcessor = 144, + GENERATED_TAGS_ParameterGenerator = 145, + GENERATED_TAGS_ParameterHelper = 146, + GENERATED_TAGS_ParameterResult = 147, + GENERATED_TAGS_Parameters = 148, + GENERATED_TAGS_ParserBase = 149, + GENERATED_TAGS_PipeExecutor = 150, + GENERATED_TAGS_PipeLiteExecutor = 151, + GENERATED_TAGS_PlatformData = 152, + GENERATED_TAGS_PnpDebugControl = 153, + GENERATED_TAGS_PolicyParser = 154, + GENERATED_TAGS_PostProcessor = 155, + GENERATED_TAGS_PostProcessorBase = 156, + GENERATED_TAGS_PostProcessorCore = 157, + GENERATED_TAGS_PrivacyControl = 158, + GENERATED_TAGS_PrivateStream = 159, + GENERATED_TAGS_ProcessorManager = 160, + GENERATED_TAGS_RequestManager = 161, + GENERATED_TAGS_RequestThread = 162, + GENERATED_TAGS_ResultProcessor = 163, + GENERATED_TAGS_SWJpegEncoder = 164, + GENERATED_TAGS_SWPostProcessor = 165, + GENERATED_TAGS_SchedPolicy = 166, + GENERATED_TAGS_Scheduler = 167, + GENERATED_TAGS_SensorHwCtrl = 168, + GENERATED_TAGS_SensorManager = 169, + GENERATED_TAGS_SensorOB = 170, + GENERATED_TAGS_ShareRefer = 171, + GENERATED_TAGS_SofSource = 172, + GENERATED_TAGS_StreamBuffer = 173, + GENERATED_TAGS_SwImageConverter = 174, + GENERATED_TAGS_SwImageProcessor = 175, + GENERATED_TAGS_SyncManager = 176, + GENERATED_TAGS_SysCall = 177, + GENERATED_TAGS_TCPServer = 178, + GENERATED_TAGS_Thread = 179, + GENERATED_TAGS_Trace = 180, + GENERATED_TAGS_TunningParser = 181, + GENERATED_TAGS_Utils = 182, + GENERATED_TAGS_V4l2DeviceFactory = 183, + GENERATED_TAGS_V4l2_device_cc = 184, + GENERATED_TAGS_V4l2_subdevice_cc = 185, + GENERATED_TAGS_V4l2_video_node_cc = 186, + GENERATED_TAGS_VendorTags = 187, + GENERATED_TAGS_camera_metadata_tests = 188, + GENERATED_TAGS_icamera_metadata_base = 189, + GENERATED_TAGS_metadata_test = 190, + ST_FPS = 191, + ST_GPU_TNR = 192, + ST_STATS = 193, }; -#define TAGS_MAX_NUM 196 +#define TAGS_MAX_NUM 194 #endif // !!! DO NOT EDIT THIS FILE !!! diff --git a/src/iutils/PerfettoTrace.cpp b/src/iutils/PerfettoTrace.cpp new file mode 100644 index 00000000..db0102ae --- /dev/null +++ b/src/iutils/PerfettoTrace.cpp @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2023 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "src/iutils/PerfettoTrace.h" + +#include +#include +#include + +namespace icamera { +bool gPerfettoEnabled = false; +} + +class PerfettoTrace : public perfetto::TrackEventSessionObserver { + public: + PerfettoTrace() { perfetto::TrackEvent::AddSessionObserver(this); } + ~PerfettoTrace() override { perfetto::TrackEvent::RemoveSessionObserver(this); } + + void OnStart(const perfetto::DataSourceBase::StartArgs&) override { + std::unique_lock lock(mutex); + cv.notify_one(); + } + + void ConnectToService() { + std::unique_lock lock(mutex); + cv.wait(lock, [] { return perfetto::TrackEvent::IsEnabled(); }); + } + + std::mutex mutex; + std::condition_variable cv; +}; + +PERFETTO_TRACK_EVENT_STATIC_STORAGE(); + +static PerfettoTrace* gPerfettoAgent = nullptr; +static std::once_flag gPerfettoOnce; + +static void uninitPerfettoTrace() { + ::perfetto::TrackEvent::Flush(); + icamera::gPerfettoEnabled = false; + delete gPerfettoAgent; +} + +void initPerfettoTrace() { + std::call_once(gPerfettoOnce, [&]() { + perfetto::TracingInitArgs args; + args.backends = perfetto::kSystemBackend; + + perfetto::Tracing::Initialize(args); + perfetto::TrackEvent::Register(); + + gPerfettoAgent = new PerfettoTrace; + gPerfettoAgent->ConnectToService(); + + icamera::gPerfettoEnabled = true; + ::atexit(::uninitPerfettoTrace); + }); +} diff --git a/src/iutils/PerfettoTrace.h b/src/iutils/PerfettoTrace.h new file mode 100644 index 00000000..80a68635 --- /dev/null +++ b/src/iutils/PerfettoTrace.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2023 Intel Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +#include + +namespace icamera { +extern bool gPerfettoEnabled; +} + +PERFETTO_DEFINE_CATEGORIES( + perfetto::Category("libcamhal").SetDescription("libcamhal")); + +extern void initPerfettoTrace(); + +constexpr std::string_view DECODE_TO_NEW_NAME(const char* fn) { + std::string_view sv(fn); + auto paren = sv.rfind('('); + auto space = sv.rfind(' ', paren + 1); + return sv.substr(space + 1, paren - space - 1); +} + +#define TRACE_PERFETTO_EVENT_NAME DECODE_TO_NEW_NAME(__PRETTY_FUNCTION__) + +#define PERFETTO_TRACE_EVENT(...) \ + static const std::string event_##__LINE__(TRACE_PERFETTO_EVENT_NAME); \ + do { \ + if (gPerfettoEnabled) \ + TRACE_EVENT("libcamhal", perfetto::StaticString{event_##__LINE__.c_str()}, \ + ##__VA_ARGS__); \ + } while (0) + +#define PERF_CAMERA_ATRACE(...) PERFETTO_TRACE_EVENT(__VA_ARGS__); + +#define PERF_CAMERA_ATRACE_PARAM1(...) PERFETTO_TRACE_EVENT(__VA_ARGS__); + +#define PERF_CAMERA_ATRACE_PARAM2(...) PERFETTO_TRACE_EVENT(__VA_ARGS__); + +#define PERF_CAMERA_ATRACE_PARAM3(...) PERFETTO_TRACE_EVENT(__VA_ARGS__); + +#define PERF_CAMERA_ATRACE_IMAGING(...) PERFETTO_TRACE_EVENT(__VA_ARGS__); + +#define PERF_CAMERA_ATRACE_PARAM1_IMAGING(...) PERFETTO_TRACE_EVENT(__VA_ARGS__); + +#define PERF_CAMERA_ATRACE_PARAM2_IMAGING(...) PERFETTO_TRACE_EVENT(__VA_ARGS__); + +#define PERF_CAMERA_ATRACE_PARAM3_IMAGING(...) PERFETTO_TRACE_EVENT(__VA_ARGS__); diff --git a/src/iutils/Utils.cpp b/src/iutils/Utils.cpp index 63fc3bba..2efa9c10 100644 --- a/src/iutils/Utils.cpp +++ b/src/iutils/Utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,13 +25,14 @@ #include #include #include +#include #include #include #include -#include "PlatformData.h" #include "iutils/CameraLog.h" +#include "iutils/Errors.h" #include "linux/ipu-isys.h" #include "linux/media-bus-format.h" @@ -188,11 +189,17 @@ struct TuningModeStringInfo { static const TuningModeStringInfo TuningModeStringInfoTable[] = { {TUNING_MODE_VIDEO, "VIDEO"}, {TUNING_MODE_VIDEO_ULL, "VIDEO-ULL"}, + // HDR_FEATURE_S + {TUNING_MODE_VIDEO_HDR, "VIDEO-HDR"}, + {TUNING_MODE_VIDEO_HDR2, "VIDEO-HDR2"}, + {TUNING_MODE_VIDEO_HLC, "VIDEO-HLC"}, + // HDR_FEATURE_E {TUNING_MODE_VIDEO_CUSTOM_AIC, "VIDEO-CUSTOM_AIC"}, {TUNING_MODE_VIDEO_LL, "VIDEO-LL"}, {TUNING_MODE_VIDEO_REAR_VIEW, "VIDEO-REAR-VIEW"}, {TUNING_MODE_VIDEO_HITCH_VIEW, "VIDEO-HITCH-VIEW"}, {TUNING_MODE_STILL_CAPTURE, "STILL_CAPTURE"}, + {TUNING_MODE_VIDEO_BINNING, "VIDEO-BINNING"}, }; const char* CameraUtils::tuningMode2String(TuningMode mode) { @@ -616,11 +623,6 @@ int CameraUtils::getInterlaceHeight(int field, int height) { return height; } -bool CameraUtils::isMultiExposureCase(int cameraId, TuningMode tuningMode) { - - return false; -} - bool CameraUtils::isUllPsysPipe(TuningMode tuningMode) { return (tuningMode == TUNING_MODE_VIDEO_ULL || tuningMode == TUNING_MODE_VIDEO_CUSTOM_AIC); } @@ -632,6 +634,14 @@ ConfigMode CameraUtils::getConfigModeByName(const char* ConfigName) { LOGE("%s, the ConfigName is nullptr", __func__); } else if (strcmp(ConfigName, "AUTO") == 0) { configMode = CAMERA_STREAM_CONFIGURATION_MODE_AUTO; + // HDR_FEATURE_S + } else if (strcmp(ConfigName, "HDR") == 0) { + configMode = CAMERA_STREAM_CONFIGURATION_MODE_HDR; + } else if (strcmp(ConfigName, "HDR2") == 0) { + configMode = CAMERA_STREAM_CONFIGURATION_MODE_HDR2; + } else if (strcmp(ConfigName, "HLC") == 0) { + configMode = CAMERA_STREAM_CONFIGURATION_MODE_HLC; + // HDR_FEATURE_E } else if (strcmp(ConfigName, "ULL") == 0) { configMode = CAMERA_STREAM_CONFIGURATION_MODE_ULL; } else if (strcmp(ConfigName, "NORMAL") == 0) { @@ -683,6 +693,17 @@ ConfigMode CameraUtils::getConfigModeBySceneMode(camera_scene_mode_t sceneMode) case SCENE_MODE_ULL: configMode = CAMERA_STREAM_CONFIGURATION_MODE_ULL; break; + // HDR_FEATURE_S + case SCENE_MODE_HDR: + configMode = CAMERA_STREAM_CONFIGURATION_MODE_HDR; + break; + case SCENE_MODE_HDR2: + configMode = CAMERA_STREAM_CONFIGURATION_MODE_HDR2; + break; + case SCENE_MODE_HLC: + configMode = CAMERA_STREAM_CONFIGURATION_MODE_HLC; + break; + // HDR_FEATURE_E case SCENE_MODE_CUSTOM_AIC: configMode = CAMERA_STREAM_CONFIGURATION_MODE_CUSTOM_AIC; break; @@ -702,6 +723,14 @@ camera_scene_mode_t CameraUtils::getSceneModeByName(const char* sceneName) { return SCENE_MODE_MAX; else if (strcmp(sceneName, "AUTO") == 0) return SCENE_MODE_AUTO; + // HDR_FEATURE_S + else if (strcmp(sceneName, "HDR") == 0) + return SCENE_MODE_HDR; + else if (strcmp(sceneName, "HDR2") == 0) + return SCENE_MODE_HDR2; + else if (strcmp(sceneName, "HLC") == 0) + return SCENE_MODE_HLC; + // HDR_FEATURE_E else if (strcmp(sceneName, "ULL") == 0) return SCENE_MODE_ULL; else if (strcmp(sceneName, "VIDEO_LL") == 0) diff --git a/src/iutils/Utils.h b/src/iutils/Utils.h index 9ba656b4..37396bf6 100644 --- a/src/iutils/Utils.h +++ b/src/iutils/Utils.h @@ -276,8 +276,6 @@ void getSubDeviceName(const char* entityName, std::string& deviceNodeName); int getInterlaceHeight(int field, int height); -bool isMultiExposureCase(int cameraId, TuningMode tuningMode); - bool isUllPsysPipe(TuningMode tuningMode); ConfigMode getConfigModeByName(const char* ConfigName); diff --git a/src/metadata/ParameterGenerator.cpp b/src/metadata/ParameterGenerator.cpp index 5f839697..696af3b5 100644 --- a/src/metadata/ParameterGenerator.cpp +++ b/src/metadata/ParameterGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2022 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ #include +#include #include #include @@ -39,6 +40,7 @@ namespace icamera { ParameterGenerator::ParameterGenerator(int cameraId) : mCameraId(cameraId), + mCallback(nullptr), mTonemapMaxCurvePoints(0) { reset(); @@ -79,27 +81,37 @@ int ParameterGenerator::reset() { return OK; } -int ParameterGenerator::saveParameters(int64_t sequence, long requestId, const Parameters* param) { +std::shared_ptr ParameterGenerator::getRequestParamBuf() { + AutoMutex l(mParamsLock); + + if (mRequestParamMap.size() < kStorageSize) { + return std::make_shared(); + } + + auto it = mRequestParamMap.begin(); + std::shared_ptr requestParam = it->second; + mRequestParamMap.erase(it->first); + + return requestParam; +} + +int ParameterGenerator::saveParameters(int64_t sequence, long requestId, + std::shared_ptr requestParam) { CHECK_REQUEST_ID(requestId); CHECK_SEQUENCE(sequence); AutoMutex l(mParamsLock); - if (param) mLastParam = *param; + if (!requestParam && mRequestParamMap.empty()) return BAD_VALUE; - LOG2("%s", requestId, sequence, __func__); - std::shared_ptr requestParam = nullptr; - if (mRequestParamMap.size() < kStorageSize) { + if (!requestParam) { requestParam = std::make_shared(); - } else { - auto it = mRequestParamMap.begin(); - requestParam = it->second; - mRequestParamMap.erase(it->first); + requestParam->param = mRequestParamMap.rbegin()->second->param; } - requestParam->requestId = requestId; - requestParam->param = mLastParam; - mRequestParamMap[sequence] = requestParam; + + LOG2("%s", requestParam->requestId, sequence, __func__); + return OK; } @@ -180,16 +192,18 @@ int ParameterGenerator::getParameters(int64_t sequence, Parameters* param, bool if (setting) { AutoMutex l(mParamsLock); - if (sequence < 0) { - *param = mLastParam; - } else { - // Find nearest parameter - // The sequence of parameter should <= sequence - auto it = mRequestParamMap.upper_bound(sequence); - if (it == mRequestParamMap.begin()) { - LOGE("Can't find settings for seq %ld", sequence); + if (!mRequestParamMap.empty()) { + if (sequence < 0) { + *param = mRequestParamMap.rbegin()->second->param; } else { - *param = (--it)->second->param; + // Find nearest parameter + // The sequence of parameter should <= sequence + auto it = mRequestParamMap.upper_bound(sequence); + if (it == mRequestParamMap.begin()) { + LOGE("Can't find settings for seq %ld", sequence); + } else { + *param = (--it)->second->param; + } } } } @@ -200,6 +214,71 @@ int ParameterGenerator::getParameters(int64_t sequence, Parameters* param, bool return OK; } +int ParameterGenerator::getIspParameters(int64_t sequence, Parameters* param) { + CheckAndLogError((param == nullptr), UNKNOWN_ERROR, "nullptr to get param!"); + CHECK_SEQUENCE(sequence); + + AutoMutex l(mParamsLock); + if (mRequestParamMap.find(sequence) != mRequestParamMap.end()) { + camera_image_enhancement_t enhancement; + int ret = mRequestParamMap[sequence]->param.getImageEnhancement(enhancement); + if (ret == OK) { + param->setImageEnhancement(enhancement); + } + camera_edge_mode_t edgeMode; + ret = mRequestParamMap[sequence]->param.getEdgeMode(edgeMode); + if (ret == OK) { + param->setEdgeMode(edgeMode); + } + camera_nr_mode_t nrMode; + ret = mRequestParamMap[sequence]->param.getNrMode(nrMode); + if (ret == OK) { + param->setNrMode(nrMode); + } + camera_nr_level_t nrLevel; + ret = mRequestParamMap[sequence]->param.getNrLevel(nrLevel); + if (ret == OK) { + param->setNrLevel(nrLevel); + } + camera_video_stabilization_mode_t stabilizationMode; + ret = mRequestParamMap[sequence]->param.getVideoStabilizationMode(stabilizationMode); + if (ret == OK) { + param->setVideoStabilizationMode(stabilizationMode); + } + float hdrRatio; + ret = mRequestParamMap[sequence]->param.getHdrRatio(hdrRatio); + if (ret == OK) { + param->setHdrRatio(hdrRatio); + } + + return OK; + } + + return UNKNOWN_ERROR; +} + +int ParameterGenerator::getZoomRegion(int64_t sequence, camera_zoom_region_t& region) { + CHECK_SEQUENCE(sequence); + + AutoMutex l(mParamsLock); + if (mRequestParamMap.find(sequence) != mRequestParamMap.end()) { + return mRequestParamMap[sequence]->param.getZoomRegion(®ion); + } + + return UNKNOWN_ERROR; +} + +int ParameterGenerator::getRawOutputMode(int64_t sequence, raw_data_output_t& rawOutputMode) { + CHECK_SEQUENCE(sequence); + + AutoMutex l(mParamsLock); + if (mRequestParamMap.find(sequence) != mRequestParamMap.end()) { + return mRequestParamMap[sequence]->param.getRawDataOutput(rawOutputMode); + } + + return UNKNOWN_ERROR; +} + int ParameterGenerator::getUserRequestId(int64_t sequence, int32_t& userRequestId) { CHECK_SEQUENCE(sequence); @@ -226,7 +305,6 @@ int ParameterGenerator::getRequestId(int64_t sequence, long& requestId) { int ParameterGenerator::generateParametersL(int64_t sequence, Parameters* params) { if (PlatformData::isEnableAIQ(mCameraId)) { updateWithAiqResultsL(sequence, params); - updateTonemapCurve(sequence, params); } return OK; } @@ -241,7 +319,7 @@ int ParameterGenerator::updateWithAiqResultsL(int64_t sequence, Parameters* para aiqResult->mAeResults.exposures[0].converged ? AE_STATE_CONVERGED : AE_STATE_NOT_CONVERGED; params->setAeState(aeState); - if (CameraUtils::isMultiExposureCase(mCameraId, aiqResult->mTuningMode) && + if (PlatformData::isMultiExposureCase(mCameraId, aiqResult->mTuningMode) && aiqResult->mAeResults.num_exposures > 1) { params->setExposureTime(aiqResult->mAeResults.exposures[1].exposure[0].exposure_time_us); } else { @@ -371,32 +449,6 @@ int ParameterGenerator::updateCcmL(Parameters* params, const AiqResult* aiqResul return OK; } -int ParameterGenerator::updateTonemapCurve(int64_t sequence, Parameters* params) { - if (!mTonemapMaxCurvePoints) return OK; - - const AiqResult* aiqResult = AiqResultStorage::getInstance(mCameraId)->getAiqResult(sequence); - CheckAndLogError((aiqResult == nullptr), UNKNOWN_ERROR, - "%s Aiq result of sequence %ld does not exist", __func__, sequence); - const cca::cca_gbce_params& gbceResults = aiqResult->mGbceResults; - - int multiplier = gbceResults.gamma_lut_size / mTonemapMaxCurvePoints; - for (int32_t i = 0; i < mTonemapMaxCurvePoints; i++) { - mTonemapCurveRed[i * 2 + 1] = gbceResults.r_gamma_lut[i * multiplier]; - mTonemapCurveBlue[i * 2 + 1] = gbceResults.g_gamma_lut[i * multiplier]; - mTonemapCurveGreen[i * 2 + 1] = gbceResults.b_gamma_lut[i * multiplier]; - } - - int count = mTonemapMaxCurvePoints * 2; - camera_tonemap_curves_t curves = {count, - count, - count, - mTonemapCurveRed.get(), - mTonemapCurveBlue.get(), - mTonemapCurveGreen.get()}; - params->setTonemapCurves(curves); - return OK; -} - int ParameterGenerator::updateCommonMetadata(Parameters* params, const AiqResult* aiqResult) { icamera_metadata_ro_entry entry; CLEAR(entry); @@ -414,12 +466,17 @@ int ParameterGenerator::updateCommonMetadata(Parameters* params, const AiqResult entry.data.i64 = &frameDuration; ParameterHelper::mergeTag(entry, params); + int32_t userRequestId = 0; + params->getUserRequestId(userRequestId); + camera_msg_data_t data = {CAMERA_METADATA_ENTRY, {}}; + data.data.metadata_entry.frameNumber = userRequestId; + bool callbackRgbs = false; params->getCallbackRgbs(&callbackRgbs); if (callbackRgbs) { - int32_t width = aiqResult->mOutStats.rgbs_grid.grid_width; - int32_t height = aiqResult->mOutStats.rgbs_grid.grid_height; + int32_t width = aiqResult->mOutStats.rgbs_grid[0].grid_width; + int32_t height = aiqResult->mOutStats.rgbs_grid[0].grid_height; int32_t gridSize[] = {width, height}; entry.tag = INTEL_VENDOR_CAMERA_RGBS_GRID_SIZE; entry.type = ICAMERA_TYPE_INT32; @@ -427,17 +484,17 @@ int ParameterGenerator::updateCommonMetadata(Parameters* params, const AiqResult entry.data.i32 = gridSize; ParameterHelper::mergeTag(entry, params); - uint8_t lscFlags = aiqResult->mOutStats.rgbs_grid.shading_correction; + uint8_t lscFlags = aiqResult->mOutStats.rgbs_grid[0].shading_correction; entry.tag = INTEL_VENDOR_CAMERA_SHADING_CORRECTION; entry.type = ICAMERA_TYPE_BYTE; entry.count = 1; entry.data.u8 = &lscFlags; ParameterHelper::mergeTag(entry, params); - if (Log::isLogTagEnabled(ST_STATS)) { + if (Log::isLogTagEnabled(ST_STATS, CAMERA_DEBUG_LOG_LEVEL2)) { const cca::cca_out_stats* outStats = &aiqResult->mOutStats; - const rgbs_grid_block* rgbsPtr = aiqResult->mOutStats.rgbs_blocks; - int size = outStats->rgbs_grid.grid_width * outStats->rgbs_grid.grid_height; + const rgbs_grid_block* rgbsPtr = aiqResult->mOutStats.rgbs_blocks[0]; + int size = outStats->rgbs_grid[0].grid_width * outStats->rgbs_grid[0].grid_height; int sumLuma = 0; for (int j = 0; j < size; j++) { @@ -447,15 +504,23 @@ int ParameterGenerator::updateCommonMetadata(Parameters* params, const AiqResult } LOG2(ST_STATS, "RGB stat %dx%d, sequence %lld, y_mean %d", - outStats->rgbs_grid.grid_width, outStats->rgbs_grid.grid_height, + outStats->rgbs_grid[0].grid_width, outStats->rgbs_grid[0].grid_height, aiqResult->mSequence, size > 0 ? sumLuma / size : 0); } - entry.tag = INTEL_VENDOR_CAMERA_RGBS_STATS_BLOCKS; - entry.type = ICAMERA_TYPE_BYTE; - entry.count = width * height * 5; - entry.data.u8 = reinterpret_cast(aiqResult->mOutStats.rgbs_blocks); - ParameterHelper::mergeTag(entry, params); + if (mCallback) { + data.data.metadata_entry.tag = INTEL_VENDOR_CAMERA_RGBS_STATS_BLOCKS; + data.data.metadata_entry.count = width * height * 5; + data.data.metadata_entry.data.u8 = + reinterpret_cast(aiqResult->mOutStats.rgbs_blocks[0]); + mCallback->notify(mCallback, data); + } else { + entry.tag = INTEL_VENDOR_CAMERA_RGBS_STATS_BLOCKS; + entry.type = ICAMERA_TYPE_BYTE; + entry.count = width * height * 5; + entry.data.u8 = reinterpret_cast(aiqResult->mOutStats.rgbs_blocks[0]); + ParameterHelper::mergeTag(entry, params); + } } if (aiqResult->mAiqParam.manualExpTimeUs <= 0 && aiqResult->mAiqParam.manualIso <= 0) { @@ -481,11 +546,53 @@ int ParameterGenerator::updateCommonMetadata(Parameters* params, const AiqResult tmCurve[i * 2] = static_cast(i) / (mTonemapMaxCurvePoints - 1); tmCurve[i * 2 + 1] = gbceResults.tone_map_lut[i * multiplier]; } - entry.tag = INTEL_VENDOR_CAMERA_TONE_MAP_CURVE; - entry.type = ICAMERA_TYPE_FLOAT; - entry.count = tmCurve.size(); - entry.data.f = tmCurve.data(); - ParameterHelper::mergeTag(entry, params); + + if (mCallback) { + data.data.metadata_entry.tag = INTEL_VENDOR_CAMERA_TONE_MAP_CURVE; + data.data.metadata_entry.count = tmCurve.size(); + data.data.metadata_entry.data.f = tmCurve.data(); + mCallback->notify(mCallback, data); + } else { + entry.tag = INTEL_VENDOR_CAMERA_TONE_MAP_CURVE; + entry.type = ICAMERA_TYPE_FLOAT; + entry.count = tmCurve.size(); + entry.data.f = tmCurve.data(); + ParameterHelper::mergeTag(entry, params); + } + } + + if (mTonemapMaxCurvePoints) { + const cca::cca_gbce_params& gbceResults = aiqResult->mGbceResults; + + int multiplier = gbceResults.gamma_lut_size / mTonemapMaxCurvePoints; + for (int32_t i = 0; i < mTonemapMaxCurvePoints; i++) { + mTonemapCurveRed[i * 2 + 1] = gbceResults.r_gamma_lut[i * multiplier]; + mTonemapCurveBlue[i * 2 + 1] = gbceResults.g_gamma_lut[i * multiplier]; + mTonemapCurveGreen[i * 2 + 1] = gbceResults.b_gamma_lut[i * multiplier]; + } + + int count = mTonemapMaxCurvePoints * 2; + camera_tonemap_curves_t curves = {count, count, count, mTonemapCurveRed.get(), + mTonemapCurveBlue.get(), mTonemapCurveGreen.get()}; + + if (mCallback) { + data.data.metadata_entry.tag = CAMERA_TONEMAP_CURVE_RED; + data.data.metadata_entry.count = count; + data.data.metadata_entry.data.f = mTonemapCurveRed.get(); + mCallback->notify(mCallback, data); + + data.data.metadata_entry.tag = CAMERA_TONEMAP_CURVE_BLUE; + data.data.metadata_entry.count = count; + data.data.metadata_entry.data.f = mTonemapCurveBlue.get(); + mCallback->notify(mCallback, data); + + data.data.metadata_entry.tag = CAMERA_TONEMAP_CURVE_GREEN; + data.data.metadata_entry.count = count; + data.data.metadata_entry.data.f = mTonemapCurveGreen.get(); + mCallback->notify(mCallback, data); + } else { + params->setTonemapCurves(curves); + } } return OK; diff --git a/src/metadata/ParameterGenerator.h b/src/metadata/ParameterGenerator.h index bdb2c360..47bcb6bf 100644 --- a/src/metadata/ParameterGenerator.h +++ b/src/metadata/ParameterGenerator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2022 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,20 @@ namespace icamera { +class RequestParam { + public: + RequestParam() : requestId(-1) {} + + ~RequestParam() {} + + long requestId; + Parameters param; + + private: + RequestParam(const RequestParam& other); + RequestParam& operator=(const RequestParam& other); +}; + /* * \class ParameterGenerator * This class is used to generator parameter results. It updates the parameters @@ -40,17 +54,25 @@ class ParameterGenerator { * \brief reset the parameters data. */ int reset(); + void callbackRegister(const camera_callback_ops_t* callback) { + mCallback = const_cast(callback); + } /** * \brief Save parameters with sequence id indicating the active frame. * And update the aiq result parameters as well. */ - int saveParameters(int64_t predictSequence, long requestId, const Parameters* param = nullptr); + int saveParameters(int64_t sequence, long requestId, + std::shared_ptr requestParam = nullptr); + std::shared_ptr getRequestParamBuf(); /** * \brief Update parameters per sequence id. */ void updateParameters(int64_t sequence, const Parameters* param); + int getIspParameters(int64_t sequence, Parameters* param); + int getRawOutputMode(int64_t sequence, raw_data_output_t& rawOutputMode); + int getZoomRegion(int64_t sequence, camera_zoom_region_t& region); int getUserRequestId(int64_t sequence, int32_t& userRequestId); /** @@ -67,34 +89,18 @@ class ParameterGenerator { int updateWithAiqResultsL(int64_t sequence, Parameters* params); int updateAwbGainsL(Parameters* params, const cca::cca_awb_results& result); int updateCcmL(Parameters* params, const AiqResult* aiqResult); - int updateTonemapCurve(int64_t sequence, Parameters* params); int updateCommonMetadata(Parameters* params, const AiqResult* aiqResult); - private: - class RequestParam { - public: - RequestParam() : requestId(-1) {} - - ~RequestParam() {} - - long requestId; - Parameters param; - - private: - RequestParam(const RequestParam& other); - RequestParam& operator=(const RequestParam& other); - }; - private: int mCameraId; + camera_callback_ops_t* mCallback; static const int kStorageSize = MAX_SETTING_COUNT; // Guard for ParameterGenerator public API. Mutex mParamsLock; // first: sequence id, second: RequestParam data std::map > mRequestParamMap; - Parameters mLastParam; std::unique_ptr mTonemapCurveRed; std::unique_ptr mTonemapCurveBlue; diff --git a/src/metadata/Parameters.cpp b/src/metadata/Parameters.cpp index bce94214..20c0f896 100644 --- a/src/metadata/Parameters.cpp +++ b/src/metadata/Parameters.cpp @@ -21,7 +21,6 @@ #include "iutils/CameraDump.h" #include "iutils/Utils.h" -#include "PlatformData.h" #include "Parameters.h" #include "ParameterHelper.h" @@ -528,6 +527,24 @@ int Parameters::getIrisLevel(int& level) { return OK; } +// HDR_FEATURE_S +int Parameters::setWdrMode(camera_wdr_mode_t wdrMode) { + uint8_t mode = wdrMode; + ParameterHelper::AutoWLock wl(mData); + return ParameterHelper::getMetadata(mData).update(INTEL_CONTROL_WDR_MODE, &mode, 1); +} + +int Parameters::getWdrMode(camera_wdr_mode_t& wdrMode) const { + ParameterHelper::AutoRLock rl(mData); + auto entry = ParameterHelper::getMetadataEntry(mData, INTEL_CONTROL_WDR_MODE); + if (entry.count != 1) { + return NAME_NOT_FOUND; + } + wdrMode = (camera_wdr_mode_t)entry.data.u8[0]; + return OK; +} +// HDR_FEATURE_E + int Parameters::setWdrLevel(uint8_t level) { ParameterHelper::AutoWLock wl(mData); return ParameterHelper::getMetadata(mData).update(INTEL_CONTROL_WDR_LEVEL, &level, 1); @@ -1596,7 +1613,6 @@ int Parameters::getSensorMountType(camera_mount_type_t& sensorMountType) const { // User can set envrionment and then call api to update the debug level. int Parameters::updateDebugLevel() { Log::setDebugLevel(); - CameraDump::setDumpLevel(); return OK; } @@ -1879,6 +1895,20 @@ int Parameters::getPowerMode(camera_power_mode_t& mode) const { return OK; } +int Parameters::setHdrRatio(float hdrRatio) { + ParameterHelper::AutoWLock wl(mData); + return ParameterHelper::getMetadata(mData).update(INTEL_VENDOR_CAMERA_HDR_RATIO, &hdrRatio, 1); +} + +int Parameters::getHdrRatio(float& hdrRatio) const { + ParameterHelper::AutoRLock rl(mData); + auto entry = ParameterHelper::getMetadataEntry(mData, INTEL_VENDOR_CAMERA_HDR_RATIO); + if (entry.count != 1) return NAME_NOT_FOUND; + + hdrRatio = entry.data.f[0]; + return OK; +} + int Parameters::setTotalExposureTarget(int64_t totalExposureTarget) { ParameterHelper::AutoWLock wl(mData); return ParameterHelper::getMetadata(mData).update(INTEL_VENDOR_CAMERA_TOTAL_EXPOSURE_TARGET, @@ -1965,79 +1995,6 @@ int Parameters::getCallbackTmCurve(bool* enabled) const { return OK; } -// ENABLE_EVCP_S -int Parameters::setEvcpEccMode(uint8_t enabled) { - ParameterHelper::AutoWLock wl(mData); - return ParameterHelper::getMetadata(mData).update(INTEL_VENDOR_CAMERA_IC_ECC_MODE, &enabled, 1); -} -int Parameters::getEvcpEccMode(uint8_t* enabled) const { - ParameterHelper::AutoRLock rl(mData); - auto entry = ParameterHelper::getMetadataEntry(mData, INTEL_VENDOR_CAMERA_IC_ECC_MODE); - - if (entry.count != 1) { - return NAME_NOT_FOUND; - } - - *enabled = entry.data.u8[0]; - return OK; -} - -int Parameters::setEvcpBCMode(uint8_t mode) { - ParameterHelper::AutoWLock wl(mData); - return ParameterHelper::getMetadata(mData).update(INTEL_VENDOR_CAMERA_IC_BC_MODE, &mode, 1); -} -int Parameters::getEvcpBCMode(uint8_t* mode) const { - ParameterHelper::AutoRLock rl(mData); - auto entry = ParameterHelper::getMetadataEntry(mData, INTEL_VENDOR_CAMERA_IC_BC_MODE); - - if (entry.count != 1) { - return NAME_NOT_FOUND; - } - - *mode = entry.data.u8[0]; - - return OK; -} - -int Parameters::setEvcpBRParameters(int height, int width, int fd) { - ParameterHelper::AutoWLock wl(mData); - int32_t values[3] = {width, height, fd}; - return ParameterHelper::getMetadata(mData).update(INTEL_VENDOR_CAMERA_IC_BR_PARAMETERS, values, - 3); -} - -int Parameters::getEvcpBRParameters(int* height, int* width, int* fd) const { - ParameterHelper::AutoRLock rl(mData); - auto entry = ParameterHelper::getMetadataEntry(mData, INTEL_VENDOR_CAMERA_IC_BR_PARAMETERS); - - if (entry.count != 3) { - return NAME_NOT_FOUND; - } - - *height = entry.data.i32[0]; - *width = entry.data.i32[1]; - *fd = entry.data.i32[2]; - - return OK; -} - -int Parameters::setEvcpFFMode(uint8_t mode) { - ParameterHelper::AutoWLock wl(mData); - return ParameterHelper::getMetadata(mData).update(INTEL_VENDOR_CAMERA_IC_UF_MODE, &mode, 1); -} -int Parameters::getEvcpFFMode(uint8_t* mode) const { - ParameterHelper::AutoRLock rl(mData); - auto entry = ParameterHelper::getMetadataEntry(mData, INTEL_VENDOR_CAMERA_IC_UF_MODE); - - if (entry.count != 1) { - return NAME_NOT_FOUND; - } - - *mode = entry.data.u8[0]; - return OK; -} -// ENABLE_EVCP_E - int Parameters::setZoomRegion(const camera_zoom_region_t& region) { ParameterHelper::AutoWLock wl(mData); int32_t values[4] = {region.left, region.top, region.right, region.bottom}; @@ -2077,6 +2034,23 @@ int Parameters::getICBMUFMode(uint8_t* mode) const { *mode = entry.data.u8[0]; return OK; } + +int Parameters::setICBMBBMode(uint8_t mode) { + ParameterHelper::AutoWLock wl(mData); + return ParameterHelper::getMetadata(mData).update(INTEL_VENDOR_CAMERA_IC_BC_MODE, &mode, 1); +} + +int Parameters::getICBMBBMode(uint8_t* mode) const { + ParameterHelper::AutoRLock rl(mData); + auto entry = ParameterHelper::getMetadataEntry(mData, INTEL_VENDOR_CAMERA_IC_BC_MODE); + + if (entry.count != 1) { + return NAME_NOT_FOUND; + } + + *mode = entry.data.u8[0]; + return OK; +} // LEVEL0_ICBM_E } // end of namespace icamera diff --git a/src/metadata/vendor_metadata_tag_info.c b/src/metadata/vendor_metadata_tag_info.c index ee649697..e85a4b7f 100644 --- a/src/metadata/vendor_metadata_tag_info.c +++ b/src/metadata/vendor_metadata_tag_info.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2012 The Android Open Source Project - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,27 +38,28 @@ static tag_info_t intel_vendor_camera[INTEL_VENDOR_CAMERA_END - INTEL_VENDOR_CAM {"callbackTmCurve", ICAMERA_TYPE_BYTE}, {"toneMapCurve", ICAMERA_TYPE_FLOAT}, {"powerMode", ICAMERA_TYPE_BYTE}, - // ENABLE_EVCP_S + // LEVEL0_ICBM_S {"icCaps", ICAMERA_TYPE_INT32}, - // ENABLE_EVCP_E - // ENABLE_EVCP_S + // LEVEL0_ICBM_E + // LEVEL0_ICBM_S {"icPeaceFeatures", ICAMERA_TYPE_INT32}, - // ENABLE_EVCP_E - // ENABLE_EVCP_S + // LEVEL0_ICBM_E + // LEVEL0_ICBM_S {"icEccMode", ICAMERA_TYPE_BYTE}, - // ENABLE_EVCP_E - // ENABLE_EVCP_S + // LEVEL0_ICBM_E + // LEVEL0_ICBM_S {"icBcMode", ICAMERA_TYPE_BYTE}, - // ENABLE_EVCP_E - // ENABLE_EVCP_S + // LEVEL0_ICBM_E + // LEVEL0_ICBM_S {"icBrParameters", ICAMERA_TYPE_INT32}, - // ENABLE_EVCP_E - // ENABLE_EVCP_S + // LEVEL0_ICBM_E + // LEVEL0_ICBM_S {"icUfMode", ICAMERA_TYPE_BYTE}, - // ENABLE_EVCP_E + // LEVEL0_ICBM_E {"totalExposureTarget", ICAMERA_TYPE_INT64}, {"totalExposureTargetRange", ICAMERA_TYPE_INT64}, {"rawDataOutput", ICAMERA_TYPE_BYTE}, + {"hdrRatio", ICAMERA_TYPE_FLOAT}, }; tag_info_t* vendor_tag_info[INTEL_VENDOR_SECTION_COUNT] = { @@ -139,17 +140,17 @@ int vendor_metadata_enum_snprint(uint32_t tag, int32_t value, char* dst, size_t } break; } - // ENABLE_EVCP_S + // LEVEL0_ICBM_S case INTEL_VENDOR_CAMERA_IC_CAPS: { break; } - // ENABLE_EVCP_E - // ENABLE_EVCP_S + // LEVEL0_ICBM_E + // LEVEL0_ICBM_S case INTEL_VENDOR_CAMERA_IC_PEACE_FEATURES: { break; } - // ENABLE_EVCP_E - // ENABLE_EVCP_S + // LEVEL0_ICBM_E + // LEVEL0_ICBM_S case INTEL_VENDOR_CAMERA_IC_ECC_MODE: { switch (value) { case INTEL_VENDOR_CAMERA_IC_ECC_MODE_OFF: @@ -165,8 +166,8 @@ int vendor_metadata_enum_snprint(uint32_t tag, int32_t value, char* dst, size_t } break; } - // ENABLE_EVCP_E - // ENABLE_EVCP_S + // LEVEL0_ICBM_E + // LEVEL0_ICBM_S case INTEL_VENDOR_CAMERA_IC_BC_MODE: { switch (value) { case INTEL_VENDOR_CAMERA_IC_BC_MODE_OFF: @@ -186,13 +187,13 @@ int vendor_metadata_enum_snprint(uint32_t tag, int32_t value, char* dst, size_t } break; } - // ENABLE_EVCP_E - // ENABLE_EVCP_S + // LEVEL0_ICBM_E + // LEVEL0_ICBM_S case INTEL_VENDOR_CAMERA_IC_BR_PARAMETERS: { break; } - // ENABLE_EVCP_E - // ENABLE_EVCP_S + // LEVEL0_ICBM_E + // LEVEL0_ICBM_S case INTEL_VENDOR_CAMERA_IC_UF_MODE: { switch (value) { case INTEL_VENDOR_CAMERA_IC_UF_MODE_OFF: @@ -208,7 +209,7 @@ int vendor_metadata_enum_snprint(uint32_t tag, int32_t value, char* dst, size_t } break; } - // ENABLE_EVCP_E + // LEVEL0_ICBM_E case INTEL_VENDOR_CAMERA_TOTAL_EXPOSURE_TARGET: { break; } @@ -230,6 +231,9 @@ int vendor_metadata_enum_snprint(uint32_t tag, int32_t value, char* dst, size_t } break; } + case INTEL_VENDOR_CAMERA_HDR_RATIO: { + break; + } } snprintf(dst, size, "%s", msg); diff --git a/src/platformdata/AiqInitData.cpp b/src/platformdata/AiqInitData.cpp index 8915baa8..cd3f3c7c 100644 --- a/src/platformdata/AiqInitData.cpp +++ b/src/platformdata/AiqInitData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2022 Intel Corporation + * Copyright (C) 2015-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include #include "AiqUtils.h" @@ -131,7 +132,7 @@ AiqInitData::AiqInitData(const std::string& sensorName, const std::string& camCf mNvm(nullptr) { LOG1("@%s, mMaxNvmSize:%d", __func__, mMaxNvmSize); - std::string aiqbNameFromModuleInfo; + std::set aiqbNameFromModuleInfo; if (nvmDir.length() > 0) { mNvmPath = nvmDir; @@ -145,8 +146,7 @@ AiqInitData::AiqInitData(const std::string& sensorName, const std::string& camCf while ((direntPtr = readdir(dir)) != nullptr) { if ((strncmp(direntPtr->d_name, aiqbName.c_str(), aiqbName.length()) == 0) && (strstr(direntPtr->d_name, postfix.c_str()) != nullptr)) { - aiqbNameFromModuleInfo.assign(direntPtr->d_name); - break; + aiqbNameFromModuleInfo.insert(direntPtr->d_name); } } closedir(dir); @@ -159,8 +159,14 @@ AiqInitData::AiqInitData(const std::string& sensorName, const std::string& camCf aiqbName.append(".aiqb"); if (!aiqbNameFromModuleInfo.empty()) { - aiqbName.assign(aiqbNameFromModuleInfo); + for (auto name : aiqbNameFromModuleInfo) { + if (strstr(name.c_str(), cfg.aiqbName.c_str()) != nullptr) { + aiqbName.assign(name); + break; + } + } } + LOGI("aiqb file name %s", aiqbName.c_str()); if (findConfigFile(camCfgDir, &aiqbName) != OK) { @@ -318,6 +324,10 @@ int AiqInitData::saveMakernoteData(int cameraId, camera_makernote_mode_t makerno return mMkn->saveMakernoteData(cameraId, makernoteMode, sequence, tuningMode); } +void* AiqInitData::getMakernoteBuf(camera_makernote_mode_t makernoteMode, bool& dump) { + return mMkn->getMakernoteBuf(makernoteMode, dump); +} + void AiqInitData::updateMakernoteTimeStamp(int64_t sequence, uint64_t timestamp) { mMkn->updateTimestamp(sequence, timestamp); } diff --git a/src/platformdata/AiqInitData.h b/src/platformdata/AiqInitData.h index 5af0cd49..898dd359 100644 --- a/src/platformdata/AiqInitData.h +++ b/src/platformdata/AiqInitData.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2022 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,6 +74,7 @@ class AiqInitData { int deinitMakernote(int cameraId, TuningMode tuningMode); int saveMakernoteData(int cameraId, camera_makernote_mode_t makernoteMode, int64_t sequence, TuningMode tuningMode); + void* getMakernoteBuf(camera_makernote_mode_t makernoteMode, bool& dump); void updateMakernoteTimeStamp(int64_t sequence, uint64_t timestamp); void acquireMakernoteData(uint64_t timestamp, Parameters* param); diff --git a/src/platformdata/CameraParser.cpp b/src/platformdata/CameraParser.cpp index 9567e039..258eead5 100644 --- a/src/platformdata/CameraParser.cpp +++ b/src/platformdata/CameraParser.cpp @@ -23,6 +23,9 @@ #include #include +// CRL_MODULE_S +#include +// CRL_MODULE_E #include #include #include @@ -229,6 +232,17 @@ void CameraParser::checkField(CameraParser* profiles, const char* name, const ch profiles->pCurrentCam->sensorName = val; } else if (strcmp(key, "description") == 0) { profiles->pCurrentCam->sensorDescription = val; + // VIRTUAL_CHANNEL_S + } else if (strcmp(key, "virtualChannel") == 0) { + profiles->pCurrentCam->mVirtualChannel = + strcmp(val, "true") == 0 ? true : false; + } else if (strcmp(key, "vcNum") == 0) { + profiles->pCurrentCam->mVCNum = strtoul(val, nullptr, 10); + } else if (strcmp(key, "vcSeq") == 0) { + profiles->pCurrentCam->mVCSeq = strtoul(val, nullptr, 10); + } else if (strcmp(key, "vcGroupId") == 0) { + profiles->pCurrentCam->mVCGroupId = strtoul(val, nullptr, 10); + // VIRTUAL_CHANNEL_E } idx += 2; } @@ -270,8 +284,6 @@ void CameraParser::handleCommon(CameraParser* profiles, const char* name, const cfg->ipuName = atts[1]; } else if (strcmp(name, "availableSensors") == 0) { parseXmlConvertStrings(atts[1], cfg->availableSensors, convertCharToString); - } else if (strcmp(name, "useGpuTnr") == 0) { - cfg->isGpuTnrEnabled = strcmp(atts[1], "true") == 0; } else if (strcmp(name, "cameraNumber") == 0) { cfg->cameraNumber = atoi(atts[1]); } else if (strcmp(name, "stillTnrPrior") == 0) { @@ -289,14 +301,10 @@ void CameraParser::handleCommon(CameraParser* profiles, const char* name, const cfg->supportHwJpegEncode = strcmp(atts[1], "true") == 0; } else if (strcmp(name, "maxIsysTimeoutValue") == 0) { cfg->maxIsysTimeoutValue = atoi(atts[1]); - // ENABLE_EVCP_S - } else if (strcmp(name, "useGpuEvcp") == 0) { - cfg->isGpuEvcpEnabled = strcmp(atts[1], "true") == 0; - // ENABLE_EVCP_E - // LEVEL0_ICBM_S + // LEVEL0_ICBM_S } else if (strcmp(name, "useGPUICBM") == 0) { cfg->isGPUICBMEnabled = strcmp(atts[1], "true") == 0; - // LEVEL0_ICBM_E + // LEVEL0_ICBM_E } } @@ -323,6 +331,8 @@ void CameraParser::handleSensor(CameraParser* profiles, const char* name, const getSupportedFormat(atts[1], pCurrentCam->mSupportedISysFormat); } else if (strcmp(name, "iSysRawFormat") == 0) { pCurrentCam->mISysRawFormat = CameraUtils::string2PixelCode(atts[1]); + } else if (strcmp(name, "preferredStillOutput") == 0) { + parseSizesList(atts[1], pCurrentCam->mPreferStillOutput); } else if (strcmp(name, "configModeToStreamId") == 0) { char* srcDup = strdup(atts[1]); CheckAndLogError(!srcDup, VOID_VALUE, "Create a copy of source string failed."); @@ -383,6 +393,10 @@ void CameraParser::handleSensor(CameraParser* profiles, const char* name, const } } else if (strcmp(name, "useCrlModule") == 0) { pCurrentCam->mUseCrlModule = strcmp(atts[1], "true") == 0; + // DOL_FEATURE_S + } else if (strcmp(name, "dolVbpOffset") == 0) { + parseXmlConvertStrings(atts[1], pCurrentCam->mDolVbpOffset, atoi); + // DOL_FEATURE_E } else if (strcmp(name, "skipFrameV4L2Error") == 0) { pCurrentCam->mSkipFrameV4L2Error = strcmp(atts[1], "true") == 0; } else if (strcmp(name, "useSensorDigitalGain") == 0) { @@ -447,6 +461,40 @@ void CameraParser::handleSensor(CameraParser* profiles, const char* name, const pCurrentCam->mDigitalGainLag = atoi(atts[1]); } else if (strcmp(name, "exposureLag") == 0) { pCurrentCam->mExposureLag = atoi(atts[1]); + // HDR_FEATURE_S + } else if (strcmp(name, "hdrExposureType") == 0) { + if (strcmp(atts[1], "fix-exposure-ratio") == 0) { + pCurrentCam->mSensorExposureType = SENSOR_FIX_EXPOSURE_RATIO; + } else if (strcmp(atts[1], "relative-multi-exposures") == 0) { + pCurrentCam->mSensorExposureType = SENSOR_RELATIVE_MULTI_EXPOSURES; + } else if (strcmp(atts[1], "multi-exposures") == 0) { + pCurrentCam->mSensorExposureType = SENSOR_MULTI_EXPOSURES; + } else if (strcmp(atts[1], "dual-exposures-dcg-and-vs") == 0) { + pCurrentCam->mSensorExposureType = SENSOR_DUAL_EXPOSURES_DCG_AND_VS; + } else { + LOGE("unknown SENSOR exposure type %s, set to SENSOR_EXPOSURE_SINGLE", atts[1]); + pCurrentCam->mSensorExposureType = SENSOR_EXPOSURE_SINGLE; + } + } else if (strcmp(name, "hdrExposureNum") == 0) { + pCurrentCam->mSensorExposureNum = atoi(atts[1]); + } else if (strcmp(name, "hdrStatsInputBitDepth") == 0) { + pCurrentCam->mHdrStatsInputBitDepth = atoi(atts[1]); + } else if (strcmp(name, "hdrStatsOutputBitDepth") == 0) { + pCurrentCam->mHdrStatsOutputBitDepth = atoi(atts[1]); + } else if (strcmp(name, "useFixedHdrExposureInfo") == 0) { + pCurrentCam->mUseFixedHdrExposureInfo = strcmp(atts[1], "true") == 0; + } else if (strcmp(name, "hdrGainType") == 0) { + if (strcmp(atts[1], "multi-dg-and-convertion-ag") == 0) { + pCurrentCam->mSensorGainType = SENSOR_MULTI_DG_AND_CONVERTION_AG; + } else if (strcmp(atts[1], "isp-dg-and-sensor-direct-ag") == 0) { + pCurrentCam->mSensorGainType = ISP_DG_AND_SENSOR_DIRECT_AG; + } else if (strcmp(atts[1], "multi-dg-and-direct-ag") == 0) { + pCurrentCam->mSensorGainType = SENSOR_MULTI_DG_AND_DIRECT_AG; + } else { + LOGE("unknown sensor gain type %s, set to SENSOR_GAIN_NONE", atts[1]); + pCurrentCam->mSensorGainType = SENSOR_GAIN_NONE; + } + // HDR_FEATURE_E } else if (strcmp(name, "graphSettingsFile") == 0) { pCurrentCam->mGraphSettingsFile = atts[1]; } else if (strcmp(name, "graphSettingsType") == 0) { @@ -615,6 +663,8 @@ void CameraParser::handleSensor(CameraParser* profiles, const char* name, const pCurrentCam->mTnrExtraFrameNum = val > 0 ? val : DEFAULT_TNR_EXTRA_FRAME_NUM; } else if (strcmp(name, "dummyStillSink") == 0) { pCurrentCam->mDummyStillSink = strcmp(atts[1], "true") == 0; + } else if (strcmp(name, "useGpuTnr") == 0) { + pCurrentCam->mGpuTnrEnabled = strcmp(atts[1], "true") == 0; } else if (!strcmp(name, "removeCacheFlushOutputBuffer")) { pCurrentCam->mRemoveCacheFlushOutputBuffer = strcmp(atts[1], "true") == 0; } else if (!strcmp(name, "isPLCEnable")) { @@ -638,6 +688,18 @@ void CameraParser::handleSensor(CameraParser* profiles, const char* name, const // PRIVACY_MODE_E } else if (strcmp(name, "stillOnlyPipe") == 0) { pCurrentCam->mStillOnlyPipe = strcmp(atts[1], "true") == 0; + // VIRTUAL_CHANNEL_S + } else if (strcmp(name, "vcAggregator") == 0) { + int size = strlen(atts[1]); + char src[size + 1]; + MEMCPY_S(src, size, atts[1], size); + src[size] = '\0'; + char* savePtr = nullptr; + char* tablePtr = strtok_r(src, ",", &savePtr); + if (tablePtr) pCurrentCam->mVcAggregator.mName = tablePtr; + tablePtr = strtok_r(nullptr, ",", &savePtr); + if (tablePtr) pCurrentCam->mVcAggregator.mIndex = atoi(tablePtr); + // VIRTUAL_CHANNEL_E } else if (strcmp(name, "disableBLCByAGain") == 0) { int size = strlen(atts[1]); char src[size + 1]; @@ -651,6 +713,9 @@ void CameraParser::handleSensor(CameraParser* profiles, const char* name, const profiles->pCurrentCam->mDisableBLCByAGain = true; } else if (strcmp(name, "resetLinkRoute") == 0) { pCurrentCam->mResetLinkRoute = strcmp(atts[1], "true") == 0; + } else if (strcmp(name, "reqWaitTimeoutNs") == 0) { + int64_t val = atoi(atts[1]); + pCurrentCam->mReqWaitTimeout = (val >= 0) ? val : 0; } } @@ -737,6 +802,10 @@ void CameraParser::parseMediaCtlConfigElement(CameraParser* profiles, const char mc.outputHeight = strtoul(atts[idx + 1], nullptr, 10); } else if (strcmp(key, "format") == 0) { mc.format = CameraUtils::string2PixelCode(atts[idx + 1]); + // DOL_FEATURE_S + } else if (strcmp(key, "vbp") == 0) { + mc.vbp = strtoul(atts[idx + 1], nullptr, 10); + // DOL_FEATURE_E } idx += 2; } @@ -788,6 +857,22 @@ void CameraParser::parseControlElement(CameraParser* profiles, const char* name, } else if (!strcmp(val, "V4L2_CID_MIPI_LANES")) { ctl.ctlCmd = V4L2_CID_MIPI_LANES; #endif + // HDR_FEATURE_S + } else if (!strcmp(val, "V4L2_CID_WDR_MODE")) { + ctl.ctlCmd = V4L2_CID_WDR_MODE; + // HDR_FEATURE_E + // CRL_MODULE_S + } else if (!strcmp(val, "V4L2_CID_LINE_LENGTH_PIXELS")) { + ctl.ctlCmd = V4L2_CID_LINE_LENGTH_PIXELS; + } else if (!strcmp(val, "V4L2_CID_FRAME_LENGTH_LINES")) { + ctl.ctlCmd = V4L2_CID_FRAME_LENGTH_LINES; + } else if (!strcmp(val, "CRL_CID_SENSOR_MODE")) { + ctl.ctlCmd = CRL_CID_SENSOR_MODE; + } else if (!strcmp(val, "CRL_CID_EXPOSURE_MODE")) { + ctl.ctlCmd = CRL_CID_EXPOSURE_MODE; + } else if (!strcmp(val, "CRL_CID_EXPOSURE_HDR_RATIO")) { + ctl.ctlCmd = CRL_CID_EXPOSURE_HDR_RATIO; + // CRL_MODULE_E } else { LOGE("Unknow ioctl command %s", val); ctl.ctlCmd = -1; diff --git a/src/platformdata/CameraTypes.h b/src/platformdata/CameraTypes.h index 28972c18..b239d7df 100644 --- a/src/platformdata/CameraTypes.h +++ b/src/platformdata/CameraTypes.h @@ -66,11 +66,17 @@ enum { typedef enum { TUNING_MODE_VIDEO, TUNING_MODE_VIDEO_ULL, + // HDR_FEATURE_S + TUNING_MODE_VIDEO_HDR, + TUNING_MODE_VIDEO_HDR2, + TUNING_MODE_VIDEO_HLC, + // HDR_FEATURE_E TUNING_MODE_VIDEO_CUSTOM_AIC, TUNING_MODE_VIDEO_LL, TUNING_MODE_VIDEO_REAR_VIEW, TUNING_MODE_VIDEO_HITCH_VIEW, TUNING_MODE_STILL_CAPTURE, + TUNING_MODE_VIDEO_BINNING, TUNING_MODE_MAX } TuningMode; @@ -127,6 +133,11 @@ typedef struct { uint32_t vertical_scaling_denominator; } SensorFrameParams; +typedef struct { + int8_t edgeStrength; + int8_t nrStrength; +} EdgeNrSetting; + enum ExecutorNotifyPolicy { POLICY_FRAME_FIRST = 0, POLICY_STATS_FIRST, @@ -173,7 +184,6 @@ struct CommonConfig { float xmlVersion; std::string ipuName; std::vector availableSensors; - bool isGpuTnrEnabled; bool isStillTnrPrior; bool isTnrParamForceUpdate; bool useTnrGlobalProtection; @@ -182,27 +192,20 @@ struct CommonConfig { bool supportIspTuningUpdate; bool supportHwJpegEncode; int maxIsysTimeoutValue; - // ENABLE_EVCP_S - bool isGpuEvcpEnabled; - // ENABLE_EVCP_E // LEVEL0_ICBM_S bool isGPUICBMEnabled; // LEVEL0_ICBM_E CommonConfig() { xmlVersion = 1.0; - isGpuTnrEnabled = false; - isStillTnrPrior = true; + isStillTnrPrior = false; isTnrParamForceUpdate = false; - useTnrGlobalProtection = false; + useTnrGlobalProtection = true; cameraNumber = -1; videoStreamNum = DEFAULT_VIDEO_STREAM_NUM; supportIspTuningUpdate = false; supportHwJpegEncode = true; maxIsysTimeoutValue = 0; - // ENABLE_EVCP_S - isGpuEvcpEnabled = false; - // ENABLE_EVCP_E // LEVEL0_ICBM_S isGPUICBMEnabled = false; // LEVEL0_ICBM_E @@ -271,4 +274,11 @@ typedef enum { } PrivacyModeType; // PRIVACY_MODE_E +// VIRTUAL_CHANNEL_S +struct VcAggregator { + VcAggregator() { mIndex = -1; } + int mIndex; + std::string mName; +}; +// VIRTUAL_CHANNEL_E } /* namespace icamera */ diff --git a/src/platformdata/ParserBase.cpp b/src/platformdata/ParserBase.cpp index 0b362f21..2e437c4b 100644 --- a/src/platformdata/ParserBase.cpp +++ b/src/platformdata/ParserBase.cpp @@ -144,8 +144,10 @@ int ParserBase::getDataFromXmlFile(std::string fileName) { std::string chosenXmlFile; getAvaliableXmlFile(profiles, chosenXmlFile); - CheckAndLogError(chosenXmlFile.empty(), UNKNOWN_ERROR, "%s is not found in: %s or %s", - fileName.c_str(), curFolderFileName.c_str(), sysFolderFileName.c_str()); + if (chosenXmlFile.empty()) { + LOGI("%s is not found", fileName.c_str()); + return UNKNOWN_ERROR; + } return parseXmlFile(chosenXmlFile); } diff --git a/src/platformdata/PlatformData.cpp b/src/platformdata/PlatformData.cpp index eec1ccdb..f4374e10 100644 --- a/src/platformdata/PlatformData.cpp +++ b/src/platformdata/PlatformData.cpp @@ -99,17 +99,90 @@ int PlatformData::init() { staticCfg->mCameras[i].mMaxNvmDataSize, camModuleName); getInstance()->mAiqInitData.push_back(aiqInitData); + staticCfg->getModuleInfoFromCmc(i); + + // Overwrite staticCfg with CameraModuleInfo in sensor xml if (!camModuleName.empty() && staticCfg->mCameras[i].mCameraModuleInfoMap.find(camModuleName) != staticCfg->mCameras[i].mCameraModuleInfoMap.end()) { ParameterHelper::merge(staticCfg->mCameras[i].mCameraModuleInfoMap[camModuleName], &staticCfg->mCameras[i].mCapability); } + + // HDR_FEATURE_S + if (isEnableHDR(i)) { + /* If sensor enable HDR replace media format to full range*/ + bool ret = updateMediaFormat(i, false); + if (ret) { + LOG1("%s, Using full range media format for HDR sensor %s", __func__, + getSensorName(i)); + } + } else { + bool ret = updateMediaFormat(i, true); + if (ret) { + LOG1("%s, Using narrow mode media format for sensor %s", __func__, + getSensorName(i)); + } + } + // HDR_FEATURE_E } return OK; } +void PlatformData::StaticCfg::getModuleInfoFromCmc(int cameraId) { + CameraInfo& info = mCameras[cameraId]; + + if (info.mSupportedTuningConfig.empty()) return; + + // Get default tuning mode and cpf data to update some static capabilities + TuningMode tuningMode = info.mSupportedTuningConfig[0].tuningMode; + ia_binary_data cpfData; + int ret = PlatformData::getCpf(cameraId, tuningMode, &cpfData); + CheckWarning(ret != OK || !cpfData.data || cpfData.size > cca::MAX_CPF_LEN, VOID_VALUE, + "%s, AIQB error data %p size %d (max %d), ret %d", __func__, cpfData.data, + cpfData.size, cca::MAX_CPF_LEN, ret); + + cca::cca_cmc cmc; + cca::cca_cpf* cpf = new cca::cca_cpf; + cpf->size = cpfData.size; + MEMCPY_S(cpf->buf, cca::MAX_CPF_LEN, cpfData.data, cpfData.size); + + ia_err iaRet = IntelCca::getInstance(cameraId, tuningMode)->getCMC(&cmc, cpf); + delete cpf; + IntelCca::releaseInstance(cameraId, tuningMode); + CheckWarning(iaRet != ia_err_none, VOID_VALUE, "Get cmc data failed"); + + LOG1("%s: base iso %d, dg [%4.2f, %4.2f], ag [%4.2f, %4.2f], from aiqb", __func__, cmc.base_iso, + cmc.min_dg, cmc.max_dg, cmc.min_ag, cmc.max_ag); + LOG1("%s: focal_len %d, min_fd %d, ap %d", __func__, cmc.optics.effect_focal_length, + cmc.optics.min_focus_distance, cmc.lut_apertures); + // HDR_FEATURE_S + mCameras[cameraId].mMediaFormat = static_cast(cmc.media_format); + LOG1("%s: media_format %d", __func__, cmc.media_format); + // HDR_FEATURE_E + int32_t maxAg = cmc.base_iso * cmc.max_ag; + const CameraMetadata caps = ParameterHelper::getMetadata(info.mCapability); + CameraMetadata meta; + uint32_t tag = CAMERA_SENSOR_MAX_ANALOG_SENSITIVITY; + icamera_metadata_ro_entry entry = caps.find(tag); + if (!entry.count) { + meta.update(tag, &maxAg, 1); + } + + tag = CAMERA_SENSOR_INFO_SENSITIVITY_RANGE; + entry = caps.find(tag); + if (!entry.count) { + int32_t maxDg = static_cast(cmc.max_dg); + int32_t range[] = {cmc.base_iso, maxAg * maxDg}; + meta.update(tag, range, ARRAY_SIZE(range)); + } + + if (!meta.isEmpty()) { + ParameterHelper::merge(meta, &info.mCapability); + } +} + /** * Read graph descriptor and settings from configuration files. * @@ -146,6 +219,27 @@ int PlatformData::queryGraphSettings(int cameraId, const stream_config_t* stream return OK; } +int PlatformData::getEdgeNrSetting(int cameraId, float totalGain, float hdrRatio, + EdgeNrSetting& setting) { + const StaticCfg::CameraInfo& pCam = getInstance()->mStaticCfg.mCameras[cameraId]; + LOG2("%s, totalGain %f, hdrRatio %f", __func__, totalGain, hdrRatio); + + if (!pCam.mTotalGainHdrRatioToEdgeNrMap.empty()) { + // found the lower value in map + auto subMap = pCam.mTotalGainHdrRatioToEdgeNrMap.upper_bound(totalGain); + if (subMap != pCam.mTotalGainHdrRatioToEdgeNrMap.begin()) { + auto sub = (--subMap)->second; + auto it = sub.upper_bound(hdrRatio); + if (it != sub.begin()) { + setting = (--it)->second; + return OK; + } + } + } + + return NAME_NOT_FOUND; +} + void PlatformData::releaseGraphConfigNodes() { std::shared_ptr graphConfig = std::make_shared(); graphConfig->releaseGraphNodes(); @@ -297,7 +391,6 @@ bool PlatformData::isDvsSupported(int cameraId) { auto entry = meta.find(CAMERA_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM); if (entry.count > 0 && *entry.data.f > 1) supported = true; - LOG2("@%s, dvs supported:%d", __func__, supported); return supported; } @@ -341,15 +434,116 @@ int PlatformData::getExposureNum(int cameraId, bool multiExposure) { } int exposureNum = 1; + // DOL_FEATURE_S + if (PlatformData::isDolShortEnabled(cameraId)) exposureNum++; + + if (PlatformData::isDolMediumEnabled(cameraId)) exposureNum++; + // DOL_FEATURE_E return exposureNum; } bool PlatformData::isLtmEnabled(int cameraId) { + // HDR_FEATURE_S + if (isEnableHDR(cameraId)) { + return true; + } + // HDR_FEATURE_E return getInstance()->mStaticCfg.mCameras[cameraId].mLtmEnabled; } +ia_media_format PlatformData::getMediaFormat(int cameraId) { + return getInstance()->mStaticCfg.mCameras[cameraId].mMediaFormat; +} + +// HDR_FEATURE_S +bool PlatformData::updateMediaFormat(int cameraId, bool isNarrow) { + ia_media_format tuning_media_format = + getInstance()->mStaticCfg.mCameras[cameraId].mMediaFormat; + ia_media_format media_format = tuning_media_format; + switch (tuning_media_format) { + case media_format_legacy: + media_format = media_format_legacy; + break; + case media_format_srgb_jpeg: + media_format = media_format_srgb_jpeg; + break; + case media_format_linear_mono: + media_format = media_format_linear_mono; + break; + case media_format_custom: + media_format = media_format_custom; + break; + case media_format_bt601_8b: + media_format = isNarrow ? media_format_bt601_8b_narrow : media_format_bt601_8b; + break; + case media_format_bt709_8b: + media_format = isNarrow ? media_format_bt709_8b_narrow : media_format_bt709_8b; + break; + case media_format_bt709_10b: + media_format = isNarrow ? media_format_bt709_10b_narrow : media_format_bt709_10b; + break; + case media_format_bt2020_10b: + media_format = isNarrow ? media_format_bt2020_10b_narrow : media_format_bt2020_10b; + break; + case media_format_bt2100_10b: + media_format = isNarrow ? media_format_bt2100_10b_narrow : media_format_bt2100_10b; + break; + case media_format_bt2100_10b_cl: + media_format = isNarrow ? media_format_bt2100_10b_cl_narrow : media_format_bt2100_10b_cl; + break; + case media_format_bt2020_12b: + media_format = isNarrow ? media_format_bt2020_12b_narrow : media_format_bt2020_12b; + break; + case media_format_bt2100_12b: + media_format = isNarrow ? media_format_bt2100_12b_narrow : media_format_bt2100_12b; + break; + case media_format_bt2100_12b_cl: + media_format = isNarrow ? media_format_bt2100_12b_cl_narrow : media_format_bt2100_12b_cl; + break; + default: + LOGE("invalid media format, default value used."); + return false; + break; + } + LOGI("%s, media format in tuning: %d, media format for aic %d.", tuning_media_format, + media_format); + getInstance()->mStaticCfg.mCameras[cameraId].mMediaFormat = media_format; + return true; +} + +bool PlatformData::isEnableHDR(int cameraId) { + return (getInstance()->mStaticCfg.mCameras[cameraId].mSensorExposureType != + SENSOR_EXPOSURE_SINGLE); +} + +int PlatformData::getHDRStatsInputBitDepth(int cameraId) { + return getInstance()->mStaticCfg.mCameras[cameraId].mHdrStatsInputBitDepth; +} + +int PlatformData::getHDRStatsOutputBitDepth(int cameraId) { + return getInstance()->mStaticCfg.mCameras[cameraId].mHdrStatsOutputBitDepth; +} + +int PlatformData::isUseFixedHDRExposureInfo(int cameraId) { + return getInstance()->mStaticCfg.mCameras[cameraId].mUseFixedHdrExposureInfo; +} +// HDR_FEATURE_E + +bool PlatformData::isMultiExposureCase(int cameraId, TuningMode tuningMode) { + // HDR_FEATURE_S + if (tuningMode == TUNING_MODE_VIDEO_HDR || tuningMode == TUNING_MODE_VIDEO_HDR2 || + tuningMode == TUNING_MODE_VIDEO_HLC) { + return true; + } else if (getSensorAeEnable(cameraId)) { + return true; + } + // HDR_FEATURE_E + + return false; +} + int PlatformData::getSensorExposureType(int cameraId) { return getInstance()->mStaticCfg.mCameras[cameraId].mSensorExposureType; } @@ -434,11 +628,27 @@ MediaCtlConf* PlatformData::getMediaCtlConf(int cameraId) { int PlatformData::getCameraInfo(int cameraId, camera_info_t& info) { info.device_version = 1; - info.facing = getInstance()->mStaticCfg.mCameras[cameraId].mFacing; info.orientation = getInstance()->mStaticCfg.mCameras[cameraId].mOrientation; info.name = getSensorName(cameraId); info.description = getSensorDescription(cameraId); info.capability = &getInstance()->mStaticCfg.mCameras[cameraId].mCapability; + + const CameraMetadata& meta = icamera::ParameterHelper::getMetadata(*info.capability); + auto entry = meta.find(CAMERA_LENS_FACING); + info.facing = FACING_BACK; + if (entry.count == 1) { + info.facing = entry.data.u8[0] == CAMERA_LENS_FACING_BACK ? + FACING_BACK : FACING_FRONT; + } + + // VIRTUAL_CHANNEL_S + info.vc.total_num = 0; + if (getInstance()->mStaticCfg.mCameras[cameraId].mVirtualChannel) { + info.vc.total_num = getInstance()->mStaticCfg.mCameras[cameraId].mVCNum; + info.vc.sequence = getInstance()->mStaticCfg.mCameras[cameraId].mVCSeq; + info.vc.group = getInstance()->mStaticCfg.mCameras[cameraId].mVCGroupId; + } + // VIRTUAL_CHANNEL_E return OK; } @@ -665,6 +875,84 @@ stream_t PlatformData::getISysOutputByPort(int cameraId, Port port) { return config; } +// DOL_FEATURE_S +int PlatformData::getFixedVbp(int cameraId) { + MediaCtlConf* mc = getMediaCtlConf(cameraId); + if (!mc) { + LOGW("%s: Failed to get MC for fixed VBP, disable fixed VBP.", __func__); + return -1; + } + return mc->vbp; +} + +bool PlatformData::needHandleVbpInMetaData(int cameraId, ConfigMode configMode) { + int fixedVbp; + + if (configMode != CAMERA_STREAM_CONFIGURATION_MODE_HDR) { + return false; + } + + // Fixed VBP take higher priority when both fixed and dynamic VBP are configured + fixedVbp = getFixedVbp(cameraId); + if (fixedVbp >= 0) { + LOG2("%s: fixed VBP configure detected, no need to handle VBP in meta", __func__); + return false; + } + + vector vbpOffset; + PlatformData::getDolVbpOffset(cameraId, vbpOffset); + if (vbpOffset.size() > 0) { + return true; + } + + return false; +} + +bool PlatformData::needSetVbp(int cameraId, ConfigMode configMode) { + int fixedVbp; + + if (configMode != CAMERA_STREAM_CONFIGURATION_MODE_HDR) { + return false; + } + + fixedVbp = getFixedVbp(cameraId); + if (fixedVbp >= 0) { + LOG2("%s: Fixed VBP configure detected, value %d", __func__, fixedVbp); + return true; + } + + vector vbpOffset; + PlatformData::getDolVbpOffset(cameraId, vbpOffset); + if (vbpOffset.size() > 0) { + LOG2("%s: Dynamic VBP configure detected", __func__); + return true; + } + + return false; +} + +void PlatformData::getDolVbpOffset(int cameraId, vector& dolVbpOffset) { + dolVbpOffset = getInstance()->mStaticCfg.mCameras[cameraId].mDolVbpOffset; +} + +bool PlatformData::isDolShortEnabled(int cameraId) { + return isVideoNodeEnabled(cameraId, VIDEO_GENERIC_SHORT_EXPO); +} + +bool PlatformData::isDolMediumEnabled(int cameraId) { + return isVideoNodeEnabled(cameraId, VIDEO_GENERIC_MEDIUM_EXPO); +} +// DOL_FEATURE_E + +// CSI_META_S +bool PlatformData::isCsiMetaEnabled(int cameraId) { + // FILE_SOURCE_S + if (isFileSourceEnabled()) return false; + // FILE_SOURCE_E + return isVideoNodeEnabled(cameraId, VIDEO_CSI_META); +} +// CSI_META_E + bool PlatformData::isAiqdEnabled(int cameraId) { return getInstance()->mStaticCfg.mCameras[cameraId].mEnableAiqd; } @@ -991,6 +1279,54 @@ int PlatformData::getConfigModesByOperationMode(int cameraId, uint32_t operation return INVALID_OPERATION; } +/* + * This function adds for binning mode tuning support, and there are 2 tuning modes for configMode. + * The first tuning mode will be used when selecting tuning mode. + * When selecting small ISYS output, the binning mode should be moved to first, otherwise full size + * mode should be the first tuning mode. + */ +void PlatformData::reorderSupportedTuningConfig(int cameraId, ConfigMode configMode) { + auto pCam = &getInstance()->mStaticCfg.mCameras[cameraId]; + int binningIdx = -1; + int fullIdx = -1; + int idx = -1; + for (auto& cfg : pCam->mSupportedTuningConfig) { + idx++; + LOG1("%s, tuningMode %d, configMode %x, idx %d", __func__, cfg.tuningMode, cfg.configMode, + idx); + if (cfg.configMode == configMode) { + if (cfg.tuningMode == TUNING_MODE_VIDEO_BINNING) { + binningIdx = idx; + } else { + fullIdx = idx; + } + } + } + + if (binningIdx < 0 || fullIdx < 0) return; + + bool smallSize = false; + MediaCtlConf* mc = PlatformData::getMediaCtlConf(cameraId); + vector res; + // The supported resolutions are saved in res with ascending order(small -> bigger) + getSupportedISysSizes(cameraId, res); + if (!res.empty() && mc) { + for (const auto& output : mc->outputs) { + if (res.back().width > output.width || res.back().height > output.height) { + smallSize = true; + break; + } + } + } + + if ((smallSize && binningIdx > fullIdx) || (!smallSize && binningIdx < fullIdx)) { + // Switch binning mode and full mode + auto config = pCam->mSupportedTuningConfig[fullIdx]; + pCam->mSupportedTuningConfig[fullIdx] = pCam->mSupportedTuningConfig[binningIdx]; + pCam->mSupportedTuningConfig[binningIdx] = config; + } +} + int PlatformData::getTuningModeByConfigMode(int cameraId, ConfigMode configMode, TuningMode& tuningMode) { CheckAndLogError(getInstance()->mStaticCfg.mCameras[cameraId].mSupportedTuningConfig.empty(), @@ -1167,6 +1503,35 @@ vector PlatformData::getMultiExpRanges(int cameraId) { return getInstance()->mStaticCfg.mCameras[cameraId].mMultiExpRanges; } +// FILE_SOURCE_S +const char* PlatformData::getInjectedFile() { + const char* PROP_CAMERA_FILE_INJECTION = "cameraInjectFile"; + return getenv(PROP_CAMERA_FILE_INJECTION); +} + +bool PlatformData::isFileSourceEnabled() { + return getInjectedFile() != nullptr; +} +// FILE_SOURCE_E + +// VIRTUAL_CHANNEL_S +int PlatformData::getVirtualChannelSequence(int cameraId) { + if (getInstance()->mStaticCfg.mCameras[cameraId].mVirtualChannel) { + return getInstance()->mStaticCfg.mCameras[cameraId].mVCSeq; + } + + return -1; +} + +int PlatformData::getVcAggregator(int cameraId, struct VcAggregator& aggregator) { + if (getInstance()->mStaticCfg.mCameras[cameraId].mVcAggregator.mIndex >= 0) { + aggregator = getInstance()->mStaticCfg.mCameras[cameraId].mVcAggregator; + return OK; + } + return NO_ENTRY; +} +// VIRTUAL_CHANNEL_E + camera_resolution_t* PlatformData::getPslOutputForRotation(int width, int height, int cameraId) { CheckAndLogError(getInstance()->mStaticCfg.mCameras[cameraId].mOutputMap.empty(), nullptr, "@%s, there isn't pslOutputMapForRotation field in xml.", cameraId, @@ -1184,6 +1549,25 @@ camera_resolution_t* PlatformData::getPslOutputForRotation(int width, int height return nullptr; } +const camera_resolution_t* PlatformData::getPreferStillOutput(int width, int height, + int cameraId) { + if (getInstance()->mStaticCfg.mCameras[cameraId].mPreferStillOutput.empty()) return nullptr; + + const std::vector& preferOutput = + getInstance()->mStaticCfg.mCameras[cameraId].mPreferStillOutput; + for (const auto& output : preferOutput) { + // get preferred still output for small size + if ((width < output.width || height < output.height) + && (width * output.height == height * output.width)) { + LOG2(" the psl output: (%dx%d) for user: %dx%d", cameraId, output.width, + output.height, width, height); + return &output; + } + } + + return nullptr; +} + bool PlatformData::isTestPatternSupported(int cameraId) { return !getInstance()->mStaticCfg.mCameras[cameraId].mTestPatternMap.empty(); } @@ -1223,9 +1607,14 @@ camera_coordinate_system_t PlatformData::getActivePixelArray(int cameraId) { } string PlatformData::getCameraCfgPath() { - char* p = getenv("CAMERA_CFG_PATH"); + string cfgPath = string(CAMERA_DEFAULT_CFG_PATH); +#ifdef SUB_CONFIG_PATH + cfgPath += string(SUB_CONFIG_PATH); + cfgPath.append("/"); +#endif - return p ? string(p) : string(CAMERA_DEFAULT_CFG_PATH); + char* p = getenv("CAMERA_CFG_PATH"); + return p ? string(p) : cfgPath; } string PlatformData::getGraphDescFilePath() { @@ -1291,6 +1680,14 @@ int PlatformData::saveMakernoteData(int cameraId, camera_makernote_mode_t makern sequence, tuningMode); } +void* PlatformData::getMakernoteBuf(int cameraId, camera_makernote_mode_t makernoteMode, + bool& dump) { + CheckAndLogError(cameraId >= static_cast(getInstance()->mAiqInitData.size()), nullptr, + "@%s, bad cameraId:%d", __func__, cameraId); + + return getInstance()->mAiqInitData[cameraId]->getMakernoteBuf(makernoteMode, dump); +} + void PlatformData::updateMakernoteTimeStamp(int cameraId, int64_t sequence, uint64_t timestamp) { CheckAndLogError(cameraId >= static_cast(getInstance()->mAiqInitData.size()), VOID_VALUE, "@%s, bad cameraId:%d", __func__, cameraId); @@ -1343,10 +1740,6 @@ void PlatformData::setScalerInfo(int cameraId, std::vectormStaticCfg.mCommonConfig.isGpuTnrEnabled; -} - int PlatformData::getVideoStreamNum() { return getInstance()->mStaticCfg.mCommonConfig.videoStreamNum; } @@ -1365,10 +1758,9 @@ int PlatformData::getMaxIsysTimeout() { bool PlatformData::isUsingGpuAlgo() { bool enabled = false; - enabled |= isGpuTnrEnabled(); - // ENABLE_EVCP_S - enabled |= isGpuEvcpEnabled(); - // ENABLE_EVCP_E + for (int cameraId = static_cast(getInstance()->mStaticCfg.mCameras.size()) - 1; + cameraId >= 0; cameraId--) + enabled |= isGpuTnrEnabled(cameraId); // LEVEL0_ICBM_S enabled |= isGPUICBMEnabled(); // LEVEL0_ICBM_E @@ -1403,6 +1795,10 @@ bool PlatformData::isDummyStillSink(int cameraId) { return getInstance()->mStaticCfg.mCameras[cameraId].mDummyStillSink; } +bool PlatformData::isGpuTnrEnabled(int cameraId) { + return getInstance()->mStaticCfg.mCameras[cameraId].mGpuTnrEnabled; +} + bool PlatformData::removeCacheFlushOutputBuffer(int cameraId) { return getInstance()->mStaticCfg.mCameras[cameraId].mRemoveCacheFlushOutputBuffer; } @@ -1411,12 +1807,6 @@ bool PlatformData::getPLCEnable(int cameraId) { return getInstance()->mStaticCfg.mCameras[cameraId].mPLCEnable; } -// ENABLE_EVCP_S -bool PlatformData::isGpuEvcpEnabled() { - return getInstance()->mStaticCfg.mCommonConfig.isGpuEvcpEnabled; -} -// ENABLE_EVCP_E - // PRIVACY_MODE_S PrivacyModeType PlatformData::getSupportPrivacy(int cameraId) { return getInstance()->mStaticCfg.mCameras[cameraId].mSupportPrivacy; @@ -1445,6 +1835,10 @@ bool PlatformData::isResetLinkRoute(int cameraId) { return getInstance()->mStaticCfg.mCameras[cameraId].mResetLinkRoute; } +int64_t PlatformData::getReqWaitTimeout(int cameraId) { + return getInstance()->mStaticCfg.mCameras[cameraId].mReqWaitTimeout; +} + // LEVEL0_ICBM_S bool PlatformData::isGPUICBMEnabled() { return getInstance()->mStaticCfg.mCommonConfig.isGPUICBMEnabled; diff --git a/src/platformdata/PlatformData.h b/src/platformdata/PlatformData.h index 002cd607..1f2f1ac0 100644 --- a/src/platformdata/PlatformData.h +++ b/src/platformdata/PlatformData.h @@ -33,6 +33,7 @@ #include "CameraTypes.h" #include "FaceType.h" #include "ICamera.h" +#include "ia_types.h" #include "IGraphConfig.h" #include "MediaControl.h" #include "Parameters.h" @@ -51,6 +52,9 @@ namespace icamera { #define RESOLUTION_VGA_HEIGHT 480 #define MAX_BUFFER_COUNT (10) +// VIRTUAL_CHANNEL_S +#define MAX_VC_GROUP_NUMBER 8 +// VIRTUAL_CHANNEL_E #define MAX_STREAM_NUMBER 5 #define MAX_WEIGHT_GRID_SIDE_LEN 1024 @@ -119,11 +123,22 @@ class PlatformData { : sensorName(""), sensorDescription("unset"), mLensName(""), + // VIRTUAL_CHANNEL_S + mVirtualChannel(false), + mVCNum(0), + mVCSeq(0), + mVCGroupId(-1), + // VIRTUAL_CHANNEL_E mLensHwType(LENS_NONE_HW), mEnablePdaf(false), mSensorAwb(false), mSensorAe(false), mRunIspAlways(false), + // HDR_FEATURE_S + mHdrStatsInputBitDepth(0), + mHdrStatsOutputBitDepth(0), + mUseFixedHdrExposureInfo(true), + // HDR_FEATURE_E mLtmEnabled(false), mSensorExposureNum(2), mSensorExposureType(SENSOR_EXPOSURE_SINGLE), @@ -153,12 +168,12 @@ class PlatformData { mISysFourcc(V4L2_PIX_FMT_SGRBG8), mISysRawFormat(V4L2_PIX_FMT_SGRBG10), mUseCrlModule(true), - mFacing(FACING_BACK), mOrientation(ORIENTATION_0), mSensorOrientation(ORIENTATION_0), mUseSensorDigitalGain(false), mUseIspDigitalGain(false), mNeedPreRegisterBuffers(false), + mMediaFormat(media_format_legacy), // FRAME_SYNC_S mFrameSyncCheckEnabled(false), // FRAME_SYNC_E @@ -184,6 +199,7 @@ class PlatformData { mNvmOverwrittenFileSize(0), mTnrExtraFrameNum(DEFAULT_TNR_EXTRA_FRAME_NUM), mDummyStillSink(false), + mGpuTnrEnabled(false), mRemoveCacheFlushOutputBuffer(false), mPLCEnable(false), // PRIVACY_MODE_S @@ -195,18 +211,31 @@ class PlatformData { mDisableBLCByAGain(false), mDisableBLCAGainLow(-1), mDisableBLCAGainHigh(-1), - mResetLinkRoute(true) {} + mResetLinkRoute(true), + mReqWaitTimeout(0) {} std::vector mMediaCtlConfs; std::string sensorName; std::string sensorDescription; std::string mLensName; + // VIRTUAL_CHANNEL_S + bool mVirtualChannel; + int mVCNum; + int mVCSeq; + int mVCGroupId; + VcAggregator mVcAggregator; + // VIRTUAL_CHANNEL_E int mLensHwType; bool mEnablePdaf; bool mSensorAwb; bool mSensorAe; bool mRunIspAlways; + // HDR_FEATURE_S + int mHdrStatsInputBitDepth; + int mHdrStatsOutputBitDepth; + bool mUseFixedHdrExposureInfo; + // HDR_FEATURE_E bool mLtmEnabled; int mSensorExposureNum; int mSensorExposureType; @@ -218,6 +247,9 @@ class PlatformData { bool mEnableMkn; // first: one algo type in imaging_algorithm_t, second: running rate std::unordered_map mAlgoRunningRateMap; + // DOL_FEATURE_S + std::vector mDolVbpOffset; + // DOL_FEATURE_E bool mSkipFrameV4L2Error; int mCITMaxMargin; camera_yuv_color_range_mode_t mYuvColorRangeMode; @@ -248,12 +280,12 @@ class PlatformData { std::vector mConfigModesForAuto; bool mUseCrlModule; - int mFacing; int mOrientation; int mSensorOrientation; bool mUseSensorDigitalGain; bool mUseIspDigitalGain; bool mNeedPreRegisterBuffers; + ia_media_format mMediaFormat; // FRAME_SYNC_S bool mFrameSyncCheckEnabled; // FRAME_SYNC_E @@ -262,6 +294,8 @@ class PlatformData { std::map mStreamToMcMap; Parameters mCapability; + /* key: total gain, value: a map (key: hdr ratio, value: edge and noise settings) */ + std::map> mTotalGainHdrRatioToEdgeNrMap; std::string mGraphSettingsFile; GraphSettingType mGraphSettingsType; std::vector mMultiExpRanges; @@ -289,6 +323,7 @@ class PlatformData { // a PG might be incorrect. To be removed after stream id mismatch issue fixed. std::map mConfigModeToStreamId; std::vector mOutputMap; + std::vector mPreferStillOutput; int mMaxNvmDataSize; std::string mNvmDirectory; int mNvmOverwrittenFileSize; @@ -300,6 +335,7 @@ class PlatformData { std::vector mScalerInfo; int mTnrExtraFrameNum; bool mDummyStillSink; + bool mGpuTnrEnabled; bool mRemoveCacheFlushOutputBuffer; bool mPLCEnable; // PRIVACY_MODE_S @@ -313,8 +349,15 @@ class PlatformData { int mDisableBLCAGainLow; int mDisableBLCAGainHigh; bool mResetLinkRoute; + /* mReqWaitTimeout is used to override dqbuf timeout (ns) */ + int64_t mReqWaitTimeout; }; + /** + * Overwrite staticCfg with info from CMC + */ + void getModuleInfoFromCmc(int cameraId); + std::vector mCameras; std::vector mPolicyConfig; CommonConfig mCommonConfig; @@ -604,6 +647,66 @@ class PlatformData { */ static bool isLtmEnabled(int cameraId); + /** + * Get media format + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return the value of media format. + */ + static ia_media_format getMediaFormat(int cameraId); + + // HDR_FEATURE_S + /** + * Update media format using isNarrow indicator + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \param isNarrow: if the media format is narrow or not + * \return if update sucessfully or not. + */ + static bool updateMediaFormat(int cameraId, bool isNarrow); + + /** + * Check HDR is enabled or not + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return if HDR is enabled or not. + */ + static bool isEnableHDR(int cameraId); + + /** + * Get HDR stats input bit depth + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return the value of HDR stats input bit depth + */ + static int getHDRStatsInputBitDepth(int cameraId); + + /** + * Get HDR stats output bit depth + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return the value of HDR stats output bit depth + */ + static int getHDRStatsOutputBitDepth(int cameraId); + + /** + * Get if HDR exposure info is fixed or not + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return true if HDR exposure info is fixed + */ + static int isUseFixedHDRExposureInfo(int cameraId); + // HDR_FEATURE_E + + /** + * Get if multi exposure cases or not + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \param[in] TuningMode: tuningMode + * \return true if multi exposure case + */ + static bool isMultiExposureCase(int cameraId, TuningMode tuningMode); + /** * Get sensor exposure type * @@ -819,6 +922,19 @@ class PlatformData { */ static int getAnalogGainLag(int cameraId); + /** + * Get EdgeNrSetting based on total gain and hdr ratio + * + * \param[in] cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \param[in] totalGain: total gain + * \param[in] hdrRatio: hdr ratio + * \param[out] setting: EdgeNrSetting setting + * + * \return OK if setting is available, otherwise return NAME_NOT_FOUND. + */ + static int getEdgeNrSetting(int cameraId, float totalGain, float hdrRatio, + EdgeNrSetting& setting); + /** * Get the executor policy config. * @@ -951,6 +1067,16 @@ class PlatformData { */ static stream_t getISysOutputByPort(int cameraId, Port port); + // CSI_META_S + /** + * get CSI meta enabled status + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return true if CSI meta is enabled, otherwise return false + */ + static bool isCsiMetaEnabled(int cameraId); + // CSI_META_E + /** * get the format by device name * @@ -982,6 +1108,59 @@ class PlatformData { */ static int getDevNameByType(int cameraId, VideoNodeType videoNodeType, std::string& devName); + // DOL_FEATURE_S + /** + * get fixed VBP from currently selected media configure + * VBP is used to parse sensor output frame under DOL mode + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return fixed vbp value + */ + static int getFixedVbp(int cameraId); + + /** + * whether need to handle VBP info from meta data + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \param configMode: the real configure mode + * \return true if needed, else false + */ + static bool needHandleVbpInMetaData(int cameraId, ConfigMode configMode); + + /** + * whether need to pass down VBP info + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \param configMode: the real configure mode + * \return true if needed, else false + */ + static bool needSetVbp(int cameraId, ConfigMode configMode); + + /** + * Check DOL VBP offset + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \param dolVbpOffset: return vbp offset for low and high bytes + */ + static void getDolVbpOffset(int cameraId, std::vector& dolVbpOffset); + + /** + * get CSI BE SOC for Dol short exposure output enabled status + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return true if video node is enabled, otherwise return false + */ + static bool isDolShortEnabled(int cameraId); + + /** + * get CSI BE SOC for Dol medium exposure output enabled status + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return true if video node is enabled, otherwise return false + */ + static bool isDolMediumEnabled(int cameraId); + // DOL_FEATURE_E + /** * Check if ISYS is enabled or not * @@ -1033,6 +1212,14 @@ class PlatformData { static int getConfigModesByOperationMode(int cameraId, uint32_t operationMode, std::vector& configModes); + /** + * to reorder tuning config + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \param configMode: type of ConfigMode + */ + static void reorderSupportedTuningConfig(int cameraId, ConfigMode configMode); + /** * to get the TuningMode by Config Mode * @@ -1176,6 +1363,41 @@ class PlatformData { */ static std::vector getMultiExpRanges(int cameraId); + // FILE_SOURCE_S + /** + * Get the injected file. + * + * \return the injected file or nullptr if cameraInjectFile isn't set. + */ + static const char* getInjectedFile(); + + /** + * Check if FileSource is enabled. + * + * \return true cameraInjectFile is set, otherwise return false. + */ + static bool isFileSourceEnabled(); + // FILE_SOURCE_E + + // VIRTUAL_CHANNEL_S + /** + * Get virtual channel sequence + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return sequence if Virtual channel supported, otherwise return -1. + */ + static int getVirtualChannelSequence(int cameraId); + + /** + * Get aggregator info + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \param aggregator: Struct VcAggregator + * \return OK if found, otherwise return NO_ENTRY. + */ + static int getVcAggregator(int cameraId, struct VcAggregator& aggregator); + // VIRTUAL_CHANNEL_E + /** * Get the psl output resolution * @@ -1186,6 +1408,16 @@ class PlatformData { */ static camera_resolution_t* getPslOutputForRotation(int width, int height, int cameraId); + /** + * Get preferred output size for still + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \param width: The width of user requirement + * \param height: The height of user requirement + * \return the output resolution if provides it in xml file, otherwise return nullptr. + */ + const static camera_resolution_t* getPreferStillOutput(int width, int height, int cameraId); + /** * Check if test pattern is supported or not * @@ -1302,6 +1534,18 @@ class PlatformData { static int saveMakernoteData(int cameraId, camera_makernote_mode_t makernoteMode, int64_t sequence, TuningMode tuningMode); + /** + * \brief Get Makernote buffer + * + * \param[in] cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \param[in] makernoteMode: makernote mode + * \param[out] dump: return dump if in dump case + * + * \return the pointer of makernote buffer + */ + static void* getMakernoteBuf(int cameraId, camera_makernote_mode_t makernoteMode, + bool& dump); + /** * \brief Update Makernote timestamp. * @@ -1346,7 +1590,7 @@ class PlatformData { * * \return true if tnr is enabled. */ - static bool isGpuTnrEnabled(); + static bool isGpuTnrEnabled(int cameraId); /** * get the video stream number supported @@ -1437,15 +1681,6 @@ class PlatformData { */ static bool getPLCEnable(int cameraId); - // ENABLE_EVCP_S - /** - * Check GPU EVCP is enabled or not - * - * \return true if EVCP is enabled. - */ - static bool isGpuEvcpEnabled(); - // ENABLE_EVCP_E - // PRIVACY_MODE_S /** * Check which privacy mode the camera supports @@ -1491,6 +1726,14 @@ class PlatformData { */ static bool isResetLinkRoute(int cameraId); + /** + * Get use defined timeout val for dqbuf + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return timeout interval for dqbuf in ns (2000000000 for 2s) + */ + static int64_t getReqWaitTimeout(int cameraId); + // LEVEL0_ICBM_S /** * Check GPU ICBM is enabled or not diff --git a/src/platformdata/gc/GraphConfig.cpp b/src/platformdata/gc/GraphConfig.cpp index 4d111765..3850ab53 100644 --- a/src/platformdata/gc/GraphConfig.cpp +++ b/src/platformdata/gc/GraphConfig.cpp @@ -144,6 +144,15 @@ int GraphConfig::getPgIdByPgName(string pgName) { return -1; } +// DOL_FEATURE_S +int GraphConfig::getDolInfo(float& gain, string& mode) { + gain = mGraphData.dolInfo.conversionGain; + mode = mGraphData.dolInfo.dolMode; + + return OK; +} +// DOL_FEATURE_E + ia_isp_bxt_program_group* GraphConfig::getProgramGroup(int32_t streamId) { CheckAndLogError(mGraphData.programGroup.empty(), nullptr, "%s, The programGroup vector is empty", __func__); diff --git a/src/platformdata/gc/GraphConfig.h b/src/platformdata/gc/GraphConfig.h index fd1c2b17..9ffe8615 100644 --- a/src/platformdata/gc/GraphConfig.h +++ b/src/platformdata/gc/GraphConfig.h @@ -66,6 +66,9 @@ class GraphConfig : public IGraphConfig { virtual int getStreamIdByPgName(std::string pgName); virtual int getPgIdByPgName(std::string pgName); virtual int getTuningModeByStreamId(const int32_t streamId); + // DOL_FEATURE_S + virtual int getDolInfo(float& gain, std::string& mode); + // DOL_FEATURE_E virtual ia_isp_bxt_program_group* getProgramGroup(int32_t streamId); virtual status_t getPgRbmValue(std::string pgName, IGraphType::StageAttr* stageAttr); virtual status_t getMBRData(int32_t streamId, ia_isp_bxt_gdc_limits* data); diff --git a/src/platformdata/gc/IGraphConfig.h b/src/platformdata/gc/IGraphConfig.h index 92fd0db0..608f1399 100644 --- a/src/platformdata/gc/IGraphConfig.h +++ b/src/platformdata/gc/IGraphConfig.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,14 +40,21 @@ typedef std::vector NodesPtrVector; namespace icamera { -#ifdef TNR7_CM // Stream id associated with video stream. +#if defined(TNR7_CM) && defined (IPU_SYSVER_ipu6v3) +// on JSL with tnr7CM static const int32_t VIDEO_STREAM_ID = 60006; #else static const int32_t VIDEO_STREAM_ID = 60001; #endif // Stream id associated with still capture with gpu tnr. +#ifdef IPU_SYSVER_ipu6v3 +// on JSL with tnr7CM static const int32_t STILL_TNR_STREAM_ID = 60009; +#else +// on ADL with tnr7CM or Level0 +static const int32_t STILL_TNR_STREAM_ID = 60013; +#endif // Stream id associated with still capture. static const int32_t STILL_STREAM_ID = 60000; @@ -135,6 +142,14 @@ struct PgInfo { StageAttr rbmValue; }; +// DOL_FEATURE_S +struct DolInfo { + DolInfo() : conversionGain(0.0) {} + float conversionGain; + std::string dolMode; +}; +// DOL_FEATURE_E + struct MbrInfo { MbrInfo() { streamId = -1; @@ -170,6 +185,9 @@ struct GdcInfo { struct GraphConfigData { int mcId; int graphId; + // DOL_FEATURE_S + DolInfo dolInfo; + // DOL_FEATURE_E camera_resolution_t csiReso; std::vector gdcInfos; std::vector streamIds; @@ -208,6 +226,9 @@ class IGraphConfig { virtual int getStreamIdByPgName(std::string pgName) = 0; virtual int getTuningModeByStreamId(const int32_t streamId) = 0; virtual int getPgIdByPgName(std::string pgName) = 0; + // DOL_FEATURE_S + virtual int getDolInfo(float& gain, std::string& mode) = 0; + // DOL_FEATURE_E virtual ia_isp_bxt_program_group* getProgramGroup(int32_t streamId) = 0; virtual status_t getMBRData(int32_t streamId, ia_isp_bxt_gdc_limits* data) = 0; virtual status_t getPgRbmValue(std::string pgName, IGraphType::StageAttr* stageAttr) { diff --git a/src/platformdata/gc/custom_gcss_keys.h b/src/platformdata/gc/custom_gcss_keys.h index deaa2377..0bab7178 100644 --- a/src/platformdata/gc/custom_gcss_keys.h +++ b/src/platformdata/gc/custom_gcss_keys.h @@ -45,6 +45,9 @@ GCSS_KEY(VIDEO2, video2) GCSS_KEY(STILL0, still0) GCSS_KEY(STILL1, still1) GCSS_KEY(STILL2, still2) +GCSS_KEY(STILLTNR0, stilltnr0) +GCSS_KEY(STILLTNR1, stilltnr1) +GCSS_KEY(STILLTNR2, stilltnr2) GCSS_KEY(RAW, raw) GCSS_KEY(OP_MODE, op_mode) GCSS_KEY(MC_ID, mc_id) diff --git a/src/v4l2/MediaControl.cpp b/src/v4l2/MediaControl.cpp index 94bfdb8d..55f960d5 100644 --- a/src/v4l2/MediaControl.cpp +++ b/src/v4l2/MediaControl.cpp @@ -202,6 +202,41 @@ int MediaControl::resetAllLinks() { return 0; } +// VIRTUAL_CHANNEL_S +int MediaControl::resetAllRoutes(int cameraId) { + LOG1(" %s", cameraId, __func__); + + for (MediaEntity& entity : mEntities) { + struct v4l2_subdev_route routes[entity.info.pads]; + uint32_t numRoutes = entity.info.pads; + + string subDeviceNodeName; + subDeviceNodeName.clear(); + CameraUtils::getSubDeviceName(entity.info.name, subDeviceNodeName); + if (subDeviceNodeName.find("/dev/") == std::string::npos) { + continue; + } + + V4L2Subdevice* subDev = V4l2DeviceFactory::getSubDev(cameraId, subDeviceNodeName); + int ret = subDev->GetRouting(routes, &numRoutes); + if (ret != 0) { + continue; + } + + for (uint32_t j = 0; j < numRoutes; j++) { + routes[j].flags &= ~V4L2_SUBDEV_ROUTE_FL_ACTIVE; + } + + ret = subDev->SetRouting(routes, numRoutes); + if (ret < 0) { + LOGW("@%s, setRouting ret:%d", __func__, ret); + } + } + + return OK; +} +// VIRTUAL_CHANNEL_E + int MediaControl::setupLink(MediaPad* source, MediaPad* sink, uint32_t flags) { MediaLink* link = nullptr; media_link_desc ulink; @@ -721,6 +756,9 @@ int MediaControl::setFormat(int cameraId, const McFormat* format, int targetWidt fmt.pad = format->pad; fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; fmt.format = mbusfmt; + // VIRTUAL_CHANNEL_S + fmt.stream = format->stream; + // VIRTUAL_CHANNEL_E ret = subDev->SetFormat(fmt); CheckAndLogError(ret < 0, BAD_VALUE, "set format %s [%d:%d] [%dx%d] %s failed.", format->entityName.c_str(), format->entity, format->pad, format->width, @@ -804,6 +842,22 @@ int MediaControl::mediaCtlSetup(int cameraId, MediaCtlConf* mc, int width, int h setMediaMcCtl(cameraId, mc->ctls); int ret = OK; + // VIRTUAL_CHANNEL_S + /* Set routing */ + for (auto& route : mc->routes) { + LOG1(" route entity:%s, sinkPad:%d, srcPad:%d, sinkStream:%d, srcStream:%d, flag:%d", + cameraId, route.entityName.c_str(), route.sinkPad, route.srcPad, route.sinkStream, + route.srcStream, route.flag); + + string subDeviceNodeName; + CameraUtils::getSubDeviceName(route.entityName.c_str(), subDeviceNodeName); + V4L2Subdevice* subDev = V4l2DeviceFactory::getSubDev(cameraId, subDeviceNodeName); + v4l2_subdev_route r = {route.sinkPad, route.sinkStream, route.srcPad, route.srcStream, + route.flag}; + ret = subDev->SetRouting(&r, 1); + CheckAndLogError(ret != 0, ret, "setRouting fail, ret:%d", ret); + } + // VIRTUAL_CHANNEL_E /* Set format & selection in format Configuration */ for (auto& fmt : mc->formats) { @@ -843,6 +897,18 @@ int MediaControl::getVCMI2CAddr(const char* vcmName, string* vcmI2CAddr) { void MediaControl::mediaCtlClear(int cameraId, MediaCtlConf* mc) { LOG1(" %s", cameraId, __func__); + // VIRTUAL_CHANNEL_S + /* Clear routing */ + for (auto& route : mc->routes) { + string subDeviceNodeName; + CameraUtils::getSubDeviceName(route.entityName.c_str(), subDeviceNodeName); + V4L2Subdevice* subDev = V4l2DeviceFactory::getSubDev(cameraId, subDeviceNodeName); + v4l2_subdev_route r = {route.sinkPad, route.sinkStream, route.srcPad, route.srcStream, + route.flag & ~V4L2_SUBDEV_ROUTE_FL_ACTIVE}; + int ret = subDev->SetRouting(&r, 1); + CheckAndLogError(ret != 0, VOID_VALUE, "Clear routing fail, ret:%d", ret); + } + // VIRTUAL_CHANNEL_E } // This function must be called after enumEntities(). diff --git a/src/v4l2/MediaControl.h b/src/v4l2/MediaControl.h index 6a3be4d3..80b4ce99 100644 --- a/src/v4l2/MediaControl.h +++ b/src/v4l2/MediaControl.h @@ -173,6 +173,9 @@ struct MediaCtlConf { int outputHeight; std::vector configMode; int format; + // DOL_FEATURE_S + int vbp; // Vertical blanking period + // DOL_FEATURE_E /* * The outputWidth or outputHeight is 0 if there isn't this setting * in MediaCtlConf. It means the isys output size is dynamic, and @@ -183,6 +186,9 @@ struct MediaCtlConf { outputWidth = 0; outputHeight = 0; format = -1; + // DOL_FEATURE_S + vbp = -1; + // DOL_FEATURE_E } }; @@ -254,6 +260,9 @@ class MediaControl { /** * \brief Clear media controller pipe * + // VIRTUAL_CHANNEL_S + * Currently only the virtual channels are cleared. + // VIRTUAL_CHANNEL_E * * \param cameraId: the current camera id * \param mc: the MediaCtlConf got from platform data @@ -261,6 +270,9 @@ class MediaControl { void mediaCtlClear(int cameraId, MediaCtlConf* mc); int resetAllLinks(); + // VIRTUAL_CHANNEL_S + int resetAllRoutes(int cameraId); + // VIRTUAL_CHANNEL_E int getLensName(std::string* lensName); bool checkAvailableSensor(const std::string& sensorEntityName, diff --git a/src/v4l2/NodeInfo.cpp b/src/v4l2/NodeInfo.cpp index ae05a1fb..0fe35eb0 100644 --- a/src/v4l2/NodeInfo.cpp +++ b/src/v4l2/NodeInfo.cpp @@ -20,6 +20,9 @@ const VideoNodeInfo gVideoNodeInfos[] = { {VIDEO_GENERIC, "VIDEO_GENERIC", "Generic"}, {VIDEO_GENERIC_MEDIUM_EXPO, "VIDEO_GENERIC_MEDIUM_EXPO", "GenericMediumExpo"}, {VIDEO_GENERIC_SHORT_EXPO, "VIDEO_GENERIC_SHORT_EXPO", "GenericShortExpo"}, + // CSI_META_S + {VIDEO_CSI_META, "VIDEO_CSI_META", "CsiMeta"}, + // CSI_META_E {VIDEO_PIXEL_ARRAY, "VIDEO_PIXEL_ARRAY", "PixelArray"}, {VIDEO_PIXEL_BINNER, "VIDEO_PIXEL_BINNER", "PixelBinner"}, diff --git a/src/v4l2/NodeInfo.h b/src/v4l2/NodeInfo.h index 59dddda7..bca622ed 100644 --- a/src/v4l2/NodeInfo.h +++ b/src/v4l2/NodeInfo.h @@ -23,6 +23,9 @@ enum VideoNodeType { VIDEO_GENERIC, VIDEO_GENERIC_MEDIUM_EXPO, VIDEO_GENERIC_SHORT_EXPO, + // CSI_META_S + VIDEO_CSI_META, + // CSI_META_E // sensor subdevice VIDEO_PIXEL_ARRAY, diff --git a/src/v4l2/V4l2DeviceFactory.cpp b/src/v4l2/V4l2DeviceFactory.cpp index b07de752..4bb894f7 100644 --- a/src/v4l2/V4l2DeviceFactory.cpp +++ b/src/v4l2/V4l2DeviceFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Corporation. + * Copyright (C) 2015-2023 Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,8 @@ #include +#include + #include "iutils/CameraLog.h" namespace icamera { @@ -67,6 +69,7 @@ void V4l2DeviceFactory::releaseDeviceFactory(int cameraId) { * Return a not nullptr sub device pointer */ V4L2Subdevice* V4l2DeviceFactory::getSubDev(int cameraId, const std::string& devName) { + LOG2(" @%s, sub device name: %s", cameraId, __func__, devName.c_str()); AutoMutex lock(sLock); V4l2DeviceFactory* factory = getInstance(cameraId); // If an existing sub device found, then just return it. @@ -84,6 +87,27 @@ V4L2Subdevice* V4l2DeviceFactory::getSubDev(int cameraId, const std::string& dev return subdev; } +/** + * Close the sub device and release it in the device map + * + * It MUST be called after this sub device is not used anymore + */ +void V4l2DeviceFactory::releaseSubDev(int cameraId, const std::string& devName) { + LOG2(" @%s, sub device name: %s", cameraId, __func__, devName.c_str()); + AutoMutex lock(sLock); + V4l2DeviceFactory* factory = getInstance(cameraId); + + if (factory->mDevices.find(devName) != factory->mDevices.end()) { + V4L2Subdevice* subdev = factory->mDevices[devName]; + if (subdev) { + subdev->Close(); + delete subdev; + } + + factory->mDevices.erase(devName); + } +} + /** * Release all sub devices in device map * diff --git a/src/v4l2/V4l2DeviceFactory.h b/src/v4l2/V4l2DeviceFactory.h index 2b928efc..70571c81 100644 --- a/src/v4l2/V4l2DeviceFactory.h +++ b/src/v4l2/V4l2DeviceFactory.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2021 Intel Corporation. + * Copyright (C) 2015-2023 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,6 +43,7 @@ class V4l2DeviceFactory { static void releaseDeviceFactory(int cameraId); static V4L2Subdevice* getSubDev(int cameraId, const std::string& devName); + static void releaseSubDev(int cameraId, const std::string& devName); private: V4l2DeviceFactory(int cameraId);