From 76ae3ee0762c8ef2c1768650306b91573db38db7 Mon Sep 17 00:00:00 2001 From: Hao Yao Date: Sun, 27 Apr 2025 14:21:24 +0800 Subject: [PATCH] IPU6 engineer release on 2025-04-26 Signed-off-by: Hao Yao --- CMakeLists.txt | 164 +- cmake/FindIA_IMAGING.cmake | 78 +- cmake/FindLIBDRM.cmake | 16 - cmake/FindLIBGCSS.cmake | 16 - cmake/FindLIBIACSS.cmake | 29 +- cmake/FindLIBIPU.cmake | 17 - .../linux/ipu6/gcss/graph_settings_imx390.xml | 529 +++-- config/linux/ipu6/sensors/imx390.xml | 308 +-- config/linux/ipu6/sensors/isx031.xml | 545 ----- config/linux/ipu6ep/IMX390_HDR_ADL.aiqb | Bin 209260 -> 209260 bytes .../ipu6ep/gcss/graph_settings_imx390.xml | 529 +++-- config/linux/ipu6ep/libcamhal_profile.xml | 5 +- config/linux/ipu6ep/psys_policy_profiles.xml | 4 - config/linux/ipu6ep/sensors/ar0234-1.xml | 125 ++ config/linux/ipu6ep/sensors/ar0234-2.xml | 125 ++ config/linux/ipu6ep/sensors/ar0234.xml | 337 --- config/linux/ipu6ep/sensors/imx390.xml | 294 +-- config/linux/ipu6ep/sensors/isx031.xml | 10 +- config/linux/ipu6ep/sensors/lt6911uxc-1.xml | 168 ++ config/linux/ipu6ep/sensors/lt6911uxc-2.xml | 167 ++ config/linux/ipu6ep/sensors/lt6911uxc.xml | 183 -- config/linux/ipu6ep/sensors/lt6911uxe-1.xml | 166 ++ config/linux/ipu6ep/sensors/lt6911uxe-2.xml | 167 ++ config/linux/ipu6ep/sensors/lt6911uxe.xml | 195 -- .../ipu6epmtl/gcss/graph_settings_imx390.xml | 529 +++-- config/linux/ipu6epmtl/libcamhal_profile.xml | 3 +- config/linux/ipu6epmtl/sensors/ar0234-1.xml | 42 +- config/linux/ipu6epmtl/sensors/ar0234-2.xml | 43 +- config/linux/ipu6epmtl/sensors/imx390-1.xml | 277 +++ config/linux/ipu6epmtl/sensors/imx390-2.xml | 300 +++ config/linux/ipu6epmtl/sensors/imx390-3.xml | 221 ++ config/linux/ipu6epmtl/sensors/imx390-4.xml | 261 +++ config/linux/ipu6epmtl/sensors/imx390-5.xml | 220 ++ config/linux/ipu6epmtl/sensors/imx390-6.xml | 320 +++ config/linux/ipu6epmtl/sensors/imx390.xml | 1085 --------- config/linux/ipu6epmtl/sensors/isx031.xml | 545 ----- .../linux/ipu6sepla/gcss/graph_descriptor.xml | 1965 ----------------- .../gcss/graph_settings_OV13858_YHCE_JSLP.xml | 629 ------ config/linux/ipu6sepla/libcamhal_profile.xml | 28 - .../linux/ipu6sepla/psys_policy_profiles.xml | 23 - config/linux/ipu6sepla/sensors/ov13858-uf.xml | 189 -- include/linux/v4l2-subdev.h | 45 +- modules/CMakeLists.txt | 4 - modules/algowrapper/IntelPGParam.cpp | 1 + modules/algowrapper/IntelTNR7US.cpp | 88 +- modules/algowrapper/IntelTNR7US.h | 34 +- modules/algowrapper/graph/GraphConfigPipe.cpp | 2 +- modules/livetune/Android.mk | 22 - modules/memory/chrome/Camera3Buffer.cpp | 34 +- modules/memory/chrome/Camera3Buffer.h | 8 + modules/v4l2/v4l2_subdevice.cc | 22 +- modules/v4l2/v4l2_video_node.cc | 12 +- src/3a/AiqUnit.cpp | 74 +- src/3a/SensorManager.cpp | 12 +- src/CMakeLists.txt | 3 - src/core/CameraBuffer.cpp | 14 +- src/core/CameraBuffer.h | 2 +- src/core/CameraDevice.cpp | 3 +- src/core/CaptureUnit.cpp | 2 +- src/core/CsiMetaDevice.cpp | 2 +- src/core/CsiMetaDevice.h | 2 +- src/core/DeviceBase.cpp | 42 +- src/core/DeviceBase.h | 6 +- src/core/FileSource.cpp | 4 + src/core/IspParamAdaptor.h | 4 +- src/core/LensHw.h | 6 +- src/core/PSysProcessor.cpp | 47 +- src/core/RequestThread.cpp | 30 +- src/core/RequestThread.h | 5 +- src/core/SensorHwCtrl.h | 2 +- src/core/SofSource.cpp | 78 +- src/core/SofSource.h | 3 +- src/core/psysprocessor/GPUExecutor.cpp | 16 +- src/core/psysprocessor/PGCommon.cpp | 13 +- src/fd/CMakeLists.txt | 7 +- src/fd/FaceDetection.h | 4 +- src/hal/CameraHal.cpp | 104 +- src/hal/CameraHal.h | 8 +- src/image_process/CMakeLists.txt | 20 - src/iutils/CameraDump.cpp | 57 +- src/iutils/CameraDump.h | 12 +- src/iutils/CameraLog.cpp | 4 +- src/iutils/CameraLog.h | 2 +- src/iutils/LogSink.cpp | 4 +- src/iutils/LogSink.h | 2 +- src/iutils/Utils.h | 15 +- src/metadata/ParameterGenerator.cpp | 2 +- src/platformdata/CameraParser.cpp | 19 +- src/platformdata/CameraTypes.h | 4 +- src/platformdata/PlatformData.cpp | 8 +- src/platformdata/PlatformData.h | 26 +- src/scheduler/Android.mk | 19 - src/v4l2/CMakeLists.txt | 17 +- src/v4l2/MediaControl.cpp | 69 +- src/v4l2/MediaControl.h | 5 +- src/v4l2/V4l2DeviceFactory.h | 2 +- 96 files changed, 4659 insertions(+), 7250 deletions(-) delete mode 100644 config/linux/ipu6/sensors/isx031.xml create mode 100644 config/linux/ipu6ep/sensors/ar0234-1.xml create mode 100644 config/linux/ipu6ep/sensors/ar0234-2.xml delete mode 100644 config/linux/ipu6ep/sensors/ar0234.xml create mode 100644 config/linux/ipu6ep/sensors/lt6911uxc-1.xml create mode 100644 config/linux/ipu6ep/sensors/lt6911uxc-2.xml delete mode 100644 config/linux/ipu6ep/sensors/lt6911uxc.xml create mode 100644 config/linux/ipu6ep/sensors/lt6911uxe-1.xml create mode 100644 config/linux/ipu6ep/sensors/lt6911uxe-2.xml delete mode 100644 config/linux/ipu6ep/sensors/lt6911uxe.xml create mode 100644 config/linux/ipu6epmtl/sensors/imx390-1.xml create mode 100644 config/linux/ipu6epmtl/sensors/imx390-2.xml create mode 100644 config/linux/ipu6epmtl/sensors/imx390-3.xml create mode 100644 config/linux/ipu6epmtl/sensors/imx390-4.xml create mode 100644 config/linux/ipu6epmtl/sensors/imx390-5.xml create mode 100644 config/linux/ipu6epmtl/sensors/imx390-6.xml delete mode 100644 config/linux/ipu6epmtl/sensors/imx390.xml delete mode 100644 config/linux/ipu6epmtl/sensors/isx031.xml delete mode 100644 config/linux/ipu6sepla/gcss/graph_descriptor.xml delete mode 100644 config/linux/ipu6sepla/gcss/graph_settings_OV13858_YHCE_JSLP.xml delete mode 100644 config/linux/ipu6sepla/libcamhal_profile.xml delete mode 100644 config/linux/ipu6sepla/psys_policy_profiles.xml delete mode 100644 config/linux/ipu6sepla/sensors/ov13858-uf.xml delete mode 100644 modules/livetune/Android.mk delete mode 100644 src/scheduler/Android.mk diff --git a/CMakeLists.txt b/CMakeLists.txt index f7b515aa..be3d45a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,13 +42,6 @@ set(ALGOWRAPPER_DIR ${MODULES_DIR}/algowrapper) set(SANDBOXING_DIR ${MODULES_DIR}/sandboxing) set(IMAGE_PROCESS_DIR ${SRC_ROOT_DIR}/image_process) -#AAL directories -if (CAL_BUILD) - set(AAL_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/aal) - set(JPEG_DIR ${SRC_ROOT_DIR}/jpeg) - set(MEMORY_DIR ${MODULES_DIR}/memory) -endif() #CAL_BUILD - if (SUPPORT_LIVE_TUNING) #LiveTuning directories set(LIVE_TUNING_DIR ${MODULES_DIR}/livetune) @@ -192,68 +185,16 @@ if(ENABLE_SANDBOXING) set(LIBCAMHAL_LINK_LIBS ${LIBCAMHAL_LINK_LIBS} ${LIBCAB_LIBS} ${LIBMOJO_LIBS} ${LIBCAMERA_IPC_LIBS} ${CMAKE_PREFIX_PATH}/librt.a) endif() #ENABLE_SANDBOXING -if (CAL_BUILD) - message("Chrome enabled ") - add_definitions(-DCAL_BUILD -DDUMP_IMAGE) - if (SW_JPEG_ENCODE) - add_definitions(-DSW_JPEG_ENCODE) - include_directories(src/jpeg/sw) - else () - include_directories(src/jpeg/chrome) - endif() - - if (SW_POST_PROCESSING) - include_directories(src/image_process/sw) - else () - include_directories(src/image_process/chrome) - endif() - - add_subdirectory(aal) - - set(LIBCAMHAL_SRCS ${LIBCAMHAL_SRCS} ${MEMORY_SRCS} ${AAL_SRCS} ${JPEG_SRCS}) - include_directories(include include/api include/utils include/linux - ${USR_INCLUDE_HEADER}/android/system/core/include/ - ${USR_INCLUDE_HEADER}/ia_imaging - ${USR_INCLUDE_HEADER}/usr/lib${IPU_VER} - ${USR_INCLUDE_HEADER}/android/hardware/libhardware/include/ - aal aal/chrome src/iutils src/jpeg - modules/memory modules/memory/chrome - ) - find_package(LIBCAMERA_CLIENT) - find_package(LIBCAMERA_COMMON) - find_package(LIBCAMERA_METADATA) - find_package(LIBCAMERA_V4L2_DEVICE) - find_package(LIBSYNC) - find_package(LIBCBM) - - include_directories(${LIBCAMERA_CLIENT_INCLUDE_DIRS} ${LIBCAMERA_COMMON_INCLUDE_DIRS} - ${LIBCAMERA_METADATA_INCLUDE_DIRS} ${LIBCAMERA_V4L2_DEVICE_INCLUDE_DIRS} - ${LIBSYNC_INCLUDE_DIRS} - ${LIBCBM_INCLUDE_DIRS} - ) - link_directories(${CMAKE_PREFIX_PATH} ${LIBCAMERA_CLIENT_LIBS} ${LIBCAMERA_METADATA_LIBS} - ${LIBCAMERA_COMMON_LIBS} ${LIBSYNC_LIBS} - ${LIBCBM_LIBS} - ) - - set(LIBCAMHAL_LINK_LIBS ${LIBCAMHAL_LINK_LIBS} ${LIBCAMERA_CLIENT_LIBS} ${LIBCAMERA_COMMON_LIBS} - ${LIBCAMERA_METADATA_LIBS} ${LIBCAMERA_V4L2_DEVICE_LIBS} - ${LIBSYNC_LIBS} jpeg ${CMAKE_PREFIX_PATH}/libyuv.pic.a - ${LIBCBM_LIBS} camera_v4l2_device - ) -endif() #CAL_BUILD - -if (NOT CAL_BUILD) - message("Linux build") - add_definitions(-DSUPPORT_MULTI_PROCESS) - add_definitions(-DLINUX_BUILD) - include_directories(${MODULES_DIR}/v4l2) - find_package(LIBDRM) - if(LIBDRM_FOUND AND ("${LIBDRM_VERSION}" VERSION_GREATER_EQUAL 2.4.114)) - include_directories(${LIBDRM_INCLUDE_DIRS}) - set(LIBCAMHAL_LINK_LIBS ${LIBCAMHAL_LINK_LIBS} ${LIBDRM_LIBS}) - add_definitions(-DLIBDRM_SUPPORT_MMAP_OFFSET) - endif() +message("Linux build") +add_definitions(-DSUPPORT_MULTI_PROCESS) +add_definitions(-DLINUX_BUILD) +include_directories(${MODULES_DIR}/v4l2) +find_package(LIBDRM) +if(LIBDRM_FOUND AND ("${LIBDRM_VERSION}" VERSION_GREATER_EQUAL 2.4.114)) + include_directories(${LIBDRM_INCLUDE_DIRS}) + link_directories(${LIBDRM_LIBRARY_DIRS}) + set(LIBCAMHAL_LINK_LIBS ${LIBCAMHAL_LINK_LIBS} ${LIBDRM_LIBRARIES}) + add_definitions(-DLIBDRM_SUPPORT_MMAP_OFFSET) endif() set(LIBCAMHAL_SRCS @@ -323,36 +264,38 @@ if (IPU_VER MATCHES "ipu6") endif() endif() -if (NOT CAL_BUILD) - set(TARGET_DEFINITIONS ${TARGET_DEFINITIONS} "-DCAMERA_DEFAULT_CFG_PATH=\"${CMAKE_INSTALL_FULL_SYSCONFDIR}/camera/${IPU_VER}/\"") -endif() +set(TARGET_DEFINITIONS ${TARGET_DEFINITIONS} "-DCAMERA_DEFAULT_CFG_PATH=\"${CMAKE_INSTALL_FULL_SYSCONFDIR}/camera/${IPU_VER}/\"") # Link libraries, the building will be interrupted if libs/includes not found # Link ia_imaging find_package(IA_IMAGING) set(TARGET_INCLUDE ${TARGET_INCLUDE} ${IA_IMAGING${TARGET_SUFFIX}_INCLUDE_DIRS}) - set(TARGET_LINK_LIBS ${TARGET_LINK_LIBS} ${IA_IMAGING${TARGET_SUFFIX}_LIBS}) + set(TARGET_LINK_LIBS ${TARGET_LINK_LIBS} ${IA_IMAGING${TARGET_SUFFIX}_LIBRARIES}) + link_directories(${IA_IMAGING${TARGET_SUFFIX}_LIBRARY_DIRS}) if(USE_PG_LITE_PIPE) find_package(LIBGCSS) set(TARGET_INCLUDE ${TARGET_INCLUDE} ${LIBGCSS${TARGET_SUFFIX}_INCLUDE_DIRS}) - set(TARGET_LINK_LIBS ${TARGET_LINK_LIBS} ${LIBGCSS${TARGET_SUFFIX}_LIBS}) + set(TARGET_LINK_LIBS ${TARGET_LINK_LIBS} ${LIBGCSS${TARGET_SUFFIX}_LIBRARIES}) + link_directories(${LIBGCSS${TARGET_SUFFIX}_LIBRARY_DIRS}) # Include libipu(4) headers find_package(LIBIPU) set(TARGET_INCLUDE ${TARGET_INCLUDE} ${LIBIPU${TARGET_SUFFIX}_INCLUDE_DIRS}) - set(TARGET_LINK_LIBS ${TARGET_LINK_LIBS} ${LIBIPU${TARGET_SUFFIX}_LIBS}) + set(TARGET_LINK_LIBS ${TARGET_LINK_LIBS} ${LIBIPU${TARGET_SUFFIX}_LIBRARIES}) + link_directories(${LIBIPU${TARGET_SUFFIX}_LIBRARY_DIRS}) else() # Link libiacss find_package(LIBIACSS) set(TARGET_INCLUDE ${TARGET_INCLUDE} ${LIBIACSS${TARGET_SUFFIX}_INCLUDE_DIRS}) - set(TARGET_LINK_LIBS ${TARGET_LINK_LIBS} ${LIBIACSS${TARGET_SUFFIX}_LIBS}) + set(TARGET_LINK_LIBS ${TARGET_LINK_LIBS} ${LIBIACSS${TARGET_SUFFIX}_LIBRARIES}) + link_directories(${LIBIACSS${TARGET_SUFFIX}_LIBRARY_DIRS}) endif() #--------------------------- Add libcamhal target --------------------------- if (BUILD_CAMHAL_PLUGIN) - set(CAMHAL_TARGET ${IPU_VER}) - set(CAMHAL_STATIC_TARGET ${IPU_VER}_static) + set(CAMHAL_TARGET camhal${IPU_VER}) + set(CAMHAL_STATIC_TARGET camhal${IPU_VER}_static) else() set(CAMHAL_TARGET camhal) set(CAMHAL_STATIC_TARGET camhal_static) @@ -388,41 +331,36 @@ endif() #--------------------------- Install settings --------------------------- -if (NOT CAL_BUILD) - if (NOT BUILD_CAMHAL_PLUGIN) - # Install headers - install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libcamhal) - if (SUPPORT_LIVE_TUNING) - install(FILES modules/livetune/LiveTuning.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libcamhal/api) - endif() #SUPPORT_LIVE_TUNING - endif() - - # Install configure files, by default ipu4 is used - message("Install camera configure files for ${IPU_VER}") - install(DIRECTORY config/linux/${IPU_VER}/ DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/camera/${IPU_VER}) - - # Install libraries - set(CAMHAL_TARGETS ${CAMHAL_TARGET} ${CAMHAL_STATIC_TARGET}) - if (BUILD_CAMHAL_PLUGIN) - set(CAMHAL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/libcamhal/plugins) - else() - set(CAMHAL_DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() - if (${CMAKE_VERSION} VERSION_LESS 3.11) - install(TARGETS ${CAMHAL_TARGETS} - LIBRARY DESTINATION ${CAMHAL_DESTINATION} - ARCHIVE DESTINATION ${CAMHAL_DESTINATION}) - else() - install(TARGETS ${CAMHAL_TARGETS} DESTINATION ${CAMHAL_DESTINATION}) - endif() - if (NOT BUILD_CAMHAL_PLUGIN) - # 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) - endif() - -endif() #NOT CAL_BUILD +if (NOT BUILD_CAMHAL_PLUGIN) + # Install headers + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libcamhal) + if (SUPPORT_LIVE_TUNING) + install(FILES modules/livetune/LiveTuning.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libcamhal/api) + endif() #SUPPORT_LIVE_TUNING +endif() +# Install configure files, by default ipu4 is used +message("Install camera configure files for ${IPU_VER}") +install(DIRECTORY config/linux/${IPU_VER}/ DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/camera/${IPU_VER}) +# Install libraries +set(CAMHAL_TARGETS ${CAMHAL_TARGET} ${CAMHAL_STATIC_TARGET}) +if (BUILD_CAMHAL_PLUGIN) + set(CAMHAL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/libcamhal/plugins) +else() + set(CAMHAL_DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif() +if (${CMAKE_VERSION} VERSION_LESS 3.11) + install(TARGETS ${CAMHAL_TARGETS} + LIBRARY DESTINATION ${CAMHAL_DESTINATION} + ARCHIVE DESTINATION ${CAMHAL_DESTINATION}) +else() + install(TARGETS ${CAMHAL_TARGETS} DESTINATION ${CAMHAL_DESTINATION}) +endif() +if (NOT BUILD_CAMHAL_PLUGIN) + # 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) +endif() endforeach() #IPU_VERSIONS diff --git a/cmake/FindIA_IMAGING.cmake b/cmake/FindIA_IMAGING.cmake index 26cbce5e..1f3f6ec7 100644 --- a/cmake/FindIA_IMAGING.cmake +++ b/cmake/FindIA_IMAGING.cmake @@ -20,7 +20,6 @@ if(TARGET ia_aiq) endif() # Get include and lib paths for IA_IMAGING from pkgconfig -include(FindPackageHandleStandardArgs) find_package(PkgConfig) pkg_check_modules(IA_IMAGING${TARGET_SUFFIX} ia_imaging${TARGET_SUFFIX}) @@ -28,64 +27,37 @@ if(NOT IA_IMAGING${TARGET_SUFFIX}_FOUND) message(FATAL_ERROR "IA_IMAGING${TARGET_SUFFIX} not found") endif() -set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${IA_IMAGING${TARGET_SUFFIX}_LIBRARY_DIRS}) - -# Libraries -find_library(IA_CCA${TARGET_SUFFIX}_LIB ia_cca${TARGET_SUFFIX}) -find_library(IA_AIQ${TARGET_SUFFIX}_LIB ia_aiq${TARGET_SUFFIX}) -find_library(IA_AIQB_PARSER${TARGET_SUFFIX}_LIB ia_aiqb_parser${TARGET_SUFFIX}) -find_library(IA_CMC_PARSER${TARGET_SUFFIX}_LIB ia_cmc_parser${TARGET_SUFFIX}) -find_library(IA_EXC${TARGET_SUFFIX}_LIB ia_exc${TARGET_SUFFIX}) -find_library(IA_MKN${TARGET_SUFFIX}_LIB ia_mkn${TARGET_SUFFIX}) -# SENSOR_EMD_DECODER -find_library(IA_EMD${TARGET_SUFFIX}_LIB ia_emd_decoder${TARGET_SUFFIX}) +set(IA_IMAGING${TARGET_SUFFIX}_LIBRARIES + ia_cca${TARGET_SUFFIX} + ia_aiq${TARGET_SUFFIX} + ia_aiqb_parser${TARGET_SUFFIX} + ia_cmc_parser${TARGET_SUFFIX} + ia_exc${TARGET_SUFFIX} + ia_mkn${TARGET_SUFFIX} + ia_emd_decoder${TARGET_SUFFIX} + ia_nvm${TARGET_SUFFIX} + ia_log${TARGET_SUFFIX} + ia_dvs${TARGET_SUFFIX} + ia_coordinate${TARGET_SUFFIX} + ia_ltm${TARGET_SUFFIX} + ia_dvs${TARGET_SUFFIX} + ia_isp_bxt${TARGET_SUFFIX} + broxton_ia_pal${TARGET_SUFFIX} # DOL_FEATURE_S -find_library(IA_BCOMP${TARGET_SUFFIX}_LIB ia_bcomp${TARGET_SUFFIX}) + ia_bcomp${TARGET_SUFFIX} # DOL_FEATURE_E -find_library(IA_NVM${TARGET_SUFFIX}_LIB ia_nvm${TARGET_SUFFIX}) -find_library(IA_LOG${TARGET_SUFFIX}_LIB ia_log${TARGET_SUFFIX}) -find_library(IA_DVS${TARGET_SUFFIX}_LIB ia_dvs${TARGET_SUFFIX}) -find_library(IA_COORDINATE${TARGET_SUFFIX}_LIB ia_coordinate${TARGET_SUFFIX}) -find_library(IA_LTM${TARGET_SUFFIX}_LIB ia_ltm${TARGET_SUFFIX}) -find_library(IA_DVS${TARGET_SUFFIX}_LIB ia_dvs${TARGET_SUFFIX}) -find_library(IA_ISP_BXT${TARGET_SUFFIX}_LIB ia_isp_bxt${TARGET_SUFFIX}) -find_library(BXT_IA_PAL${TARGET_SUFFIX}_LIB broxton_ia_pal${TARGET_SUFFIX}) - -set(IA_IMAGING${TARGET_SUFFIX}_LIBS - ${IA_CCA${TARGET_SUFFIX}_LIB} - ${IA_AIQ${TARGET_SUFFIX}_LIB} - ${IA_AIQB_PARSER${TARGET_SUFFIX}_LIB} - ${IA_CMC_PARSER${TARGET_SUFFIX}_LIB} - ${IA_EXC${TARGET_SUFFIX}_LIB} - ${IA_MKN${TARGET_SUFFIX}_LIB} - ${IA_EMD${TARGET_SUFFIX}_LIB} - ${IA_BCOMP${TARGET_SUFFIX}_LIB} - ${IA_NVM${TARGET_SUFFIX}_LIB} - ${IA_LOG${TARGET_SUFFIX}_LIB} - ${IA_DVS${TARGET_SUFFIX}_LIB} - ${IA_COORDINATE${TARGET_SUFFIX}_LIB} - ${IA_LTM${TARGET_SUFFIX}_LIB} - ${IA_DVS${TARGET_SUFFIX}_LIB} - ${IA_OB${TARGET_SUFFIX}_LIB} - ${IA_ISP_BXT${TARGET_SUFFIX}_LIB} - ${BXT_IA_PAL${TARGET_SUFFIX}_LIB} ) if (NOT ENABLE_SANDBOXING) - find_library(IA_LARD${TARGET_SUFFIX}_LIB ia_lard${TARGET_SUFFIX}) - set(IA_IMAGING${TARGET_SUFFIX}_LIBS ${IA_IMAGING${TARGET_SUFFIX}_LIBS} ${IA_LARD${TARGET_SUFFIX}_LIB}) + set(IA_IMAGING${TARGET_SUFFIX}_LIBRARIES + ${IA_IMAGING${TARGET_SUFFIX}_LIBRARIES} + ia_lard${TARGET_SUFFIX} + ) endif() #ENABLE_SANDBOXING if (USE_PG_LITE_PIPE) - find_library(IA_P2P${TARGET_SUFFIX}_LIB ia_p2p${TARGET_SUFFIX}) - set(IA_IMAGING${TARGET_SUFFIX}_LIBS ${IA_IMAGING${TARGET_SUFFIX}_LIBS} ${IA_P2P${TARGET_SUFFIX}_LIB}) -endif() - -# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if -# all listed variables are TRUE -find_package_handle_standard_args(IA_IMAGING${TARGET_SUFFIX} - REQUIRED_VARS IA_IMAGING${TARGET_SUFFIX}_INCLUDE_DIRS IA_IMAGING${TARGET_SUFFIX}_LIBS) - -if(NOT IA_IMAGING${TARGET_SUFFIX}_FOUND) - message(FATAL_ERROR "IA_IMAGING${TARGET_SUFFIX} not found") + set(IA_IMAGING${TARGET_SUFFIX}_LIBRARIES + ${IA_IMAGING${TARGET_SUFFIX}_LIBRARIES} + ia_p2p${TARGET_SUFFIX} + ) endif() diff --git a/cmake/FindLIBDRM.cmake b/cmake/FindLIBDRM.cmake index c71b9ae0..af66b3f7 100644 --- a/cmake/FindLIBDRM.cmake +++ b/cmake/FindLIBDRM.cmake @@ -15,25 +15,9 @@ # # Get include and lib paths for LIBDRM from pkgconfig -include(FindPackageHandleStandardArgs) find_package(PkgConfig) pkg_check_modules(LIBDRM libdrm) if(NOT LIBDRM_FOUND) message(SEND_ERROR "LIBDRM not found") endif() - -set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${LIBDRM_LIBRARY_DIRS}) - -# Libraries -find_library(DRM_LIB drm) -set(LIBDRM_LIBS ${DRM_LIB}) - -# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if -# all listed variables are TRUE -find_package_handle_standard_args(LIBDRM REQUIRED_VARS LIBDRM_INCLUDE_DIRS LIBDRM_LIBS) - -if(NOT LIBDRM_FOUND) - message(SEND_ERROR "LIBDRM not found") -endif() - diff --git a/cmake/FindLIBGCSS.cmake b/cmake/FindLIBGCSS.cmake index dd0ff799..e360f7c7 100644 --- a/cmake/FindLIBGCSS.cmake +++ b/cmake/FindLIBGCSS.cmake @@ -15,25 +15,9 @@ # # Get include and lib paths for LIBGCSS from pkgconfig -include(FindPackageHandleStandardArgs) find_package(PkgConfig) pkg_check_modules(LIBGCSS${TARGET_SUFFIX} libgcss${TARGET_SUFFIX}) if(NOT LIBGCSS${TARGET_SUFFIX}_FOUND) message(FATAL_ERROR "LIBGCSS${TARGET_SUFFIX} not found") endif() - -set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${LIBGCSS${TARGET_SUFFIX}_LIBRARY_DIRS}) - -# Libraries -find_library(GCSS${TARGET_SUFFIX}_LIB gcss${TARGET_SUFFIX}) -set(LIBGCSS${TARGET_SUFFIX}_LIBS ${GCSS${TARGET_SUFFIX}_LIB}) - -# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if -# all listed variables are TRUE -find_package_handle_standard_args(LIBGCSS${TARGET_SUFFIX} REQUIRED_VARS LIBGCSS${TARGET_SUFFIX}_INCLUDE_DIRS LIBGCSS${TARGET_SUFFIX}_LIBS) - -if(NOT LIBGCSS${TARGET_SUFFIX}_FOUND) - message(FATAL_ERROR "LIBGCSS${TARGET_SUFFIX} not found") -endif() - diff --git a/cmake/FindLIBIACSS.cmake b/cmake/FindLIBIACSS.cmake index c2485e14..9f8769d9 100644 --- a/cmake/FindLIBIACSS.cmake +++ b/cmake/FindLIBIACSS.cmake @@ -15,32 +15,9 @@ # # Get include and lib paths for LIBIACSS from pkgconfig -include(FindPackageHandleStandardArgs) find_package(PkgConfig) -pkg_check_modules(LIBIACSS libiacss) -if(NOT LIBIACSS_FOUND) - message(FATAL_ERROR "LIBIACSS not found") +pkg_check_modules(LIBIACSS${TARGET_SUFFIX} libiacss${TARGET_SUFFIX}) +if(NOT LIBIACSS${TARGET_SUFFIX}_FOUND) + message(FATAL_ERROR "LIBIACSS${TARGET_SUFFIX} not found") endif() - -set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${LIBIACSS_LIBRARY_DIRS}) - -# Libraries -find_library(GCSS_LIB gcss) -find_library(IA_CAMERA_LIB ia_camera) -find_library(IA_CIPF_LIB ia_cipf) -set(LIBIACSS_LIBS - ${GCSS_LIB} - ${IA_CAMERA_LIB} - ${IA_CIPF_LIB} - ) - -# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if -# all listed variables are TRUE -find_package_handle_standard_args(LIBIACSS - REQUIRED_VARS LIBIACSS_INCLUDE_DIRS LIBIACSS_LIBS) - -if(NOT LIBIACSS_FOUND) - message(FATAL_ERROR "LIBIACSS not found") -endif() - diff --git a/cmake/FindLIBIPU.cmake b/cmake/FindLIBIPU.cmake index 9f8d9fc6..17a6efe8 100644 --- a/cmake/FindLIBIPU.cmake +++ b/cmake/FindLIBIPU.cmake @@ -28,26 +28,9 @@ else() endif() # Get include and lib paths for LIBIPU from pkgconfig -include(FindPackageHandleStandardArgs) -# Include directory find_package(PkgConfig) pkg_check_modules(LIBIPU${TARGET_SUFFIX} ${libipu_ver}) if(NOT LIBIPU${TARGET_SUFFIX}_FOUND) message(FATAL_ERROR "LIBIPU${TARGET_SUFFIX} not found") endif() - -set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${LIBIPU${TARGET_SUFFIX}_LIBRARY_DIRS}) - -# Libraries -find_library(IPU${TARGET_SUFFIX}_LIB NAMES ${libipu_ver}.a) -set(LIBIPU${TARGET_SUFFIX}_LIBS ${IPU${TARGET_SUFFIX}_LIB}) - -# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if -# all listed variables are TRUE -find_package_handle_standard_args(LIBIPU${TARGET_SUFFIX} - REQUIRED_VARS LIBIPU${TARGET_SUFFIX}_INCLUDE_DIRS LIBIPU${TARGET_SUFFIX}_LIBS) - -if(NOT LIBIPU${TARGET_SUFFIX}_FOUND) - message(FATAL_ERROR "LIBIPU${TARGET_SUFFIX} not found") -endif() diff --git a/config/linux/ipu6/gcss/graph_settings_imx390.xml b/config/linux/ipu6/gcss/graph_settings_imx390.xml index 321e4884..f5d1e51d 100644 --- a/config/linux/ipu6/gcss/graph_settings_imx390.xml +++ b/config/linux/ipu6/gcss/graph_settings_imx390.xml @@ -1,6 +1,5 @@ - - - + @@ -21,18 +20,18 @@ See the License for the specific language governing permissions and - + - - + + - - + + - - + + @@ -40,269 +39,439 @@ See the License for the specific language governing permissions and - + - + - + + + - - + + + + + + + - + - - - - + + + + - + - - + + - +
- - - - - - + + - - + + - - - - - - - - + + + + + + + + - - + + - - - - - - - - + + + + - - + + + + + + + + + + - - - - - + - - - - - + + + + + - - + +
- - - - + + + + - + - - - - - - + + + + - + - - + + - + + + + + + + + + + + + + + + + + +
- - - - - - + + - - + + - - - - - - - - + + + + + + + + - - + + - - - - - - - - + + + + - - + + + + + + + + + + - - - - - + - - - - - + + + + + - - + +
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + - + - - - - - - + + + + + + + + - + - - + + - +
- - - - - - - - - - + + + + + + + + + + + + + - - + + - - - - - - - - - - + + - - - - - - - - - - - - - + - - - - - + + + + + - - -
+ + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/config/linux/ipu6/sensors/imx390.xml b/config/linux/ipu6/sensors/imx390.xml index 2afed977..4c9122a4 100644 --- a/config/linux/ipu6/sensors/imx390.xml +++ b/config/linux/ipu6/sensors/imx390.xml @@ -16,14 +16,14 @@ - - - - - - - - + + + + + + + + @@ -87,7 +87,7 @@ - + @@ -111,14 +111,14 @@ - - - - - - - - + + + + + + + + @@ -182,7 +182,7 @@ - + @@ -206,14 +206,14 @@ - - - - - - - - + + + + + + + + @@ -277,7 +277,7 @@ - + @@ -301,14 +301,14 @@ - - - - - - - - + + + + + + + + @@ -372,7 +372,7 @@ - + @@ -396,14 +396,14 @@ - - - - - - - - + + + + + + + + @@ -467,7 +467,7 @@ - + @@ -491,14 +491,14 @@ - - - - - - - - + + + + + + + + @@ -562,7 +562,7 @@ - + @@ -586,14 +586,14 @@ - - - - - - - - + + + + + + + + @@ -657,7 +657,7 @@ - + @@ -681,14 +681,14 @@ - - - - - - - - + + + + + + + + @@ -752,7 +752,7 @@ - + @@ -776,15 +776,15 @@ - + - - - - - - - + + + + + + + @@ -849,7 +849,7 @@ - + @@ -873,15 +873,15 @@ - + - - - - - - - + + + + + + + @@ -946,7 +946,7 @@ - + @@ -970,15 +970,15 @@ - + - - - - - - - + + + + + + + @@ -1043,7 +1043,7 @@ - + @@ -1067,15 +1067,15 @@ - + - - - - - - - + + + + + + + @@ -1140,7 +1140,7 @@ - + @@ -1164,15 +1164,15 @@ - + - - - - - - - + + + + + + + @@ -1237,7 +1237,7 @@ - + @@ -1261,15 +1261,15 @@ - + - - - - - - - + + + + + + + @@ -1334,7 +1334,7 @@ - + @@ -1358,15 +1358,15 @@ - + - - - - - - - + + + + + + + @@ -1431,7 +1431,7 @@ - + @@ -1455,15 +1455,15 @@ - + - - - - - - - + + + + + + + @@ -1528,7 +1528,7 @@ - + @@ -1552,10 +1552,10 @@ - - - - + + + + @@ -1592,7 +1592,7 @@ - + @@ -1614,10 +1614,10 @@ - - - - + + + + @@ -1654,7 +1654,7 @@ - + diff --git a/config/linux/ipu6/sensors/isx031.xml b/config/linux/ipu6/sensors/isx031.xml deleted file mode 100644 index f1ba28e3..00000000 --- a/config/linux/ipu6/sensors/isx031.xml +++ /dev/null @@ -1,545 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/linux/ipu6ep/IMX390_HDR_ADL.aiqb b/config/linux/ipu6ep/IMX390_HDR_ADL.aiqb index a61ef56b0c16b1898a035f7c06d029f282925761..ced28cf3cf072c77f68e4ba085b3b82bab0711a6 100644 GIT binary patch delta 269 zcmaF!i092Co(Uo>s_!c~CrX$YoD%Ra*ulWSkjlWwU}R!wU}S7yYG`U|YGQ7};AL#Y zz{%hl7+g}Cl9|t7WUOaoFtMhF7p}^}(!{)(m9d?bk#RdKBa^>})U@0cw;X`Rr7$ou zA{%FFIz7*mDS-tj#W4MnCsW4cLPnA8eqKyYvK$Qz%nS@n>^jpY6flWQUr@lrvVB83 z(;f~m6T&YkVDex@;vXqwnupBKDrVAPg3GgQpHs>dvs=1?%oX delta 278 zcmaF!i092Co(Uo>>GJO@CrX$YoDlIW-oe1YkjlWwU}S7yYG`O=U}9lxW?^c{;AL#Y zz{%hl7+g}Cl9>;b)-$x2SX0AmU}j)!Xkln*Vrpb$(9Fu%&dSKRot2Tv-$QE8-%q^` zK;u#v7#Wd`voxQc=gE}7@*fDMU-D$i;0X;iZ36K?V7r?alb5U<10yp70~5Q>4=n}; zWNg~Rz+l?6eO)@!J`Of0r>KC*ixI{-RLHad&dDfd(qe+i%qV3_*e%^NH^ff^?5cxI QNUkzBu{4-2Y{(o50O_q!PXGV_ diff --git a/config/linux/ipu6ep/gcss/graph_settings_imx390.xml b/config/linux/ipu6ep/gcss/graph_settings_imx390.xml index 321e4884..f5d1e51d 100644 --- a/config/linux/ipu6ep/gcss/graph_settings_imx390.xml +++ b/config/linux/ipu6ep/gcss/graph_settings_imx390.xml @@ -1,6 +1,5 @@ - - - + @@ -21,18 +20,18 @@ See the License for the specific language governing permissions and - + - - + + - - + + - - + + @@ -40,269 +39,439 @@ See the License for the specific language governing permissions and - + - + - + + + - - + + + + + + + - + - - - - + + + + - + - - + + - +
- - - - - - + + - - + + - - - - - - - - + + + + + + + + - - + + - - - - - - - - + + + + - - + + + + + + + + + + - - - - - + - - - - - + + + + + - - + +
- - - - + + + + - + - - - - - - + + + + - + - - + + - + + + + + + + + + + + + + + + + + +
- - - - - - + + - - + + - - - - - - - - + + + + + + + + - - + + - - - - - - - - + + + + - - + + + + + + + + + + - - - - - + - - - - - + + + + + - - + +
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + - + - - - - - - + + + + + + + + - + - - + + - +
- - - - - - - - - - + + + + + + + + + + + + + - - + + - - - - - - - - - - + + - - - - - - - - - - - - - + - - - - - + + + + + - - -
+ + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/config/linux/ipu6ep/libcamhal_profile.xml b/config/linux/ipu6ep/libcamhal_profile.xml index f167d84f..6cc193cc 100644 --- a/config/linux/ipu6ep/libcamhal_profile.xml +++ b/config/linux/ipu6ep/libcamhal_profile.xml @@ -1,5 +1,5 @@ - + isx031,imx390,ar0234-1-1,ar0234-2-2,external_source,ar0234_usb, + lt6911uxc-1-1,lt6911uxc-2-2,lt6911uxe-1-1,lt6911uxe-2-2"/> diff --git a/config/linux/ipu6ep/psys_policy_profiles.xml b/config/linux/ipu6ep/psys_policy_profiles.xml index eb6fb30f..6029bcd2 100644 --- a/config/linux/ipu6ep/psys_policy_profiles.xml +++ b/config/linux/ipu6ep/psys_policy_profiles.xml @@ -19,8 +19,6 @@ limitations under the License. - - @@ -46,8 +44,6 @@ limitations under the License. - - diff --git a/config/linux/ipu6ep/sensors/ar0234-1.xml b/config/linux/ipu6ep/sensors/ar0234-1.xml new file mode 100644 index 00000000..ecd67dd9 --- /dev/null +++ b/config/linux/ipu6ep/sensors/ar0234-1.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/ar0234-2.xml b/config/linux/ipu6ep/sensors/ar0234-2.xml new file mode 100644 index 00000000..e158a063 --- /dev/null +++ b/config/linux/ipu6ep/sensors/ar0234-2.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/ar0234.xml b/config/linux/ipu6ep/sensors/ar0234.xml deleted file mode 100644 index df0a2475..00000000 --- a/config/linux/ipu6ep/sensors/ar0234.xml +++ /dev/null @@ -1,337 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/linux/ipu6ep/sensors/imx390.xml b/config/linux/ipu6ep/sensors/imx390.xml index 2e104dfb..3d7028c7 100644 --- a/config/linux/ipu6ep/sensors/imx390.xml +++ b/config/linux/ipu6ep/sensors/imx390.xml @@ -16,14 +16,14 @@ - - - - - - - - + + + + + + + + @@ -78,7 +78,7 @@ - + @@ -104,14 +104,14 @@ - - - - - - - - + + + + + + + + @@ -166,7 +166,7 @@ - + @@ -192,14 +192,14 @@ - - - - - - - - + + + + + + + + @@ -254,7 +254,7 @@ - + @@ -280,14 +280,14 @@ - - - - - - - - + + + + + + + + @@ -342,7 +342,7 @@ - + @@ -368,14 +368,14 @@ - - - - - - - - + + + + + + + + @@ -430,7 +430,7 @@ - + @@ -456,14 +456,14 @@ - - - - - - - - + + + + + + + + @@ -518,7 +518,7 @@ - + @@ -544,14 +544,14 @@ - - - - - - - - + + + + + + + + @@ -606,7 +606,7 @@ - + @@ -632,14 +632,14 @@ - - - - - - - - + + + + + + + + @@ -666,7 +666,7 @@ - + @@ -694,7 +694,7 @@ - + @@ -720,15 +720,15 @@ - + - - - - - - - + + + + + + + @@ -784,7 +784,7 @@ - + @@ -810,15 +810,15 @@ - + - - - - - - - + + + + + + + @@ -874,7 +874,7 @@ - + @@ -900,15 +900,15 @@ - + - - - - - - - + + + + + + + @@ -964,7 +964,7 @@ - + @@ -990,15 +990,15 @@ - + - - - - - - - + + + + + + + @@ -1054,7 +1054,7 @@ - + @@ -1080,15 +1080,15 @@ - + - - - - - - - + + + + + + + @@ -1144,7 +1144,7 @@ - + @@ -1170,15 +1170,15 @@ - + - - - - - - - + + + + + + + @@ -1234,7 +1234,7 @@ - + @@ -1260,15 +1260,15 @@ - + - - - - - - - + + + + + + + @@ -1280,7 +1280,7 @@ - + @@ -1324,7 +1324,7 @@ - + @@ -1350,15 +1350,15 @@ - + - - - - - - - + + + + + + + @@ -1386,7 +1386,7 @@ - + @@ -1414,7 +1414,7 @@ - + diff --git a/config/linux/ipu6ep/sensors/isx031.xml b/config/linux/ipu6ep/sensors/isx031.xml index d7525f52..2dee4812 100644 --- a/config/linux/ipu6ep/sensors/isx031.xml +++ b/config/linux/ipu6ep/sensors/isx031.xml @@ -78,6 +78,7 @@ + @@ -144,6 +145,7 @@ + @@ -210,6 +212,7 @@ + @@ -276,6 +279,7 @@ + @@ -342,6 +346,7 @@ + @@ -408,6 +413,7 @@ + @@ -474,6 +480,7 @@ + @@ -540,6 +547,7 @@ + - \ No newline at end of file + diff --git a/config/linux/ipu6ep/sensors/lt6911uxc-1.xml b/config/linux/ipu6ep/sensors/lt6911uxc-1.xml new file mode 100644 index 00000000..a4121e51 --- /dev/null +++ b/config/linux/ipu6ep/sensors/lt6911uxc-1.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/lt6911uxc-2.xml b/config/linux/ipu6ep/sensors/lt6911uxc-2.xml new file mode 100644 index 00000000..534ab67a --- /dev/null +++ b/config/linux/ipu6ep/sensors/lt6911uxc-2.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/lt6911uxc.xml b/config/linux/ipu6ep/sensors/lt6911uxc.xml deleted file mode 100644 index 0f2f0c1c..00000000 --- a/config/linux/ipu6ep/sensors/lt6911uxc.xml +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/linux/ipu6ep/sensors/lt6911uxe-1.xml b/config/linux/ipu6ep/sensors/lt6911uxe-1.xml new file mode 100644 index 00000000..72f92806 --- /dev/null +++ b/config/linux/ipu6ep/sensors/lt6911uxe-1.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/lt6911uxe-2.xml b/config/linux/ipu6ep/sensors/lt6911uxe-2.xml new file mode 100644 index 00000000..1711d407 --- /dev/null +++ b/config/linux/ipu6ep/sensors/lt6911uxe-2.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6ep/sensors/lt6911uxe.xml b/config/linux/ipu6ep/sensors/lt6911uxe.xml deleted file mode 100644 index f9d5dd06..00000000 --- a/config/linux/ipu6ep/sensors/lt6911uxe.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/linux/ipu6epmtl/gcss/graph_settings_imx390.xml b/config/linux/ipu6epmtl/gcss/graph_settings_imx390.xml index 321e4884..f5d1e51d 100644 --- a/config/linux/ipu6epmtl/gcss/graph_settings_imx390.xml +++ b/config/linux/ipu6epmtl/gcss/graph_settings_imx390.xml @@ -1,6 +1,5 @@ - - - + @@ -21,18 +20,18 @@ See the License for the specific language governing permissions and - + - - + + - - + + - - + + @@ -40,269 +39,439 @@ See the License for the specific language governing permissions and - + - + - + + + - - + + + + + + + - + - - - - + + + + - + - - + + - +
- - - - - - + + - - + + - - - - - - - - + + + + + + + + - - + + - - - - - - - - + + + + - - + + + + + + + + + + - - - - - + - - - - - + + + + + - - + +
- - - - + + + + - + - - - - - - + + + + - + - - + + - + + + + + + + + + + + + + + + + + +
- - - - - - + + - - + + - - - - - - - - + + + + + + + + - - + + - - - - - - - - + + + + - - + + + + + + + + + + - - - - - + - - - - - + + + + + - - + +
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + - + - - - - - - + + + + + + + + - + - - + + - +
- - - - - - - - - - + + + + + + + + + + + + + - - + + - - - - - - - - - - + + - - - - - - - - - - - - - + - - - - - + + + + + - - -
+ + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/config/linux/ipu6epmtl/libcamhal_profile.xml b/config/linux/ipu6epmtl/libcamhal_profile.xml index 93c91806..c605b04f 100644 --- a/config/linux/ipu6epmtl/libcamhal_profile.xml +++ b/config/linux/ipu6epmtl/libcamhal_profile.xml @@ -22,6 +22,7 @@ + imx390-1-0,imx390-2-0,imx390-3-0,imx390-4-0,imx390-5-4,imx390-6-4,ar0234-1-0,ar0234-2-4, + external_source,ar0234_usb,lt6911uxc,lt6911uxe-1-0,lt6911uxe-2-4"/> diff --git a/config/linux/ipu6epmtl/sensors/ar0234-1.xml b/config/linux/ipu6epmtl/sensors/ar0234-1.xml index 3f5e377b..c6e6c57c 100644 --- a/config/linux/ipu6epmtl/sensors/ar0234-1.xml +++ b/config/linux/ipu6epmtl/sensors/ar0234-1.xml @@ -32,6 +32,22 @@ + + + + + + + + + + + + + + + + @@ -40,16 +56,32 @@ - - + + + + + + + + + + + + + + + + - + + - + - + diff --git a/config/linux/ipu6epmtl/sensors/ar0234-2.xml b/config/linux/ipu6epmtl/sensors/ar0234-2.xml index 2e329251..fb7ed4fc 100644 --- a/config/linux/ipu6epmtl/sensors/ar0234-2.xml +++ b/config/linux/ipu6epmtl/sensors/ar0234-2.xml @@ -32,6 +32,22 @@ + + + + + + + + + + + + + + + + @@ -40,17 +56,32 @@ - - + + - + + + + + + + + + + + + + + + + - - + - + diff --git a/config/linux/ipu6epmtl/sensors/imx390-1.xml b/config/linux/ipu6epmtl/sensors/imx390-1.xml new file mode 100644 index 00000000..0e845305 --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/imx390-1.xml @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/imx390-2.xml b/config/linux/ipu6epmtl/sensors/imx390-2.xml new file mode 100644 index 00000000..be6e2e53 --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/imx390-2.xml @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/imx390-3.xml b/config/linux/ipu6epmtl/sensors/imx390-3.xml new file mode 100644 index 00000000..933d4f3d --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/imx390-3.xml @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/imx390-4.xml b/config/linux/ipu6epmtl/sensors/imx390-4.xml new file mode 100644 index 00000000..3adba6ca --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/imx390-4.xml @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/imx390-5.xml b/config/linux/ipu6epmtl/sensors/imx390-5.xml new file mode 100644 index 00000000..72cbb5a0 --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/imx390-5.xml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/imx390-6.xml b/config/linux/ipu6epmtl/sensors/imx390-6.xml new file mode 100644 index 00000000..d12af74b --- /dev/null +++ b/config/linux/ipu6epmtl/sensors/imx390-6.xml @@ -0,0 +1,320 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/linux/ipu6epmtl/sensors/imx390.xml b/config/linux/ipu6epmtl/sensors/imx390.xml deleted file mode 100644 index e400a2be..00000000 --- a/config/linux/ipu6epmtl/sensors/imx390.xml +++ /dev/null @@ -1,1085 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/linux/ipu6epmtl/sensors/isx031.xml b/config/linux/ipu6epmtl/sensors/isx031.xml deleted file mode 100644 index 199ba441..00000000 --- a/config/linux/ipu6epmtl/sensors/isx031.xml +++ /dev/null @@ -1,545 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/linux/ipu6sepla/gcss/graph_descriptor.xml b/config/linux/ipu6sepla/gcss/graph_descriptor.xml deleted file mode 100644 index 93226830..00000000 --- a/config/linux/ipu6sepla/gcss/graph_descriptor.xml +++ /dev/null @@ -1,1965 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/linux/ipu6sepla/gcss/graph_settings_OV13858_YHCE_JSLP.xml b/config/linux/ipu6sepla/gcss/graph_settings_OV13858_YHCE_JSLP.xml deleted file mode 100644 index 70285a3c..00000000 --- a/config/linux/ipu6sepla/gcss/graph_settings_OV13858_YHCE_JSLP.xml +++ /dev/null @@ -1,629 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/linux/ipu6sepla/libcamhal_profile.xml b/config/linux/ipu6sepla/libcamhal_profile.xml deleted file mode 100644 index 471609b5..00000000 --- a/config/linux/ipu6sepla/libcamhal_profile.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - diff --git a/config/linux/ipu6sepla/psys_policy_profiles.xml b/config/linux/ipu6sepla/psys_policy_profiles.xml deleted file mode 100644 index d5cf006a..00000000 --- a/config/linux/ipu6sepla/psys_policy_profiles.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - diff --git a/config/linux/ipu6sepla/sensors/ov13858-uf.xml b/config/linux/ipu6sepla/sensors/ov13858-uf.xml deleted file mode 100644 index b27ea2eb..00000000 --- a/config/linux/ipu6sepla/sensors/ov13858-uf.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h index 94a89b63..8f544245 100644 --- a/include/linux/v4l2-subdev.h +++ b/include/linux/v4l2-subdev.h @@ -129,6 +129,8 @@ struct v4l2_subdev_selection { #define V4L2_SUBDEV_ROUTE_FL_ACTIVE (1 << 0) #define V4L2_SUBDEV_ROUTE_FL_IMMUTABLE (1 << 1) #define V4L2_SUBDEV_ROUTE_FL_SOURCE (1 << 2) +#define VIDIOC_SUBDEV_G_CLIENT_CAP _IOR('V', 101, struct v4l2_subdev_client_capability) +#define VIDIOC_SUBDEV_S_CLIENT_CAP _IOWR('V', 102, struct v4l2_subdev_client_capability) /** * struct v4l2_subdev_route - A signal route inside a subdev * @sink_pad: the sink pad @@ -158,14 +160,47 @@ struct v4l2_subdev_route { }; /** - * struct v4l2_subdev_routing - Routing information - * @routes: the routes array - * @num_routes: the total number of routes in the routes array + * struct v4l2_subdev_routing - Subdev routing information + * + * @which: configuration type (from enum v4l2_subdev_format_whence) + * @len_routes: the length of the routes array, in routes; set by the user, not + * modified by the kernel + * @routes: pointer to the routes array + * @num_routes: the total number of routes, possibly more than fits in the + * routes array + * @reserved: drivers and applications must zero this array */ struct v4l2_subdev_routing { - struct v4l2_subdev_route *routes; + __u32 which; + __u32 len_routes; + __u64 routes; __u32 num_routes; - __u32 reserved[5]; + __u32 reserved[11]; +}; + +/* + * The client is aware of streams. Setting this flag enables the use of 'stream' + * fields (referring to the stream number) with various ioctls. If this is not + * set (which is the default), the 'stream' fields will be forced to 0 by the + * kernel. + */ +#define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1ULL << 0) + +/* + * The client is aware of the struct v4l2_subdev_frame_interval which field. If + * this is not set (which is the default), the which field is forced to + * V4L2_SUBDEV_FORMAT_ACTIVE by the kernel. + */ +#define V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH (1ULL << 1) + +/** + * struct v4l2_subdev_client_capability - Capabilities of the client accessing + * the subdev + * + * @capabilities: A bitmask of V4L2_SUBDEV_CLIENT_CAP_* flags. + */ +struct v4l2_subdev_client_capability { + __u64 capabilities; }; #endif diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 597937f0..99c212c2 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -14,10 +14,6 @@ # limitations under the License. # -if (CAL_BUILD) - add_subdirectory(memory) -endif() #CAL_BUILD - if (ENABLE_SANDBOXING) add_subdirectory(sandboxing) else() diff --git a/modules/algowrapper/IntelPGParam.cpp b/modules/algowrapper/IntelPGParam.cpp index 2528015c..41824fb5 100644 --- a/modules/algowrapper/IntelPGParam.cpp +++ b/modules/algowrapper/IntelPGParam.cpp @@ -475,6 +475,7 @@ void IntelPGParam::destroyPayloads() { int IntelPGParam::updatePALAndEncode(const ia_binary_data* ipuParams, int payloadCount, ia_binary_data* payloads) { + LOG1("@%s", __func__); ia_err err = ia_p2p_parse(mP2pHandle, ipuParams, mP2pCacheBuffer.data); CheckAndLogError(err != ia_err_none, UNKNOWN_ERROR, "Failed to parse PAL data."); diff --git a/modules/algowrapper/IntelTNR7US.cpp b/modules/algowrapper/IntelTNR7US.cpp index 66404596..2f5e8f36 100644 --- a/modules/algowrapper/IntelTNR7US.cpp +++ b/modules/algowrapper/IntelTNR7US.cpp @@ -18,9 +18,6 @@ #include "modules/algowrapper/IntelTNR7US.h" -#include -#include - #include #include "iutils/CameraLog.h" @@ -34,6 +31,8 @@ namespace icamera { IntelTNR7US* IntelTNR7US::createIntelTNR(int cameraId) { #ifdef TNR7_CM return new IntelC4mTNR(cameraId); +#else + return nullptr; #endif } @@ -45,6 +44,15 @@ Tnr7Param* IntelTNR7US::allocTnr7ParamBuf() { #ifdef TNR7_CM IntelC4mTNR::~IntelC4mTNR() { + icamera::Thread::requestExit(); + { + std::lock_guard l(mLock); + mThreadRunning = false; + mRequestCondition.notify_one(); + } + + icamera::Thread::requestExitAndWait(); + for (auto surface : mCMSurfaceMap) { destroyCMSurface(surface.second); } @@ -58,8 +66,9 @@ int IntelC4mTNR::init(int width, int height, TnrType type) { mTnrType = type; std::string threadName = "IntelC4mTNR" + std::to_string(type + (mCameraId << 1)); - mThread = std::unique_ptr(new base::Thread(threadName)); - mThread->Start(); + run(threadName); + mThreadRunning = true; + return OK; } @@ -116,10 +125,7 @@ int IntelC4mTNR::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, 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,23 +133,43 @@ int IntelC4mTNR::runTnrFrame(const void* inBufAddr, void* outBufAddr, uint32_t i if (fd >= 0) { destroyCMSurface(outSurface); } - CheckAndLogError(ret != OK, UNKNOWN_ERROR, "tnr7us process failed"); - 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 time:%lu us", __func__, timeUsedUs); + + return ret; +} +bool IntelC4mTNR::threadLoop() { + { + std::unique_lock lock(mLock); + if (!mThreadRunning) return false; + if (mParamGainRequest.empty()) { + std::cv_status ret = mRequestCondition.wait_for( + lock, std::chrono::nanoseconds(kMaxDuration * SLOWLY_MULTIPLIER)); + + // Already stopped + if (!mThreadRunning) return false; + + if (ret == std::cv_status::timeout) { + return true; + } + } } - return OK; + + ParamGain param; + { + std::lock_guard l(mLock); + param = mParamGainRequest.front(); + mParamGainRequest.pop(); + } + + tnr7usParamUpdate(param.gain, param.forceUpdate, mTnrType); + + return true; } int IntelC4mTNR::asyncParamUpdate(int gain, bool forceUpdate) { - if (mThread->task_runner()) { - mThread->task_runner()->PostTask( - FROM_HERE, base::BindOnce(&IntelC4mTNR::handleParamUpdate, base::Unretained(this), gain, - forceUpdate)); - } + std::lock_guard l(mLock); + mParamGainRequest.push({gain, forceUpdate}); + mRequestCondition.notify_one(); + return OK; } @@ -158,24 +184,6 @@ int32_t IntelC4mTNR::getTnrBufferSize(int width, int height, uint32_t* size) { return OK; } -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, CAMERA_DEBUG_LOG_LEVEL2)) { - clock_gettime(CLOCK_MONOTONIC, &beginTime); - } - - tnr7usParamUpdate(gain, forceUpdate, mTnrType); - 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 time:%lu us", __func__, timeUsedUs); - } -} - CmSurface2DUP* IntelC4mTNR::getBufferCMSurface(void* bufAddr) { if (mCMSurfaceMap.find(bufAddr) != mCMSurfaceMap.end()) { return mCMSurfaceMap[bufAddr]; diff --git a/modules/algowrapper/IntelTNR7US.h b/modules/algowrapper/IntelTNR7US.h index 2db4d59b..8a1f6c3b 100644 --- a/modules/algowrapper/IntelTNR7US.h +++ b/modules/algowrapper/IntelTNR7US.h @@ -16,7 +16,6 @@ #pragma once -#include #include #include @@ -28,8 +27,10 @@ extern "C" { #include "CameraBuffer.h" #include "PlatformData.h" #include "TNRCommon.h" +#include "iutils/Thread.h" #ifdef TNR7_CM +#define HANDLE cancel_fw_pre_define /* 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 */ @@ -37,7 +38,6 @@ extern "C" { #pragma clang diagnostic ignored "-Wbitfield-constant-conversion" #pragma clang diagnostic ignored "-Wunused-private-field" // HANDLE is redefined in cm_rt.h, avoid the redefinition build error -#define HANDLE cancel_fw_pre_define #include "cm_rt.h" #pragma clang diagnostic pop @@ -99,11 +99,11 @@ class IntelTNR7US { }; #ifdef TNR7_CM -class IntelC4mTNR : public IntelTNR7US { +class IntelC4mTNR : public IntelTNR7US, public icamera::Thread { public: explicit IntelC4mTNR(int cameraId) : IntelTNR7US(cameraId) {} virtual ~IntelC4mTNR(); - virtual int init(int width, int height, TnrType type = TNR_INSTANCE0); + virtual int init(int width, int height, TnrType type = TNR_INSTANCE0) override; /** * call tnr api to calc tnr result * @@ -113,12 +113,13 @@ class IntelC4mTNR : public IntelTNR7US { * \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); + uint32_t outBufSize, Tnr7Param* tnrParam, bool syncUpdate, + int fd = -1) override; + virtual void* allocCamBuf(uint32_t bufSize, int id) override; + virtual void freeAllBufs() override; + virtual int prepareSurface(void* bufAddr, int size) override; + virtual int asyncParamUpdate(int gain, bool forceUpdate) override; + virtual int getTnrBufferSize(int width, int height, uint32_t* size) override; private: /* tnr api use CmSurface2DUP object as data buffer, call this api to create @@ -127,14 +128,21 @@ class IntelC4mTNR : public IntelTNR7US { int32_t destroyCMSurface(CmSurface2DUP* surface); // get the CmSurface object of the bufAddr in mCMSurfaceMap CmSurface2DUP* getBufferCMSurface(void* bufAddr); - /* call tnr7us API to update params */ - void handleParamUpdate(int gain, bool forceUpdate); DISALLOW_COPY_AND_ASSIGN(IntelC4mTNR); private: // Tnr will create CMSurface for input buffers and cache them in the map std::unordered_map mCMSurfaceMap; - std::unique_ptr mThread; + virtual bool threadLoop() override; + std::mutex mLock; + std::condition_variable mRequestCondition; + const uint64_t kMaxDuration = 5000000000; // 5s + typedef struct { + int gain; + bool forceUpdate; + } ParamGain; + std::queue mParamGainRequest; + bool mThreadRunning; }; #endif } // namespace icamera diff --git a/modules/algowrapper/graph/GraphConfigPipe.cpp b/modules/algowrapper/graph/GraphConfigPipe.cpp index 2f0e466a..ce92b5de 100644 --- a/modules/algowrapper/graph/GraphConfigPipe.cpp +++ b/modules/algowrapper/graph/GraphConfigPipe.cpp @@ -23,7 +23,7 @@ #include #include -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include diff --git a/modules/livetune/Android.mk b/modules/livetune/Android.mk deleted file mode 100644 index 2e75d9ab..00000000 --- a/modules/livetune/Android.mk +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (C) 2020 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. -# - -LOCAL_SRC_FILES += \ - modules/livetune/LiveTuning.cpp \ - -LOCAL_C_INCLUDES += $(LOCAL_PATH)/modules/ \ - $(LOCAL_PATH)/modules/livetune - diff --git a/modules/memory/chrome/Camera3Buffer.cpp b/modules/memory/chrome/Camera3Buffer.cpp index 72f23866..39648be5 100644 --- a/modules/memory/chrome/Camera3Buffer.cpp +++ b/modules/memory/chrome/Camera3Buffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2023 Intel Corporation + * Copyright (C) 2013-2025 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,9 @@ #include #include +#include +#include +#include #include #include "Camera3Stream.h" @@ -148,7 +151,11 @@ Camera3Buffer::~Camera3Buffer() { */ icamera::status_t Camera3Buffer::init(const camera3_stream_buffer* aBuffer, int cameraId) { mType = BUF_TYPE_HANDLE; +#ifdef HAVE_CHROME_OS mGbmBufferManager = cros::CameraBufferManager::GetInstance(); +#else + mGbmBufferManager = crosIpu6::CameraBufferManager::GetInstance(); +#endif mHandle = *aBuffer->buffer; mHandlePtr = aBuffer->buffer; mHalBuffer.s.width = aBuffer->stream->width; @@ -194,7 +201,11 @@ icamera::status_t Camera3Buffer::init(const camera3_stream_t* stream, buffer_han CheckAndLogError(!handle, UNKNOWN_ERROR, "%s, handle is nullptr", __func__); mType = BUF_TYPE_HANDLE; +#ifdef HAVE_CHROME_OS mGbmBufferManager = cros::CameraBufferManager::GetInstance(); +#else + mGbmBufferManager = crosIpu6::CameraBufferManager::GetInstance(); +#endif mHandle = handle; mHandlePtr = &mHandle; mHalBuffer.s.width = stream->width; @@ -404,10 +415,21 @@ void Camera3Buffer::dumpImage(const void* data, int frameNumber, const int size, static unsigned int count = 0; count++; - std::string fileName(gDumpPath); + std::string fileName(CameraDump::getDumpPath()); fileName += "dump_" + std::to_string(width) + "x" + std::to_string(height) + "_frame#" + - std::to_string(count) + "_req#" + std::to_string(frameNumber) + "." + - CameraUtils::format2string(format).c_str(); + std::to_string(count) + "_req#" + std::to_string(frameNumber); + + struct timeval tv; + gettimeofday(&tv, nullptr); + time_t nowtime = tv.tv_sec; + struct tm targetTm; + struct tm* nowtm = localtime_r(&nowtime, &targetTm); + if (nowtm) { + fileName += "_time#" + std::to_string(nowtm->tm_mday) + ":" + std::to_string(nowtm->tm_min) + + ":" + std::to_string(nowtm->tm_sec) + ":" + std::to_string(tv.tv_usec / 1000); + } + + fileName += "." + std::string(CameraUtils::format2string(format).c_str()); LOG2("%s filename is %s", __func__, fileName.data()); FILE* fp = fopen(fileName.data(), "w+"); @@ -457,7 +479,11 @@ std::shared_ptr allocateHeapBuffer(int w, int h, int stride, int std::shared_ptr allocateHandleBuffer(int w, int h, int gfxFmt, int usage, int cameraId) { HAL_TRACE_CALL(CAMERA_DEBUG_LOG_LEVEL1); +#ifdef HAVE_CHROME_OS cros::CameraBufferManager* bufManager = cros::CameraBufferManager::GetInstance(); +#else + crosIpu6::CameraBufferManager* bufManager = crosIpu6::CameraBufferManager::GetInstance(); +#endif buffer_handle_t handle; uint32_t stride = 0; diff --git a/modules/memory/chrome/Camera3Buffer.h b/modules/memory/chrome/Camera3Buffer.h index 8338bfa5..8047f222 100644 --- a/modules/memory/chrome/Camera3Buffer.h +++ b/modules/memory/chrome/Camera3Buffer.h @@ -16,7 +16,11 @@ #pragma once +#ifdef HAVE_CHROME_OS #include +#else +#include "camera_buffer_manager.h" +#endif #include #include @@ -142,7 +146,11 @@ class Camera3Buffer { private: bool mRegistered; /*!< Use to track the buffer register status */ +#ifdef HAVE_CHROME_OS cros::CameraBufferManager* mGbmBufferManager; +#else + crosIpu6::CameraBufferManager* mGbmBufferManager; +#endif }; namespace MemoryUtils { diff --git a/modules/v4l2/v4l2_subdevice.cc b/modules/v4l2/v4l2_subdevice.cc index 2d93b1d4..c4d13591 100644 --- a/modules/v4l2/v4l2_subdevice.cc +++ b/modules/v4l2/v4l2_subdevice.cc @@ -46,11 +46,19 @@ V4L2Subdevice::~V4L2Subdevice() { } int V4L2Subdevice::Open(int flags) { + struct v4l2_subdev_client_capability clientcap = {}; + LOG1("@%s", __func__); int status = V4L2Device::Open(flags); if (status == 0) state_ = SubdevState::OPEN; - return status; + + clientcap.capabilities = V4L2_SUBDEV_CLIENT_CAP_STREAMS; + status = ioctl(fd_, VIDIOC_SUBDEV_S_CLIENT_CAP, &clientcap); + if (status < 0) + LOG1("Failed to set client capabilities %s", strerror(errno)); + + return 0; } int V4L2Subdevice::Close() { @@ -142,7 +150,11 @@ int V4L2Subdevice::SetRouting(v4l2_subdev_route* routes, uint32_t numRoutes) { return -EINVAL; } - v4l2_subdev_routing r = {routes, numRoutes}; + v4l2_subdev_routing r = {}; + r.which = V4L2_SUBDEV_FORMAT_ACTIVE; + r.len_routes = numRoutes; + r.num_routes = numRoutes; + r.routes = reinterpret_cast(routes); int ret = ::ioctl(fd_, VIDIOC_SUBDEV_S_ROUTING, &r); if (ret < 0) { @@ -162,7 +174,11 @@ int V4L2Subdevice::GetRouting(v4l2_subdev_route* routes, uint32_t* numRoutes) { return -EINVAL; } - v4l2_subdev_routing r = {routes, *numRoutes}; + v4l2_subdev_routing r = {}; + r.which = V4L2_SUBDEV_FORMAT_ACTIVE; + r.len_routes = *numRoutes; + r.num_routes = *numRoutes; + r.routes = reinterpret_cast(routes); int ret = ::ioctl(fd_, VIDIOC_SUBDEV_G_ROUTING, &r); if (ret < 0) { diff --git a/modules/v4l2/v4l2_video_node.cc b/modules/v4l2/v4l2_video_node.cc index 8c9a913d..2d8f365c 100644 --- a/modules/v4l2/v4l2_video_node.cc +++ b/modules/v4l2/v4l2_video_node.cc @@ -661,10 +661,14 @@ int V4L2VideoNode::ExportFrame(unsigned int index, std::vector* fds) { } uint32_t num_planes = V4L2_TYPE_IS_MULTIPLANAR(buffer.Type()) ? buffer.Get()->length : 1; struct v4l2_exportbuffer ebuf = {}; - ebuf.type = buffer_type_; - ebuf.index = index; - ebuf.flags = O_RDWR; - for (uint32_t i = 0; i < num_planes; i++) { + + for (uint32_t plane = 0; plane < num_planes; plane++) { + memset(&ebuf, 0, sizeof(ebuf)); + ebuf.type = buffer_type_; + ebuf.index = index; + ebuf.flags = O_RDWR; + ebuf.plane = plane; + ret = ::ioctl(fd_, VIDIOC_EXPBUF, &ebuf); if (ret < 0) { LOGE("%s: Device node %s IOCTL VIDIOC_EXPBUF error: %s", __func__, name_.c_str(), diff --git a/src/3a/AiqUnit.cpp b/src/3a/AiqUnit.cpp index c5306073..a1f8da66 100644 --- a/src/3a/AiqUnit.cpp +++ b/src/3a/AiqUnit.cpp @@ -241,14 +241,15 @@ int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { // Initialize cca_cpf data ia_binary_data cpfData; - cca::cca_init_params params = {}; + std::unique_ptr params = + std::unique_ptr(new cca::cca_init_params()); ret = PlatformData::getCpf(mCameraId, tuningMode, &cpfData); if (ret == OK && cpfData.data) { CheckAndLogError(cpfData.size > cca::MAX_CPF_LEN, UNKNOWN_ERROR, "%s, AIQB buffer is too small cpfData:%d > MAX_CPF_LEN:%d", __func__, cpfData.size, cca::MAX_CPF_LEN); - MEMCPY_S(params.aiq_cpf.buf, cca::MAX_CPF_LEN, cpfData.data, cpfData.size); - params.aiq_cpf.size = cpfData.size; + MEMCPY_S(params->aiq_cpf.buf, cca::MAX_CPF_LEN, cpfData.data, cpfData.size); + params->aiq_cpf.size = cpfData.size; } // Initialize cca_nvm data @@ -257,8 +258,8 @@ int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { CheckAndLogError(nvmData->size > cca::MAX_NVM_LEN, UNKNOWN_ERROR, "%s, NVM buffer is too small: nvmData:%d MAX_NVM_LEN:%d", __func__, nvmData->size, cca::MAX_NVM_LEN); - MEMCPY_S(params.aiq_nvm.buf, cca::MAX_NVM_LEN, nvmData->data, nvmData->size); - params.aiq_nvm.size = nvmData->size; + MEMCPY_S(params->aiq_nvm.buf, cca::MAX_NVM_LEN, nvmData->data, nvmData->size); + params->aiq_nvm.size = nvmData->size; } // Initialize cca_aiqd data @@ -267,25 +268,25 @@ int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { CheckAndLogError(aiqdData->size > cca::MAX_AIQD_LEN, UNKNOWN_ERROR, "%s, AIQD buffer is too small aiqdData:%d > MAX_AIQD_LEN:%d", __func__, aiqdData->size, cca::MAX_AIQD_LEN); - MEMCPY_S(params.aiq_aiqd.buf, cca::MAX_AIQD_LEN, aiqdData->data, aiqdData->size); - params.aiq_aiqd.size = aiqdData->size; + MEMCPY_S(params->aiq_aiqd.buf, cca::MAX_AIQD_LEN, aiqdData->data, aiqdData->size); + params->aiq_aiqd.size = aiqdData->size; } SensorFrameParams sensorParam = {}; ret = PlatformData::calculateFrameParams(mCameraId, sensorParam); CheckAndLogError(ret != OK, ret, "%s: Failed to calculate frame params", __func__); - AiqUtils::convertToAiqFrameParam(sensorParam, params.frameParams); + AiqUtils::convertToAiqFrameParam(sensorParam, params->frameParams); - params.frameUse = ia_aiq_frame_use_video; - params.aiqStorageLen = MAX_SETTING_COUNT; + params->frameUse = ia_aiq_frame_use_video; + params->aiqStorageLen = MAX_SETTING_COUNT; // handle AE delay in AiqEngine - params.aecFrameDelay = 0; + params->aecFrameDelay = 0; // Initialize functions which need to be started - params.bitmap = cca::CCA_MODULE_AE | cca::CCA_MODULE_AWB | cca::CCA_MODULE_PA | - cca::CCA_MODULE_SA | cca::CCA_MODULE_GBCE | cca::CCA_MODULE_LARD; + params->bitmap = cca::CCA_MODULE_AE | cca::CCA_MODULE_AWB | cca::CCA_MODULE_PA | + cca::CCA_MODULE_SA | cca::CCA_MODULE_GBCE | cca::CCA_MODULE_LARD; if (PlatformData::getLensHwType(mCameraId) == LENS_VCM_HW) { - params.bitmap |= cca::CCA_MODULE_AF; + params->bitmap |= cca::CCA_MODULE_AF; } std::shared_ptr graphConfig = @@ -305,7 +306,7 @@ int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { PlatformData::isDolMediumEnabled(mCameraId)); // DOL_FEATURE_E if (hasLtm && mLtm) { - params.bitmap |= cca::CCA_MODULE_LTM; + params->bitmap |= cca::CCA_MODULE_LTM; ret = mLtm->configure(configModes, graphConfig, VIDEO_STREAM_ID); CheckAndLogError(ret != OK, ret, "configure LTM engine error: %d", ret); } @@ -324,11 +325,11 @@ int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { } 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; + 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 @@ -339,25 +340,25 @@ int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { // 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); + 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]; + params->dolMode = dolModeNameMap[dol_mode_name]; } } - LOG2("conversionGainRatio: %f, dolMode: %d", params.conversionGainRatio, - params.dolMode); - params.bitmap = params.bitmap | cca::CCA_MODULE_BCOM; + 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; + 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 @@ -365,18 +366,18 @@ int AiqUnit::initIntelCcaHandle(const std::vector& configModes) { if (graphConfig != nullptr) { std::vector streamIds; graphConfig->graphGetStreamIds(streamIds); - params.aic_stream_ids.count = streamIds.size(); + params->aic_stream_ids.count = streamIds.size(); CheckAndLogError(streamIds.size() > cca::MAX_STREAM_NUM, UNKNOWN_ERROR, "%s, Too many streams: %zu in graph", __func__, streamIds.size()); for (size_t i = 0; i < streamIds.size(); ++i) { - params.aic_stream_ids.ids[i] = streamIds[i]; + params->aic_stream_ids.ids[i] = streamIds[i]; } } } IntelCca* intelCca = IntelCca::getInstance(mCameraId, tuningMode); CheckAndLogError(!intelCca, UNKNOWN_ERROR, "Failed to get cca. mode:%d cameraId:%d", tuningMode, mCameraId); - ia_err iaErr = intelCca->init(params); + ia_err iaErr = intelCca->init(*params); if (iaErr == ia_err_none) { mTuningModes.push_back(tuningMode); } else { @@ -404,10 +405,11 @@ void AiqUnit::deinitIntelCcaHandle() { __func__, mode, mCameraId); if (PlatformData::isAiqdEnabled(mCameraId)) { - cca::cca_aiqd aiqd = {}; - ia_err iaErr = intelCca->getAiqd(&aiqd); + std::unique_ptr aiqd = + std::unique_ptr(new cca::cca_aiqd()); + ia_err iaErr = intelCca->getAiqd(aiqd.get()); if (AiqUtils::convertError(iaErr) == OK) { - ia_binary_data data = {aiqd.buf, static_cast(aiqd.size)}; + ia_binary_data data = {aiqd->buf, static_cast(aiqd->size)}; PlatformData::saveAiqd(mCameraId, mode, data); } else { LOGW("@%s, failed to get aiqd data, iaErr %d", __func__, iaErr); diff --git a/src/3a/SensorManager.cpp b/src/3a/SensorManager.cpp index 2eb27a56..a683658e 100644 --- a/src/3a/SensorManager.cpp +++ b/src/3a/SensorManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2024 Intel Corporation. + * Copyright (C) 2015-2025 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -195,8 +195,14 @@ 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 = 0; + if (PlatformData::isWaitFirstStats(mCameraId)) { + effectSeq = mLastSofSequence < 0 ? 0 + : mLastSofSequence + PlatformData::getExposureLag(mCameraId); + } else { + effectSeq = mLastSofSequence < 0 ? PlatformData::getExposureLag(mCameraId) + : mLastSofSequence + PlatformData::getExposureLag(mCameraId); + } if (sensorExposures.empty()) { LOGW("%s: No exposure parameter", __func__); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7545192f..9f8e0156 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,9 +23,6 @@ add_subdirectory(metadata) add_subdirectory(platformdata) add_subdirectory(v4l2) add_subdirectory(image_process) -if (CAL_BUILD) - add_subdirectory(jpeg) -endif() #CAL_BUILD if(FACE_DETECTION) add_subdirectory(fd) endif() #FACE_DETECTION diff --git a/src/core/CameraBuffer.cpp b/src/core/CameraBuffer.cpp index ef446628..a4c4e85e 100644 --- a/src/core/CameraBuffer.cpp +++ b/src/core/CameraBuffer.cpp @@ -43,8 +43,6 @@ CameraBuffer::CameraBuffer(int cameraId, int usage, int memory, uint32_t size, i mU(nullptr), mBufferUsage(usage), mSettingSequence(-1) { - int num_plane = 1; - LOG2("%s: construct buffer with usage:%d, memory:%d, size:%d, format:%d, index:%d", cameraId, __func__, usage, memory, size, format, index); @@ -57,13 +55,7 @@ CameraBuffer::CameraBuffer(int cameraId, int usage, int memory, uint32_t size, i CLEAR(mMmapAddrs); CLEAR(mDmaFd); - if ((usage == BUFFER_USAGE_PSYS_INPUT || usage == BUFFER_USAGE_PSYS_INTERNAL || - usage == BUFFER_USAGE_GENERAL) && - (PlatformData::isIsysEnabled(cameraId) && PlatformData::isCSIFrontEndCapture(cameraId))) { - num_plane = CameraUtils::getNumOfPlanes(format); - } else if (usage == BUFFER_USAGE_MIPI_CAPTURE || usage == BUFFER_USAGE_METADATA) { - num_plane = CameraUtils::getNumOfPlanes(format); - } + int num_plane = CameraUtils::getNumOfPlanes(format); initBuffer(memory, v4l2BufType, size, index, num_plane); } @@ -205,8 +197,10 @@ int CameraBuffer::allocateMemory(V4L2VideoNode* vDevice) { mU->addr = getAddr(); break; case V4L2_MEMORY_MMAP: - exportMmapDmabuf(vDevice); + ret = exportMmapDmabuf(vDevice); + CheckAndLogError(ret != OK, -1, "allocateMemory failed, ret %d", ret); ret = allocateMmap(vDevice); + CheckAndLogError(ret != OK, -1, "allocateMemory failed, ret %d", ret); mU->addr = getAddr(); mAllocatedMemory = true; break; diff --git a/src/core/CameraBuffer.h b/src/core/CameraBuffer.h index e5fc4443..e476f1ab 100644 --- a/src/core/CameraBuffer.h +++ b/src/core/CameraBuffer.h @@ -22,7 +22,7 @@ #include #include -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include diff --git a/src/core/CameraDevice.cpp b/src/core/CameraDevice.cpp index aa25a52e..4303a5b8 100644 --- a/src/core/CameraDevice.cpp +++ b/src/core/CameraDevice.cpp @@ -955,7 +955,7 @@ int CameraDevice::getParameters(Parameters& param, int64_t sequence) { LOG2("@%s", mCameraId, sequence, __func__); AutoMutex m(mDeviceLock); -#ifdef CAL_BUILD +#if defined(HAVE_CHROME_OS) || defined(HAVE_ANDROID_OS) if (sequence >= 0 && mState != DEVICE_STOP) { // fetch target parameter and results return mParamGenerator->getParameters(sequence, ¶m); @@ -1127,6 +1127,7 @@ void CameraDevice::handleEvent(EventData eventData) { } break; } + case EVENT_ISYS_ERROR: { if (mCallback) { camera_msg_data_t data = {CAMERA_DEVICE_ERROR, {}}; diff --git a/src/core/CaptureUnit.cpp b/src/core/CaptureUnit.cpp index 5240977d..621f55ef 100644 --- a/src/core/CaptureUnit.cpp +++ b/src/core/CaptureUnit.cpp @@ -415,7 +415,7 @@ int CaptureUnit::poll() { } CheckAndLogError(ret < 0, UNKNOWN_ERROR, "%s: Poll error, ret:%d", __func__, ret); if (ret == 0) { -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS LOGI("%s, timeout happens, buffer in device: %d. wait recovery", mCameraId, __func__, mDevices.front()->getBufferNumInDevice()); #else diff --git a/src/core/CsiMetaDevice.cpp b/src/core/CsiMetaDevice.cpp index 25fb9f64..32127bde 100644 --- a/src/core/CsiMetaDevice.cpp +++ b/src/core/CsiMetaDevice.cpp @@ -377,7 +377,7 @@ int CsiMetaDevice::setFormat() { struct v4l2_format v4l2fmt; CLEAR(v4l2fmt); -#ifdef CAL_BUILD +#if defined(HAVE_CHROME_OS) || defined(HAVE_ANDROID_OS) v4l2fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; #else int dev_caps = mCsiMetaDevice->GetDeviceCaps(); diff --git a/src/core/CsiMetaDevice.h b/src/core/CsiMetaDevice.h index dfaafb89..0fbee7c1 100644 --- a/src/core/CsiMetaDevice.h +++ b/src/core/CsiMetaDevice.h @@ -16,7 +16,7 @@ #pragma once -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include diff --git a/src/core/DeviceBase.cpp b/src/core/DeviceBase.cpp index eab1b962..b41a0fc2 100644 --- a/src/core/DeviceBase.cpp +++ b/src/core/DeviceBase.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation. + * Copyright (C) 2018-2024 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,8 @@ DeviceBase::DeviceBase(int cameraId, VideoNodeType nodeType, VideoNodeDirection mNeedSkipFrame(false), mDeviceCB(deviceCB), mMaxBufferNumber(MAX_BUFFER_COUNT), - mBufferQueuing(false) { + mBufferQueuing(false), + mBufType(V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { LOG1("%s, device:%s", mCameraId, __func__, mName); mFrameSkipNum = PlatformData::getInitialSkipFrame(mCameraId); @@ -59,9 +60,6 @@ DeviceBase::DeviceBase(int cameraId, VideoNodeType nodeType, VideoNodeDirection nodeType); mDevice = new V4L2VideoNode(devName); -#ifdef LINUX_BUILD - mBufType = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; -#endif } DeviceBase::~DeviceBase() { @@ -77,24 +75,23 @@ int DeviceBase::openDevice() { SyncManager::getInstance()->updateSyncCamNum(); // FRAME_SYNC_E -#ifdef LINUX_BUILD int ret = mDevice->Open(O_RDWR); if (ret) return ret; +#ifdef LINUX_BUILD int dev_caps = mDevice->GetDeviceCaps(); if (dev_caps & V4L2_CAP_VIDEO_CAPTURE) { mBufType = V4L2_BUF_TYPE_VIDEO_CAPTURE; } else { mBufType = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; } - +#else + mBufType = mDevice->GetBufferType(); +#endif PlatformData::setV4L2BufType(mCameraId, mBufType); return OK; -#else - return mDevice->Open(O_RDWR); -#endif } void DeviceBase::closeDevice() { @@ -159,18 +156,18 @@ int DeviceBase::queueBuffer(int64_t sequence) { mBufferQueuing = true; } -#ifdef LINUX_BUILD buffer->getV4L2Buffer().SetType(mBufType); -#endif int ret = onQueueBuffer(sequence, buffer); if (ret == OK) { ret = mDevice->PutFrame(&buffer->getV4L2Buffer()); if (ret >= 0) { AutoMutex l(mBufferLock); - mPendingBuffers.pop_front(); - mBuffersInDevice.push_back(buffer); + if (!mPendingBuffers.empty()) { + mPendingBuffers.pop_front(); + mBuffersInDevice.push_back(buffer); + } } else { LOGE("%s, index:%u size:%u, memory:%u, used:%u", __func__, buffer->getIndex(), buffer->getBufferSize(), buffer->getMemory(), buffer->getBytesused()); @@ -308,8 +305,9 @@ MainDevice::MainDevice(int cameraId, VideoNodeType nodeType, DeviceCallback* dev MainDevice::~MainDevice() {} int MainDevice::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); + LOG1("%s, fmt:%s(%dx%d) field:%d, mBufType:%d", mCameraId, __func__, + CameraUtils::pixelCode2String(config.format), config.width, config.height, config.field, + mBufType); // Pass down ISYS compression flag to driver, which is CSI-BE output compression bool isISYSCompression = PlatformData::getISYSCompression(mCameraId); @@ -325,10 +323,10 @@ int MainDevice::createBufferPool(const stream_t& config) { csiBEDeviceNodeName.c_str(), ret); } - struct v4l2_format v4l2fmt; + struct v4l2_format v4l2fmt = {}; v4l2fmt.fmt.pix_mp.field = config.field; - if (PlatformData::isCSIFrontEndCapture(mCameraId)) { + if (V4L2_TYPE_IS_MULTIPLANAR(mBufType)) { int planesNum = CameraUtils::getNumOfPlanes(config.format); LOG1("@%s Num of planes: %d, mCameraId:%d", __func__, planesNum, mCameraId); @@ -348,11 +346,7 @@ int MainDevice::createBufferPool(const stream_t& config) { v4l2fmt.fmt.pix.sizeimage = 0; } -#ifdef LINUX_BUILD v4l2fmt.type = mBufType; -#else - v4l2fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; -#endif V4L2Format tmpbuf{v4l2fmt}; int ret = mDevice->SetFormat(tmpbuf); CheckAndLogError(ret != OK, ret, "set v4l2 format failed ret=%d", ret); @@ -457,11 +451,7 @@ int DolCaptureDevice::createBufferPool(const stream_t& config) { v4l2fmt.fmt.pix.sizeimage = 0; v4l2fmt.fmt.pix_mp.field = 0; -#ifdef LINUX_BUILD v4l2fmt.type = mBufType; -#else - v4l2fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; -#endif V4L2Format tmpbuf{v4l2fmt}; int ret = mDevice->SetFormat(tmpbuf); CheckAndLogError(ret != OK, ret, "set DOL v4l2 format failed ret=%d", ret); diff --git a/src/core/DeviceBase.h b/src/core/DeviceBase.h index 95d60ce6..4c8da4ae 100644 --- a/src/core/DeviceBase.h +++ b/src/core/DeviceBase.h @@ -16,7 +16,7 @@ #pragma once -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include @@ -138,7 +138,7 @@ class DeviceBase : public EventSource { /** * Each device has below two structures to manager its buffers. * And please note that: - * 1. Buffer to be queued into drive comes from mPendingBuffers. + * 1. Buffer to be queued into driver 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. @@ -152,9 +152,7 @@ class DeviceBase : public EventSource { uint32_t mMaxBufferNumber; bool mBufferQueuing; -#ifdef LINUX_BUILD v4l2_buf_type mBufType; -#endif private: DISALLOW_COPY_AND_ASSIGN(DeviceBase); diff --git a/src/core/FileSource.cpp b/src/core/FileSource.cpp index 4b58d7b0..003faa3e 100644 --- a/src/core/FileSource.cpp +++ b/src/core/FileSource.cpp @@ -166,6 +166,10 @@ int FileSource::stop() { mProduceThread->requestExitAndWait(); mFrameFileBuffers.clear(); + while (mBufferQueue.size() > 0) { + mBufferQueue.pop(); + } + return OK; } diff --git a/src/core/IspParamAdaptor.h b/src/core/IspParamAdaptor.h index bc4bc920..0ef28655 100644 --- a/src/core/IspParamAdaptor.h +++ b/src/core/IspParamAdaptor.h @@ -16,7 +16,7 @@ #pragma once -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include @@ -35,7 +35,7 @@ #include "NodeInfo.h" extern "C" { -#ifndef CAL_BUILD +#if !defined(HAVE_CHROME_OS) && !defined(HAVE_ANDROID_OS) #include "ia_camera/ipu_process_group_wrapper.h" #endif } diff --git a/src/core/LensHw.h b/src/core/LensHw.h index b289b253..98e432a5 100644 --- a/src/core/LensHw.h +++ b/src/core/LensHw.h @@ -16,7 +16,7 @@ #pragma once -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include @@ -26,7 +26,11 @@ namespace icamera { +#ifdef HAVE_ANDROID_OS +typedef ::crosIpu6::V4L2Subdevice V4L2Subdevice; +#else typedef ::cros::V4L2Subdevice V4L2Subdevice; +#endif /** * \class LensHw diff --git a/src/core/PSysProcessor.cpp b/src/core/PSysProcessor.cpp index db616fd7..5e1ee525 100644 --- a/src/core/PSysProcessor.cpp +++ b/src/core/PSysProcessor.cpp @@ -908,8 +908,8 @@ status_t PSysProcessor::prepareTask(CameraBufferPortMap* srcBuffers, int64_t settingSequence = getSettingSequence(*dstBuffers); bool needRunPipe = needExecutePipe(settingSequence, inputSequence); bool holdOnInput = needHoldOnInputFrame(settingSequence, inputSequence); - LOG2("%s: dst sequence = %ld, src sequence = %ld, needRunPipe = %d, needReuseInput = %d", - __func__, settingSequence, inputSequence, needRunPipe, holdOnInput); + LOG2("%s: dst sequence = %ld, src sequence = %ld, needRunPipe = %d, needReuseInput = %d", + mCameraId, __func__, settingSequence, inputSequence, needRunPipe, holdOnInput); { AutoMutex l(mBufferQueueLock); @@ -1064,28 +1064,29 @@ void PSysProcessor::dispatchTask(CameraBufferPortMap& inBuf, CameraBufferPortMap EdgeNrSetting edgeNrSetting; CLEAR(edgeNrSetting); + auto* res = AiqResultStorage::getInstance(mCameraId)->getAiqResult(currentSequence); 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, mTuningMode, - edgeNrSetting); - mIspSettings.eeSetting.strength += edgeNrSetting.edgeStrength; - mIspSettings.nrSetting.strength += edgeNrSetting.nrStrength; - LOG2("edgeStrength %d, nrStrength %d", edgeNrSetting.edgeStrength, - edgeNrSetting.nrStrength); - - TuningMode stillMode = (mTuningMode == TUNING_MODE_VIDEO) ? - TUNING_MODE_STILL_CAPTURE : TUNING_MODE_VIDEO_ULL; - PlatformData::getEdgeNrSetting(mCameraId, totalGain, hdrRatio, stillMode, - edgeNrSetting); - mIspSettings.eeStillSetting.strength += edgeNrSetting.edgeStrength; - mIspSettings.nrStillSetting.strength += edgeNrSetting.nrStrength; - LOG2("Still edgeStrength %d, nrStrength %d", edgeNrSetting.edgeStrength, - edgeNrSetting.nrStrength); - } + if (ret == OK && res != nullptr) { + auto exposure = res->mAeResults.exposures[0].exposure[0]; + float totalGain = exposure.analog_gain * exposure.digital_gain; + PlatformData::getEdgeNrSetting(mCameraId, totalGain, hdrRatio, mTuningMode, + edgeNrSetting); + mIspSettings.eeSetting.strength += edgeNrSetting.edgeStrength; + mIspSettings.nrSetting.strength += edgeNrSetting.nrStrength; + // Limit NR strength range from EXTREME_STRENGTH_LEVEL1 to EXTREME_STRENGTH_LEVEL4 + mIspSettings.nrSetting.strength = CLIP(mIspSettings.nrSetting.strength, + EXTREME_STRENGTH_LEVEL1, EXTREME_STRENGTH_LEVEL4); + LOG2("edgeStrength %d, nrStrength %d", edgeNrSetting.edgeStrength, + edgeNrSetting.nrStrength); + + TuningMode stillMode = (mTuningMode == TUNING_MODE_VIDEO) ? + TUNING_MODE_STILL_CAPTURE : TUNING_MODE_VIDEO_ULL; + PlatformData::getEdgeNrSetting(mCameraId, totalGain, hdrRatio, stillMode, + edgeNrSetting); + mIspSettings.eeStillSetting.strength += edgeNrSetting.edgeStrength; + mIspSettings.nrStillSetting.strength += edgeNrSetting.nrStrength; + LOG2("Still edgeStrength %d, nrStrength %d", edgeNrSetting.edgeStrength, + edgeNrSetting.nrStrength); } bool hasStill = false; diff --git a/src/core/RequestThread.cpp b/src/core/RequestThread.cpp index a2d13da9..08d275b1 100644 --- a/src/core/RequestThread.cpp +++ b/src/core/RequestThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2024 Intel Corporation. + * Copyright (C) 2015-2025 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,7 +40,7 @@ RequestThread::RequestThread(int cameraId, AiqUnitBase* a3AControl, ParameterGen mLastEffectSeq(-1), mLastAppliedSeq(-1), mLastSofSeq(-1), - mBlockRequest(true), + mBlockRequest(PlatformData::isWaitFirstStats(cameraId)), mSofEnabled(false), mWaitFrameDurationOverride(0) { CLEAR(mFakeReqBuf); @@ -89,7 +89,7 @@ void RequestThread::clearRequests() { mLastAppliedSeq = -1; mLastSofSeq = -1; mFirstRequest = true; - mBlockRequest = true; + mBlockRequest = PlatformData::isWaitFirstStats(mCameraId); } int RequestThread::configure(const stream_config_t* streamList) { @@ -106,6 +106,12 @@ int RequestThread::configure(const stream_config_t* streamList) { // Don't block request handling if no 3A stats (from video pipe) mBlockRequest = PlatformData::isEnableAIQ(mCameraId) && (previewIndex >= 0 || videoIndex >= 0); + + if (!PlatformData::isWaitFirstStats(mCameraId)) { + // Don't block request processing on Android for CTS testSharedSurfaceSwitch + mBlockRequest = false; + } + LOG1("%s: user specified Configmode: %d, blockRequest: %d", __func__, static_cast(streamList->operation_mode), mBlockRequest); @@ -165,7 +171,13 @@ int RequestThread::processRequest(int bufferNum, camera_buffer_t** ubuffer, } } - if (mFirstRequest && !hasVideoBuffer) { + if (!mActive) { + request.mIsFirstRequest = true; + mActive = true; + LOG2("%s: process first request.", mCameraId, __func__); + } + + if (request.mIsFirstRequest && !hasVideoBuffer) { LOG2("there is no video buffer in first request, so don't block request processing."); mBlockRequest = false; } @@ -173,11 +185,7 @@ int RequestThread::processRequest(int bufferNum, camera_buffer_t** ubuffer, request.mRequestParam = copyRequestParams(params); mPendingRequests.push_back(request); - if (!mActive) { - mActive = true; - } - - if (mRequestsInProcessing == 0) { + if (mRequestsInProcessing == 0 || !mPerframeControlSupport) { mRequestTriggerEvent |= NEW_REQUEST; mRequestSignal.signal(); } @@ -374,7 +382,7 @@ bool RequestThread::threadLoop() { } if (!mActive) { - return false; + return true; } CameraRequest request; @@ -448,7 +456,7 @@ void RequestThread::handleRequest(CameraRequest& request, int64_t applyingSeq) { { AutoMutex l(mFirstRequestLock); - if (mFirstRequest) { + if (request.mIsFirstRequest) { LOG1("%s: first request done", __func__); mFirstRequest = false; mFirstRequestSignal.signal(); diff --git a/src/core/RequestThread.h b/src/core/RequestThread.h index 466415a4..6f2dd004 100644 --- a/src/core/RequestThread.h +++ b/src/core/RequestThread.h @@ -77,9 +77,12 @@ class RequestThread : public Thread, public EventSource, public EventListener { std::shared_ptr mFakeBuffer; struct CameraRequest { - CameraRequest() : mBufferNum(0), mRequestParam(nullptr) { CLEAR(mBuffer); } + CameraRequest() : mBufferNum(0), mIsFirstRequest(false), mRequestParam(nullptr) { + CLEAR(mBuffer); + } int mBufferNum; + bool mIsFirstRequest; camera_buffer_t* mBuffer[MAX_STREAM_NUMBER]; std::shared_ptr mRequestParam; }; diff --git a/src/core/SensorHwCtrl.h b/src/core/SensorHwCtrl.h index a4ef8122..07c81b97 100644 --- a/src/core/SensorHwCtrl.h +++ b/src/core/SensorHwCtrl.h @@ -16,7 +16,7 @@ #pragma once -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include diff --git a/src/core/SofSource.cpp b/src/core/SofSource.cpp index 97faba1e..1d7a78b8 100644 --- a/src/core/SofSource.cpp +++ b/src/core/SofSource.cpp @@ -17,6 +17,7 @@ #include "SofSource.h" +#include #include #include @@ -41,6 +42,21 @@ SofSource::SofSource(int cameraId) mExitPending(false) { LOG1("%s: SofSource is constructed", __func__); + mFlushFd[0] = -1; + mFlushFd[1] = -1; + + int ret = pipe(mFlushFd); + if (ret >= 0) { + ret = fcntl(mFlushFd[0], F_SETFL, O_NONBLOCK); + if (ret < 0) { + LOG1("failed to set flush pipe flag: %s", strerror(errno)); + close(mFlushFd[0]); + close(mFlushFd[1]); + mFlushFd[0] = -1; + mFlushFd[1] = -1; + } + LOG1("%s, mFlushFd [%d-%d]", __func__, mFlushFd[0], mFlushFd[1]); + } mSofDisabled = !PlatformData::isIsysEnabled(cameraId); // FILE_SOURCE_S mSofDisabled = mSofDisabled || PlatformData::isFileSourceEnabled(); @@ -49,6 +65,8 @@ SofSource::SofSource(int cameraId) SofSource::~SofSource() { LOG1("%s: SofSource is distructed.", __func__); + if (mFlushFd[0] != -1) close(mFlushFd[0]); + if (mFlushFd[1] != -1) close(mFlushFd[1]); } int SofSource::init() { @@ -84,7 +102,7 @@ int SofSource::initDev() { mIsysReceiverSubDev = V4l2DeviceFactory::getSubDev(mCameraId, subDeviceNodeName); -#ifdef CAL_BUILD +#if defined(HAVE_CHROME_OS) || defined(HAVE_ANDROID_OS) int status = mIsysReceiverSubDev->SubscribeEvent(V4L2_EVENT_FRAME_SYNC); CheckAndLogError(status != OK, status, "Failed to subscribe sync event 0"); LOG1("%s: Using SOF event id 0 for sync", __func__); @@ -100,21 +118,9 @@ int SofSource::initDev() { 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.c_str()); - 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); - } - } + mFrameSyncId = aggregator.mVcId; } + if (mFrameSyncId >= 0) id = mFrameSyncId; // VIRTUAL_CHANNEL_E @@ -130,7 +136,7 @@ int SofSource::deinitDev() { if (mIsysReceiverSubDev == nullptr) return OK; int status = 0; -#ifdef CAL_BUILD +#if defined(HAVE_CHROME_OS) || defined(HAVE_ANDROID_OS) status = mIsysReceiverSubDev->UnsubscribeEvent(V4L2_EVENT_FRAME_SYNC); if (status == OK) { LOG1("%s: Unsubscribe SOF event id 0 done", __func__); @@ -167,6 +173,12 @@ int SofSource::start() { return OK; } + if (mFlushFd[0] != -1) { + // read pipe just in case there is data in pipe. + char readBuf; + int readSize = read(mFlushFd[0], reinterpret_cast(&readBuf), sizeof(char)); + LOG1("%s, readSize %d", __func__, readSize); + } int status = mPollThread->run("SofSource", PRIORITY_URGENT_AUDIO); mExitPending = false; return status; @@ -179,40 +191,45 @@ int SofSource::stop() { } mExitPending = true; + if (mFlushFd[1] != -1) { + char buf = 0xf; // random value to write to flush fd. + int size = write(mFlushFd[1], &buf, sizeof(char)); + LOG1("%s, write size %d", __func__, size); + } + int status = mPollThread->requestExitAndWait(); return status; } int SofSource::poll() { int ret = 0; - const int pollTimeoutCount = 100; - const int pollTimeout = 100; + const int pollTimeoutCount = 10; + const int pollTimeout = 1000; std::vector pollDevs; pollDevs.push_back(mIsysReceiverSubDev); - V4L2DevicePoller poller{pollDevs, -1}; + V4L2DevicePoller poller{pollDevs, mFlushFd[0]}; std::vector readyDevices; int timeOutCount = pollTimeoutCount; while (timeOutCount-- && ret == 0) { + if (mExitPending) { + LOG2("%s: mExitPending is true, exit", __func__); + return -1; + } + ret = poller.Poll(pollTimeout, POLLPRI | POLLIN | POLLOUT | POLLERR, &readyDevices); + } - if (ret == 0 && mExitPending) { - // timed out - LOGI("Time out or thread is not running, ret = %d", ret); - return BAD_VALUE; - } + if (mExitPending) { + LOG2("%s: mExitPending is true, exit", __func__); + return -1; } // handle the poll error if (ret < 0) { - if (mExitPending) { - // Exiting, no error - return 0; - } - LOGE("Poll error"); return ret; } else if (ret == 0) { @@ -228,7 +245,8 @@ int SofSource::poll() { syncData.sequence = event.u.frame_sync.frame_sequence; syncData.timestamp.tv_sec = event.timestamp.tv_sec; syncData.timestamp.tv_usec = (event.timestamp.tv_nsec / 1000); - LOG2(" %s:sof event, event.id %u", syncData.sequence, __func__, event.id); + LOG2("camera:%d, %s, timestamp:%ld, sof event, event.id %u", mCameraId, + syncData.sequence, __func__, TIMEVAL2USECS(syncData.timestamp), event.id); TRACE_LOG_POINT("SofSource", "receive sof event", MAKE_COLOR(syncData.sequence), syncData.sequence); EventData eventData; diff --git a/src/core/SofSource.h b/src/core/SofSource.h index 737b2905..9a27aff6 100644 --- a/src/core/SofSource.h +++ b/src/core/SofSource.h @@ -16,7 +16,7 @@ #pragma once -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include @@ -67,6 +67,7 @@ class SofSource : public EventSource { bool mSofDisabled; int poll(); + int mFlushFd[2]; // Flush file descriptor }; } // namespace icamera diff --git a/src/core/psysprocessor/GPUExecutor.cpp b/src/core/psysprocessor/GPUExecutor.cpp index 67ebdd92..a47a6d37 100644 --- a/src/core/psysprocessor/GPUExecutor.cpp +++ b/src/core/psysprocessor/GPUExecutor.cpp @@ -555,8 +555,8 @@ int GPUExecutor::runTnrFrame(const std::shared_ptr& inBuf, 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, "executor name:%s, sequence: %u update param time %lu us", - mName.c_str(), inBuf->getSequence(), timeUsedUs); + LOG2("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"); } @@ -621,8 +621,16 @@ int GPUExecutor::runTnrFrame(const std::shared_ptr& inBuf, int dstSize = bufferSize; int dstFd = fd; std::map::iterator tnrOutBuf; +#ifdef HAVE_CHROME_OS // use internal tnr buffer for ZSL and none APP buffer request usage bool useInternalBuffer = mUseInternalTnrBuffer || memoryType != V4L2_MEMORY_DMABUF; +#else + /* + ** WA, Android App buffer can't be wrapped as CMSurface, use internal buffer + ** do tnr processing, and copy to App buffer + */ + bool useInternalBuffer = true; +#endif if (useInternalBuffer) { std::unique_lock lock(mTnrOutBufMapLock); tnrOutBuf = mTnrOutBufMap.begin(); @@ -650,8 +658,8 @@ int GPUExecutor::runTnrFrame(const std::shared_ptr& inBuf, 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 run tnr time %lu us", __func__, - mName.c_str(), inBuf->getSequence(), timeUsedUs); + LOG2("%s executor name:%s, sequence: %u run tnr time %lu us", __func__, mName.c_str(), + inBuf->getSequence(), timeUsedUs); } if (icamera::PlatformData::isStillTnrPrior()) { mGPULock.unlock(); diff --git a/src/core/psysprocessor/PGCommon.cpp b/src/core/psysprocessor/PGCommon.cpp index 0bb7df86..433f0859 100644 --- a/src/core/psysprocessor/PGCommon.cpp +++ b/src/core/psysprocessor/PGCommon.cpp @@ -884,7 +884,7 @@ int PGCommon::iterate(CameraBufferMap& inBufs, CameraBufferMap& outBufs, ia_bina if (!inBufs.empty()) { sequence = inBufs.begin()->second->getSequence(); } - LOG2("%s:%s ++", sequence, getName(), __func__); + LOG2("%s:%s ++", mCameraId, sequence, getName(), __func__); int ret = prepareTerminalBuffers(ipuParameters, inBufs, outBufs, sequence); CheckAndLogError((ret != OK), ret, "%s, prepareTerminalBuffers fail with %d", getName(), ret); @@ -932,7 +932,7 @@ int PGCommon::iterate(CameraBufferMap& inBufs, CameraBufferMap& outBufs, ia_bina } postTerminalBuffersDone(sequence); - LOG2("%s:%s -- ", sequence, getName(), __func__); + LOG2("%s:%s -- ", mCameraId, sequence, getName(), __func__); return ret; } @@ -1097,6 +1097,13 @@ int PGCommon::prepareTerminalBuffers(const ia_binary_data* ipuParameters, buffer->isFlagsSet(BUFFER_FLAG_NO_FLUSH))) { flush = false; } +#ifdef LINUX_BUILD + // FILE_SOURCE_S + if (PlatformData::isFileSourceEnabled() && buffer->getMemory() == V4L2_MEMORY_USERPTR) { + flush = true; + } + // FILE_SOURCE_E +#endif ciprBuf = (buffer->getMemory() == V4L2_MEMORY_DMABUF) ? registerUserBuffer(buffer->getBufferSize(), buffer->getFd(), flush) : @@ -1248,6 +1255,8 @@ int PGCommon::handleCmd(CIPR::Command** cmd, CIPR::PSysCommandConfig* cmdCfg) { cmdCfg->issueID = reinterpret_cast(cmd); eventCfg.commandIssueID = cmdCfg->issueID; + LOG3("@%s", mCameraId, __func__); + CIPR::Result ret = (*cmd)->setConfig(*cmdCfg); CheckAndLogError((ret != CIPR::Result::OK), UNKNOWN_ERROR, "%s, call CIPR::Command::setConfig fail", __func__); diff --git a/src/fd/CMakeLists.txt b/src/fd/CMakeLists.txt index 4f9c49a6..99acdaa3 100644 --- a/src/fd/CMakeLists.txt +++ b/src/fd/CMakeLists.txt @@ -36,9 +36,4 @@ else () ) endif() -if (CAL_BUILD) - find_package(LIBCAMERA_V4L2_DEVICE) - include_directories(${LIBCAMERA_V42L_DEVICE_INCLUDE_DIRS}) -else() - include_directories(${MODULES_DIR}/v4l2) -endif() +include_directories(${MODULES_DIR}/v4l2) \ No newline at end of file diff --git a/src/fd/FaceDetection.h b/src/fd/FaceDetection.h index 4a26b778..d0b59558 100644 --- a/src/fd/FaceDetection.h +++ b/src/fd/FaceDetection.h @@ -27,7 +27,7 @@ #include #include -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include "Camera3Buffer.h" #endif #include "FaceType.h" @@ -129,7 +129,7 @@ class FaceDetection { return nullptr; } static void destoryInstance(int cameraId) {} -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS void runFaceDetection(const std::shared_ptr ccBuf) {} #endif bool faceRunningByCondition() { return false; } diff --git a/src/hal/CameraHal.cpp b/src/hal/CameraHal.cpp index acbeb064..00e4d15b 100644 --- a/src/hal/CameraHal.cpp +++ b/src/hal/CameraHal.cpp @@ -47,8 +47,12 @@ CameraHal::CameraHal() : mInitTimes(0), mState(HAL_UNINIT), mCameraOpenNum(0) { CLEAR(mCameraDevices); // VIRTUAL_CHANNEL_S - CLEAR(mTotalVirtualChannelCamNum); - CLEAR(mConfigTimes); + mCurrentGroupId = -1; + mVcNum = 0; + mConfigTimes = 0; + for (int i = 0; i < MAX_CAMERA_NUMBER; i++) { + mDeviceClosing[i] = false; + } // VIRTUAL_CHANNEL_E } @@ -70,12 +74,13 @@ int CameraHal::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; + mCurrentGroupId = -1; + mVcNum = 0; + mConfigTimes = 0; + for (int i = 0; i < MAX_CAMERA_NUMBER; i++) { + mDeviceClosing[i] = false; } // VIRTUAL_CHANNEL_E - mState = HAL_INIT; return OK; @@ -92,9 +97,11 @@ int CameraHal::deinit() { } // VIRTUAL_CHANNEL_S - for (int i = 0; i < MAX_VC_GROUP_NUMBER; i++) { - mTotalVirtualChannelCamNum[i] = 0; - mConfigTimes[i] = 0; + mVcNum = 0; + mCurrentGroupId = -1; + mConfigTimes = 0; + for (int i = 0; i < MAX_CAMERA_NUMBER; i++) { + mDeviceClosing[i] = false; } // VIRTUAL_CHANNEL_E @@ -127,18 +134,26 @@ int CameraHal::deviceOpen(int cameraId, int vcNum) { return INVALID_OPERATION; } - if (mCameraShm.CameraDeviceOpen(cameraId) != OK) return INVALID_OPERATION; - - mCameraDevices[cameraId] = new CameraDevice(cameraId); - // VIRTUAL_CHANNEL_S + CheckAndLogError(mCameraOpenNum && vcNum != mVcNum, INVALID_OPERATION, + "New vcNum %d dismatch the previous %d", vcNum, mVcNum); + camera_info_t info; CLEAR(info); PlatformData::getCameraInfo(cameraId, info); - int groupId = info.vc.group >= 0 ? info.vc.group : 0; - mTotalVirtualChannelCamNum[groupId] = vcNum; + if (info.vc.total_num) { + // Open as vc sensor + int groupId = info.vc.group >= 0 ? info.vc.group : 0; + CheckAndLogError(mCurrentGroupId >= 0 && groupId != mCurrentGroupId, INVALID_OPERATION, + "Open group %d fail because group %d already opened!", groupId, + mCurrentGroupId); + mCurrentGroupId = groupId; + } + mVcNum = vcNum; // VIRTUAL_CHANNEL_E + if (mCameraShm.CameraDeviceOpen(cameraId) != OK) return INVALID_OPERATION; + mCameraDevices[cameraId] = new CameraDevice(cameraId); // The check is to handle dual camera cases mCameraOpenNum = mCameraShm.cameraDeviceOpenNum(); CheckAndLogError(mCameraOpenNum == 0, INVALID_OPERATION, "camera open num couldn't be 0"); @@ -167,12 +182,32 @@ void CameraHal::deviceClose(int cameraId) { AutoMutex l(mLock); if (mCameraDevices[cameraId]) { - mCameraDevices[cameraId]->deinit(); - delete mCameraDevices[cameraId]; - mCameraDevices[cameraId] = nullptr; - + if (mVcNum <= 0) { + mCameraDevices[cameraId]->deinit(); + delete mCameraDevices[cameraId]; + mCameraDevices[cameraId] = nullptr; + mCameraOpenNum--; + } else if (!mDeviceClosing[cameraId]) { + // only deinit vc camera here + mCameraDevices[cameraId]->deinit(); + mCameraOpenNum--; + mDeviceClosing[cameraId] = true; + } mCameraShm.CameraDeviceClose(cameraId); } + // VIRTUAL_CHANNEL_S + // Destroy all closed vc cameras + if (mVcNum > 0 && mCameraOpenNum == 0) { + for (int i = 0; i < MAX_CAMERA_NUMBER; i++) { + if (mDeviceClosing[i]) { + delete mCameraDevices[i]; + mCameraDevices[i] = nullptr; + mDeviceClosing[i] = false; + } + } + mVcNum = 0; + } + // VIRTUAL_CHANNEL_E } void CameraHal::deviceCallbackRegister(int cameraId, const camera_callback_ops_t* callback) { @@ -215,15 +250,10 @@ int CameraHal::deviceConfigStreams(int cameraId, stream_config_t* streamList) { } // 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(); + if (mVcNum > 0) { + mConfigTimes++; + LOG1(" @%s, mConfigTimes:%d, before signal", cameraId, __func__, mConfigTimes); + mVirtualChannelSignal.signal(); } // VIRTUAL_CHANNEL_E @@ -238,22 +268,16 @@ int CameraHal::deviceStart(int 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) { + if (mVcNum > 0) { + LOG1("@%s, mConfigTimes:%d, mVcNum:%d", cameraId, __func__, mConfigTimes, mVcNum); int timeoutCnt = 10; - while (mConfigTimes[groupId] < mTotalVirtualChannelCamNum[groupId]) { - mVirtualChannelSignal[groupId].waitRelative(lock, mWaitDuration * SLOWLY_MULTIPLIER); + while (mConfigTimes < mVcNum) { + mVirtualChannelSignal.waitRelative(lock, mWaitDuration * SLOWLY_MULTIPLIER); LOG1(" @%s, mConfigTimes:%d, timeoutCnt:%d", cameraId, __func__, - mConfigTimes[groupId], timeoutCnt); + mConfigTimes, timeoutCnt); --timeoutCnt; CheckAndLogError(!timeoutCnt, TIMED_OUT, " mConfigTimes:%d, wait time out", - cameraId, mConfigTimes[groupId]); + cameraId, mConfigTimes); } } // VIRTUAL_CHANNEL_E diff --git a/src/hal/CameraHal.h b/src/hal/CameraHal.h index 500cc04a..c208f481 100644 --- a/src/hal/CameraHal.h +++ b/src/hal/CameraHal.h @@ -74,9 +74,11 @@ class CameraHal { // 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]; + int mCurrentGroupId; + int mVcNum; + int mConfigTimes; + bool mDeviceClosing[MAX_CAMERA_NUMBER]; // deinited but not destroyed when close + Condition mVirtualChannelSignal; static const nsecs_t mWaitDuration = 500000000; // 500ms // VIRTUAL_CHANNEL_E diff --git a/src/image_process/CMakeLists.txt b/src/image_process/CMakeLists.txt index 26473711..5c2b6541 100644 --- a/src/image_process/CMakeLists.txt +++ b/src/image_process/CMakeLists.txt @@ -19,23 +19,3 @@ set(IMAGE_PROCESS_SRCS CACHE INTERNAL "image_process sources" ) -if (CAL_BUILD) -set(IMAGE_PROCESS_SRCS - ${IMAGE_PROCESS_DIR}/PostProcessorBase.cpp - ${IMAGE_PROCESS_DIR}/PostProcessorCore.cpp - CACHE INTERNAL "image_process sources" - ) -if (SW_POST_PROCESSING) - set(IMAGE_PROCESS_SRCS - ${IMAGE_PROCESS_SRCS} - ${IMAGE_PROCESS_DIR}/sw/SWPostProcessor.cpp - CACHE INTERNAL "image_process sources" - ) -else() - set(IMAGE_PROCESS_SRCS - ${IMAGE_PROCESS_SRCS} - ${IMAGE_PROCESS_DIR}/chrome/ImageProcessorCore.cpp - CACHE INTERNAL "image_process sources" - ) -endif() #SW_POST_PROCESSING -endif() #CAL_BUILD diff --git a/src/iutils/CameraDump.cpp b/src/iutils/CameraDump.cpp index 2a9282b5..c7bba84f 100644 --- a/src/iutils/CameraDump.cpp +++ b/src/iutils/CameraDump.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2023 Intel Corporation. + * Copyright (C) 2015-2025 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,9 @@ #include "iutils/CameraDump.h" +#ifdef HAVE_ANDROID_OS +#include +#endif #include #include #include @@ -45,14 +48,20 @@ using std::string; namespace icamera { Thread* gDumpThread = nullptr; - +#ifdef HAVE_ANDROID_OS +static const char* defaultDumpPath = "/data/camera"; +constexpr char DUMP_LEVEL_PROPERTY_NAME[] = "vendor.camera.intel.dump_level_mask"; +constexpr char DUMP_PATH_PROPERTY_NAME[] = "vendor.camera.intel.dump_path"; +bool gDumpPathSet = false; +bool gDumpLevelSet = false; +#endif int gDumpType = 0; int gDumpFormat = 0; uint32_t gDumpSkipNum = 0; uint32_t gDumpRangeMin = 0; uint32_t gDumpRangeMax = 0; int gDumpFrequency = 1; -char gDumpPath[50]; +char gDumpPath[100]; bool gDumpRangeEnabled = false; int gDumpPatternEnabled = 0; uint32_t gDumpPattern = 0xffffffff; @@ -198,6 +207,12 @@ void CameraDump::setDumpThread(void) { } bool CameraDump::isDumpTypeEnable(int dumpType) { +#ifdef HAVE_ANDROID_OS + if (!gDumpLevelSet) { + gDumpLevelSet = true; + gDumpType = property_get_int32(DUMP_LEVEL_PROPERTY_NAME, 0); + } +#endif return gDumpType & dumpType; } @@ -206,6 +221,12 @@ bool CameraDump::isDumpFormatEnable(int dumpFormat) { } const char* CameraDump::getDumpPath(void) { +#ifdef HAVE_ANDROID_OS + if (!gDumpPathSet) { + gDumpPathSet = true; + property_get(DUMP_PATH_PROPERTY_NAME, gDumpPath, defaultDumpPath); + } +#endif return gDumpPath; } @@ -250,6 +271,10 @@ static string getNamePrefix(int cameraId, ModuleType_t type, Port port, int sUsa static string getAiqSettingAppendix(int cameraId, int64_t sequence) { char settingAppendix[MAX_NAME_LEN] = {'\0'}; + if (!PlatformData::isEnableAIQ(cameraId)) { + return string(settingAppendix); + } + AiqResult* aiqResults = const_cast(AiqResultStorage::getInstance(cameraId)->getAiqResult(sequence)); if (aiqResults == nullptr) { @@ -421,11 +446,24 @@ static string formatBinFileName(int cameraId, const char* prefix, BinParam_t* bi return string(fileName); } -int CameraDump::checkPattern(void* data, int bufferSize, int w, int h, int stride) { +/* + * return 1, match the pattern + * + * pink pattern 0xffff may be padding bytes. + * 0xffff observed in bottom half of frame buffer. + * 0xffff not observed relative to Y/U/V plane. + * for example: + * Y plane may OK, U plane bottom half is 0xffff, V plane is whole 0xffff. + */ +int CameraDump::matchPattern(void* data, int bufferSize, int w, int h, int stride, int format) { uint32_t val; int lineStart = h - 1; int lineEnd = h - 1; + if (format != V4L2_PIX_FMT_UYVY) return 0; + + LOG1("%s, stride %d, w %d, h %d, buffersize %d", __func__, stride, w, h, bufferSize); + if (gDumpPatternLineEnabled && gDumpPatternLineMin < (uint32_t)h) lineStart = gDumpPatternLineMin; @@ -471,12 +509,11 @@ void CameraDump::dumpImage(int cameraId, const shared_ptr& camBuff void* pBuf = mapper.getUserPtr(); if (gDumpPatternEnabled) { - if (!checkPattern(pBuf, bufferSize, - camBuffer->getWidth(), - camBuffer->getHeight(), - camBuffer->getStride())) - return; - LOGI("@%s, dump pattern matched frame %d", __func__, camBuffer->getSequence()); + if (matchPattern(pBuf, bufferSize, camBuffer->getWidth(), camBuffer->getHeight(), + camBuffer->getStride(), camBuffer->getFormat())) + LOGI("@%s, dump pattern matched frame %d", __func__, camBuffer->getSequence()); + + return; } LOG1("@%s, fd:%d, buffersize:%d, buf:%p, memoryType:%d, fileName:%s", __func__, fd, bufferSize, pBuf, memoryType, fileName.c_str()); diff --git a/src/iutils/CameraDump.h b/src/iutils/CameraDump.h index 08875277..ebeccc0c 100644 --- a/src/iutils/CameraDump.h +++ b/src/iutils/CameraDump.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2023 Intel Corporation. + * Copyright (C) 2015-2025 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,14 +28,6 @@ namespace icamera { -/** - * global dump level - * This global variable is set from system properties - * It is used to control the type of frame dump - */ -extern int gDumpType; -extern char gDumpPath[50]; - // Dump bit mask definition enum { // IPU Buffer dump (bit[0-3]), export cameraDump=0xf @@ -152,7 +144,7 @@ bool isDumpFormatEnable(int dumpFormat); void writeData(const void* data, int size, const char* fileName); const char* getDumpPath(void); void parseRange(char* rangeStr, uint32_t* rangeMin, uint32_t* rangeMax); -int checkPattern(void* data, int bufferSize, int w, int h, int stride); +int matchPattern(void* data, int bufferSize, int w, int h, int stride, int format); /** * Dump image according to CameraBuffer properties */ diff --git a/src/iutils/CameraLog.cpp b/src/iutils/CameraLog.cpp index bd3100e7..5dd14a09 100644 --- a/src/iutils/CameraLog.cpp +++ b/src/iutils/CameraLog.cpp @@ -165,7 +165,7 @@ namespace Log { #define SYSLOG_SINK "SYSLOG" static void initLogSinks() { -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS const char* sinkName = ::getenv("logSink"); if (!sinkName) { @@ -259,7 +259,7 @@ void setDebugLevel(void) { char* perfLevel = getenv(PROP_CAMERA_HAL_PERF); if (perfLevel) { #ifndef GPU_ALGO_SERVER -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS initPerfettoTrace(); #else gPerfLevel = strtoul(perfLevel, nullptr, 0); diff --git a/src/iutils/CameraLog.h b/src/iutils/CameraLog.h index 4e8fe66d..1683ada6 100644 --- a/src/iutils/CameraLog.h +++ b/src/iutils/CameraLog.h @@ -23,7 +23,7 @@ #endif #ifndef GPU_ALGO_SERVER -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include "src/iutils/PerfettoTrace.h" #else #include "utils/ScopedAtrace.h" diff --git a/src/iutils/LogSink.cpp b/src/iutils/LogSink.cpp index 3311307b..9d7d9f48 100644 --- a/src/iutils/LogSink.cpp +++ b/src/iutils/LogSink.cpp @@ -21,7 +21,7 @@ #include #include -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #endif @@ -39,7 +39,7 @@ extern const char* cameraDebugLogToString(int level); #define CAMERA_DEBUG_LOG_ERR (1 << 5) #define CAMERA_DEBUG_LOG_WARNING (1 << 3) -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS const char* GLogSink::getName() const { return "Google gLOG"; } diff --git a/src/iutils/LogSink.h b/src/iutils/LogSink.h index 67319c91..d02f4070 100644 --- a/src/iutils/LogSink.h +++ b/src/iutils/LogSink.h @@ -35,7 +35,7 @@ class LogOutputSink { static void setLogTime(char* timeBuf); }; -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS class GLogSink : public LogOutputSink { public: const char* getName() const override; diff --git a/src/iutils/Utils.h b/src/iutils/Utils.h index 388d017b..d47cbe3d 100644 --- a/src/iutils/Utils.h +++ b/src/iutils/Utils.h @@ -17,7 +17,7 @@ #pragma once #include -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include @@ -34,12 +34,21 @@ namespace icamera { typedef int64_t nsecs_t; +#ifdef HAVE_ANDROID_OS +typedef ::crosIpu6::V4L2DevicePoller V4L2DevicePoller; +typedef ::crosIpu6::V4L2Device V4L2Device; +typedef ::crosIpu6::V4L2VideoNode V4L2VideoNode; +typedef ::crosIpu6::V4L2Subdevice V4L2Subdevice; +typedef ::crosIpu6::V4L2Buffer V4L2Buffer; +typedef ::crosIpu6::V4L2Format V4L2Format; +#else typedef ::cros::V4L2DevicePoller V4L2DevicePoller; typedef ::cros::V4L2Device V4L2Device; typedef ::cros::V4L2VideoNode V4L2VideoNode; typedef ::cros::V4L2Subdevice V4L2Subdevice; typedef ::cros::V4L2Buffer V4L2Buffer; typedef ::cros::V4L2Format V4L2Format; +#endif #define ALIGN(val, alignment) (((val) + (alignment)-1) & ~((alignment)-1)) #define ALIGN_64(val) ALIGN(val, 64) @@ -58,13 +67,11 @@ typedef ::cros::V4L2Format V4L2Format; #define UNUSED(param) (void)(param) #endif -#ifdef CAL_BUILD +#if defined(HAVE_CHROME_OS) || defined(HAVE_ANDROID_OS) #ifndef V4L2_PIX_FMT_P010 #define V4L2_PIX_FMT_P010 v4l2_fourcc('P', '0', '1', '0') #endif -#endif -#ifdef CAL_BUILD #define V4L2_PIX_FMT_YUYV420_V32 v4l2_fourcc('y', '0', '3', '2') #define V4L2_PIX_FMT_SGRBG12V32 v4l2_fourcc('b', 'V', '0', 'K') #define V4L2_PIX_FMT_SGRBG10V32 v4l2_fourcc('b', 'V', '0', 'G') diff --git a/src/metadata/ParameterGenerator.cpp b/src/metadata/ParameterGenerator.cpp index 3b9dc87a..654fcbd3 100644 --- a/src/metadata/ParameterGenerator.cpp +++ b/src/metadata/ParameterGenerator.cpp @@ -542,7 +542,7 @@ int ParameterGenerator::updateCommonMetadata(Parameters* params, const AiqResult 3); } - LOG2(ST_STATS, "RGB stat %dx%d, sequence %lld, y_mean %d", + LOG2("RGB stat %dx%d, sequence %lld, y_mean %d", outStats->rgbs_grid[0].grid_width, outStats->rgbs_grid[0].grid_height, aiqResult->mSequence, size > 0 ? sumLuma / size : 0); } diff --git a/src/platformdata/CameraParser.cpp b/src/platformdata/CameraParser.cpp index 6f4cabe8..0c9395ed 100644 --- a/src/platformdata/CameraParser.cpp +++ b/src/platformdata/CameraParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2024 Intel Corporation + * Copyright (C) 2015-2025 Intel Corporation * Copyright 2008-2017, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -599,6 +599,8 @@ void CameraParser::handleSensor(CameraParser* profiles, const char* name, const parseSupportedTuningConfig(atts[1], pCurrentCam->mSupportedTuningConfig); } else if (strcmp(name, "enableAiqd") == 0) { pCurrentCam->mEnableAiqd = strcmp(atts[1], "true") == 0; + } else if (strcmp(name, "isWaitFirstStats") == 0) { + pCurrentCam->mWaitFirstStats = strcmp(atts[1], "true") == 0; } else if (strcmp(name, "testPatternMap") == 0) { int size = strlen(atts[1]); char src[size + 1]; @@ -772,7 +774,7 @@ void CameraParser::handleSensor(CameraParser* profiles, const char* name, const char* tablePtr = strtok_r(src, ",", &savePtr); if (tablePtr) pCurrentCam->mVcAggregator.mName = tablePtr; tablePtr = strtok_r(nullptr, ",", &savePtr); - if (tablePtr) pCurrentCam->mVcAggregator.mIndex = atoi(tablePtr); + if (tablePtr) pCurrentCam->mVcAggregator.mVcId = atoi(tablePtr); // VIRTUAL_CHANNEL_E } else if (strcmp(name, "disableBLCByAGain") == 0) { int size = strlen(atts[1]); @@ -1406,7 +1408,6 @@ void CameraParser::parseLinkElement(CameraParser* profiles, const char* name, co void CameraParser::parseRouteElement(CameraParser* profiles, const char* name, const char** atts) { McRoute route; - MediaCtlConf& mc = profiles->pCurrentCam->mMediaCtlConfs.back(); route.flag = MEDIA_LNK_FL_ENABLED; int idx = 0; @@ -1432,8 +1433,18 @@ void CameraParser::parseRouteElement(CameraParser* profiles, const char* name, c } idx += 2; } + // VIRTUAL_CHANNEL_S + MediaCtlConf& mc = profiles->pCurrentCam->mMediaCtlConfs.back(); - mc.routes.push_back(route); + auto it = mc.routings.find(route.entityName); + if (it != mc.routings.end()) { + it->second.push_back(route); + } else { + std::vector routes; + routes.push_back(route); + mc.routings.insert(std::pair>(route.entityName, routes)); + } + // VIRTUAL_CHANNEL_E } void CameraParser::parseVideoElement(CameraParser* profiles, const char* name, diff --git a/src/platformdata/CameraTypes.h b/src/platformdata/CameraTypes.h index 8b146fe3..809a5d60 100644 --- a/src/platformdata/CameraTypes.h +++ b/src/platformdata/CameraTypes.h @@ -286,8 +286,8 @@ typedef enum { // VIRTUAL_CHANNEL_S struct VcAggregator { - VcAggregator() { mIndex = -1; } - int mIndex; + VcAggregator() { mVcId = -1; } + int mVcId; std::string mName; }; // VIRTUAL_CHANNEL_E diff --git a/src/platformdata/PlatformData.cpp b/src/platformdata/PlatformData.cpp index 37db7486..06f786bd 100644 --- a/src/platformdata/PlatformData.cpp +++ b/src/platformdata/PlatformData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2024 Intel Corporation. + * Copyright (C) 2015-2025 Intel Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1097,6 +1097,10 @@ bool PlatformData::isAiqdEnabled(int cameraId) { return getInstance()->mStaticCfg.mCameras[cameraId].mEnableAiqd; } +bool PlatformData::isWaitFirstStats(int cameraId) { + return getInstance()->mStaticCfg.mCameras[cameraId].mWaitFirstStats; +} + int PlatformData::getFormatByDevName(int cameraId, const string& devName, McFormat& format) { MediaCtlConf* mc = getMediaCtlConf(cameraId); CheckAndLogError(!mc, BAD_VALUE, "getMediaCtlConf returns nullptr, cameraId:%d", cameraId); @@ -1667,7 +1671,7 @@ int PlatformData::getVirtualChannelSequence(int cameraId) { } int PlatformData::getVcAggregator(int cameraId, struct VcAggregator& aggregator) { - if (getInstance()->mStaticCfg.mCameras[cameraId].mVcAggregator.mIndex >= 0) { + if (getInstance()->mStaticCfg.mCameras[cameraId].mVcAggregator.mVcId >= 0) { aggregator = getInstance()->mStaticCfg.mCameras[cameraId].mVcAggregator; return OK; } diff --git a/src/platformdata/PlatformData.h b/src/platformdata/PlatformData.h index 59699f6d..282198a4 100644 --- a/src/platformdata/PlatformData.h +++ b/src/platformdata/PlatformData.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2024 Intel Corporation. + * Copyright (C) 2015-2025 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 -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include @@ -69,7 +69,7 @@ namespace icamera { */ #define MAX_SETTING_COUNT 40 -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #define MAX_CAMERA_NUMBER 2 #define CAMERA_CACHE_DIR "/var/cache/camera/" #define CAMERA_DEFAULT_CFG_PATH "/etc/camera/" @@ -77,12 +77,12 @@ namespace icamera { #define CAMERA_GRAPH_SETTINGS_DIR "gcss/" #endif -#ifdef __ANDROID__ +#ifdef HAVE_ANDROID_OS #define MAX_CAMERA_NUMBER 2 -#define CAMERA_CACHE_DIR "./" -#define CAMERA_DEFAULT_CFG_PATH "/vendor/etc/" -#define CAMERA_GRAPH_DESCRIPTOR_FILE "graph_descriptor.xml" -#define CAMERA_GRAPH_SETTINGS_DIR "" +#define CAMERA_CACHE_DIR "/var/cache/camera/" +#define CAMERA_DEFAULT_CFG_PATH "/vendor/etc/camera/" +#define CAMERA_GRAPH_DESCRIPTOR_FILE "gcss/graph_descriptor.xml" +#define CAMERA_GRAPH_SETTINGS_DIR "gcss/" #endif #ifdef LINUX_BUILD @@ -182,6 +182,7 @@ class PlatformData { mFrameSyncCheckEnabled(false), // FRAME_SYNC_E mEnableAiqd(false), + mWaitFirstStats(true), mCurrentMcConf(nullptr), mGraphSettingsType(COUPLED), mDVSType(MORPH_TABLE), @@ -301,6 +302,7 @@ class PlatformData { bool mFrameSyncCheckEnabled; // FRAME_SYNC_E bool mEnableAiqd; + bool mWaitFirstStats; MediaCtlConf* mCurrentMcConf; std::map mStreamToMcMap; Parameters mCapability; @@ -1434,6 +1436,14 @@ class PlatformData { */ static bool isAiqdEnabled(int cameraId); + /** + * if wait for the first stats + * + * \param cameraId: [0, MAX_CAMERA_NUMBER - 1] + * \return true if wait for the first stats + */ + static bool isWaitFirstStats(int cameraId); + /** * if image from tpg * diff --git a/src/scheduler/Android.mk b/src/scheduler/Android.mk deleted file mode 100644 index 20193b8f..00000000 --- a/src/scheduler/Android.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -#Copyright(C) 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. -# - -LOCAL_SRC_FILES += \ - src/scheduler/CameraScheduler.cpp \ - src/scheduler/CameraSchedulerPolicy.cpp diff --git a/src/v4l2/CMakeLists.txt b/src/v4l2/CMakeLists.txt index fe07ba64..b710cf02 100644 --- a/src/v4l2/CMakeLists.txt +++ b/src/v4l2/CMakeLists.txt @@ -22,12 +22,11 @@ set (V4L2_SRCS CACHE INTERNAL "v4l2 sources" ) -if (NOT CAL_BUILD) - set(V4L2_SRCS - ${V4L2_SRCS} - ${MODULES_DIR}/v4l2/v4l2_device.cc - ${MODULES_DIR}/v4l2/v4l2_subdevice.cc - ${MODULES_DIR}/v4l2/v4l2_video_node.cc - CACHE INTERNAL "v4l2 sources" - ) -endif() +set(V4L2_SRCS + ${V4L2_SRCS} + ${MODULES_DIR}/v4l2/v4l2_device.cc + ${MODULES_DIR}/v4l2/v4l2_subdevice.cc + ${MODULES_DIR}/v4l2/v4l2_video_node.cc + CACHE INTERNAL "v4l2 sources" + ) + diff --git a/src/v4l2/MediaControl.cpp b/src/v4l2/MediaControl.cpp index 54158cc3..de148fae 100644 --- a/src/v4l2/MediaControl.cpp +++ b/src/v4l2/MediaControl.cpp @@ -810,6 +810,9 @@ int MediaControl::setFormat(int cameraId, const McFormat* format, int targetWidt tmt.format = mbusfmt; tmt.pad = link->sink->index; tmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; + // VIRTUAL_CHANNEL_S + tmt.stream = format->stream; + // VIRTUAL_CHANNEL_E subDev->SetFormat(tmt); } } @@ -872,17 +875,25 @@ int MediaControl::mediaCtlSetup(int cameraId, MediaCtlConf* mc, int width, int h 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); - + for (auto& routing : mc->routings) { + LOG1(" route entity:%s:", cameraId, routing.first.c_str()); + int num = routing.second.size(); + v4l2_subdev_route* routes = new v4l2_subdev_route[num]; + CheckAndLogError(!routes, NO_MEMORY, "Failed to alloc routes"); + for (int i = 0; i < num; i++) { + const McRoute& route = routing.second[i]; + v4l2_subdev_route r = {route.sinkPad, route.sinkStream, route.srcPad, route.srcStream, + route.flag}; + LOG1(" sinkPad:%d, srcPad:%d, sinkStream:%d, srcStream:%d, flag:%d", r.sink_pad, + r.source_pad, r.sink_stream, r.source_stream, route.flag); + + routes[i] = r; + } string subDeviceNodeName; - CameraUtils::getSubDeviceName(route.entityName.c_str(), subDeviceNodeName); + CameraUtils::getSubDeviceName(routing.first.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); + ret = subDev->SetRouting(routes, num); + delete[] routes; CheckAndLogError(ret != 0, ret, "setRouting fail, ret:%d", ret); } // VIRTUAL_CHANNEL_E @@ -954,13 +965,25 @@ void MediaControl::mediaCtlClear(int cameraId, MediaCtlConf* mc) { // VIRTUAL_CHANNEL_S /* Clear routing */ - for (auto& route : mc->routes) { + for (auto& routing : mc->routings) { + LOG1(" route entity:%s:", cameraId, routing.first.c_str()); + int num = routing.second.size(); + v4l2_subdev_route* routes = new v4l2_subdev_route[num]; + CheckAndLogError(!routes, VOID_VALUE, "Failed to alloc routes"); + for (int i = 0; i < num; i++) { + const McRoute& route = routing.second[i]; + LOG1(" sinkPad:%d, srcPad:%d, sinkStream:%d, srcStream:%d, flag:%d", route.sinkPad, + route.srcPad, route.sinkStream, route.srcStream, route.flag); + v4l2_subdev_route r = {route.sinkPad, route.sinkStream, route.srcPad, route.srcStream, + route.flag & ~V4L2_SUBDEV_ROUTE_FL_ACTIVE}; + routes[i] = r; + } + string subDeviceNodeName; - CameraUtils::getSubDeviceName(route.entityName.c_str(), subDeviceNodeName); + CameraUtils::getSubDeviceName(routing.first.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); + int ret = subDev->SetRouting(routes, num); + delete[] routes; CheckAndLogError(ret != 0, VOID_VALUE, "Clear routing fail, ret:%d", ret); } // VIRTUAL_CHANNEL_E @@ -993,17 +1016,29 @@ int MediaControl::getPrivacyDeviceName(std::string* name) { } // PRIVACY_MODE_E +bool MediaControl::isMediaSourceEntity(const MediaEntity* entity) { + if (nullptr == entity) return false; + auto n_pads = entity->info.pads; + + for (auto i = 0; i < n_pads; ++i) { + // If any sink pad in an entity, it's not the source entity + if (entity->pads[i].flags & MEDIA_PAD_FL_SINK) return false; + } + + return true; +} + bool MediaControl::checkHasSource(const MediaEntity* sink, const std::string& source) { for (unsigned int i = 0; i < sink->numLinks; ++i) { if (sink->links[i].sink->entity == sink) { // links[i] is the link to sink entity // pre is the link's source entity MediaEntity* pre = sink->links[i].source->entity; - if (pre->info.type == MEDIA_ENT_T_V4L2_SUBDEV_SENSOR) { - // if pre is sensor, return compare name result + if (isMediaSourceEntity(pre)) { + // if pre is pure source, return compare name result if (strncmp(source.c_str(), pre->info.name, source.length()) == 0) return true; } else { - // if pre is not sensor, search recursively + // if pre is not pure source, search recursively if (checkHasSource(pre, source)) return true; } } diff --git a/src/v4l2/MediaControl.h b/src/v4l2/MediaControl.h index 39174c5f..10547c92 100644 --- a/src/v4l2/MediaControl.h +++ b/src/v4l2/MediaControl.h @@ -32,7 +32,7 @@ #include #include -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include @@ -174,7 +174,7 @@ struct McVideoNode { struct MediaCtlConf { std::vector ctls; std::vector links; - std::vector routes; + std::map> routings; std::vector formats; std::vector outputs; std::vector videoNodes; @@ -296,6 +296,7 @@ class MediaControl { // VIRTUAL_CHANNEL_E int getLensName(std::string* lensName); + bool isMediaSourceEntity(const MediaEntity* entity); bool checkAvailableSensor(const std::string& sensorEntityName); bool checkAvailableSensor(const std::string& sensorEntityName, const std::string& sinkEntityName); diff --git a/src/v4l2/V4l2DeviceFactory.h b/src/v4l2/V4l2DeviceFactory.h index 70571c81..954eb295 100644 --- a/src/v4l2/V4l2DeviceFactory.h +++ b/src/v4l2/V4l2DeviceFactory.h @@ -16,7 +16,7 @@ #pragma once -#ifdef CAL_BUILD +#ifdef HAVE_CHROME_OS #include #else #include